Add ParameterBlock::IsSetConstantByUser()

Introduce IsSetConstantByUser method which indicates whether
the user set the parameter block constant or not.

Changed the definition of IsConstant() to indicate if the
parameter block is effectively constant or not, which is
now the uniion of two conditions - the user set it to be constant
or the local tangent space is of size zero. Currently
this change has no effect as we do not allow local parameterizations
with zero tangent space size, but thats an inconsistency we are
working on fixing.

A variety of code cleans up to parameter_block.h

1. Remove an old TODO comment which is not really actionable.
2. Remove Init() method.
3. NULL -> nullptr
4. memcpy -> std::copy

Change-Id: I12973ee0f053fa22f09908cf36e9aa57d9d8dd74
This commit is contained in:
Sameer Agarwal
2018-10-05 17:43:26 -07:00
parent 7edb3a6b92
commit 0040434507
3 changed files with 79 additions and 101 deletions
+1 -1
View File
@@ -649,7 +649,7 @@ bool ProblemImpl::IsParameterBlockConstant(double* values) const {
<< "Parameter block not found: " << values << ". You must add the "
<< "parameter block to the problem before it can be queried.";
return parameter_block->IsConstant();
return parameter_block->IsSetConstantByUser();
}
void ProblemImpl::SetParameterBlockVariable(double* values) {