Changeset 3026
- Timestamp:
- Jan 17, 2005, 12:17:29 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 14 edited
-
src/dataManip/psFunctions.c (modified) (2 diffs)
-
src/dataManip/psMatrix.c (modified) (5 diffs)
-
src/dataManip/psMatrix.h (modified) (2 diffs)
-
src/dataManip/psMinimize.c (modified) (9 diffs)
-
src/math/psMatrix.c (modified) (5 diffs)
-
src/math/psMatrix.h (modified) (2 diffs)
-
src/math/psMinimize.c (modified) (9 diffs)
-
src/math/psPolynomial.c (modified) (2 diffs)
-
src/math/psSpline.c (modified) (2 diffs)
-
test/dataIO (modified) (1 prop)
-
test/dataIO/.cvsignore (modified) (1 diff)
-
test/dataManip/tst_psMatrix03.c (modified) (4 diffs)
-
test/fileUtils (modified) (1 prop)
-
test/fileUtils/.cvsignore (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r3002 r3026 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01-1 4 23:40:24$9 * @version $Revision: 1.82 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-17 22:17:29 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1906 1906 (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1907 1907 } 1908 1909 // This should be set by the psVectorFitSpline1D() 1910 tmp->p_psDeriv2 = NULL; 1908 1911 1909 1912 tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32)); -
trunk/psLib/src/dataManip/psMatrix.c
r2697 r3026 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $23 * @date $Date: 200 4-12-11 00:16:38$22 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2005-01-17 22:17:29 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 175 175 /*****************************************************************************/ 176 176 177 psImage* psMatrixLUD(psImage* outImage, psVector* outPerm, psImage* inImage)177 psImage* psMatrixLUD(psImage* outImage, psVector** outPerm, psImage* inImage) 178 178 { 179 179 psS32 signum = 0; … … 190 190 PS_CHECK_POINTERS(inImage, outImage, outImage); 191 191 PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, outImage); 192 PS_VECTOR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT); 193 PS_CHECK_DIMEN_AND_TYPE(outPerm, PS_DIMEN_VECTOR, outImage); 192 PS_PTR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT); 194 193 psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type); 195 psVectorRecycle(outPerm, inImage->numRows, inImage->type.type);196 194 PS_CHECK_SQUARE(inImage, outImage); 197 195 PS_CHECK_SQUARE(outImage, outImage); … … 203 201 // Initialize GSL data 204 202 perm.size = numCols; 205 outPerm->n = numCols; 206 perm.data = outPerm->data.V; 203 if (sizeof(size_t) == 4) { 204 *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S32); 205 } else if (sizeof(size_t) == 8) { 206 *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S64); 207 } else { 208 psError(PS_ERR_UNKNOWN, true, 209 "Failed to allocate the permutation vector; " 210 "could not determine the cooresponding data type."); 211 psMatrixLUD_EXIT; 212 } 213 214 (*outPerm)->n = numCols; 215 perm.data = (*outPerm)->data.V; 207 216 lu = gsl_matrix_alloc(numRows, numCols); 208 217 … … 244 253 PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_VECTOR, outVector); 245 254 PS_VECTOR_CHECK_NULL(inPerm, outVector); 246 PS_CHECK_DIMEN_AND_TYPE(inPerm, PS_DIMEN_VECTOR, outVector);247 255 psVectorRecycle(outVector, inImage->numRows, inImage->type.type); 248 256 -
trunk/psLib/src/dataManip/psMatrix.h
r2671 r3026 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $25 * @date $Date: 200 4-12-09 20:51:22$24 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2005-01-17 22:17:29 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 psImage* psMatrixLUD( 46 46 psImage* outImage, ///< Image to return, or NULL. 47 psVector* outPerm,///< Output permutation vector used by psMatrixLUSolve.47 psVector** outPerm, ///< Output permutation vector used by psMatrixLUSolve. 48 48 psImage* inImage ///< Image to decompose. 49 49 ); -
trunk/psLib/src/dataManip/psMinimize.c
r3000 r3026 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1. 99$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-01-1 4 23:27:56$11 * @version $Revision: 1.100 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-17 22:17:29 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 294 294 This can not be implemented until SDR states what order spline should be 295 295 created. 296 296 297 297 Should we error if mySPline is not NULL? 298 298 */ … … 616 616 psS32 p; 617 617 psVector *beta = psVectorAlloc(numParams, PS_TYPE_F64); 618 psVector *perm = psVectorAlloc(numParams, PS_TYPE_F64);618 psVector *perm = NULL; 619 619 620 620 psVector *paramDeltasF64 = psVectorAlloc(numParams, PS_TYPE_F64); … … 738 738 // XXX: How do we know if these functions were successful? 739 739 // 740 aOut = psMatrixLUD(aOut, perm, A);740 aOut = psMatrixLUD(aOut, &perm, A); 741 741 paramDeltasF64 = psMatrixLUSolve(paramDeltasF64, aOut, beta, perm); 742 742 … … 936 936 coeffs = psVectorAlloc(polyOrder, PS_TYPE_F64); 937 937 X = psVectorAlloc(x->n, PS_TYPE_F64); 938 outPerm = psVectorAlloc(polyOrder, PS_TYPE_F64);939 938 xSums = psVectorAlloc(1 + 2 * polyOrder, PS_TYPE_F64); 940 939 … … 943 942 B->data.F64[i] = 0.0; 944 943 coeffs->data.F64[i] = 0.0; 945 outPerm->data.F64[i] = 0.0;946 944 for (j = 0; j < polyOrder; j++) { 947 945 A->data.F64[i][j] = 0.0; … … 987 985 988 986 // XXX: How do we know if these routines were successful? 989 ALUD = psMatrixLUD(ALUD, outPerm, A);987 ALUD = psMatrixLUD(ALUD, &outPerm, A); 990 988 coeffs = psMatrixLUSolve(coeffs, ALUD, B, outPerm); 991 989 … … 1139 1137 Algorithm: 1140 1138 1141 XXX completely ad hoc: 1139 XXX completely ad hoc: 1142 1140 start with the user-supplied starting parameter and 1143 1141 call that b. Calculate a/c as a fractional amount smaller/larger than b. 1144 1142 Repeat this process until a local minimum is found. 1145 1143 1146 XXX: 1147 new algorithm: 1144 XXX: 1145 new algorithm: 1148 1146 start at x=0, expand in one direction until the function 1149 1147 decreases. Then you have two points in the bracket. Keep going until it … … 1151 1149 direction. 1152 1150 1153 XXX: 1151 XXX: 1154 1152 This is F32 only. 1155 1153 1156 XXX: 1154 XXX: 1157 1155 output bracket vector should be an input as well. 1158 1156 *****************************************************************************/ -
trunk/psLib/src/math/psMatrix.c
r2697 r3026 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $23 * @date $Date: 200 4-12-11 00:16:38$22 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2005-01-17 22:17:29 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 175 175 /*****************************************************************************/ 176 176 177 psImage* psMatrixLUD(psImage* outImage, psVector* outPerm, psImage* inImage)177 psImage* psMatrixLUD(psImage* outImage, psVector** outPerm, psImage* inImage) 178 178 { 179 179 psS32 signum = 0; … … 190 190 PS_CHECK_POINTERS(inImage, outImage, outImage); 191 191 PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, outImage); 192 PS_VECTOR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT); 193 PS_CHECK_DIMEN_AND_TYPE(outPerm, PS_DIMEN_VECTOR, outImage); 192 PS_PTR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT); 194 193 psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type); 195 psVectorRecycle(outPerm, inImage->numRows, inImage->type.type);196 194 PS_CHECK_SQUARE(inImage, outImage); 197 195 PS_CHECK_SQUARE(outImage, outImage); … … 203 201 // Initialize GSL data 204 202 perm.size = numCols; 205 outPerm->n = numCols; 206 perm.data = outPerm->data.V; 203 if (sizeof(size_t) == 4) { 204 *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S32); 205 } else if (sizeof(size_t) == 8) { 206 *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S64); 207 } else { 208 psError(PS_ERR_UNKNOWN, true, 209 "Failed to allocate the permutation vector; " 210 "could not determine the cooresponding data type."); 211 psMatrixLUD_EXIT; 212 } 213 214 (*outPerm)->n = numCols; 215 perm.data = (*outPerm)->data.V; 207 216 lu = gsl_matrix_alloc(numRows, numCols); 208 217 … … 244 253 PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_VECTOR, outVector); 245 254 PS_VECTOR_CHECK_NULL(inPerm, outVector); 246 PS_CHECK_DIMEN_AND_TYPE(inPerm, PS_DIMEN_VECTOR, outVector);247 255 psVectorRecycle(outVector, inImage->numRows, inImage->type.type); 248 256 -
trunk/psLib/src/math/psMatrix.h
r2671 r3026 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $25 * @date $Date: 200 4-12-09 20:51:22$24 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2005-01-17 22:17:29 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 psImage* psMatrixLUD( 46 46 psImage* outImage, ///< Image to return, or NULL. 47 psVector* outPerm,///< Output permutation vector used by psMatrixLUSolve.47 psVector** outPerm, ///< Output permutation vector used by psMatrixLUSolve. 48 48 psImage* inImage ///< Image to decompose. 49 49 ); -
trunk/psLib/src/math/psMinimize.c
r3000 r3026 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1. 99$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-01-1 4 23:27:56$11 * @version $Revision: 1.100 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-01-17 22:17:29 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 294 294 This can not be implemented until SDR states what order spline should be 295 295 created. 296 296 297 297 Should we error if mySPline is not NULL? 298 298 */ … … 616 616 psS32 p; 617 617 psVector *beta = psVectorAlloc(numParams, PS_TYPE_F64); 618 psVector *perm = psVectorAlloc(numParams, PS_TYPE_F64);618 psVector *perm = NULL; 619 619 620 620 psVector *paramDeltasF64 = psVectorAlloc(numParams, PS_TYPE_F64); … … 738 738 // XXX: How do we know if these functions were successful? 739 739 // 740 aOut = psMatrixLUD(aOut, perm, A);740 aOut = psMatrixLUD(aOut, &perm, A); 741 741 paramDeltasF64 = psMatrixLUSolve(paramDeltasF64, aOut, beta, perm); 742 742 … … 936 936 coeffs = psVectorAlloc(polyOrder, PS_TYPE_F64); 937 937 X = psVectorAlloc(x->n, PS_TYPE_F64); 938 outPerm = psVectorAlloc(polyOrder, PS_TYPE_F64);939 938 xSums = psVectorAlloc(1 + 2 * polyOrder, PS_TYPE_F64); 940 939 … … 943 942 B->data.F64[i] = 0.0; 944 943 coeffs->data.F64[i] = 0.0; 945 outPerm->data.F64[i] = 0.0;946 944 for (j = 0; j < polyOrder; j++) { 947 945 A->data.F64[i][j] = 0.0; … … 987 985 988 986 // XXX: How do we know if these routines were successful? 989 ALUD = psMatrixLUD(ALUD, outPerm, A);987 ALUD = psMatrixLUD(ALUD, &outPerm, A); 990 988 coeffs = psMatrixLUSolve(coeffs, ALUD, B, outPerm); 991 989 … … 1139 1137 Algorithm: 1140 1138 1141 XXX completely ad hoc: 1139 XXX completely ad hoc: 1142 1140 start with the user-supplied starting parameter and 1143 1141 call that b. Calculate a/c as a fractional amount smaller/larger than b. 1144 1142 Repeat this process until a local minimum is found. 1145 1143 1146 XXX: 1147 new algorithm: 1144 XXX: 1145 new algorithm: 1148 1146 start at x=0, expand in one direction until the function 1149 1147 decreases. Then you have two points in the bracket. Keep going until it … … 1151 1149 direction. 1152 1150 1153 XXX: 1151 XXX: 1154 1152 This is F32 only. 1155 1153 1156 XXX: 1154 XXX: 1157 1155 output bracket vector should be an input as well. 1158 1156 *****************************************************************************/ -
trunk/psLib/src/math/psPolynomial.c
r3002 r3026 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01-1 4 23:40:24$9 * @version $Revision: 1.82 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-17 22:17:29 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1906 1906 (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1907 1907 } 1908 1909 // This should be set by the psVectorFitSpline1D() 1910 tmp->p_psDeriv2 = NULL; 1908 1911 1909 1912 tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32)); -
trunk/psLib/src/math/psSpline.c
r3002 r3026 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-01-1 4 23:40:24$9 * @version $Revision: 1.82 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-01-17 22:17:29 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1906 1906 (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1907 1907 } 1908 1909 // This should be set by the psVectorFitSpline1D() 1910 tmp->p_psDeriv2 = NULL; 1908 1911 1909 1912 tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32)); -
trunk/psLib/test/dataIO
- Property svn:ignore
-
old new 3 3 tst_psFits 4 4 multi.fits 5 table.fits
-
- Property svn:ignore
-
trunk/psLib/test/dataIO/.cvsignore
r2991 r3026 3 3 tst_psFits 4 4 multi.fits 5 table.fits -
trunk/psLib/test/dataManip/tst_psMatrix03.c
r2686 r3026 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $17 * @date $Date: 200 4-12-10 20:00:06$16 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-01-17 22:17:29 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 108 108 inVector->n = 3; 109 109 luImage32 = (psImage*)psImageAlloc(3, 3, PS_TYPE_F32); 110 perm32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32);111 110 outVector32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32); 112 111 inVector32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32); … … 131 130 printPositiveTestHeader(stdout, "psMatrix", "Calculate LU matrix"); 132 131 tempImage = luImage; 133 luImage = psMatrixLUD(luImage, perm, inImage);132 luImage = psMatrixLUD(luImage, &perm, inImage); 134 133 CHECK_MATRIX(luImage); 135 134 if(luImage->type.dimen != PS_DIMEN_IMAGE) { … … 140 139 141 140 tempImage32 = luImage32; 142 luImage32 = psMatrixLUD(luImage32, perm32, inImage32);141 luImage32 = psMatrixLUD(luImage32, &perm32, inImage32); 143 142 CHECK_MATRIX(luImage32); 144 143 if(luImage32->type.dimen != PS_DIMEN_IMAGE) { -
trunk/psLib/test/fileUtils
- Property svn:ignore
-
old new 3 3 tst_psFits 4 4 multi.fits 5 table.fits
-
- Property svn:ignore
-
trunk/psLib/test/fileUtils/.cvsignore
r2991 r3026 3 3 tst_psFits 4 4 multi.fits 5 table.fits
Note:
See TracChangeset
for help on using the changeset viewer.
