82 CLO_COMBINEDUPLICATES,
96char *option[N_OPTIONS] = {
117 "sddsinterp [<inputfile>] [<outputfile>]\n"
118 " [-pipe=[input][,output]]\n"
119 " -columns=<independent-quantity>,<dependent-name>[,...]\n"
120 " [-exclude=<name>[,...]]\n"
122 " -atValues=<values-list> | \n"
123 " -sequence=<points>[,<start>,<end>] |\n"
124 " -equispaced=<spacing>[,<start>,<end>] | \n"
126 " -fileValues=<valuesfile>[,column=<column-name>][,parallelPages]]\n"
127 " [-interpShort=-1|-2] \n"
128 " [-order=<number>]\n"
129 " [-printout[=bare][,stdout]]\n"
130 " [-forceMonotonic[={increasing|decreasing}]]\n"
131 " [-belowRange={value=<value>|skip|saturate|extrapolate|wrap}[,{abort|warn}]]\n"
132 " [-aboveRange={value=<value>|skip|saturate|extrapolate|wrap}[,{abort|warn}]]\n"
133 " [-majorOrder=row|column]\n"
135 " -pipe=[input][,output] Use pipe for input and/or output.\n"
136 " -columns=<independent>,<dependent1>[,...] Specify the independent and dependent columns.\n"
137 " -exclude=<name>[,...] Exclude specified columns from processing.\n"
138 " -atValues=<values-list> Interpolate at the specified list of values.\n"
139 " -sequence=<points>[,<start>,<end>] Generate a sequence of interpolation points.\n"
140 " -equispaced=<spacing>[,<start>,<end>] Generate equispaced interpolation points.\n"
141 " -fillIn Automatically fill in interpolation points based on data.\n"
142 " -fileValues=<valuesfile>[,column=<name>][,parallelPages]\n"
143 " Use values from a file for interpolation.\n"
144 " -interpShort=-1|-2 Interpolate short columns with order -1 or -2.\n"
145 " Order -1 inherits value from the previous point;\n"
146 " Order -2 inherits value from the next point.\n"
147 " -order=<number> Set the interpolation order (default is 1).\n"
148 " -printout[=bare][,stdout] Output interpolated data in bare format and/or to stdout.\n"
149 " -forceMonotonic[={increasing|decreasing}] Enforce monotonicity in the data.\n"
150 " -belowRange={value=<v>|skip|saturate|extrapolate|wrap}[,{abort|warn}]\n"
151 " Handle values below the interpolation range.\n"
152 " -aboveRange={value=<v>|skip|saturate|extrapolate|wrap}[,{abort|warn}]\n"
153 " Handle values above the interpolation range.\n"
154 " -majorOrder=row|column Set the major order of data storage.\n\n"
156 " sddsinterp input.sdds output.sdds -columns=energy,flux -atValues=1.0,2.0,3.0\n\n"
157 " Program by Michael Borland. (" __DATE__
" " __TIME__
", SVN revision: " SVN_VERSION
")\n";
159double *makeSequence(int64_t *points,
double start,
double end,
double spacing,
double *data, int64_t dataRows);
160double *makeFillInSequence(
double *x, int64_t dataRows, int64_t *nPointsReturn);
161long checkMonotonicity(
double *indepValue, int64_t rows);
162int64_t forceMonotonicity(
double *indepValue,
double **y,
long columns, int64_t rows,
unsigned long direction);
163int64_t combineDuplicatePoints(
double *x,
double **y,
long columns, int64_t rows,
double tolerance);
165#define FILEVALUES_PARALLEL_PAGES 0x0001U
167#define NORMAL_PRINTOUT 1
168#define BARE_PRINTOUT 2
169#define STDOUT_PRINTOUT 4
171#define FORCE_MONOTONIC 0x0001U
172#define FORCE_INCREASING 0x0002U
173#define FORCE_DECREASING 0x0004U
175int main(
int argc,
char **argv) {
177 char *indepQuantity, **depenQuantity, *fileValuesQuantity, *fileValuesFile, **exclude;
178 long depenQuantities, monotonicity, excludes;
179 char *input, *output;
180 long i, readCode, order, valuesReadCode, fillIn;
181 int64_t rows, row, interpPoints, j;
182 long sequencePoints, combineDuplicates, branch;
184 double sequenceStart, sequenceEnd;
185 double sequenceSpacing;
186 unsigned long flags, interpCode, printFlags, forceMonotonic;
187 SCANNED_ARG *scanned;
189 OUTRANGE_CONTROL aboveRange, belowRange;
191 long atValues, doNotRead, parallelPages;
192 double *indepValue, **depenValue, *interpPoint, **outputData;
193 unsigned long pipeFlags, majorOrderFlag;
195 short interpShort = 0, interpShortOrder = -1, *shortValue = NULL, columnMajorOrder = -1;
199 argc =
scanargs(&scanned, argc, argv);
200 if (argc < 3 || argc > (3 + N_OPTIONS))
204 atValues = fillIn = 0;
205 output = input = NULL;
206 combineDuplicates = branch = sequencePoints = parallelPages = 0;
207 indepQuantity = NULL;
208 depenQuantity = exclude = NULL;
209 depenQuantities = excludes = 0;
210 aboveRange.flags = belowRange.flags = OUTRANGE_SATURATE;
212 readCode = interpPoints = 0;
213 fileValuesFile = fileValuesQuantity = NULL;
214 sequenceStart = sequenceEnd = sequenceSpacing = 0;
215 printFlags = pipeFlags = 0;
217 indepValue = interpPoint = NULL;
218 depenValue = outputData = NULL;
220 for (iArg = 1; iArg < argc; iArg++) {
221 if (scanned[iArg].arg_type == OPTION) {
223 switch (
match_string(scanned[iArg].list[0], option, N_OPTIONS, 0)) {
224 case CLO_MAJOR_ORDER:
226 scanned[iArg].n_items--;
227 if (scanned[iArg].n_items > 0 &&
228 (!
scanItemList(&majorOrderFlag, scanned[iArg].list + 1, &scanned[iArg].n_items, 0,
229 "row", -1, NULL, 0, SDDS_ROW_MAJOR_ORDER,
230 "column", -1, NULL, 0, SDDS_COLUMN_MAJOR_ORDER, NULL)))
231 SDDS_Bomb(
"invalid -majorOrder syntax/values");
232 if (majorOrderFlag & SDDS_COLUMN_MAJOR_ORDER)
233 columnMajorOrder = 1;
234 else if (majorOrderFlag & SDDS_ROW_MAJOR_ORDER)
235 columnMajorOrder = 0;
238 if (scanned[iArg].n_items != 2 ||
239 sscanf(scanned[iArg].list[1],
"%ld", &order) != 1 || order < 0)
240 SDDS_Bomb(
"invalid -order syntax/value");
243 if (scanned[iArg].n_items < 2)
247 atValue =
tmalloc(
sizeof(*atValue) * (atValues = scanned[iArg].n_items - 1));
248 for (i = 0; i < atValues; i++)
249 if (sscanf(scanned[iArg].list[i + 1],
"%lf", &atValue[i]) != 1)
252 case CLO_INTERP_SHORT:
253 if (scanned[iArg].n_items == 2) {
254 if (sscanf(scanned[iArg].list[1],
"%hd", &interpShortOrder) != 1 ||
255 (interpShortOrder != -1 && interpShortOrder != -2))
256 SDDS_Bomb(
"invalid -interpShort value; must be -1 or -2");
261 if ((scanned[iArg].n_items != 2 && scanned[iArg].n_items != 4) ||
262 sscanf(scanned[iArg].list[1],
"%ld", &sequencePoints) != 1 ||
264 SDDS_Bomb(
"invalid -sequence syntax/value");
265 if (scanned[iArg].n_items == 4 &&
266 (sscanf(scanned[iArg].list[2],
"%lf", &sequenceStart) != 1 ||
267 sscanf(scanned[iArg].list[3],
"%lf", &sequenceEnd) != 1))
268 SDDS_Bomb(
"invalid -sequence syntax/value");
270 SDDS_Bomb(
"give only one of -sequence and -equispaced");
273 if ((scanned[iArg].n_items != 2 && scanned[iArg].n_items != 4) ||
274 sscanf(scanned[iArg].list[1],
"%lf", &sequenceSpacing) != 1 ||
275 sequenceSpacing <= 0)
276 SDDS_Bomb(
"invalid -equispaced syntax/value");
277 if (scanned[iArg].n_items == 4 &&
278 (sscanf(scanned[iArg].list[2],
"%lf", &sequenceStart) != 1 ||
279 sscanf(scanned[iArg].list[3],
"%lf", &sequenceEnd) != 1))
280 SDDS_Bomb(
"invalid -equispaced syntax/values");
282 SDDS_Bomb(
"give only one of -sequence and -equispaced");
286 SDDS_Bomb(
"only one -columns option may be given");
287 if (scanned[iArg].n_items < 2)
289 indepQuantity = scanned[iArg].list[1];
290 if (scanned[iArg].n_items >= 2) {
291 depenQuantity =
tmalloc(
sizeof(*depenQuantity) * (depenQuantities = scanned[iArg].n_items - 2));
292 for (i = 0; i < depenQuantities; i++)
293 depenQuantity[i] = scanned[iArg].list[i + 2];
297 if ((scanned[iArg].n_items -= 1) >= 1) {
298 if (!
scanItemList(&printFlags, scanned[iArg].list + 1, &scanned[iArg].n_items, 0,
299 "bare", -1, NULL, 0, BARE_PRINTOUT,
300 "stdout", -1, NULL, 0, STDOUT_PRINTOUT, NULL))
303 if (!(printFlags & BARE_PRINTOUT))
304 printFlags |= NORMAL_PRINTOUT;
307 if (scanned[iArg].n_items < 2)
309 fileValuesFile = scanned[iArg].list[1];
310 scanned[iArg].n_items -= 2;
311 if (!
scanItemList(&flags, scanned[iArg].list + 2, &scanned[iArg].n_items, 0,
313 "parallelpages", -1, NULL, 0, FILEVALUES_PARALLEL_PAGES, NULL))
315 if (flags & FILEVALUES_PARALLEL_PAGES)
318 case CLO_COMBINEDUPLICATES:
319 SDDS_Bomb(
"-combineDuplicates option not implemented yet--send email to borland@aps.anl.gov");
320 combineDuplicates = 1;
323 SDDS_Bomb(
"-branch option not implemented yet--send email to borland@aps.anl.gov");
324 if (scanned[iArg].n_items != 2 || sscanf(scanned[iArg].list[1],
"%ld", &branch) != 1 || branch < 1)
325 SDDS_Bomb(
"invalid -branch syntax/value");
328 if ((scanned[iArg].n_items -= 1) < 1 ||
329 !
scanItemList(&belowRange.flags, scanned[iArg].list + 1, &scanned[iArg].n_items, 0,
330 "value",
SDDS_DOUBLE, &belowRange.value, 1, OUTRANGE_VALUE,
331 "skip", -1, NULL, 0, OUTRANGE_SKIP,
332 "saturate", -1, NULL, 0, OUTRANGE_SATURATE,
333 "extrapolate", -1, NULL, 0, OUTRANGE_EXTRAPOLATE,
334 "wrap", -1, NULL, 0, OUTRANGE_WRAP,
335 "abort", -1, NULL, 0, OUTRANGE_ABORT,
336 "warn", -1, NULL, 0, OUTRANGE_WARN, NULL))
337 SDDS_Bomb(
"invalid -belowRange syntax/value");
338 if ((i =
bitsSet(belowRange.flags & (OUTRANGE_VALUE | OUTRANGE_SKIP | OUTRANGE_SATURATE | OUTRANGE_EXTRAPOLATE | OUTRANGE_WRAP | OUTRANGE_ABORT))) > 1)
339 SDDS_Bomb(
"incompatible keywords given for -belowRange");
341 belowRange.flags |= OUTRANGE_SATURATE;
344 if ((scanned[iArg].n_items -= 1) < 1 ||
345 !
scanItemList(&aboveRange.flags, scanned[iArg].list + 1, &scanned[iArg].n_items, 0,
346 "value",
SDDS_DOUBLE, &aboveRange.value, 1, OUTRANGE_VALUE,
347 "skip", -1, NULL, 0, OUTRANGE_SKIP,
348 "saturate", -1, NULL, 0, OUTRANGE_SATURATE,
349 "extrapolate", -1, NULL, 0, OUTRANGE_EXTRAPOLATE,
350 "wrap", -1, NULL, 0, OUTRANGE_WRAP,
351 "abort", -1, NULL, 0, OUTRANGE_ABORT,
352 "warn", -1, NULL, 0, OUTRANGE_WARN, NULL))
353 SDDS_Bomb(
"invalid -aboveRange syntax/value");
354 if ((i =
bitsSet(aboveRange.flags & (OUTRANGE_VALUE | OUTRANGE_SKIP | OUTRANGE_SATURATE | OUTRANGE_EXTRAPOLATE | OUTRANGE_WRAP | OUTRANGE_ABORT))) > 1)
355 SDDS_Bomb(
"incompatible keywords given for -aboveRange");
357 aboveRange.flags |= OUTRANGE_SATURATE;
360 if (!
processPipeOption(scanned[iArg].list + 1, scanned[iArg].n_items - 1, &pipeFlags))
364 if (scanned[iArg].n_items < 2)
366 moveToStringArray(&exclude, &excludes, scanned[iArg].list + 1, scanned[iArg].n_items - 1);
368 case CLO_FORCEMONOTONIC:
369 if ((scanned[iArg].n_items -= 1) > 0) {
370 if (!
scanItemList(&forceMonotonic, scanned[iArg].list + 1, &scanned[iArg].n_items, 0,
371 "increasing", -1, NULL, 0, FORCE_INCREASING,
372 "decreasing", -1, NULL, 0, FORCE_DECREASING, NULL) ||
374 SDDS_Bomb(
"invalid -forceMonotonic syntax/value");
376 forceMonotonic = FORCE_MONOTONIC;
382 fprintf(stderr,
"error: unknown/ambiguous option: %s\n", scanned[iArg].list[0]);
388 input = scanned[iArg].list[0];
390 output = scanned[iArg].list[0];
399 if (printFlags & STDOUT_PRINTOUT)
403 SDDS_Bomb(
"supply the independent quantity name with the -columns option");
405 if ((atValues ? 1 : 0) + (fileValuesFile ? 1 : 0) + (sequencePoints ? 1 : 0) + fillIn + (sequenceSpacing > 0 ? 1 : 0) != 1)
406 SDDS_Bomb(
"you must give one and only one of -atValues, -fileValues, -sequence, -equispaced, and -fillIn");
411 excludes = appendToStringArray(&exclude, excludes, indepQuantity);
412 if (!depenQuantities)
413 depenQuantities = appendToStringArray(&depenQuantity, depenQuantities,
"*");
415 if ((depenQuantities = expandColumnPairNames(&SDDSin, &depenQuantity, NULL, depenQuantities, exclude, excludes, FIND_NUMERIC_TYPE, 0)) <= 0) {
417 SDDS_Bomb(
"no dependent quantities selected for interpolation");
424 if (columnMajorOrder != -1)
425 SDDSout.layout.data_mode.column_major = columnMajorOrder;
427 SDDSout.layout.data_mode.column_major = SDDSin.layout.data_mode.column_major;
432 "Page of interpolation data file used to create this page", NULL,
SDDS_LONG, NULL) < 0 ||
433 SDDS_DefineParameter(&SDDSout,
"InterpPointsPage", NULL, NULL,
"Page of interpolation points file used to create this page", NULL,
SDDS_LONG, NULL) < 0)
435 for (i = 0; i < depenQuantities; i++)
437 fprintf(stderr,
"problem creating interpolated-output column %s\n", depenQuantity[i]);
446 outputData =
tmalloc(
sizeof(*outputData) * (depenQuantities));
447 depenValue =
tmalloc(
sizeof(*depenValue) * (depenQuantities));
451 while (doNotRead || (readCode =
SDDS_ReadPage(&SDDSin)) > 0) {
456 interpPoint = atValue;
457 interpPoints = atValues;
458 }
else if (fileValuesFile) {
463 else if (valuesReadCode == -1) {
465 fprintf(stderr,
"warning: file %s ends before file %s\n", fileValuesFile, input);
473 fprintf(stderr,
"error: unable to (re)read file %s\n", fileValuesFile);
497 }
else if (sequencePoints || sequenceSpacing) {
500 interpPoints = sequencePoints;
501 if (!(interpPoint = makeSequence(&interpPoints, sequenceStart, sequenceEnd, sequenceSpacing, indepValue, rows)))
507 if (!(interpPoint = makeFillInSequence(indepValue, rows, &interpPoints)))
511 for (i = 0; i < depenQuantities; i++)
512 outputData[i] =
tmalloc(
sizeof(*outputData[i]) * interpPoints);
513 rowFlag =
trealloc(rowFlag,
sizeof(*rowFlag) * interpPoints);
514 for (j = 0; j < interpPoints; j++)
516 for (i = 0; i < depenQuantities; i++) {
521 rows = forceMonotonicity(indepValue, depenValue, depenQuantities, rows, forceMonotonic);
522 else if (combineDuplicates)
523 rows = combineDuplicatePoints(indepValue, depenValue, depenQuantities, rows, 0.0);
524 if ((monotonicity = checkMonotonicity(indepValue, rows)) == 0)
525 SDDS_Bomb(
"independent data values do not change monotonically or repeated independent values exist");
527 shortValue =
tmalloc(
sizeof(*shortValue) * rows);
529 for (i = 0; i < depenQuantities; i++) {
531 for (row = 0; row < rows; row++) {
532 shortValue[row] = (short)depenValue[i][row];
535 for (j = 0; j < interpPoints; j++) {
537 outputData[i][j] =
interpolate(depenValue[i], indepValue, rows, interpPoint[j], &belowRange, &aboveRange, order, &interpCode, monotonicity);
539 outputData[i][j] = (double)
interp_short(shortValue, indepValue, rows, interpPoint[j], 0, interpShortOrder, &interpCode, &nextPos);
542 if (interpCode & OUTRANGE_ABORT) {
543 fprintf(stderr,
"error: value %e is out of range for column %s\n", interpPoint[j], depenQuantity[i]);
546 if (interpCode & OUTRANGE_WARN)
547 fprintf(stderr,
"warning: value %e is out of range for column %s\n", interpPoint[j], depenQuantity[i]);
548 if (interpCode & OUTRANGE_SKIP)
558 if (!
SDDS_SetParameters(&SDDSout, SDDS_BY_NAME | SDDS_PASS_BY_VALUE,
"InterpDataPage", readCode,
"InterpPointsPage", valuesReadCode, NULL) ||
561 for (i = 0; i < depenQuantities; i++)
566 if (printFlags & BARE_PRINTOUT) {
567 for (j = 0; j < interpPoints; j++)
569 fprintf(fpPrint,
"%21.15e ", interpPoint[j]);
570 for (i = 0; i < depenQuantities; i++)
571 fprintf(fpPrint,
"%21.15e ", outputData[i][j]);
572 fputc(
'\n', fpPrint);
574 }
else if (printFlags & NORMAL_PRINTOUT) {
575 for (j = 0; j < interpPoints; j++)
577 fprintf(fpPrint,
"%s=%21.15e ", indepQuantity, interpPoint[j]);
578 for (i = 0; i < depenQuantities; i++)
579 fprintf(fpPrint,
"%s=%21.15e ", depenQuantity[i], outputData[i][j]);
580 fputc(
'\n', fpPrint);
586 for (i = 0; i < depenQuantities; i++) {
589 outputData[i] = NULL;
592 depenValue[i] = NULL;
594 if (fileValuesFile) {
612 if (fileValuesFile) {
622double *makeFillInSequence(
double *x, int64_t dataRows, int64_t *nPointsReturn) {
624 double dxMin, dx, xMin, xMax;
628 for (i = 1; i < dataRows; i++) {
629 if ((dx = fabs(x[i] - x[i - 1])) < dxMin && dx > 0)
636 *nPointsReturn = (int64_t)((xMax - xMin) / dxMin + 1);
637 return makeSequence(nPointsReturn, xMin, xMax, 0.0, x, dataRows);
640double *makeSequence(int64_t *points,
double start,
double end,
double spacing,
double *data, int64_t dataRows) {
642 double delta, *sequence;
648 delta = (end - start) / (*points - 1);
649 }
else if (spacing >= 0) {
653 *points = (int64_t)((end - start) / delta + 1.5);
658 sequence =
tmalloc(
sizeof(*sequence) * (*points));
659 for (i = 0; i < *points; i++)
660 sequence[i] = start + delta * i;
664long checkMonotonicity(
double *indepValue, int64_t rows) {
667 if (indepValue[rows - 1] > indepValue[0]) {
669 if (indepValue[rows] <= indepValue[rows - 1])
674 if (indepValue[rows] >= indepValue[rows - 1])
680int64_t combineDuplicatePoints(
double *x,
double **y,
long columns, int64_t rows,
double tolerance) {
687 SDDS_Bomb(
"interpolation data is invalid--no range in independent variable");
688 tolerance *= xmax - xmin;
689 for (i = 1; i < rows; i++) {
690 if (fabs(x[i] - x[i - 1]) <= tolerance) {
691 x[i - 1] = (x[i] + x[i - 1]) / 2;
692 for (column = 0; column < columns; column++)
693 y[column][i - 1] = (y[column][i] + y[column][i - 1]) / 2;
694 for (j = i + 1; j < rows; j++) {
696 for (column = 0; column < columns; column++)
697 y[column][j - 1] = y[column][j];
706int64_t forceMonotonicity(
double *x,
double **y,
long columns, int64_t rows,
unsigned long mode) {
708 long column, direction;
715 if (mode & FORCE_INCREASING)
717 else if (mode & FORCE_DECREASING)
720 direction = x[1] > x[0] ? 1 : -1;
722 keep =
tmalloc(
sizeof(*keep) * rows);
725 for (i = 1; i < rows; i++) {
726 if (direction * (x[i] - reference) > 0) {
733 for (i = j = 1; i < rows; i++) {
736 for (column = 0; column < columns; column++)
737 y[column][j] = y[column][i];
SDDS (Self Describing Data Set) Data Types Definitions and Function Prototypes.
int32_t SDDS_CopyParameters(SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source)
int32_t SDDS_StartPage(SDDS_DATASET *SDDS_dataset, int64_t expected_n_rows)
int32_t SDDS_SetParameters(SDDS_DATASET *SDDS_dataset, int32_t mode,...)
int32_t SDDS_SetColumnFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, double *data, int64_t rows,...)
Sets the values for a single data column using double-precision floating-point numbers.
int32_t SDDS_InitializeOutput(SDDS_DATASET *SDDS_dataset, int32_t data_mode, int32_t lines_per_row, const char *description, const char *contents, const char *filename)
Initializes the SDDS output dataset.
int32_t SDDS_WritePage(SDDS_DATASET *SDDS_dataset)
Writes the current data table to the output file.
int32_t SDDS_WriteLayout(SDDS_DATASET *SDDS_dataset)
Writes the SDDS layout header to the output file.
int32_t SDDS_DefineParameter(SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, char *fixed_value)
Defines a data parameter with a fixed string value.
int32_t SDDS_TransferColumnDefinition(SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName)
Transfers a column definition from a source dataset to a target dataset.
int32_t SDDS_TransferAllParameterDefinitions(SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, uint32_t mode)
Transfers all parameter definitions from a source dataset to a target dataset.
void SDDS_PrintErrors(FILE *fp, int32_t mode)
Prints recorded error messages to a specified file stream.
void SDDS_RegisterProgramName(const char *name)
Registers the executable program name for use in error messages.
int32_t SDDS_NumberOfErrors()
Retrieves the number of errors recorded by SDDS library routines.
void SDDS_Bomb(char *message)
Terminates the program after printing an error message and recorded errors.
#define SDDS_STRING
Identifier for the string data type.
#define SDDS_LONG
Identifier for the signed 32-bit integer data type.
#define SDDS_DOUBLE
Identifier for the double data type.
Utility functions for SDDS dataset manipulation and string array operations.
void * trealloc(void *old_ptr, uint64_t size_of_block)
Reallocates a memory block to a new size.
void * tmalloc(uint64_t size_of_block)
Allocates a memory block of the specified size with zero initialization.
long bitsSet(unsigned long data)
Counts the number of set bits (1s) in the given data.
void bomb(char *error, char *usage)
Reports error messages to the terminal and aborts the program.
int find_min_max(double *min, double *max, double *list, int64_t n)
Finds the minimum and maximum values in a list of doubles.
short interp_short(short *f, double *x, int64_t n, double xo, long warnings, short order, unsigned long *returnCode, long *next_start_pos)
Performs interpolation for short integer data types.
double interpolate(double *f, double *x, int64_t n, double xo, OUTRANGE_CONTROL *belowRange, OUTRANGE_CONTROL *aboveRange, long order, unsigned long *returnCode, long M)
Performs interpolation with range control options.
long match_string(char *string, char **option, long n_options, long mode)
Matches a given string against an array of option strings based on specified modes.
int scanargs(SCANNED_ARG **scanned, int argc, char **argv)
long processPipeOption(char **item, long items, unsigned long *flags)
void processFilenames(char *programName, char **input, char **output, unsigned long pipeFlags, long noWarnings, long *tmpOutputUsed)
long scanItemList(unsigned long *flags, char **item, long *items, unsigned long mode,...)
Scans a list of items and assigns values based on provided keywords and types.