IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2012, 3:16:45 PM (14 years ago)
Author:
eugene
Message:

fix spline function to build correctly

Location:
branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline.c

    r34525 r34526  
    22
    33int spline_list (int argc, char **argv);
    4 int spline_init (int argc, char **argv);
    54int spline_create (int argc, char **argv);
     5int spline_apply (int argc, char **argv);
    66int spline_delete (int argc, char **argv);
    77int 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);
    178
    189static Command spline_commands[] = {
    1910  {1, "list",       spline_list,       "list splines"},
    20   {1, "init",       spline_init,       "initialize a spline"},
    2111  {1, "create",     spline_create,     "create a spline"},
     12  {1, "apply",      spline_apply,      "apply a spline"},
    2213  {1, "delete",     spline_delete,     "delete a spline"},
    2314};
     
    3021    gprint (GP_ERR, "USAGE: spline (command)\n");
    3122    gprint (GP_ERR, "    spline list                                    : list splines\n");
    32     gprint (GP_ERR, "    spline init     (spline)                       : removes all pages from spline\n");
    3323    gprint (GP_ERR, "    spline create   (spline)                       : create a spline\n");
    3424    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  
    3131  Spline *myspline = CreateSpline (argv[1], xvec->Nelements);
    3232
    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];
    3636  }   
    3737
     
    6161  ResetVector (yvec, OPIHI_FLT, xvec->Nelements);
    6262
    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;
    6666  }   
    6767
Note: See TracChangeset for help on using the changeset viewer.