281 fprintf(
cp_err,
"Internal error: cx_deriv: bad scale\n");
291 scratch =
alloc_d(n * (n + 1));
298 double *r_coefs, *i_coefs;
305 for (i = degree; i < length; i += 1) {
308 for (j = i; j < i + n; j++)
309 spare[j] = c_indata[j].
cx_real;
311 r_coefs, degree, scratch)) {
312 fprintf(stderr,
"ft_polyfit @ %d failed\n", i);
317 for (j = k; j <= i + degree / 2; j++) {
323 for (j = i; j < i + n; j++)
324 spare[j] = c_indata[j].
cx_imag;
326 i_coefs, degree, scratch)) {
327 fprintf(stderr,
"ft_polyfit @ %d failed\n", i);
332 for (j = k; j <= i - degree / 2; j++) {
340 for (j = k; j < length; j++) {
350 return (
char *) c_outdata;
358 double *outdata, *indata;
362 indata = (
double *) data;
365 for (i = 0; i < length; i++)
368 for (i = degree; i < length; i += 1) {
369 if (!
ft_polyfit(scale + i - degree, indata + i - degree,
370 coefs, degree, scratch)) {
371 fprintf(stderr,
"ft_polyfit @ %d failed\n", i);
376 for (j = k; j <= i - degree / 2; j++) {
378 outdata[j] =
ft_peval(x, coefs, degree - 1);
383 for (j = k; j < length; j++) {
385 outdata[j] =
ft_peval(x, coefs, degree - 1);
390 return (
char *) outdata;
bool cp_getvar(char *n, int t, char *r)