17static char const linLinInterpolationString[] =
"lin-lin";
18static char const logLinInterpolationString[] =
"log-lin";
19static char const linLogInterpolationString[] =
"lin-log";
20static char const logLogInterpolationString[] =
"log-log";
21static char const flatInterpolationString[] =
"flat";
29 double biSectionMax,
double accuracy, int64_t primarySize, int64_t secondarySize,
int userFlag ) {
33 if( ptwXY == NULL )
return( NULL );
34 if(
ptwXY_initialize( smr, ptwXY, interpolation, interpolationString, biSectionMax, accuracy, primarySize, secondarySize, userFlag ) !=
nfu_Okay ) {
48 return(
ptwXY_new( smr, interpolation, interpolationString, 12, 1e-3, primarySize, secondarySize, 0 ) );
54 char const *interpolationString,
double biSectionMax,
double accuracy, int64_t primarySize, int64_t secondarySize,
60 switch( interpolation ) {
72 if( interpolationString == NULL ) {
74 "Invalid other interplation. interpolationString is NULL, it must be a defined string" );
111 double biSectionMax,
double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length,
double const *xy,
116 if( primarySize < length ) primarySize = length;
117 if( ( ptwXY =
ptwXY_new( smr, interpolation, interpolationString, biSectionMax, accuracy, primarySize,
118 secondarySize, userFlag ) ) != NULL ) {
129 int64_t primarySize, int64_t secondarySize, int64_t length,
double const *xy,
int userFlag ) {
133 return(
ptwXY_create( smr, interpolation, interpolationString, 12, 1e-3, primarySize, secondarySize, length, xy, userFlag ) );
139 double biSectionMax,
double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length,
double const *Xs,
140 double const *Ys,
int userFlag ) {
145 if( primarySize < length ) primarySize = length;
146 if( ( ptwXY =
ptwXY_new( smr, interpolation, interpolationString, biSectionMax, accuracy, primarySize,
147 secondarySize, userFlag ) ) != NULL ) {
148 for( i = 0; i < length; i++ ) {
162 int64_t secondarySize, int64_t length,
double const *Xs,
double const *Ys,
int userFlag ) {
166 return(
ptwXY_createFrom_Xs_Ys( smr, interpolation, interpolationString, 12, 1e-3, primarySize, secondarySize, length, Xs, Ys, userFlag ) );
173 int64_t i, nonOverflowLength;
224 while( o != overflowHeader ) {
225 if( i < nonOverflowLength ) {
226 if( pointFrom->
x < o->
point.
x ) {
227 *pointTo = *pointFrom;
240 for( ; i < nonOverflowLength; i++, pointFrom++, pointTo++ ) *pointTo = *pointFrom;
249 int64_t i, nonOverflowLength;
279 while( o != overflowHeader ) {
280 if( i < nonOverflowLength ) {
281 if( pointFrom->
x < o->
point.
x ) {
282 *pointTo = *pointFrom;
295 for( ; i < nonOverflowLength; i++, pointFrom++, pointTo++ ) *pointTo = *pointFrom;
314 int64_t length = ptwXY->
length;
329 pointsTo = &(ptwXY2->
points[length - 1]);
331 if( ( pointsFrom >= ptwXY->
points ) && ( pointsFrom->
x > last->
point.
x ) ) {
332 *pointsTo = *pointsFrom;
335 *pointsTo = last->
point;
341 for( ; pointsFrom >= ptwXY->
points; --pointsFrom, --pointsTo ) *pointsTo = *pointsFrom;
368 switch( interpolationTo ) {
398 if( ( index1 < 0 ) || ( index2 < index1 ) || ( index2 > ptwXY->
length ) ) {
400 (
int) index1, (
int) index2, (
int) ptwXY->
length );
404 length = index2 - index1;
415 for( i = index1; i < index2; i++ ) n->points[i - index1] = ptwXY->
points[i];
423 int64_t secondarySize,
int fill ) {
426 double y, _domainMin, _domainMax;
443 if( ( ptwXY->
length == 0 ) || ( _domainMin >= domainMax ) || ( _domainMax <= domainMin ) ) {
453 if( ( n->points[0].x < domainMin ) || ( n->points[n->length - 1].x > domainMax ) ) {
454 if( fill && ( n->points[n->length - 1].x > domainMax ) ) {
458 if( fill && ( n->points[0].x < domainMin ) ) {
463 for( i1 = 0; i1 < n->length; i1++ )
if( n->points[i1].x >= domainMin )
break;
464 for( i2 = n->length - 1; i2 > 0; i2-- )
if( n->points[i2].x <= domainMax )
break;
467 for( i = i1; i < i2; i++ ) n->points[i- i1] = n->points[i];
484 double domainMax = 1.1 * domainMin + 1;
487 if( domainMin < 0 ) domainMax = 0.9 * domainMin + 1;
492 if( ( ptwXY2 =
ptwXY_domainSlice( smr, ptwXY, domainMin, domainMax, secondarySize, fill ) ) == NULL )
501 double domainMin = 0.9 * domainMax - 1;
504 if( domainMax < 0 ) domainMin = 1.1 * domainMax - 1;
511 if( ( ptwXY2 =
ptwXY_domainSlice( smr, ptwXY, domainMin, domainMax, secondarySize, fill ) ) == NULL )
591 if( biSectionMax < 0 ) {
612 if( size < ptwXY->length ) size = ptwXY->
length;
616 else if( ( ptwXY->
allocatedSize > 2 * size ) || forceSmallerResize ) {
621 if( ptwXY->
points == NULL ) {
644 if( size < ptwXY->overflowLength ) {
668 ptwXYPoint *newPoint,
int forceSmallerResize ) {
671 int64_t length = ptwXY->
length + ( ( newPoint != NULL ) ? 1 : 0 );
681 if( size < length ) size = length;
689 pointsTo = &(ptwXY->
points[length - 1]);
692 if( newPoint != NULL ) {
693 if( ( pointsFrom >= ptwXY->
points ) && ( pointsFrom->
x > last->
point.
x ) ) {
694 if( newPoint->
x > pointsFrom->
x ) addNewPoint = 1; }
696 if( newPoint->
x > last->
point.
x ) addNewPoint = 1;
698 if( addNewPoint == 1 ) {
699 *pointsTo = *newPoint;
703 if( addNewPoint == 0 ) {
704 if( ( pointsFrom >= ptwXY->
points ) && ( pointsFrom->
x > last->
point.
x ) ) {
705 *pointsTo = *pointsFrom;
708 *pointsTo = last->
point;
714 while( ( newPoint != NULL ) && ( pointsFrom >= ptwXY->
points ) ) {
715 if( newPoint->
x > pointsFrom->
x ) {
716 *pointsTo = *newPoint;
719 *pointsTo = *pointsFrom;
724 if( newPoint != NULL ) *pointsTo = *newPoint;
784 if( ptwXY != NULL ) {
825 int64_t lower = 0, mid, upper;
831 return( a_ptwXY->
status );
834 if( *a_length < 2 ) {
840 point = &a_ptwXY->
points[lower];
841 if( a_x < point->x )
return(
nfu_Okay );
843 upper = *a_length - 1;
845 point = &a_ptwXY->
points[upper];
849 mid = ( lower + upper ) >> 1;
850 if( mid == lower )
break;
851 point = &a_ptwXY->
points[mid];
852 if( a_x < point->x ) {
870 double const *d = xy;
884 for( index = 0, p = ptwXY->
points; index < length; index++, p++ ) {
888 "X value at index = %d of %.17e is <= prior value of %.17e", (
int) index, *d, priorX );
908 double const *x,
double const *y ) {
925 for( i = 0, p = ptwXY->
points; i < length; i++, p++, x++, y++ ) {
945 int64_t n = ptwXY->
length - ( i2 - i1 );
952 if( ( i1 < 0 ) || ( i2 < i1 ) || ( i2 > ptwXY->
length ) ) {
954 (
int) i1, (
int) i2, (
int) ptwXY->
length );
969 int64_t i1, length = ptwXY->
length;
983 if( x < ptwXY->points[0].x )
return(
nfu_Okay );
985 for( i1 = 1; i1 < length; ++i1 ) {
986 if( x < ptwXY->points[i1].x )
break;
1001 if( ( index < 0 ) || ( index >= ptwXY->
length ) )
return( NULL );
1013 if( overflowPoint->
index == index )
return( &(overflowPoint->
point) );
1014 if( overflowPoint->
index > index )
break;
1016 return( &(ptwXY->
points[index - i]) );
1049 0, &closeIsEqual, &closePoint );
1051 return( lessEqualGreaterX );
1061 int64_t indexMin, indexMid, indexMax;
1063 double domainMin, domainMax;
1066 ptwXYPoint *lowerPoint = NULL, *upperPoint = NULL;
1068 if( nonOverflowLength < 0 ) {
1074 if( ptwXY->
length == 0 )
return( status );
1086 ptwXY_initialOverflowPoint( lessThanEqualXPoint, overflowHeader, NULL );
1087 ptwXY_initialOverflowPoint( greaterThanXPoint, overflowHeader, NULL );
1088 if( x < domainMin ) {
1091 greaterThanXPoint->
prior = overflowHeader;
1092 greaterThanXPoint->
index = 0;
1094 *closePoint = &(ptwXY->
points[0]); }
1096 *greaterThanXPoint = *(overflowHeader->
next);
1097 *closePoint = &(overflowHeader->
next->
point);
1099 else if( x > domainMax ) {
1102 lessThanEqualXPoint->
prior = overflowHeader->
prior;
1103 lessThanEqualXPoint->
index = nonOverflowLength - 1;
1105 *closePoint = &(ptwXY->
points[lessThanEqualXPoint->
index]); }
1107 *lessThanEqualXPoint = *(overflowHeader->
prior);
1108 *closePoint = &(overflowHeader->
prior->
point);
1112 for( overflowPoint = overflowHeader->
next, overflowIndex = 0; overflowPoint != overflowHeader;
1113 overflowPoint = overflowPoint->
next, overflowIndex++ )
if( overflowPoint->
point.
x > x )
break;
1114 overflowPoint = overflowPoint->
prior;
1115 if( ( overflowPoint != overflowHeader ) && ( overflowPoint->
point.
x == x ) ) {
1117 *lessThanEqualXPoint = *overflowPoint; }
1118 else if( ptwXY->
length == 1 ) {
1120 lessThanEqualXPoint->
index = 0;
1124 indexMax = nonOverflowLength - 1;
1125 indexMid = ( indexMin + indexMax ) >> 1;
1126 while( ( indexMin != indexMid ) && ( indexMid != indexMax ) ) {
1127 if( ptwXY->
points[indexMid].
x > x ) {
1128 indexMax = indexMid; }
1130 indexMin = indexMid;
1132 indexMid = ( indexMin + indexMax ) >> 1;
1134 if( ptwXY->
points[indexMin].
x == x ) {
1136 lessThanEqualXPoint->
index = indexMin;
1137 lessThanEqualXPoint->
point = ptwXY->
points[indexMin]; }
1138 else if( ptwXY->
points[indexMax].
x == x ) {
1140 lessThanEqualXPoint->
index = indexMax;
1141 lessThanEqualXPoint->
point = ptwXY->
points[indexMax]; }
1143 if( ptwXY->
points[indexMin].
x > x ) indexMax = 0;
1144 if( ptwXY->
points[indexMax].
x < x ) indexMin = indexMax;
1145 if( ( overflowPoint == overflowHeader ) ||
1146 ( ( ptwXY->
points[indexMin].
x > overflowPoint->
point.
x ) && ( ptwXY->
points[indexMin].
x < x ) ) ) {
1147 if( overflowPoint != overflowHeader ) lessThanEqualXPoint->
prior = overflowPoint;
1148 lowerPoint = &(ptwXY->
points[indexMin]);
1149 lessThanEqualXPoint->
index = indexMin;
1150 lessThanEqualXPoint->
point = ptwXY->
points[indexMin]; }
1152 lowerPoint = &(overflowPoint->
point);
1153 *lessThanEqualXPoint = *overflowPoint;
1155 if( ( overflowPoint->
next == overflowHeader ) ||
1157 upperPoint = &(ptwXY->
points[indexMax]);
1158 greaterThanXPoint->
index = indexMax;
1159 greaterThanXPoint->
point = ptwXY->
points[indexMax]; }
1161 upperPoint = &(overflowPoint->
next->
point);
1162 *greaterThanXPoint = *(overflowPoint->
next);
1169 double absX = fabs( x );
1172 if( absX < fabs( greaterThanXPoint->
point.
x ) ) absX = fabs( greaterThanXPoint->
point.
x );
1173 if( ( greaterThanXPoint->
point.
x - x ) < eps * absX ) *closeIsEqual = 1; }
1175 if( absX < fabs( lessThanEqualXPoint->
point.
x ) ) absX = fabs( lessThanEqualXPoint->
point.
x );
1176 if( ( x - lessThanEqualXPoint->
point.
x ) < eps * absX ) *closeIsEqual = -1; }
1178 if( ( x - lessThanEqualXPoint->
point.
x ) < ( greaterThanXPoint->
point.
x - x ) ) {
1179 *closePoint = lowerPoint;
1180 if( absX < fabs( lessThanEqualXPoint->
point.
x ) ) absX = fabs( lessThanEqualXPoint->
point.
x );
1181 if( ( x - lessThanEqualXPoint->
point.
x ) < eps * absX ) *closeIsEqual = -1; }
1183 *closePoint = upperPoint;
1184 if( absX < fabs( greaterThanXPoint->
point.
x ) ) absX = fabs( greaterThanXPoint->
point.
x );
1185 if( ( greaterThanXPoint->
point.
x - x ) < eps * absX ) *closeIsEqual = 1;
1213 *y = lessThanEqualXPoint.
point.
y;
1217 greaterThanXPoint.
point.
x, greaterThanXPoint.
point.
y );
1235 double eps,
int override ) {
1240 ptwXYPoint *point = NULL, newPoint = { x, y };
1245 if( nonOverflowLength < 0 ) {
1258 if( closeIsEqual ) {
1259 if( !
override )
return(
nfu_Okay );
1265 point = &(ptwXY->
points[nonOverflowLength]); }
1274 overflowPoint->
prior = greaterThanXPoint.
prior;
1275 overflowPoint->
index = 0; }
1278 overflowPoint->
prior = overflowHeader->
prior;
1281 overflowPoint->
prior = lessThanEqualXPoint.
prior;
1282 if( lessThanEqualXPoint.
next != NULL ) {
1283 if( lessThanEqualXPoint.
point.
x < x )
1287 for( p = overflowHeader->
next, i = 1; p != overflowHeader; p = p->
next, i++ )
1288 if( p->
point.
x > x )
break;
1290 overflowPoint->
index = lessThanEqualXPoint.
index + i;
1294 overflowPoint->
prior->
next = overflowPoint;
1295 overflowPoint->
next->
prior = overflowPoint;
1296 point = &(overflowPoint->
point);
1297 for( overflowPoint = overflowPoint->
next; overflowPoint != overflowHeader; overflowPoint = overflowPoint->
next ) {
1298 overflowPoint->
index++;
1308 if( closeIsEqual && !
override )
return(
nfu_Okay );
1309 if( lessThanEqualXPoint.
next == NULL ) {
1310 point = &(ptwXY->
points[lessThanEqualXPoint.
index]); }
1327 if( ptwXY_mergeFrom( smr, ptwXY, 1, length, xs, ys ) !=
nfu_Okay )
1337 double *xs, *p1, *p2;
1339 if( length == 0 )
return(
nfu_Okay );
1346 for( i = 0, p1 = xs, p2 = xys; i < length; i++, p1++, p2 += 2 ) *p1 = *p2;
1347 if( ptwXY_mergeFrom( smr, ptwXY, 2, length, xs, xys ) !=
nfu_Okay )
1367 if( length == 0 )
return(
nfu_Okay );
1379 priorX = 1.1 * xs[0]; }
1381 priorX = 0.9 * xs[0] - 1;
1383 for( i1 = 0, p1 = xs; i1 < length; ++i1, ++p1 ) {
1388 for( i1 = 0, p1 = xs, j1 = 0; i1 < length; ++i1, ++p1 ) {
1389 for( ; j1 < ptwXY->
length; ++j1 ) {
1390 if( *p1 <= ptwXY->points[j1].x )
break;
1392 if( j1 == ptwXY->
length )
break;
1393 if( *p1 == ptwXY->
points[j1].
x ) ++n1;
1395 n1 = length + (int) ptwXY->
length - n1;
1401 point1 = &(ptwXY->
points[n1-1]);
1403 p1 = &(xs[length-1]);
1404 for( i1 = length - 1, j1 = (
int) ptwXY->
length - 1; ( i1 >= 0 ) && ( j1 >= 0 ); --point1 ) {
1405 if( *p1 >= point2->
x ) {
1408 if( *p1 == point2->
x ) {
1420 for( ; i1 >= 0; --i1, --p1, --point1 ) {
1437 if( nonOverflowLength < 0 ) {
1442 if( ptwXY->
length != 0 ) {
1450 if( domainMax >= x ) {
1456 if( nonOverflowLength < ptwXY->allocatedSize ) {
1457 ptwXY->
points[nonOverflowLength].
x = x;
1458 ptwXY->
points[nonOverflowLength].
y = y; }
1464 return( ptwXY->
status ); } }
1471 overflowPoint->
prior->
next = overflowPoint;
1472 overflowPoint->
next->
prior = overflowPoint;
1473 overflowPoint->
point.
x = x;
1474 overflowPoint->
point.
y = y;
1494 if( ( index < 0 ) || ( index >= ptwXY->
length ) ) {
1496 (
int) index, (
int) ptwXY->
length );
1501 if( overflowPoint->
index >= index )
break;
1504 pm1 = pp1 = overflowPoint;
1505 if( overflowPoint->
index == index ) {
1506 pp1 = overflowPoint->
next;
1520 if( ( overflowPoint != &(ptwXY->
overflowHeader) ) && ( overflowPoint->
index == index ) ) {
1521 overflowPoint->
point.
x = x;
1522 overflowPoint->
point.
y = y; }
1536 ptwXYOverflowPoint lessThanEqualXPoint = { NULL, NULL, 0, {0.0, 0.0}}, greaterThanXPoint;
1539 greaterThanXPoint = lessThanEqualXPoint;
1547 if( ( side !=
'-' ) && ( side !=
'+' ) ) {
1562 *slope = ( greaterThanXPoint.point.y - lessThanEqualXPoint.
point.
y ) /
1563 ( greaterThanXPoint.point.x - lessThanEqualXPoint.
point.
x );
1567 if( lessThanEqualXPoint.
index == 0 ) {
1571 *slope = ( lessThanEqualXPoint.
point.
y - point->
y ) / ( lessThanEqualXPoint.
point.
x - point->
x );
1574 if( lessThanEqualXPoint.
index == ( ptwXY->
length - 1 ) ) {
1578 *slope = ( point->
y - lessThanEqualXPoint.
point.
y ) / ( point->
x - lessThanEqualXPoint.
point.
x );
1595 if( nonOverflowLength < 0 ) {
1603 if( nonOverflowLength >= 0 ) {
1604 if( *domainMin > ptwXY->
points[0].
x ) {
1606 *domainMin = ptwXY->
points[0].
x;
1609 else if( nonOverflowLength > 0 ) {
1611 *domainMin = ptwXY->
points[0].
x; }
1626 if( status ==
nfu_empty )
return( status );
1643 if( nonOverflowLength < 0 ) {
1651 if( ( nonOverflowLength > 0 ) ) {
1652 if( *domainMax < ptwXY->points[nonOverflowLength-1].x ) {
1654 *domainMax = ptwXY->
points[nonOverflowLength-1].
x;
1657 else if( ptwXY->
length > 0 ) {
1659 *domainMax = ptwXY->
points[nonOverflowLength-1].
x; }
1674 if( status ==
nfu_empty )
return( status );
1689 *rangeMin = *rangeMax = 0.;
1691 if( nonOverflowLength < 0 ) {
1697 if( nonOverflowLength > 0 ) {
1698 *rangeMin = *rangeMax = p->
y;
1699 for( i = 1, p++; i < nonOverflowLength; i++, p++ ) {
1700 *rangeMin = ( ( *rangeMin < p->
y ) ? *rangeMin : p->
y );
1701 *rangeMax = ( ( *rangeMax > p->
y ) ? *rangeMax : p->
y );
1704 *rangeMin = *rangeMax = overflowPoint->
point.
y;
1706 for( ; overflowPoint != &(ptwXY->
overflowHeader); overflowPoint = overflowPoint->
next ) {
1707 *rangeMin = ( ( *rangeMin < overflowPoint->
point.
y ) ? *rangeMin : overflowPoint->
point.
y );
1708 *rangeMax = ( ( *rangeMax < overflowPoint->
point.
y ) ? *rangeMax : overflowPoint->
point.
y );
1723 if( nonOverflowLength < 0 ) {
1729 if( nonOverflowLength > 0 ) {
1731 for( i = 1, p++; i < nonOverflowLength; i++, p++ ) *rangeMin = ( ( *rangeMin < p->y ) ? *rangeMin : p->
y ); }
1733 *rangeMin = overflowPoint->
point.
y;
1735 for( ; overflowPoint != &(ptwXY->
overflowHeader); overflowPoint = overflowPoint->
next )
1736 *rangeMin = ( ( *rangeMin < overflowPoint->point.y ) ? *rangeMin : overflowPoint->
point.
y );
1750 if( nonOverflowLength < 0 ) {
1756 if( nonOverflowLength > 0 ) {
1758 for( i = 1, p++; i < nonOverflowLength; i++, p++ ) *rangeMax = ( ( *rangeMax > p->
y ) ? *rangeMax : p->
y ); }
1760 *rangeMax = overflowPoint->
point.
y;
1762 for( ; overflowPoint != &(ptwXY->
overflowHeader); overflowPoint = overflowPoint->
next )
1763 *rangeMax = ( ( *rangeMax > overflowPoint->
point.
y ) ? *rangeMax : overflowPoint->
point.
y );
1771 overflowPoint->
prior = prior;
1772 overflowPoint->
next = next;
1773 overflowPoint->
index = -1;
1774 overflowPoint->
point.
x = 0.;
1775 overflowPoint->
point.
y = 0.;
1782 switch( interpolation ) {
@ nfu_invalidInterpolation
enum nfu_status_e nfu_status
#define ptwXY_minAccuracy
double ptwXY_limitAccuracy(double accuracy)
enum ptwXY_lessEqualGreaterX_e ptwXY_lessEqualGreaterX
enum ptwXY_dataFrom_e ptwXY_dataFrom
struct ptwXYOverflowPoint_s ptwXYOverflowPoint
enum ptwXY_interpolation_e ptwXY_interpolation
@ ptwXY_interpolationFlat
@ ptwXY_interpolationLinLog
@ ptwXY_interpolationLogLog
@ ptwXY_interpolationLinLin
@ ptwXY_interpolationOther
@ ptwXY_interpolationLogLin
struct ptwXYPoints_s ptwXYPoints
#define ptwXY_maxBiSectionMax
#define ptwXY_minimumSize
nfu_status ptwXY_interpolatePoint(statusMessageReporting *smr, ptwXY_interpolation interpolation, double x, double *y, double x1, double y1, double x2, double y2)
@ ptwXY_lessEqualGreaterX_equal
@ ptwXY_lessEqualGreaterX_Error
@ ptwXY_lessEqualGreaterX_empty
@ ptwXY_lessEqualGreaterX_between
@ ptwXY_lessEqualGreaterX_lessThan
@ ptwXY_lessEqualGreaterX_greater
struct ptwXYPoint_s ptwXYPoint
#define ptwXY_minimumOverflowSize
@ ptwXY_dataFrom_Overflow
nfu_status ptwXY_setInterpolationString(ptwXYPoints *ptwXY, char const *interpolationString)
nfu_status ptwXY_domainMax(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *domainMax)
nfu_status ptwXY_deletePoints(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t i1, int64_t i2)
ptwXYPoints * ptwXY_domainSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMin, double domainMax, int64_t secondarySize, int fill)
nfu_status ptwXY_mergeFromXsAndYs(statusMessageReporting *smr, ptwXYPoints *ptwXY, int length, double *xs, double *ys)
double ptwXY_getAccuracy(ptwXYPoints *ptwXY)
nfu_status ptwXY_setValueAtX(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, double y)
ptwXY_interpolation ptwXY_getInterpolation(ptwXYPoints *ptwXY)
double ptwXY_setAccuracy(ptwXYPoints *ptwXY, double accuracy)
nfu_status ptwXY_initialize(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXY_interpolation interpolation, char const *interpolationString, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int userFlag)
ptwXYPoints * ptwXY_clone2(statusMessageReporting *smr, ptwXYPoints const *ptwXY)
int ptwXY_getUserFlag(ptwXYPoints *ptwXY)
nfu_status ptwXY_startIndex(statusMessageReporting *a_smr, ptwXYPoints *a_ptwXY, double a_x, int64_t *a_startIndex, int64_t *a_length)
char const * ptwXY_interpolationToString(ptwXY_interpolation interpolation)
nfu_status ptwXY_release(statusMessageReporting *smr, ptwXYPoints *ptwXY)
int64_t ptwXY_getNonOverflowLength(statusMessageReporting *smr, ptwXYPoints const *ptwXY)
ptwXYPoints * ptwXY_clone(statusMessageReporting *smr, ptwXYPoints *ptwXY)
void ptwXY_setUserFlag(ptwXYPoints *ptwXY, int userFlag)
nfu_status ptwXY_coalescePoints(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t size, ptwXYPoint *newPoint, int forceSmallerResize)
nfu_status ptwXY_getLowerIndexBoundingX(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, int64_t *index)
ptwXYPoints * ptwXY_createFrom_Xs_Ys2(statusMessageReporting *smr, ptwXY_interpolation interpolation, int64_t primarySize, int64_t secondarySize, int64_t length, double const *Xs, double const *Ys, int userFlag)
nfu_status ptwXY_range(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *rangeMin, double *rangeMax)
nfu_status ptwXY_domainMaxAndFrom(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXY_dataFrom *dataFrom, double *domainMax)
ptwXY_lessEqualGreaterX ptwXY_getPointsAroundX(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, ptwXYOverflowPoint *lessThanEqualXPoint, ptwXYOverflowPoint *greaterThanXPoint)
nfu_status ptwXY_reallocateOverflowPoints(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t size)
ptwXYPoints * ptwXY_new2(statusMessageReporting *smr, ptwXY_interpolation interpolation, int64_t primarySize, int64_t secondarySize)
ptwXYPoints * ptwXY_cloneToInterpolation(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXY_interpolation interpolationTo)
nfu_status ptwXY_domainMinAndFrom(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXY_dataFrom *dataFrom, double *domainMin)
ptwXY_lessEqualGreaterX ptwXY_getPointsAroundX_closeIsEqual(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, ptwXYOverflowPoint *lessThanEqualXPoint, ptwXYOverflowPoint *greaterThanXPoint, double eps, int *closeIsEqual, ptwXYPoint **closePoint)
nfu_status ptwXY_mergeFromXYs(statusMessageReporting *smr, ptwXYPoints *ptwXY, int length, double *xys)
char const * ptwXY_getInterpolationString(ptwXYPoints *ptwXY)
nfu_status ptwXY_rangeMax(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *rangeMax)
nfu_status ptwXY_setXYPairAtIndex(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t index, double x, double y)
ptwXYPoints * ptwXY_domainMinSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMin, int64_t secondarySize, int fill)
nfu_status ptwXY_getXYPairAtIndex(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t index, double *x, double *y)
nfu_status ptwXY_getSlopeAtX(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, const char side, double *slope)
ptwXYPoints * ptwXY_createFrom_Xs_Ys(statusMessageReporting *smr, ptwXY_interpolation interpolation, char const *interpolationString, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length, double const *Xs, double const *Ys, int userFlag)
ptwXYPoints * ptwXY_domainMaxSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMax, int64_t secondarySize, int fill)
nfu_status ptwXY_clear(statusMessageReporting *smr, ptwXYPoints *ptwXY)
double ptwXY_getBiSectionMax(ptwXYPoints *ptwXY)
nfu_status ptwXY_getStatus(ptwXYPoints *ptwXY)
ptwXYPoints * ptwXY_new(statusMessageReporting *smr, ptwXY_interpolation interpolation, char const *interpolationString, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int userFlag)
nfu_status ptwXY_appendXY(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, double y)
ptwXYPoints * ptwXY_create2(statusMessageReporting *smr, ptwXY_interpolation interpolation, int64_t primarySize, int64_t secondarySize, int64_t length, double const *xy, int userFlag)
int64_t ptwXY_length(statusMessageReporting *smr, ptwXYPoints *ptwXY)
nfu_status ptwXY_copy(statusMessageReporting *smr, ptwXYPoints *dest, ptwXYPoints *src)
nfu_status ptwXY_reallocatePoints(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t size, int forceSmallerResize)
ptwXY_interpolation ptwXY_stringToInterpolation(char const *interpolationString)
nfu_status ptwXY_setXYData(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t length, double const *xy)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
ptwXYPoints * ptwXY_slice(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t index1, int64_t index2, int64_t secondarySize)
nfu_status ptwXY_rangeMin(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *rangeMin)
ptwXYPoint * ptwXY_getPointAtIndex_Unsafely(ptwXYPoints const *ptwXY, int64_t index)
nfu_status ptwXY_domainMin(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *domainMin)
ptwXYPoints * ptwXY_create(statusMessageReporting *smr, ptwXY_interpolation interpolation, char const *interpolationString, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length, double const *xy, int userFlag)
ptwXYPoint * ptwXY_getPointAtIndex(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t index)
double ptwXY_setBiSectionMax(ptwXYPoints *ptwXY, double biSectionMax)
nfu_status ptwXY_getValueAtX(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, double *y)
nfu_status ptwXY_simpleCoalescePoints(statusMessageReporting *smr, ptwXYPoints *ptwXY)
nfu_status ptwXY_setValueAtX_overrideIfClose(statusMessageReporting *smr, ptwXYPoints *ptwXY, double x, double y, double eps, int override)
nfu_status ptwXY_copyPointsOnly(statusMessageReporting *smr, ptwXYPoints *dest, ptwXYPoints *src)
nfu_status ptwXY_setXYDataFromXsAndYs(statusMessageReporting *smr, ptwXYPoints *ptwXY, int64_t length, double const *x, double const *y)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_setReportError2p(smr, libraryID, code, fmt)
#define smr_realloc2(smr, old, size, forItem)
#define smr_freeMemory2(p)
#define smr_allocateCopyString2(smr, s, forItem)
#define smr_malloc2(smr, size, zero, forItem)
struct ptwXYOverflowPoint_s * next
struct ptwXYOverflowPoint_s * prior
ptwXYOverflowPoint overflowHeader
ptwXY_interpolation interpolation
int64_t overflowAllocatedSize
ptwXYOverflowPoint * overflowPoints
char const * interpolationString