Fix broken constant parameter blocks
This fixes the bug introduced in a previous commit,
and adds a test to check that constant parameter
blocks work as expected.
This also refactors the Solver/SolverImpl split so
that SolverImpl is no longer a friend of Problem;
instead, Solver is. This makes it possible to
verify the invariant on parameter block states in
the unit test, and is a more symmetric design
anyway.
Bug: 51
Change-Id: Id503f5b526cfb8bc24aae3aaad2e414b14063d78
diff --git a/internal/ceres/program.cc b/internal/ceres/program.cc
index 529e4a3..3d62272 100644
--- a/internal/ceres/program.cc
+++ b/internal/ceres/program.cc
@@ -90,7 +90,7 @@
}
}
-bool Program::CopyUserStateToParameterBlocks() {
+bool Program::SetParameterBlockStatePtrsToUserStatePtrs() {
for (int i = 0; i < parameter_blocks_.size(); ++i) {
if (!parameter_blocks_[i]->SetState(parameter_blocks_[i]->user_state())) {
return false;