IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2016, 2:14:52 PM (10 years ago)
Author:
eugene
Message:

new api to set vector value en-masse; fix the fit1d_irls mean calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/VectorOps.c

    r39225 r39640  
    229229  } else {
    230230    REALLOCATE (vec[0].elements.Int, opihi_int, MAX(1, Nelements));
     231    vec[0].type = OPIHI_INT;
     232  }
     233  return TRUE;
     234}
     235
     236int SetVectorValues (Vector *vec, void *data, char type, int Nelements) {
     237
     238  // a vector can only have >= 0 elements
     239  vec[0].Nelements = MAX(Nelements,0);
     240  if (type == OPIHI_FLT) {
     241    free (vec[0].elements.Flt);
     242    vec[0].elements.Flt = (opihi_flt *) data;
     243    vec[0].type = OPIHI_FLT;
     244  } else {
     245    free (vec[0].elements.Int);
     246    vec[0].elements.Int = (opihi_int *) data;
    231247    vec[0].type = OPIHI_INT;
    232248  }
Note: See TracChangeset for help on using the changeset viewer.