Changeset 25865
- Timestamp:
- Oct 16, 2009, 5:23:09 PM (17 years ago)
- Location:
- branches/pap/psLib/src/math
- Files:
-
- 2 edited
-
psMatrix.c (modified) (2 diffs)
-
psMatrix.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/psLib/src/math/psMatrix.c
r25864 r25865 1033 1033 } 1034 1034 1035 psVector *psMatrixSolveSVD(const psImage *matrix, const psVector *vector) 1036 { 1037 PS_ASSERT_IMAGE_NON_NULL(matrix, NULL); 1038 PS_CHECK_DIMEN_AND_TYPE(matrix, PS_DIMEN_IMAGE, {return NULL;}); 1039 PS_ASSERT_VECTOR_NON_NULL(vector, NULL); 1040 PS_CHECK_DIMEN_AND_TYPE(vector, PS_DIMEN_VECTOR, {return NULL;}); 1035 psVector *psMatrixSolveSVD(psVector *out, const psImage *matrix, const psVector *vector) 1036 { 1037 #define psMatrixSolveSVD_EXIT {psFree(out); return NULL; } 1038 PS_ASSERT_GENERAL_IMAGE_NON_NULL(matrix, psMatrixSolveSVD_EXIT); 1039 PS_CHECK_DIMEN_AND_TYPE(matrix, PS_DIMEN_IMAGE, psMatrixSolveSVD_EXIT); 1040 PS_ASSERT_GENERAL_VECTOR_NON_NULL(RHS, psMatrixSolveSVD_EXIT); 1041 PS_CHECK_DIMEN_AND_TYPE(vector, PS_DIMEN_VECTOR, psMatrixSolveSVD_EXIT); 1041 1042 1042 1043 int numCols = matrix->numCols, numRows = matrix->numRows; // Size of matrix … … 1084 1085 gsl_vector_free(b); 1085 1086 1086 psVector *solution = psVectorAlloc(numCols, PS_TYPE_F64);1087 out = psVectorRecycle(out, numCols, PS_TYPE_F64); 1087 1088 1088 1089 vectorGSLtoPS(solution, x); -
branches/pap/psLib/src/math/psMatrix.h
r25862 r25865 190 190 /// Solves Ax = b for x 191 191 psVector *psMatrixSolveSVD( 192 psVector *solution, ///< Solution to output, or NULL 192 193 const psImage *matrix, ///< Matrix to be solved 193 194 const psVector *vector ///< Vector of values
Note:
See TracChangeset
for help on using the changeset viewer.
