Mercurial > repos > vipints > rdiff
comparison rDiff/src/locfit/Source/lfev.c @ 0:0f80a5141704
version 0.3 uploaded
| author | vipints |
|---|---|
| date | Thu, 14 Feb 2013 23:38:36 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:0f80a5141704 |
|---|---|
| 1 #include "local.h" | |
| 2 | |
| 3 int lf_error; | |
| 4 | |
| 5 lfit lf; | |
| 6 design des; | |
| 7 | |
| 8 void calllf(x,y,n) | |
| 9 double *x, *y; | |
| 10 int n; | |
| 11 { lfdata *lfd; | |
| 12 fitpt *fp; | |
| 13 int i; | |
| 14 | |
| 15 lfit_init(&lf); | |
| 16 | |
| 17 lfd = &(lf.lfd); | |
| 18 lfd->x[0] = x; | |
| 19 lfd->y = y; | |
| 20 lfd->n = n; | |
| 21 lfd->d = 1; | |
| 22 | |
| 23 startlf(&des,&lf,procv,1); | |
| 24 // startmodule(&lf,&des,"std",0); | |
| 25 | |
| 26 fp = &lf.fp; | |
| 27 for (i=0; i<fp->nv; i++) | |
| 28 printf("%8.5f %8.5f\n",evptx(fp,i,0),fp->coef[i]); | |
| 29 } | |
| 30 | |
| 31 int main() | |
| 32 { double x[10], y[10]; | |
| 33 | |
| 34 x[0] = 0; x[1] = 1; x[2] = 2; x[3] = 3; x[4] = 4; | |
| 35 x[5] = 5; x[6] = 6; x[7] = 7; x[8] = 8; x[9] = 9; | |
| 36 | |
| 37 y[0] = 0.3692449; y[1] = 0.8194270; | |
| 38 y[2] = 1.6363139; y[3] =-0.9969944; | |
| 39 y[4] = 0.5359200; y[5] = 1.8642622; | |
| 40 y[6] = 0.3568127; y[7] = 0.4746753; | |
| 41 y[8] =-2.0038246; y[9] = 1.6636109; | |
| 42 | |
| 43 calllf(x,y,10); | |
| 44 } |
