Problem::Evaluate implementation.

1. Add Problem::Evaluate and tests.
2. Remove Solver::Summary::initial/final_*
3. Remove Solver::Options::return_* members.
4. Various cpplint cleanups.

Change-Id: I4266de53489896f72d9c6798c5efde6748d68a47
This commit is contained in:
Sameer Agarwal
2013-02-20 01:39:03 -08:00
committed by Gerrit Code Review
parent d4a0bf86d6
commit 509f68cfe3
79 changed files with 1383 additions and 578 deletions
+10 -5
View File
@@ -65,18 +65,20 @@
#include <cmath>
#include <numeric>
#include <glog/logging.h>
#include <vector>
#include "ceres/cost_function.h"
#include "ceres/internal/scoped_ptr.h"
#include "ceres/jet.h"
#include "glog/logging.h"
namespace ceres {
template <typename CostFunctor, int Stride = 4>
class DynamicAutoDiffCostFunction : public CostFunction {
public:
DynamicAutoDiffCostFunction(CostFunctor* functor)
: functor_(functor) {}
explicit DynamicAutoDiffCostFunction(CostFunctor* functor)
: functor_(functor) {}
virtual ~DynamicAutoDiffCostFunction() {}
@@ -144,7 +146,9 @@ class DynamicAutoDiffCostFunction : public CostFunction {
// Evaluate all of the strides. Each stride is a chunk of the derivative to
// evaluate, typically some size proportional to the size of the SIMD
// registers of the CPU.
int num_strides = int(ceil(num_active_parameters / float(Stride)));
int num_strides = static_cast<int>(ceil(num_active_parameters /
static_cast<float>(Stride)));
for (int pass = 0; pass < num_strides; ++pass) {
// Set most of the jet components to zero, except for
// non-constant #Stride parameters.
@@ -180,7 +184,8 @@ class DynamicAutoDiffCostFunction : public CostFunction {
if (jacobians[i] != NULL) {
for (int k = 0; k < num_residuals(); ++k) {
jacobians[i][k * parameter_block_sizes()[i] + j] =
output_jets[k].v[parameter_cursor - start_derivative_section];
output_jets[k].v[parameter_cursor -
start_derivative_section];
}
++active_parameter_count;
}