Changeset 34526
- Timestamp:
- Oct 7, 2012, 3:16:45 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120905/Ohana/src/opihi
- Files:
-
- 4 edited
-
cmd.data/spline.c (modified) (2 diffs)
-
cmd.data/spline_commands.c (modified) (2 diffs)
-
lib.data/Makefile (modified) (1 diff)
-
lib.data/SplineOps.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline.c
r34525 r34526 2 2 3 3 int spline_list (int argc, char **argv); 4 int spline_init (int argc, char **argv);5 4 int spline_create (int argc, char **argv); 5 int spline_apply (int argc, char **argv); 6 6 int spline_delete (int argc, char **argv); 7 7 int spline_getspline (int argc, char **argv); 8 int spline_listspline (int argc, char **argv);9 int spline_shuffle (int argc, char **argv);10 int spline_npages (int argc, char **argv);11 int spline_newpage (int argc, char **argv);12 int spline_getpage (int argc, char **argv);13 int spline_delpage (int argc, char **argv);14 int spline_listpage (int argc, char **argv);15 int spline_setword (int argc, char **argv);16 int spline_getword (int argc, char **argv);17 8 18 9 static Command spline_commands[] = { 19 10 {1, "list", spline_list, "list splines"}, 20 {1, "init", spline_init, "initialize a spline"},21 11 {1, "create", spline_create, "create a spline"}, 12 {1, "apply", spline_apply, "apply a spline"}, 22 13 {1, "delete", spline_delete, "delete a spline"}, 23 14 }; … … 30 21 gprint (GP_ERR, "USAGE: spline (command)\n"); 31 22 gprint (GP_ERR, " spline list : list splines\n"); 32 gprint (GP_ERR, " spline init (spline) : removes all pages from spline\n");33 23 gprint (GP_ERR, " spline create (spline) : create a spline\n"); 34 24 gprint (GP_ERR, " spline delete (spline) : delete a spline\n"); -
branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline_commands.c
r34525 r34526 31 31 Spline *myspline = CreateSpline (argv[1], xvec->Nelements); 32 32 33 for (i = 0; i < xvec-> elements; i++) {34 myspline->xk[i] = xvec->elements [i];35 myspline->yk[i] = yvec->elements [i];33 for (i = 0; i < xvec->Nelements; i++) { 34 myspline->xk[i] = xvec->elements.Flt[i]; 35 myspline->yk[i] = yvec->elements.Flt[i]; 36 36 } 37 37 … … 61 61 ResetVector (yvec, OPIHI_FLT, xvec->Nelements); 62 62 63 for (i = 0; i < xvec-> elements; i++) {64 opihi_flt value = spline_apply_dbl (myspline->xk, myspline->yk, myspline->y2, myspline->Nknots, xvec->elements [i]);65 yvec->elements [i] = value;;63 for (i = 0; i < xvec->Nelements; i++) { 64 opihi_flt value = spline_apply_dbl (myspline->xk, myspline->yk, myspline->y2, myspline->Nknots, xvec->elements.Flt[i]); 65 yvec->elements.Flt[i] = value; 66 66 } 67 67 -
branches/eam_branches/ipp-20120905/Ohana/src/opihi/lib.data/Makefile
r31635 r34526 23 23 $(SDIR)/bracket.$(ARCH).o \ 24 24 $(SDIR)/spline.$(ARCH).o \ 25 $(SDIR)/SplineOps.$(ARCH).o \ 25 26 $(SDIR)/mrqmin.$(ARCH).o \ 26 27 $(SDIR)/mrq2dmin.$(ARCH).o \ -
branches/eam_branches/ipp-20120905/Ohana/src/opihi/lib.data/SplineOps.c
r34525 r34526 30 30 31 31 spline[0].Nknots = Nknots; 32 spline[0].NKNOTS = Nknots; 33 ALLOCATE (spline[0].xk, opihi_flt, spline[0].NKNOTS); 34 ALLOCATE (spline[0].yk, opihi_flt, spline[0].NKNOTS); 35 ALLOCATE (spline[0].y2, opihi_flt, spline[0].NKNOTS); 36 memset (spline[0].xk, 0, spline[0].NKNOTS * sizeof(opihi_flt)); 37 memset (spline[0].yk, 0, spline[0].NKNOTS * sizeof(opihi_flt)); 38 memset (spline[0].y2, 0, spline[0].NKNOTS * sizeof(opihi_flt)); 32 ALLOCATE (spline[0].xk, opihi_flt, spline[0].Nknots); 33 ALLOCATE (spline[0].yk, opihi_flt, spline[0].Nknots); 34 ALLOCATE (spline[0].y2, opihi_flt, spline[0].Nknots); 35 memset (spline[0].xk, 0, spline[0].Nknots * sizeof(opihi_flt)); 36 memset (spline[0].yk, 0, spline[0].Nknots * sizeof(opihi_flt)); 37 memset (spline[0].y2, 0, spline[0].Nknots * sizeof(opihi_flt)); 39 38 } 40 39 41 40 void FreeSpline (Spline *spline) { 42 43 int i;44 41 45 42 free (spline[0].name);
Note:
See TracChangeset
for help on using the changeset viewer.
