mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
Add Problem::HasParameterization
This will help the transition from LocalParameterization to Manifolds, since most uses of Problem::GetParameterization is to just check whether a parameter block has a local parameterization associated with it or not. Change-Id: Ib3539f377eaed853d7542c9844ec1487aa0fb4d6
This commit is contained in:
@@ -543,6 +543,18 @@ const LocalParameterization* ProblemImpl::GetParameterization(
|
||||
return parameter_block->local_parameterization();
|
||||
}
|
||||
|
||||
bool ProblemImpl::HasParameterization(const double* values) const {
|
||||
ParameterBlock* parameter_block = FindWithDefault(
|
||||
parameter_block_map_, const_cast<double*>(values), nullptr);
|
||||
if (parameter_block == nullptr) {
|
||||
LOG(FATAL) << "Parameter block not found: " << values
|
||||
<< ". You must add the parameter block to the problem before "
|
||||
<< "you can get its local parameterization.";
|
||||
}
|
||||
|
||||
return (parameter_block->local_parameterization() != nullptr);
|
||||
}
|
||||
|
||||
void ProblemImpl::SetParameterLowerBound(double* values,
|
||||
int index,
|
||||
double lower_bound) {
|
||||
|
||||
Reference in New Issue
Block a user