IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40168


Ignore:
Timestamp:
Oct 15, 2017, 12:27:40 PM (9 years ago)
Author:
eugene
Message:

change opihi_int from int to long long int

Location:
branches/eam_branches/ohana.20170822/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20170822/src/libdvo/include/dvodb.h

    r39633 r40168  
    33
    44# define MEASURE_HAS_XCCD 1
     5
     6// Some values used by code moved to libdvo from opihi.
     7enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
     8# define opihi_flt double
     9// # define opihi_int int64_t
     10# define opihi_int long long int
     11# define OPIHI_INT_FMT "%lld"
    512
    613typedef enum {
     
    471478  char    type;
    472479  int     field;
    473   // opihi_flt FltValue;
    474   // opihi_int IntValue;
    475   double FltValue;
    476   int IntValue;
     480  opihi_flt FltValue;
     481  opihi_int IntValue;
     482  // double FltValue;
     483  // int IntValue;
    477484} dbStack;
    478485
    479486typedef struct {
    480   // opihi_flt Flt;
    481   // opihi_int Int;
    482   double Flt;
    483   int Int;
     487  opihi_flt Flt;
     488  opihi_int Int;
     489  // double Flt;
     490  // int Int;
    484491} dbValue;
    485492
     
    562569int dbExtractImagesReset (void);
    563570
    564 // Some values used by code moved to libdvo from opihi.
    565 enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
    566 #define opihi_flt double
    567 #define opihi_int int
    568 
    569571#include "get_graphdata.h"
    570572
  • branches/eam_branches/ohana.20170822/src/libdvo/src/dbCheckStack.c

    r39578 r40168  
    4343       * an int unless proven otherwise **/
    4444      stack[i].FltValue = strtod (stack[i].name, &c1);
    45       stack[i].IntValue = strtol (stack[i].name, &c2, 0);
     45      stack[i].IntValue = strtoll (stack[i].name, &c2, 0);
    4646      if (c2 == stack[i].name + strlen (stack[i].name)) {
    4747        stack[i].type  |= DB_STACK_INT;
  • branches/eam_branches/ohana.20170822/src/libohana/include/ohana_sort.h

    r38986 r40168  
    6868void fsort (float *value, int N);
    6969void isort (int *value, int N);
     70void llsort (long long int *value, int N);
    7071
    7172void dsortpair (double *X, double *Y, int N);
  • branches/eam_branches/ohana.20170822/src/libohana/src/sorts.c

    r38986 r40168  
    3030
    3131# define SWAPFUNC(A,B){ int tmp = value[A]; value[A] = value[B]; value[B] = tmp; }
     32# define COMPARE(A,B)(value[A] < value[B])
     33
     34  OHANA_SORT (N, COMPARE, SWAPFUNC);
     35
     36# undef SWAPFUNC
     37# undef COMPARE
     38
     39}
     40
     41void llsort (long long int *value, int N) {
     42
     43# define SWAPFUNC(A,B){ long long int tmp = value[A]; value[A] = value[B]; value[B] = tmp; }
    3244# define COMPARE(A,B)(value[A] < value[B])
    3345
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx.c

    r39610 r40168  
    7777  double *dD = dDvec->elements.Flt;
    7878
    79   int *mask = NULL;
     79  opihi_int *mask = NULL;
    8080  if (mvec) {
    8181    mask = mvec->elements.Int;
     
    380380}
    381381
    382 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal) {
     382int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal) {
    383383
    384384  int i;
     
    413413
    414414// generate the fit values (projected X,Y; parallax factors;
    415 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean) {
     415int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean) {
    416416
    417417  int i;
     
    464464# define MAX_REJECT 0.1
    465465
    466 int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) {
     466int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) {
    467467
    468468  int i, n;
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx_irls.c

    r39926 r40168  
    8181  double *dD = dDvec->elements.Flt;
    8282
    83   int *mask = NULL;
     83  opihi_int *mask = NULL;
    8484  if (mvec) {
    8585    mask = mvec->elements.Int;
     
    109109  for (i = 0; (VERBOSE == 2) && (i < fitdata.Npts); i++) {
    110110    int n = fitdata.index[i];
    111     int maskValue = mask ? mask[n] : 1;
    112     fprintf (stderr, "%f %f : %f %d : %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]);
     111    opihi_int maskValue = mask ? mask[n] : 1;
     112    fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]);
    113113  }
    114114
     
    150150     
    151151      if (VERBOSE == 2) {
    152           fprintf (stderr, "%f %f : %f %d : %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy);
     152          fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy);
    153153      }
    154154    }
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm.c

    r39228 r40168  
    5050  double *dD = dDvec->elements.Flt;
    5151
    52   int *mask = NULL;
     52  opihi_int *mask = NULL;
    5353  if (mvec) {
    5454    mask = mvec->elements.Int;
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm_irls.c

    r39596 r40168  
    5858  double *dD = dDvec->elements.Flt;
    5959
    60   int *mask = NULL;
     60  opihi_int *mask = NULL;
    6161  if (mvec) {
    6262    mask = mvec->elements.Int;
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c

    r37049 r40168  
    3535          gprint (GP_LOG, "%f ", vec[i][0].elements.Flt[j]);
    3636        } else {
    37           gprint (GP_LOG, "%d ", vec[i][0].elements.Int[j]);
     37          gprint (GP_LOG, OPIHI_INT_FMT, vec[i][0].elements.Int[j]);
    3838        }
    3939      }
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.data/reindex.c

    r39227 r40168  
    4747        continue;
    4848      }
    49       if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
     49      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
    5050      ovec[0].elements.Flt[Npts] = vi[*vx];
    5151      Npts++;
     
    6767        continue;
    6868      }
    69       if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
     69      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
    7070      ovec[0].elements.Int[Npts] = vi[*vx];
    7171      Npts++;
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniq.c

    r39457 r40168  
    8080    memcpy (indata, ivec->elements.Int, ivec[0].Nelements*sizeof(opihi_int));
    8181
    82     isort (indata, ivec->Nelements);
     82    llsort (indata, ivec->Nelements);
    8383
    8484    Nnew = 0;
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.data/write_vectors.c

    r39360 r40168  
    165165        } else {
    166166          if (CSV) {
    167             fprintf (f, "%d,", vec[j][0].elements.Int[i]);
     167            fprintf (f, OPIHI_INT_FMT",", vec[j][0].elements.Int[i]);
    168168          } else {
    169             fprintf (f, "%d ", vec[j][0].elements.Int[i]);
     169            fprintf (f, OPIHI_INT_FMT" ", vec[j][0].elements.Int[i]);
    170170          }
    171171        }
  • branches/eam_branches/ohana.20170822/src/opihi/dvo/remote.c

    r39283 r40168  
    2727    gprint (GP_ERR, "  -skip-result : do not try to read from the result file\n");
    2828    gprint (GP_ERR, "OR:    remote -reload (uniquer)\n");
     29    gprint (GP_ERR, "       (reloads the remote host results into vectors as if a parallel command were run)\n");
    2930    gprint (GP_ERR, "OR:    remote -get-results (uniquer)\n");
     31    gprint (GP_ERR, "       (generates the list of remote result filenames and status variables)\n");
     32    gprint (GP_ERR, "       (RESULT_FILE:i is the filenme, RESULT_STATUS:i is the dvo_client exit status)\n");
    3033    return FALSE;
    3134  }
  • branches/eam_branches/ohana.20170822/src/opihi/include/astro.h

    r39610 r40168  
    4747double VectorFractionInterpolate (double *values, float fraction, int Npts);
    4848
    49 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal);
    50 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean);
    51 int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE);
     49int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal);
     50int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean);
     51int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE);
    5252
    5353int PlxFitDataAlloc (PlxFitData *data, int N);
  • branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c

    r39457 r40168  
    8282      } else {
    8383        if (stack[0].type == ST_SCALAR_INT) {
    84           sprintf (outname, "%d", stack[0].IntValue);
     84          sprintf (outname, OPIHI_INT_FMT, stack[0].IntValue);
    8585        } else {
    8686          sprintf (outname, "%.12g", stack[0].FltValue);
  • branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c

    r40014 r40168  
    8989      }
    9090      if (tmp_stack.type == ST_SCALAR_INT) {
    91         gprint (GP_ERR, "---> %d ", tmp_stack.IntValue);
     91        gprint (GP_ERR, "---> "OPIHI_INT_FMT" ", tmp_stack.IntValue);
    9292      }
    9393      if (tmp_stack.type == ST_SCALAR_FLT) {
Note: See TracChangeset for help on using the changeset viewer.