Evaluate ResidualBlocks without LossFunction if needed.
1. Add the ability to evaluate the problem without loss function.
2. Remove static Evaluator::Evaluate
3. Refactor the common code from problem_test.cc and
evaluator_test.cc into evaluator_test_utils.cc
Change-Id: I1aa841580afe91d288fbb65288b0ffdd1e43e827
diff --git a/internal/ceres/program_evaluator.h b/internal/ceres/program_evaluator.h
index a19cdf8..de56ac2 100644
--- a/internal/ceres/program_evaluator.h
+++ b/internal/ceres/program_evaluator.h
@@ -120,7 +120,8 @@
return jacobian_writer_.CreateJacobian();
}
- bool Evaluate(const double* state,
+ bool Evaluate(const Evaluator::EvaluateOptions& evaluate_options,
+ const double* state,
double* cost,
double* residuals,
double* gradient,
@@ -196,6 +197,7 @@
// Evaluate the cost, residuals, and jacobians.
double block_cost;
if (!residual_block->Evaluate(
+ evaluate_options.apply_loss_function,
&block_cost,
block_residuals,
block_jacobians,