Expose numeric trend segment formulas from native reconstruction models

This commit is contained in:
2026-09-27 03:13:39 +03:00
parent de4609ea00
commit f3937eaf14
7 changed files with 203 additions and 4 deletions

View File

@@ -10,6 +10,12 @@ enum { SET_SIGNAL_POLYNOMIAL, SET_SIGNAL_LINEAR, SET_SIGNAL_PCHIP, SET_SIGNAL_SP
* Inputs may be unsorted; duplicate times are averaged. No extrapolation.
* meta[0..2] = original count, unique count, RMSE at original measurements.
* endpoint=1 includes the last time; 0 samples a cyclic period [first,last).
* On success, workspace blocks used by host formula annotations are:
* work[0..2*count): sorted original interleaved x,y pairs;
* work[2*count..3*count): unique x normalized to [0,1];
* work[3*count..4*count): unique averaged y divided by max(1,max(abs(y)));
* work[4*count..5*count): PCHIP first / spline second derivatives in these
* normalized coordinates (only meta[1] entries in each unique-data block).
* Return: 0 success, 1 bounds, 2 nonfinite/degenerate data, 3 rank deficient. */
PCAN_ABI_API int set_signal_reconstruct(const double *x, const double *y, size_t count,
int method, unsigned degree, size_t output_count, int endpoint,