Skip to content
Snippets Groups Projects
Commit 5272497a authored by Patrick Jaap's avatar Patrick Jaap
Browse files

Merge branch 'feature/cholmod-error-code' into 'master'

CholmodSolver: Add error code member

See merge request !44
parents 8ecddd67 c204ff57
No related branches found
No related tags found
1 merge request!44CholmodSolver: Add error code member
Pipeline #30317 passed
# Master (will become release 2.8)
- ...
- CholmodSolver: Added `errorCode_` member to report errors and warnings during the matrix decomposition
## Deprecations and removals
......
......@@ -93,7 +93,12 @@ public:
{
// the apply() method doesn't like constant values
auto mutableRhs = *rhs_;
// setMatrix will decompose the matrix
solver.setMatrix(*matrix_);
// get the error code from Cholmod in case something happened
errorCode_ = solver.cholmodCommonObject().status;
solver.apply(*x_, mutableRhs, statistics);
}
else
......@@ -102,6 +107,8 @@ public:
// The setMatrix method stores only the selected entries of the matrix (determined by the ignore field)
solver.setMatrix(*matrix_,&ignore);
// get the error code from Cholmod in case something happened
errorCode_ = solver.cholmodCommonObject().status;
auto modifiedRhs = *rhs_;
......@@ -149,6 +156,19 @@ public:
}
}
/** \brief return the error code of the Cholmod factorize call
*
* In setMatrix() the matrix factorization takes place and Cholmod is
* able to communicate error codes of the factorization in the status
* field of the cholmodCommonObject.
* The return value 0 means "good" and the other values can be found
* in the Cholmod User Guide.
*/
int errorCode() const
{
return errorCode_;
}
//! Pointer to the system matrix
const MatrixType* matrix_;
......@@ -157,6 +177,9 @@ public:
//! Pointer to the right hand side
const VectorType* rhs_;
//! error code of Cholmod factorize call
int errorCode_ = 0;
};
} // namespace Solvers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment