More C++ification. "> >" -> ">>" "> > >" -> ">>>" Change-Id: Id1ddd9dbf030fe21d57207741b4ca8403068e55b
diff --git a/include/ceres/covariance.h b/include/ceres/covariance.h index 971175c..a8061b5 100644 --- a/include/ceres/covariance.h +++ b/include/ceres/covariance.h
@@ -183,7 +183,7 @@ // Covariance::Options options; // Covariance covariance(options); // -// std::vector<std::pair<const double*, const double*> > covariance_blocks; +// std::vector<std::pair<const double*, const double*>> covariance_blocks; // covariance_blocks.push_back(make_pair(x, x)); // covariance_blocks.push_back(make_pair(y, y)); // covariance_blocks.push_back(make_pair(x, y)); @@ -360,7 +360,7 @@ // function returns false. bool Compute( const std::vector<std::pair<const double*, - const double*> >& covariance_blocks, + const double*>>& covariance_blocks, Problem* problem); // Compute a part of the covariance matrix.
diff --git a/include/ceres/cubic_interpolation.h b/include/ceres/cubic_interpolation.h index 9804a33..88a3ebf 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h
@@ -117,7 +117,7 @@ // // const double data[] = {1.0, 2.0, 5.0, 6.0}; // Grid1D<double, 1> grid(x, 0, 4); -// CubicInterpolator<Grid1D<double, 1> > interpolator(grid); +// CubicInterpolator<Grid1D<double, 1>> interpolator(grid); // double f, dfdx; // interpolator.Evaluator(1.5, &f, &dfdx); template<typename Grid> @@ -248,7 +248,7 @@ // 3.6, 2.1, 4.2, 2.0, // 2.0, 1.0, 3.1, 5.2}; // Grid2D<double, 1> grid(data, 3, 4); -// BiCubicInterpolator<Grid2D<double, 1> > interpolator(grid); +// BiCubicInterpolator<Grid2D<double, 1>> interpolator(grid); // double f, dfdr, dfdc; // interpolator.Evaluate(1.2, 2.5, &f, &dfdr, &dfdc);
diff --git a/include/ceres/dynamic_autodiff_cost_function.h b/include/ceres/dynamic_autodiff_cost_function.h index f1eb0d3..2d66f3f 100644 --- a/include/ceres/dynamic_autodiff_cost_function.h +++ b/include/ceres/dynamic_autodiff_cost_function.h
@@ -112,8 +112,8 @@ 0); // Allocate scratch space for the strided evaluation. - std::vector<Jet<double, Stride> > input_jets(num_parameters); - std::vector<Jet<double, Stride> > output_jets(num_residuals()); + std::vector<Jet<double, Stride>> input_jets(num_parameters); + std::vector<Jet<double, Stride>> output_jets(num_residuals()); // Make the parameter pack that is sent to the functor (reused). std::vector<Jet<double, Stride>* > jet_parameters(num_parameter_blocks,
diff --git a/include/ceres/internal/autodiff.h b/include/ceres/internal/autodiff.h index 21f3b92..92542a4 100644 --- a/include/ceres/internal/autodiff.h +++ b/include/ceres/internal/autodiff.h
@@ -193,7 +193,7 @@ DCHECK(src); DCHECK(dst); for (int i = 0; i < M; ++i) { - Eigen::Map<Eigen::Matrix<T, N, 1> >(dst + N * i, N) = + Eigen::Map<Eigen::Matrix<T, N, 1>>(dst + N * i, N) = src[i].v.template segment<N>(N0); } }
diff --git a/include/ceres/internal/eigen.h b/include/ceres/internal/eigen.h index 7853ea7..59545df 100644 --- a/include/ceres/internal/eigen.h +++ b/include/ceres/internal/eigen.h
@@ -52,15 +52,15 @@ Eigen::ColMajor> ColMajorMatrix; typedef Eigen::Map<ColMajorMatrix, 0, - Eigen::Stride<Eigen::Dynamic, 1> > ColMajorMatrixRef; + Eigen::Stride<Eigen::Dynamic, 1>> ColMajorMatrixRef; typedef Eigen::Map<const ColMajorMatrix, 0, - Eigen::Stride<Eigen::Dynamic, 1> > ConstColMajorMatrixRef; + Eigen::Stride<Eigen::Dynamic, 1>> ConstColMajorMatrixRef; // C++ does not support templated typdefs, thus the need for this // struct so that we can support statically sized Matrix and Maps. -template <int num_rows = Eigen::Dynamic, int num_cols = Eigen::Dynamic> + template <int num_rows = Eigen::Dynamic, int num_cols = Eigen::Dynamic> struct EigenTypes { typedef Eigen::Matrix<double, num_rows, @@ -71,8 +71,8 @@ typedef Eigen::Map<Matrix> MatrixRef; typedef Eigen::Map<const Matrix> ConstMatrixRef; typedef Eigen::Matrix<double, num_rows, 1> Vector; - typedef Eigen::Map<Eigen::Matrix<double, num_rows, 1> > VectorRef; - typedef Eigen::Map<const Eigen::Matrix<double, num_rows, 1> > ConstVectorRef; + typedef Eigen::Map<Eigen::Matrix<double, num_rows, 1>> VectorRef; + typedef Eigen::Map<const Eigen::Matrix<double, num_rows, 1>> ConstVectorRef; }; } // namespace ceres
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 5b56d86..d3edeac 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -912,7 +912,7 @@ // Creating a specialization of NumTraits enables placing Jet objects inside // Eigen arrays, getting all the goodness of Eigen combined with autodiff. template<typename T, int N> -struct NumTraits<ceres::Jet<T, N> > { +struct NumTraits<ceres::Jet<T, N>> { typedef ceres::Jet<T, N> Real; typedef ceres::Jet<T, N> NonInteger; typedef ceres::Jet<T, N> Nested;
diff --git a/include/ceres/ordered_groups.h b/include/ceres/ordered_groups.h index aa1bd3a..3ff459e 100644 --- a/include/ceres/ordered_groups.h +++ b/include/ceres/ordered_groups.h
@@ -126,9 +126,9 @@ return; } - typename std::map<int, std::set<T> >::reverse_iterator it = + typename std::map<int, std::set<T>>::reverse_iterator it = group_to_elements_.rbegin(); - std::map<int, std::set<T> > new_group_to_elements; + std::map<int, std::set<T>> new_group_to_elements; new_group_to_elements[it->first] = it->second; int new_group_id = it->first + 1; @@ -165,7 +165,7 @@ // This function always succeeds, i.e., implicitly there exists a // group for every integer. int GroupSize(const int group) const { - typename std::map<int, std::set<T> >::const_iterator it = + typename std::map<int, std::set<T>>::const_iterator it = group_to_elements_.find(group); return (it == group_to_elements_.end()) ? 0 : it->second.size(); } @@ -187,7 +187,7 @@ return group_to_elements_.begin()->first; } - const std::map<int, std::set<T> >& group_to_elements() const { + const std::map<int, std::set<T>>& group_to_elements() const { return group_to_elements_; } @@ -196,7 +196,7 @@ } private: - std::map<int, std::set<T> > group_to_elements_; + std::map<int, std::set<T>> group_to_elements_; std::map<T, int> element_to_group_; };
diff --git a/include/ceres/tiny_solver.h b/include/ceres/tiny_solver.h index c55375e..3cf1c32 100644 --- a/include/ceres/tiny_solver.h +++ b/include/ceres/tiny_solver.h
@@ -128,7 +128,7 @@ typename LinearSolver = Eigen::LDLT< Eigen::Matrix<typename Function::Scalar, Function::NUM_PARAMETERS, - Function::NUM_PARAMETERS> > > + Function::NUM_PARAMETERS>>> class TinySolver { public: enum {
diff --git a/include/ceres/tiny_solver_autodiff_function.h b/include/ceres/tiny_solver_autodiff_function.h index 6bdb2ac..c54a6e5 100644 --- a/include/ceres/tiny_solver_autodiff_function.h +++ b/include/ceres/tiny_solver_autodiff_function.h
@@ -115,7 +115,7 @@ // Copy the jacobian out of the derivative part of the residual jets. Eigen::Map<Eigen::Matrix<T, kNumResiduals, - kNumParameters> > jacobian_matrix(jacobian); + kNumParameters>> jacobian_matrix(jacobian); for (int r = 0; r < kNumResiduals; ++r) { residuals[r] = jet_residuals_[r].a; // Note that while this looks like a fast vectorized write, in practice it
diff --git a/include/ceres/tiny_solver_cost_function_adapter.h b/include/ceres/tiny_solver_cost_function_adapter.h index e3217d0..d44bdeb 100644 --- a/include/ceres/tiny_solver_cost_function_adapter.h +++ b/include/ceres/tiny_solver_cost_function_adapter.h
@@ -116,7 +116,7 @@ // column-major layout, and the CostFunction objects use row-major // Jacobian matrices. So the following bit of code does the // conversion from row-major Jacobians to column-major Jacobians. - Eigen::Map<Eigen::Matrix<double, NUM_RESIDUALS, NUM_PARAMETERS> > + Eigen::Map<Eigen::Matrix<double, NUM_RESIDUALS, NUM_PARAMETERS>> col_major_jacobian(jacobian, NumResiduals(), NumParameters()); col_major_jacobian = row_major_jacobian_; return true;
diff --git a/internal/ceres/block_random_access_sparse_matrix.cc b/internal/ceres/block_random_access_sparse_matrix.cc index a822d69..9c16454 100644 --- a/internal/ceres/block_random_access_sparse_matrix.cc +++ b/internal/ceres/block_random_access_sparse_matrix.cc
@@ -51,7 +51,7 @@ BlockRandomAccessSparseMatrix::BlockRandomAccessSparseMatrix( const vector<int>& blocks, - const set<pair<int, int> >& block_pairs) + const set<pair<int, int>>& block_pairs) : kMaxRowBlocks(10 * 1000 * 1000), blocks_(blocks) { CHECK_LT(blocks.size(), kMaxRowBlocks);
diff --git a/internal/ceres/block_random_access_sparse_matrix.h b/internal/ceres/block_random_access_sparse_matrix.h index fb24900..5520d49 100644 --- a/internal/ceres/block_random_access_sparse_matrix.h +++ b/internal/ceres/block_random_access_sparse_matrix.h
@@ -59,7 +59,7 @@ // of this matrix. BlockRandomAccessSparseMatrix( const std::vector<int>& blocks, - const std::set<std::pair<int, int> >& block_pairs); + const std::set<std::pair<int, int>>& block_pairs); // The destructor is not thread safe. It assumes that no one is // modifying any cells when the matrix is being destroyed. @@ -115,7 +115,7 @@ // In order traversal of contents of the matrix. This allows us to // implement a matrix-vector which is 20% faster than using the // iterator in the Layout object instead. - std::vector<std::pair<std::pair<int, int>, double*> > cell_values_; + std::vector<std::pair<std::pair<int, int>, double*>> cell_values_; // The underlying matrix object which actually stores the cells. std::unique_ptr<TripletSparseMatrix> tsm_;
diff --git a/internal/ceres/block_random_access_sparse_matrix_test.cc b/internal/ceres/block_random_access_sparse_matrix_test.cc index c5816d5..bae33b9 100644 --- a/internal/ceres/block_random_access_sparse_matrix_test.cc +++ b/internal/ceres/block_random_access_sparse_matrix_test.cc
@@ -52,7 +52,7 @@ blocks.push_back(5); const int num_rows = 3 + 4 + 5; - set< pair<int, int> > block_pairs; + set<pair<int, int>> block_pairs; int num_nonzeros = 0; block_pairs.insert(make_pair(0, 0)); num_nonzeros += blocks[0] * blocks[0]; @@ -142,7 +142,7 @@ virtual void SetUp() { vector<int> blocks; blocks.push_back(1); - set< pair<int, int> > block_pairs; + set<pair<int, int>> block_pairs; block_pairs.insert(make_pair(0, 0)); m_.reset(new BlockRandomAccessSparseMatrix(blocks, block_pairs)); }
diff --git a/internal/ceres/compressed_col_sparse_matrix_utils_test.cc b/internal/ceres/compressed_col_sparse_matrix_utils_test.cc index 47a98c2..2162b9f 100644 --- a/internal/ceres/compressed_col_sparse_matrix_utils_test.cc +++ b/internal/ceres/compressed_col_sparse_matrix_utils_test.cc
@@ -91,7 +91,7 @@ const vector<int>& col_blocks, const int row_block_id, const int col_block_id, - vector<Eigen::Triplet<double> >* triplets) { + vector<Eigen::Triplet<double>>* triplets) { const int row_offset = std::accumulate(&row_blocks[0], &row_blocks[row_block_id], 0); const int col_offset = std::accumulate(&col_blocks[0], &col_blocks[col_block_id], 0); for (int r = 0; r < row_blocks[row_block_id]; ++r) { @@ -125,7 +125,7 @@ const int num_rows = std::accumulate(row_blocks.begin(), row_blocks.end(), 0.0); const int num_cols = std::accumulate(col_blocks.begin(), col_blocks.end(), 0.0); - vector<Eigen::Triplet<double> > triplets; + vector<Eigen::Triplet<double>> triplets; FillBlock(row_blocks, col_blocks, 0, 0, &triplets); FillBlock(row_blocks, col_blocks, 2, 0, &triplets); FillBlock(row_blocks, col_blocks, 1, 1, &triplets);
diff --git a/internal/ceres/compressed_row_jacobian_writer.cc b/internal/ceres/compressed_row_jacobian_writer.cc index 0444d45..1fc0116 100644 --- a/internal/ceres/compressed_row_jacobian_writer.cc +++ b/internal/ceres/compressed_row_jacobian_writer.cc
@@ -71,7 +71,7 @@ void CompressedRowJacobianWriter::GetOrderedParameterBlocks( const Program* program, int residual_id, - vector<pair<int, int> >* evaluated_jacobian_blocks) { + vector<pair<int, int>>* evaluated_jacobian_blocks) { const ResidualBlock* residual_block = program->residual_blocks()[residual_id]; const int num_parameter_blocks = residual_block->NumParameterBlocks(); @@ -208,7 +208,7 @@ program_->residual_blocks()[residual_id]; const int num_residuals = residual_block->NumResiduals(); - vector<pair<int, int> > evaluated_jacobian_blocks; + vector<pair<int, int>> evaluated_jacobian_blocks; GetOrderedParameterBlocks(program_, residual_id, &evaluated_jacobian_blocks); // Where in the current row does the jacobian for a parameter block begin.
diff --git a/internal/ceres/compressed_row_jacobian_writer.h b/internal/ceres/compressed_row_jacobian_writer.h index 1cd0123..9fb414e 100644 --- a/internal/ceres/compressed_row_jacobian_writer.h +++ b/internal/ceres/compressed_row_jacobian_writer.h
@@ -83,7 +83,7 @@ static void GetOrderedParameterBlocks( const Program* program, int residual_id, - std::vector<std::pair<int, int> >* evaluated_jacobian_blocks); + std::vector<std::pair<int, int>>* evaluated_jacobian_blocks); // JacobianWriter interface.
diff --git a/internal/ceres/coordinate_descent_minimizer.cc b/internal/ceres/coordinate_descent_minimizer.cc index 48fd04c..087f01f 100644 --- a/internal/ceres/coordinate_descent_minimizer.cc +++ b/internal/ceres/coordinate_descent_minimizer.cc
@@ -81,7 +81,7 @@ // Serialize the OrderedGroups into a vector of parameter block // offsets for parallel access. map<ParameterBlock*, int> parameter_block_index; - map<int, set<double*> > group_to_elements = ordering.group_to_elements(); + map<int, set<double*>> group_to_elements = ordering.group_to_elements(); for (const auto& g_t_e : group_to_elements) { const auto& elements = g_t_e.second; for (double* parameter_block: elements) { @@ -261,7 +261,7 @@ const Program& program, const ParameterBlockOrdering& ordering, string* message) { - const map<int, set<double*> >& group_to_elements = + const map<int, set<double*>>& group_to_elements = ordering.group_to_elements(); // Verify that each group is an independent set
diff --git a/internal/ceres/coordinate_descent_minimizer.h b/internal/ceres/coordinate_descent_minimizer.h index 0ee193f..3bbcc2d 100644 --- a/internal/ceres/coordinate_descent_minimizer.h +++ b/internal/ceres/coordinate_descent_minimizer.h
@@ -90,7 +90,7 @@ Solver::Summary* summary); std::vector<ParameterBlock*> parameter_blocks_; - std::vector<std::vector<ResidualBlock*> > residual_blocks_; + std::vector<std::vector<ResidualBlock*>> residual_blocks_; // The optimization is performed in rounds. In each round all the // parameter blocks that form one independent set are optimized in // parallel. This array, marks the boundaries of the independent
diff --git a/internal/ceres/covariance.cc b/internal/ceres/covariance.cc index cb280a3..068cd9c 100644 --- a/internal/ceres/covariance.cc +++ b/internal/ceres/covariance.cc
@@ -50,7 +50,7 @@ } bool Covariance::Compute( - const vector<pair<const double*, const double*> >& covariance_blocks, + const vector<pair<const double*, const double*>>& covariance_blocks, Problem* problem) { return impl_->Compute(covariance_blocks, problem->problem_impl_.get()); }
diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc index 70719b0..2552416 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc
@@ -73,7 +73,7 @@ using std::swap; using std::vector; -typedef vector<pair<const double*, const double*> > CovarianceBlocks; +typedef vector<pair<const double*, const double*>> CovarianceBlocks; CovarianceImpl::CovarianceImpl(const Covariance::Options& options) : options_(options), @@ -102,7 +102,7 @@ std::adjacent_find(blocks.begin(), blocks.end()); if (it != blocks.end()) { // In case there are duplicates, we search for their location. - map<T, vector<int> > blocks_map; + map<T, vector<int>> blocks_map; for (int i = 0; i < blocks.size(); ++i) { blocks_map[blocks[i]].push_back(i); } @@ -127,7 +127,7 @@ bool CovarianceImpl::Compute(const CovarianceBlocks& covariance_blocks, ProblemImpl* problem) { - CheckForDuplicates<pair<const double*, const double*> >(covariance_blocks); + CheckForDuplicates<pair<const double*, const double*>>(covariance_blocks); problem_ = problem; parameter_block_to_row_index_.clear(); covariance_matrix_.reset(NULL); @@ -881,7 +881,7 @@ jacobian.rows.data(), jacobian.cols.data(), jacobian.values.data()); event_logger.AddEvent("ConvertToSparseMatrix"); - Eigen::SparseQR<EigenSparseMatrix, Eigen::COLAMDOrdering<int> > + Eigen::SparseQR<EigenSparseMatrix, Eigen::COLAMDOrdering<int>> qr_solver(sparse_jacobian); event_logger.AddEvent("QRDecomposition");
diff --git a/internal/ceres/covariance_impl.h b/internal/ceres/covariance_impl.h index c3a9bc1..065e43c 100644 --- a/internal/ceres/covariance_impl.h +++ b/internal/ceres/covariance_impl.h
@@ -52,7 +52,7 @@ bool Compute( const std::vector<std::pair<const double*, - const double*> >& covariance_blocks, + const double*>>& covariance_blocks, ProblemImpl* problem); bool Compute( @@ -72,7 +72,7 @@ bool ComputeCovarianceSparsity( const std::vector<std::pair<const double*, - const double*> >& covariance_blocks, + const double*>>& covariance_blocks, ProblemImpl* problem); bool ComputeCovarianceValues();
diff --git a/internal/ceres/covariance_test.cc b/internal/ceres/covariance_test.cc index afa9bb6..9c55136 100644 --- a/internal/ceres/covariance_test.cc +++ b/internal/ceres/covariance_test.cc
@@ -204,7 +204,7 @@ 6, 7, 8, 9}; - vector<pair<const double*, const double*> > covariance_blocks; + vector<pair<const double*, const double*>> covariance_blocks; covariance_blocks.push_back(make_pair(block1, block1)); covariance_blocks.push_back(make_pair(block4, block4)); covariance_blocks.push_back(make_pair(block2, block2)); @@ -287,7 +287,7 @@ 3, 4, 5, 6, 3, 4, 5, 6}; - vector<pair<const double*, const double*> > covariance_blocks; + vector<pair<const double*, const double*>> covariance_blocks; covariance_blocks.push_back(make_pair(block1, block1)); covariance_blocks.push_back(make_pair(block4, block4)); covariance_blocks.push_back(make_pair(block2, block2)); @@ -368,7 +368,7 @@ 3, 4, 5, 6, 3, 4, 5, 6}; - vector<pair<const double*, const double*> > covariance_blocks; + vector<pair<const double*, const double*>> covariance_blocks; covariance_blocks.push_back(make_pair(block1, block1)); covariance_blocks.push_back(make_pair(block4, block4)); covariance_blocks.push_back(make_pair(block2, block2)); @@ -406,7 +406,7 @@ class CovarianceTest : public ::testing::Test { protected: - typedef map<const double*, pair<int, int> > BoundsMap; + typedef map<const double*, pair<int, int>> BoundsMap; virtual void SetUp() { double* x = parameters_; @@ -495,7 +495,7 @@ // Generate all possible combination of block pairs and check if the // covariance computation is correct. for (int i = 0; i <= 64; ++i) { - vector<pair<const double*, const double*> > covariance_blocks; + vector<pair<const double*, const double*>> covariance_blocks; if (i & 1) { covariance_blocks.push_back(all_covariance_blocks_[0]); } @@ -590,7 +590,7 @@ double parameters_[6]; Problem problem_; - vector<pair<const double*, const double*> > all_covariance_blocks_; + vector<pair<const double*, const double*>> all_covariance_blocks_; BoundsMap column_bounds_; BoundsMap local_column_bounds_; }; @@ -1089,7 +1089,7 @@ EXPECT_DEATH_IF_SUPPORTED(covariance.Compute(parameter_blocks, &problem_), "Covariance::Compute called with duplicate blocks " "at indices \\(0, 1\\) and \\(2, 3\\)"); - vector<pair<const double*, const double*> > covariance_blocks; + vector<pair<const double*, const double*>> covariance_blocks; covariance_blocks.push_back(make_pair(x, x)); covariance_blocks.push_back(make_pair(x, x)); covariance_blocks.push_back(make_pair(y, y)); @@ -1263,7 +1263,7 @@ int num_parameter_blocks_; Problem problem_; - vector<pair<const double*, const double*> > all_covariance_blocks_; + vector<pair<const double*, const double*>> all_covariance_blocks_; }; #if !defined(CERES_NO_SUITESPARSE) && defined(CERES_USE_OPENMP)
diff --git a/internal/ceres/cubic_interpolation_test.cc b/internal/ceres/cubic_interpolation_test.cc index fd56016..d68af22 100644 --- a/internal/ceres/cubic_interpolation_test.cc +++ b/internal/ceres/cubic_interpolation_test.cc
@@ -220,7 +220,7 @@ } Grid1D<double, kDataDimension> grid(values_.get(), 0, kNumSamples); - CubicInterpolator<Grid1D<double, kDataDimension> > interpolator(grid); + CubicInterpolator<Grid1D<double, kDataDimension>> interpolator(grid); // Check values in the all the cells but the first and the last // ones. In these cells, the interpolated function values should @@ -283,7 +283,7 @@ const double values[] = {1.0, 2.0, 2.0, 5.0, 3.0, 9.0, 2.0, 7.0}; Grid1D<double, 2, true> grid(values, 0, 4); - CubicInterpolator<Grid1D<double, 2, true> > interpolator(grid); + CubicInterpolator<Grid1D<double, 2, true>> interpolator(grid); double f[2], dfdx[2]; const double x = 2.5; @@ -327,7 +327,7 @@ } Grid2D<double, kDataDimension> grid(values_.get(), 0, kNumRows, 0, kNumCols); - BiCubicInterpolator<Grid2D<double, kDataDimension> > interpolator(grid); + BiCubicInterpolator<Grid2D<double, kDataDimension>> interpolator(grid); for (int j = 0; j < kNumRowSamples; ++j) { const double r = 1.0 + 7.0 / (kNumRowSamples - 1) * j; @@ -471,7 +471,7 @@ 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 1.0}; Grid2D<double, 2> grid(values, 0, 2, 0, 4); - BiCubicInterpolator<Grid2D<double, 2> > interpolator(grid); + BiCubicInterpolator<Grid2D<double, 2>> interpolator(grid); double f[2], dfdr[2], dfdc[2]; const double r = 0.5;
diff --git a/internal/ceres/dynamic_autodiff_cost_function_test.cc b/internal/ceres/dynamic_autodiff_cost_function_test.cc index 626cdee..29f8d10 100644 --- a/internal/ceres/dynamic_autodiff_cost_function_test.cc +++ b/internal/ceres/dynamic_autodiff_cost_function_test.cc
@@ -119,7 +119,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -186,7 +186,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -236,7 +236,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -420,7 +420,7 @@ std::unique_ptr<CostFunction> cost_function_; - vector<vector<double> > jacobian_vect_; + vector<vector<double>> jacobian_vect_; vector<double> expected_residuals_; @@ -667,10 +667,10 @@ std::unique_ptr<CostFunction> cost_function_; - vector<vector<double> > jacobian_vect_; + vector<vector<double>> jacobian_vect_; vector<double> expected_residuals_; - vector<vector<double> > expected_jacobians_; + vector<vector<double>> expected_jacobians_; }; TEST_F(SixParameterCostFunctorTest, TestSixParameterResiduals) {
diff --git a/internal/ceres/dynamic_compressed_row_jacobian_writer.cc b/internal/ceres/dynamic_compressed_row_jacobian_writer.cc index 4f89145..acc372a 100644 --- a/internal/ceres/dynamic_compressed_row_jacobian_writer.cc +++ b/internal/ceres/dynamic_compressed_row_jacobian_writer.cc
@@ -67,7 +67,7 @@ program_->residual_blocks()[residual_id]; const int num_residuals = residual_block->NumResiduals(); - vector<pair<int, int> > evaluated_jacobian_blocks; + vector<pair<int, int>> evaluated_jacobian_blocks; CompressedRowJacobianWriter::GetOrderedParameterBlocks( program_, residual_id, &evaluated_jacobian_blocks);
diff --git a/internal/ceres/dynamic_compressed_row_sparse_matrix.h b/internal/ceres/dynamic_compressed_row_sparse_matrix.h index cab860b..ad41da7 100644 --- a/internal/ceres/dynamic_compressed_row_sparse_matrix.h +++ b/internal/ceres/dynamic_compressed_row_sparse_matrix.h
@@ -91,8 +91,8 @@ void Finalize(int num_additional_elements); private: - std::vector<std::vector<int> > dynamic_cols_; - std::vector<std::vector<double> > dynamic_values_; + std::vector<std::vector<int>> dynamic_cols_; + std::vector<std::vector<double>> dynamic_values_; }; } // namespace internal
diff --git a/internal/ceres/dynamic_numeric_diff_cost_function_test.cc b/internal/ceres/dynamic_numeric_diff_cost_function_test.cc index e4db3c1..b627eb7 100644 --- a/internal/ceres/dynamic_numeric_diff_cost_function_test.cc +++ b/internal/ceres/dynamic_numeric_diff_cost_function_test.cc
@@ -120,7 +120,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -187,7 +187,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -237,7 +237,7 @@ parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector<vector<double> > jacobian_vect(2); + vector<vector<double>> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector<double*> jacobian; @@ -421,7 +421,7 @@ std::unique_ptr<CostFunction> cost_function_; - vector<vector<double> > jacobian_vect_; + vector<vector<double>> jacobian_vect_; vector<double> expected_residuals_;
diff --git a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc index 451cfde..a46c85e 100644 --- a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc +++ b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
@@ -129,7 +129,7 @@ A->mutable_values()); Eigen::SparseMatrix<double> lhs = a.transpose() * a; - Eigen::SimplicialLDLT<Eigen::SparseMatrix<double> > solver; + Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>> solver; LinearSolver::Summary summary; summary.num_iterations = 1;
diff --git a/internal/ceres/eigensparse.cc b/internal/ceres/eigensparse.cc index aa6b6a9..4945036 100644 --- a/internal/ceres/eigensparse.cc +++ b/internal/ceres/eigensparse.cc
@@ -117,11 +117,11 @@ #if EIGEN_VERSION_AT_LEAST(3, 2, 2) typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>, Eigen::Upper, - Eigen::AMDOrdering<int> > + Eigen::AMDOrdering<int>> WithAMDOrdering; typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>, Eigen::Upper, - Eigen::NaturalOrdering<int> > + Eigen::NaturalOrdering<int>> WithNaturalOrdering; if (ordering_type == AMD) { return new EigenSparseCholeskyTemplate<WithAMDOrdering>();
diff --git a/internal/ceres/gradient_checker_test.cc b/internal/ceres/gradient_checker_test.cc index 85d58b9..92d7b26 100644 --- a/internal/ceres/gradient_checker_test.cc +++ b/internal/ceres/gradient_checker_test.cc
@@ -112,7 +112,7 @@ private: int arity_; bool return_value_; - vector<vector<double> > a_; // our vectors. + vector<vector<double>> a_; // our vectors. }; class BadTestTerm : public CostFunction { @@ -165,7 +165,7 @@ private: int arity_; - vector<vector<double> > a_; // our vectors. + vector<vector<double>> a_; // our vectors. }; const double kTolerance = 1e-6;
diff --git a/internal/ceres/gradient_checking_cost_function_test.cc b/internal/ceres/gradient_checking_cost_function_test.cc index 7cf1e45..6ae77f6 100644 --- a/internal/ceres/gradient_checking_cost_function_test.cc +++ b/internal/ceres/gradient_checking_cost_function_test.cc
@@ -126,7 +126,7 @@ private: int arity_; - vector<vector<double> > a_; + vector<vector<double>> a_; }; TEST(GradientCheckingCostFunction, ResidualsAndJacobiansArePreservedTest) {
diff --git a/internal/ceres/graph.h b/internal/ceres/graph.h index 25bb141..079d31d 100644 --- a/internal/ceres/graph.h +++ b/internal/ceres/graph.h
@@ -100,7 +100,7 @@ private: std::unordered_set<Vertex> vertices_; - std::unordered_map<Vertex, std::unordered_set<Vertex> > edges_; + std::unordered_map<Vertex, std::unordered_set<Vertex>> edges_; }; // A weighted undirected graph templated over the vertex ids. Vertex
diff --git a/internal/ceres/graph_algorithms.h b/internal/ceres/graph_algorithms.h index 08837cf..8768465 100644 --- a/internal/ceres/graph_algorithms.h +++ b/internal/ceres/graph_algorithms.h
@@ -260,7 +260,7 @@ WeightedGraph<Vertex>* Degree2MaximumSpanningForest(const WeightedGraph<Vertex>& graph) { // Array of edges sorted in decreasing order of their weights. - std::vector<std::pair<double, std::pair<Vertex, Vertex> > > weighted_edges; + std::vector<std::pair<double, std::pair<Vertex, Vertex>>> weighted_edges; WeightedGraph<Vertex>* forest = new WeightedGraph<Vertex>(); // Disjoint-set to keep track of the connected components in the
diff --git a/internal/ceres/graph_algorithms_test.cc b/internal/ceres/graph_algorithms_test.cc index 6440544..2aef327 100644 --- a/internal/ceres/graph_algorithms_test.cc +++ b/internal/ceres/graph_algorithms_test.cc
@@ -111,7 +111,8 @@ graph.AddEdge(0, 1, 0.5); graph.AddEdge(1, 0, 0.5); - std::unique_ptr<WeightedGraph<int> > forest(Degree2MaximumSpanningForest(graph)); + std::unique_ptr<WeightedGraph<int> > forest( + Degree2MaximumSpanningForest(graph)); const std::unordered_set<int>& vertices = forest->vertices(); EXPECT_EQ(vertices.size(), 2);
diff --git a/internal/ceres/inner_product_computer_test.cc b/internal/ceres/inner_product_computer_test.cc index 8b2ff91..31cd829 100644 --- a/internal/ceres/inner_product_computer_test.cc +++ b/internal/ceres/inner_product_computer_test.cc
@@ -115,7 +115,7 @@ random_matrix->num_cols(), random_matrix->num_nonzeros()); random_matrix->ToTripletSparseMatrix(&tsm); - std::vector<Eigen::Triplet<double> > triplets; + std::vector<Eigen::Triplet<double>> triplets; for (int i = 0; i < tsm.num_nonzeros(); ++i) { triplets.push_back(Eigen::Triplet<double>( tsm.rows()[i], tsm.cols()[i], tsm.values()[i])); @@ -187,7 +187,7 @@ random_matrix->num_cols(), random_matrix->num_nonzeros()); random_matrix->ToTripletSparseMatrix(&tsm); - std::vector<Eigen::Triplet<double> > triplets; + std::vector<Eigen::Triplet<double>> triplets; for (int i = 0; i < tsm.num_nonzeros(); ++i) { if (tsm.rows()[i] >= start_row && tsm.rows()[i] < end_row) { triplets.push_back(Eigen::Triplet<double>(
diff --git a/internal/ceres/local_parameterization_test.cc b/internal/ceres/local_parameterization_test.cc index 41c78cb..2465b41 100644 --- a/internal/ceres/local_parameterization_test.cc +++ b/internal/ceres/local_parameterization_test.cc
@@ -378,8 +378,8 @@ q_delta.coeffs() << delta[0], delta[1], delta[2], T(1.0); } - Eigen::Map<Eigen::Quaternion<T> > x_plus_delta_ref(x_plus_delta); - Eigen::Map<const Eigen::Quaternion<T> > x_ref(x); + Eigen::Map<Eigen::Quaternion<T>> x_plus_delta_ref(x_plus_delta); + Eigen::Map<const Eigen::Quaternion<T>> x_ref(x); x_plus_delta_ref = q_delta * x_ref; return true; } @@ -440,9 +440,9 @@ template<typename Scalar> bool operator()(const Scalar* p_x, const Scalar* p_delta, Scalar* p_x_plus_delta) const { - Eigen::Map<const Eigen::Matrix<Scalar, 4, 1> > x(p_x); - Eigen::Map<const Eigen::Matrix<Scalar, 3, 1> > delta(p_delta); - Eigen::Map<Eigen::Matrix<Scalar, 4, 1> > x_plus_delta(p_x_plus_delta); + Eigen::Map<const Eigen::Matrix<Scalar, 4, 1>> x(p_x); + Eigen::Map<const Eigen::Matrix<Scalar, 3, 1>> delta(p_delta); + Eigen::Map<Eigen::Matrix<Scalar, 4, 1>> x_plus_delta(p_x_plus_delta); const Scalar squared_norm_delta = delta[0] * delta[0] + delta[1] * delta[1] + delta[2] * delta[2];
diff --git a/internal/ceres/parallel_utils_test.cc b/internal/ceres/parallel_utils_test.cc index 8638f90..f997d25 100644 --- a/internal/ceres/parallel_utils_test.cc +++ b/internal/ceres/parallel_utils_test.cc
@@ -42,7 +42,7 @@ // indices that are in-range and unique. TEST(LinearIndexToUpperTriangularIndexTest, UniqueAndValid) { for (int n = 0; n < 100; n++) { - std::set<std::pair<int, int> > seen_pairs; + std::set<std::pair<int, int>> seen_pairs; int actual_work_items = (n * (n + 1)) / 2; for (int k = 0; k < actual_work_items; k++) { int i, j;
diff --git a/internal/ceres/parameter_block_ordering.cc b/internal/ceres/parameter_block_ordering.cc index a71c019..ffae223 100644 --- a/internal/ceres/parameter_block_ordering.cc +++ b/internal/ceres/parameter_block_ordering.cc
@@ -162,7 +162,7 @@ return; } - const map<int, set<double*> >& group_to_elements = + const map<int, set<double*>>& group_to_elements = ordering->group_to_elements(); for (const auto& g_t_e : group_to_elements) { group_sizes->push_back(g_t_e.second.size());
diff --git a/internal/ceres/reorder_program.cc b/internal/ceres/reorder_program.cc index f3480a3..86c1368 100644 --- a/internal/ceres/reorder_program.cc +++ b/internal/ceres/reorder_program.cc
@@ -234,7 +234,7 @@ program->mutable_parameter_blocks(); parameter_blocks->clear(); - const map<int, set<double*> >& groups = ordering.group_to_elements(); + const map<int, set<double*>>& groups = ordering.group_to_elements(); for (const auto& p : groups) { const set<double*>& group = p.second; for (double* parameter_block_ptr : group) {
diff --git a/internal/ceres/schur_complement_solver.cc b/internal/ceres/schur_complement_solver.cc index 0fb9c30..7934e36 100644 --- a/internal/ceres/schur_complement_solver.cc +++ b/internal/ceres/schur_complement_solver.cc
@@ -249,7 +249,7 @@ blocks_[i - num_eliminate_blocks] = bs->cols[i].size; } - set<pair<int, int> > block_pairs; + set<pair<int, int>> block_pairs; for (int i = 0; i < blocks_.size(); ++i) { block_pairs.insert(make_pair(i, i)); }
diff --git a/internal/ceres/split.cc b/internal/ceres/split.cc index 296c09a..3a09e86 100644 --- a/internal/ceres/split.cc +++ b/internal/ceres/split.cc
@@ -115,7 +115,7 @@ const char* delim, vector<string>* result) { result->reserve(result->size() + CalculateReserveForVector(full, delim)); - std::back_insert_iterator<vector<string> > it(*result); + std::back_insert_iterator<vector<string>> it(*result); SplitStringToIteratorUsing(full, delim, it); }
diff --git a/internal/ceres/visibility.cc b/internal/ceres/visibility.cc index a446b6b..aa195b9 100644 --- a/internal/ceres/visibility.cc +++ b/internal/ceres/visibility.cc
@@ -53,7 +53,7 @@ void ComputeVisibility(const CompressedRowBlockStructure& block_structure, const int num_eliminate_blocks, - vector< set<int> >* visibility) { + vector<set<int>>* visibility) { CHECK_NOTNULL(visibility); // Clear the visibility vector and resize it to hold a @@ -79,7 +79,7 @@ } WeightedGraph<int>* CreateSchurComplementGraph( - const vector<set<int> >& visibility) { + const vector<set<int>>& visibility) { const time_t start_time = time(NULL); // Compute the number of e_blocks/point blocks. Since the visibility // set for each e_block/camera contains the set of e_blocks/points @@ -96,7 +96,7 @@ // cameras. However, to compute the sparsity structure of the Schur // Complement efficiently, its better to have the point->camera // mapping. - vector<set<int> > inverse_visibility(num_points); + vector<set<int>> inverse_visibility(num_points); for (int i = 0; i < visibility.size(); i++) { const set<int>& visibility_set = visibility[i]; for (const int v : visibility_set) {
diff --git a/internal/ceres/visibility.h b/internal/ceres/visibility.h index 605682f..e443766 100644 --- a/internal/ceres/visibility.h +++ b/internal/ceres/visibility.h
@@ -54,7 +54,7 @@ // points and f_blocks correspond to cameras. void ComputeVisibility(const CompressedRowBlockStructure& block_structure, int num_eliminate_blocks, - std::vector<std::set<int> >* visibility); + std::vector<std::set<int>>* visibility); // Given f_block visibility as computed by the ComputeVisibility // function above, construct and return a graph whose vertices are @@ -70,7 +70,7 @@ // Caller acquires ownership of the returned WeightedGraph pointer // (heap-allocated). WeightedGraph<int>* CreateSchurComplementGraph( - const std::vector<std::set<int> >& visibility); + const std::vector<std::set<int>>& visibility); } // namespace internal } // namespace ceres
diff --git a/internal/ceres/visibility_based_preconditioner.cc b/internal/ceres/visibility_based_preconditioner.cc index b13c529..36247b7 100644 --- a/internal/ceres/visibility_based_preconditioner.cc +++ b/internal/ceres/visibility_based_preconditioner.cc
@@ -123,7 +123,7 @@ // preconditioner matrix. void VisibilityBasedPreconditioner::ComputeClusterJacobiSparsity( const CompressedRowBlockStructure& bs) { - vector<set<int> > visibility; + vector<set<int>> visibility; ComputeVisibility(bs, options_.elimination_groups[0], &visibility); CHECK_EQ(num_blocks_, visibility.size()); ClusterCameras(visibility); @@ -141,7 +141,7 @@ // forest. The set of edges in this forest are the cluster pairs. void VisibilityBasedPreconditioner::ComputeClusterTridiagonalSparsity( const CompressedRowBlockStructure& bs) { - vector<set<int> > visibility; + vector<set<int>> visibility; ComputeVisibility(bs, options_.elimination_groups[0], &visibility); CHECK_EQ(num_blocks_, visibility.size()); ClusterCameras(visibility); @@ -150,7 +150,7 @@ // edges are the number of 3D points/e_blocks visible in both the // clusters at the ends of the edge. Return an approximate degree-2 // maximum spanning forest of this graph. - vector<set<int> > cluster_visibility; + vector<set<int>> cluster_visibility; ComputeClusterVisibility(visibility, &cluster_visibility); std::unique_ptr<WeightedGraph<int> > cluster_graph( CHECK_NOTNULL(CreateClusterGraph(cluster_visibility))); @@ -484,8 +484,8 @@ // of all its cameras. In other words, the set of points visible to // any camera in the cluster. void VisibilityBasedPreconditioner::ComputeClusterVisibility( - const vector<set<int> >& visibility, - vector<set<int> >* cluster_visibility) const { + const vector<set<int>>& visibility, + vector<set<int>>* cluster_visibility) const { CHECK_NOTNULL(cluster_visibility)->resize(0); cluster_visibility->resize(num_clusters_); for (int i = 0; i < num_blocks_; ++i) { @@ -499,7 +499,7 @@ // weights are the number of 3D points visible to cameras in both the // vertices. WeightedGraph<int>* VisibilityBasedPreconditioner::CreateClusterGraph( - const vector<set<int> >& cluster_visibility) const { + const vector<set<int>>& cluster_visibility) const { WeightedGraph<int>* cluster_graph = new WeightedGraph<int>; for (int i = 0; i < num_clusters_; ++i) {
diff --git a/internal/ceres/visibility_based_preconditioner.h b/internal/ceres/visibility_based_preconditioner.h index b47bb68..a03a582 100644 --- a/internal/ceres/visibility_based_preconditioner.h +++ b/internal/ceres/visibility_based_preconditioner.h
@@ -152,14 +152,14 @@ LinearSolverTerminationType Factorize(); void ScaleOffDiagonalCells(); - void ClusterCameras(const std::vector<std::set<int> >& visibility); + void ClusterCameras(const std::vector<std::set<int>>& visibility); void FlattenMembershipMap(const std::unordered_map<int, int>& membership_map, std::vector<int>* membership_vector) const; void ComputeClusterVisibility( - const std::vector<std::set<int> >& visibility, - std::vector<std::set<int> >* cluster_visibility) const; + const std::vector<std::set<int>>& visibility, + std::vector<std::set<int>>* cluster_visibility) const; WeightedGraph<int>* CreateClusterGraph( - const std::vector<std::set<int> >& visibility) const; + const std::vector<std::set<int>>& visibility) const; void ForestToClusterPairs(const WeightedGraph<int>& forest, std::unordered_set<std::pair<int, int>, pair_hash>* cluster_pairs) const; void ComputeBlockPairsInPreconditioner(const CompressedRowBlockStructure& bs); @@ -181,7 +181,7 @@ // Non-zero camera pairs from the schur complement matrix that are // present in the preconditioner, sorted by row (first element of // each pair), then column (second). - std::set<std::pair<int, int> > block_pairs_; + std::set<std::pair<int, int>> block_pairs_; // Set of cluster pairs (including self pairs (i,i)) in the // preconditioner.
diff --git a/internal/ceres/visibility_based_preconditioner_test.cc b/internal/ceres/visibility_based_preconditioner_test.cc index 437b5d4..a006d98 100644 --- a/internal/ceres/visibility_based_preconditioner_test.cc +++ b/internal/ceres/visibility_based_preconditioner_test.cc
@@ -196,11 +196,11 @@ // return &preconditioner_->cluster_membership_; // } -// const set<pair<int, int> >& get_block_pairs() { +// const set<pair<int, int>>& get_block_pairs() { // return preconditioner_->block_pairs_; // } -// set<pair<int, int> >* get_mutable_block_pairs() { +// set<pair<int, int>>* get_mutable_block_pairs() { // return &preconditioner_->block_pairs_; // }
diff --git a/internal/ceres/visibility_test.cc b/internal/ceres/visibility_test.cc index 81ad99f..5028e01 100644 --- a/internal/ceres/visibility_test.cc +++ b/internal/ceres/visibility_test.cc
@@ -100,7 +100,7 @@ } bs.cols.resize(num_cols); - vector< set<int> > visibility; + vector< set<int>> visibility; ComputeVisibility(bs, num_eliminate_blocks, &visibility); ASSERT_EQ(visibility.size(), num_cols - num_eliminate_blocks); for (int i = 0; i < visibility.size(); ++i) { @@ -176,14 +176,15 @@ } bs.cols.resize(num_cols); - vector<set<int> > visibility; + vector<set<int>> visibility; ComputeVisibility(bs, num_eliminate_blocks, &visibility); ASSERT_EQ(visibility.size(), num_cols - num_eliminate_blocks); for (int i = 0; i < visibility.size(); ++i) { ASSERT_EQ(visibility[i].size(), 0); } - std::unique_ptr<WeightedGraph<int> > graph(CreateSchurComplementGraph(visibility)); + std::unique_ptr<WeightedGraph<int> > graph( + CreateSchurComplementGraph(visibility)); EXPECT_EQ(graph->vertices().size(), visibility.size()); for (int i = 0; i < visibility.size(); ++i) { EXPECT_EQ(graph->VertexWeight(i), 1.0);