Changeset 26891 for trunk/Ohana/src/opihi/cmd.data
- Timestamp:
- Feb 10, 2010, 7:24:46 PM (16 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.data
- Files:
-
- 3 edited
- 5 copied
-
Makefile (modified) (2 diffs)
-
hermitian1d.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/hermitian1d.c )
-
hermitian2d.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/hermitian2d.c )
-
init.c (modified) (4 diffs)
-
matrix.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/matrix.c )
-
svd.c (modified) (1 diff)
-
test/matrix.sh (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/test/matrix.sh )
-
test/svd.sh (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/test/svd.sh )
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/Makefile
r25757 r26891 53 53 $(SRC)/ungridify.$(ARCH).o \ 54 54 $(SRC)/histogram.$(ARCH).o \ 55 $(SRC)/hermitian1d.$(ARCH).o \ 56 $(SRC)/hermitian2d.$(ARCH).o \ 55 57 $(SRC)/imcut.$(ARCH).o \ 56 58 $(SRC)/imhist.$(ARCH).o \ … … 69 71 $(SRC)/load.$(ARCH).o \ 70 72 $(SRC)/lookup.$(ARCH).o \ 73 $(SRC)/matrix.$(ARCH).o \ 71 74 $(SRC)/mkrgb.$(ARCH).o \ 72 75 $(SRC)/mcreate.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r25757 r26891 42 42 int ungridify PROTO((int, char **)); 43 43 int histogram PROTO((int, char **)); 44 int hermitian1d PROTO((int, char **)); 45 int hermitian2d PROTO((int, char **)); 44 46 int imcut PROTO((int, char **)); 45 47 int imhist PROTO((int, char **)); … … 58 60 int load PROTO((int, char **)); 59 61 int lookup PROTO((int, char **)); 62 int matrix PROTO((int, char **)); 60 63 int mkrgb PROTO((int, char **)); 61 64 int mcreate PROTO((int, char **)); … … 172 175 {1, "header", header, "print image header"}, 173 176 {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"}, 174 179 {1, "imbin", rebin, "rebin image data by factor of N"}, 175 180 {1, "imclip", imclip, "clip values in an image to be within a range"}, … … 195 200 {1, "minterp", minterp, "interpolate image pixels"}, 196 201 {1, "iminterp", minterp, "interpolate image pixels"}, 202 {1, "matrix", matrix, "matrix math operations"}, 197 203 {1, "mkrgb", mkrgb, "convert 3 images to rgb jpeg (use Kapa for better control)"}, 198 204 {1, "mset", mset, "insert a vector in an image"}, -
trunk/Ohana/src/opihi/cmd.data/svd.c
r20936 r26891 57 57 /* use a bcopy instead? */ 58 58 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 59 111 status = svdcmp (U, W, V, Nx, Ny); 60 112 if (!status) {
Note:
See TracChangeset
for help on using the changeset viewer.
