IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:24:46 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201

Location:
trunk/Ohana/src/opihi/cmd.data
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r25757 r26891  
    5353$(SRC)/ungridify.$(ARCH).o     \
    5454$(SRC)/histogram.$(ARCH).o      \
     55$(SRC)/hermitian1d.$(ARCH).o    \
     56$(SRC)/hermitian2d.$(ARCH).o    \
    5557$(SRC)/imcut.$(ARCH).o          \
    5658$(SRC)/imhist.$(ARCH).o \
     
    6971$(SRC)/load.$(ARCH).o           \
    7072$(SRC)/lookup.$(ARCH).o \
     73$(SRC)/matrix.$(ARCH).o \
    7174$(SRC)/mkrgb.$(ARCH).o  \
    7275$(SRC)/mcreate.$(ARCH).o        \
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r25757 r26891  
    4242int ungridify        PROTO((int, char **));
    4343int histogram        PROTO((int, char **));
     44int hermitian1d      PROTO((int, char **));
     45int hermitian2d      PROTO((int, char **));
    4446int imcut            PROTO((int, char **));
    4547int imhist           PROTO((int, char **));
     
    5860int load             PROTO((int, char **));
    5961int lookup           PROTO((int, char **));
     62int matrix           PROTO((int, char **));
    6063int mkrgb            PROTO((int, char **));
    6164int mcreate          PROTO((int, char **));
     
    172175  {1, "header",       header,           "print image header"},
    173176  {1, "histogram",    histogram,        "generate histogram from vector"},
     177  {1, "hermitian1d",  hermitian1d,      "generate 1-D Hermitian Polynomial"},
     178  {1, "hermitian2d",  hermitian2d,      "generate 2-D Hermitian Polynomial"},
    174179  {1, "imbin",        rebin,            "rebin image data by factor of N"},
    175180  {1, "imclip",       imclip,           "clip values in an image to be within a range"},
     
    195200  {1, "minterp",      minterp,          "interpolate image pixels"},
    196201  {1, "iminterp",     minterp,          "interpolate image pixels"},
     202  {1, "matrix",       matrix,           "matrix math operations"},
    197203  {1, "mkrgb",        mkrgb,            "convert 3 images to rgb jpeg (use Kapa for better control)"},
    198204  {1, "mset",         mset,             "insert a vector in an image"},
  • trunk/Ohana/src/opihi/cmd.data/svd.c

    r20936 r26891  
    5757  /* use a bcopy instead? */
    5858
     59  // try C.R. Bond's version -- requires matrices in the form A[row][col] not A[row*Ncol + col]
     60  if (1) {
     61      int j;
     62      double **a, **u, **v, *q;
     63      ALLOCATE (a, double *, Ny);
     64      ALLOCATE (u, double *, Ny);
     65      ALLOCATE (v, double *, Ny);
     66      for (i = 0; i < Ny; i++) {
     67          ALLOCATE (a[i], double, Nx);
     68          ALLOCATE (u[i], double, Nx);
     69          ALLOCATE (v[i], double, Nx);
     70      }   
     71      ALLOCATE (q, double, Nx);
     72
     73      for (j = 0; j < Ny; j++) {
     74          for (i = 0; i < Nx; i++) {
     75              a[j][i] = A[j*Nx + i];
     76              u[j][i] = 0;
     77              v[j][i] = 0;
     78          }
     79      }
     80      for (i = 0; i < Nx; i++) {
     81          q[i] = 0;
     82      }
     83
     84      status = svdcmp_bond_raw (Ny, Nx, 1, 1, FLT_EPSILON, 1e-6, a, q, u, v);
     85      fprintf (stderr, "status: %d\n", status);
     86
     87      // copy u q v back to U W V:
     88      for (j = 0; j < Ny; j++) {
     89          for (i = 0; i < Nx; i++) {
     90              U[j*Nx + i] = u[j][i];
     91              V[j*Nx + i] = v[j][i];
     92          }
     93      }
     94      for (i = 0; i < Nx; i++) {
     95          W[i] = q[i];
     96      }
     97
     98      for (j = 0; j < Ny; j++) {
     99          free(a[j]);
     100          free(u[j]);
     101          free(v[j]);
     102      }
     103      free (a);
     104      free (u);
     105      free (v);
     106      free (q);
     107
     108      return TRUE;
     109  }
     110
    59111  status = svdcmp (U, W, V, Nx, Ny);
    60112  if (!status) {
Note: See TracChangeset for help on using the changeset viewer.