Changeset 9291f85 for molecuilder/src/gslmatrix.cpp
- Timestamp:
- Jan 10, 2010, 7:25:50 PM (16 years ago)
- Children:
- 9cdbee
- Parents:
- 7b991d
- File:
-
- 1 edited
-
molecuilder/src/gslmatrix.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/gslmatrix.cpp
r7b991d r9291f85 229 229 return (gsl_linalg_cholesky_decomp (matrix) != GSL_EDOM); 230 230 }; 231 232 233 /** Calculates the determinant of the matrix. 234 * if matrix is square, uses LU decomposition. 235 */ 236 double GSLMatrix::Determinant() 237 { 238 int signum = 0; 239 assert (rows == columns && "Determinant can only be calculated for square matrices."); 240 gsl_permutation *p = gsl_permutation_alloc(rows); 241 gsl_linalg_LU_decomp(matrix, p, &signum); 242 gsl_permutation_free(p); 243 return gsl_linalg_LU_det(matrix, signum); 244 }; 245
Note:
See TracChangeset
for help on using the changeset viewer.
