mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add check for dynamic sparsity in Solver::Options::IsValid.
Dynamic sparsity should only be used with SPARSE_NORMAL_CHOLESKY. Change-Id: I8dd33c05ec0337b3c13b547ecffe3aefc3e5ab12
This commit is contained in:
@@ -216,6 +216,12 @@ bool TrustRegionOptionsAreValid(const Solver::Options& options, string* error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.dynamic_sparsity &&
|
||||
options.linear_solver_type != SPARSE_NORMAL_CHOLESKY) {
|
||||
*error = "Dynamic sparsity is only supported with SPARSE_NORMAL_CHOLESKY.";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user