Changeset 24083 for trunk/psLib/test/math/tap_psMatrix03.c
- Timestamp:
- May 6, 2009, 2:17:40 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tap_psMatrix03.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tap_psMatrix03.c
r13123 r24083 106 106 psVector *inVector = (psVector*) psVectorAlloc(3, PS_TYPE_F64); 107 107 108 luImage = psMatrixLUD (luImage, &perm, inImage);109 ok(luImage != NULL, "psMatrixLUD () produced a non-NULL LU matrix");108 luImage = psMatrixLUDecomposition(luImage, &perm, inImage); 109 ok(luImage != NULL, "psMatrixLUDecomposition() produced a non-NULL LU matrix"); 110 110 skip_start(luImage == NULL, 6, "Skipping tests because LU matrix was NULL"); 111 ok(!checkMatrix(luImage), "psMatrixLUD () produced the correct LU matrix");111 ok(!checkMatrix(luImage), "psMatrixLUDecomposition() produced the correct LU matrix"); 112 112 ok(luImage->type.dimen == PS_DIMEN_IMAGE, "The LU matrix has the correct ->dimen member"); 113 113 ok(luImage == tempImage, "The LU matrix was not created from scratch"); … … 119 119 inVector->n = 3; 120 120 121 outVector = psMatrixLUSol ve(outVector, luImage, inVector, perm);122 ok(!checkVector(outVector), "psMatrixLUSol ve() correctly solved the equations");121 outVector = psMatrixLUSolution(outVector, luImage, inVector, perm); 122 ok(!checkVector(outVector), "psMatrixLUSolution() correctly solved the equations"); 123 123 ok(outVector->type.dimen == PS_DIMEN_VECTOR, "The output vector hasthe correct ->dimen member"); 124 124 ok(outVector == tempVector, "The output vector was not created from scratch"); … … 159 159 inVector32->n = 3; 160 160 161 luImage32 = psMatrixLUD (luImage32, &perm32, inImage32);162 ok(luImage32 != NULL, "psMatrixLUD () produced a non-NULL LU matrix");161 luImage32 = psMatrixLUDecomposition(luImage32, &perm32, inImage32); 162 ok(luImage32 != NULL, "psMatrixLUDecomposition() produced a non-NULL LU matrix"); 163 163 skip_start(luImage32 == NULL, 6, "Skipping tests because LU matrix was NULL"); 164 ok(!checkMatrix(luImage32), "psMatrixLUD () produced the correct LU matrix");164 ok(!checkMatrix(luImage32), "psMatrixLUDecomposition() produced the correct LU matrix"); 165 165 ok(luImage32->type.dimen == PS_DIMEN_IMAGE, "The LU matrix has the correct ->dimen member"); 166 166 ok(luImage32 == tempImage32, "The LU matrix was not created from scratch"); … … 168 168 // Determine solution to matrix equation 169 169 170 outVector32 = psMatrixLUSol ve(outVector32, luImage32, inVector32, perm32);171 ok(!checkVector(outVector32), "psMatrixLUSol ve() correctly solved the equations");170 outVector32 = psMatrixLUSolution(outVector32, luImage32, inVector32, perm32); 171 ok(!checkVector(outVector32), "psMatrixLUSolution() correctly solved the equations"); 172 172 ok(outVector32->type.dimen == PS_DIMEN_VECTOR, "The output vector hasthe correct ->dimen member"); 173 173 ok(outVector32 == tempVector32, "The output vector was not created from scratch"); … … 182 182 } 183 183 184 185 184 // Attempt to use null image input argument 186 185 // XXX: This test should generate an error or warning 187 186 // XXX: This seg-faults 188 if (0) { 189 psMemId id = psMemGetId(); 190 psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 191 psMatrixLUD(imageTest, NULL, NULL); 192 psFree(imageTest); 193 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 194 } 195 187 { 188 psMemId id = psMemGetId(); 189 psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 190 psMatrixLUDecomposition(imageTest, NULL, NULL); 191 psFree(imageTest); 192 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 193 } 196 194 197 195 // Attempt to use null input vector argument 198 196 // XXX: This test should generate an error or warning 199 197 // XXX: This seg-faulta 200 if (0) { 201 psMemId id = psMemGetId(); 202 psVector *vectorBad = NULL; 203 psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 204 psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 205 psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 206 psMatrixLUSolve(vectorBadOut, imageTest, vectorBad, permBad); 207 psFree(vectorBadOut); 208 psFree(permBad); 209 psFree(imageTest); 210 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 211 } 212 198 { 199 psMemId id = psMemGetId(); 200 psVector *vectorBad = NULL; 201 psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 202 psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 203 psImage *imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 204 psMatrixLUSolution(vectorBadOut, imageTest, vectorBad, permBad); 205 psFree(vectorBadOut); 206 psFree(permBad); 207 psFree(imageTest); 208 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 209 } 213 210 214 211 // Attempt to use null LU image argument 215 212 // XXX: This test should generate an error or warning, but we don't know how to test that. 216 213 // XXX: This seg-faulta 217 if (0){218 psMemId id = psMemGetId();219 psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);220 psVector *vectorBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);221 psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);222 psMatrixLUSolve(vectorBadOut, NULL, vectorBad, permBad);223 psFree(vectorBadOut);224 psFree(vectorBad);225 psFree(permBad);226 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");214 { 215 psMemId id = psMemGetId(); 216 psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 217 psVector *vectorBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 218 psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 219 psMatrixLUSolution(vectorBadOut, NULL, vectorBad, permBad); 220 psFree(vectorBadOut); 221 psFree(vectorBad); 222 psFree(permBad); 223 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 227 224 } 228 225 }
Note:
See TracChangeset
for help on using the changeset viewer.
