diff --git a/include/ceres/covariance.h b/include/ceres/covariance.h index 971175ce5..a8061b58d 100644 --- a/include/ceres/covariance.h +++ b/include/ceres/covariance.h @@ -183,7 +183,7 @@ class CovarianceImpl; // Covariance::Options options; // Covariance covariance(options); // -// std::vector > covariance_blocks; +// std::vector> 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 @@ class CERES_EXPORT Covariance { // function returns false. bool Compute( const std::vector >& 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 9804a332d..88a3ebf5a 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h @@ -117,7 +117,7 @@ void CubicHermiteSpline(const Eigen::Matrix& p0, // // const double data[] = {1.0, 2.0, 5.0, 6.0}; // Grid1D grid(x, 0, 4); -// CubicInterpolator > interpolator(grid); +// CubicInterpolator> interpolator(grid); // double f, dfdx; // interpolator.Evaluator(1.5, &f, &dfdx); template @@ -248,7 +248,7 @@ struct Grid1D { // 3.6, 2.1, 4.2, 2.0, // 2.0, 1.0, 3.1, 5.2}; // Grid2D grid(data, 3, 4); -// BiCubicInterpolator > interpolator(grid); +// BiCubicInterpolator> 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 f1eb0d3d6..2d66f3f5d 100644 --- a/include/ceres/dynamic_autodiff_cost_function.h +++ b/include/ceres/dynamic_autodiff_cost_function.h @@ -112,8 +112,8 @@ class DynamicAutoDiffCostFunction : public DynamicCostFunction { 0); // Allocate scratch space for the strided evaluation. - std::vector > input_jets(num_parameters); - std::vector > output_jets(num_residuals()); + std::vector> input_jets(num_parameters); + std::vector> output_jets(num_residuals()); // Make the parameter pack that is sent to the functor (reused). std::vector* > jet_parameters(num_parameter_blocks, diff --git a/include/ceres/internal/autodiff.h b/include/ceres/internal/autodiff.h index 21f3b9241..92542a474 100644 --- a/include/ceres/internal/autodiff.h +++ b/include/ceres/internal/autodiff.h @@ -193,7 +193,7 @@ inline void Take1stOrderPart(const int M, const JetT *src, T *dst) { DCHECK(src); DCHECK(dst); for (int i = 0; i < M; ++i) { - Eigen::Map >(dst + N * i, N) = + Eigen::Map>(dst + N * i, N) = src[i].v.template segment(N0); } } diff --git a/include/ceres/internal/eigen.h b/include/ceres/internal/eigen.h index 7853ea79f..59545dfd9 100644 --- a/include/ceres/internal/eigen.h +++ b/include/ceres/internal/eigen.h @@ -52,15 +52,15 @@ typedef Eigen::Matrix ColMajorMatrix; typedef Eigen::Map > ColMajorMatrixRef; + Eigen::Stride> ColMajorMatrixRef; typedef Eigen::Map > ConstColMajorMatrixRef; + Eigen::Stride> ConstColMajorMatrixRef; // C++ does not support templated typdefs, thus the need for this // struct so that we can support statically sized Matrix and Maps. -template + template struct EigenTypes { typedef Eigen::Matrix MatrixRef; typedef Eigen::Map ConstMatrixRef; typedef Eigen::Matrix Vector; - typedef Eigen::Map > VectorRef; - typedef Eigen::Map > ConstVectorRef; + typedef Eigen::Map> VectorRef; + typedef Eigen::Map> ConstVectorRef; }; } // namespace ceres diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 5b56d8603..d3edeac88 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -912,7 +912,7 @@ namespace Eigen { // Creating a specialization of NumTraits enables placing Jet objects inside // Eigen arrays, getting all the goodness of Eigen combined with autodiff. template -struct NumTraits > { +struct NumTraits> { typedef ceres::Jet Real; typedef ceres::Jet NonInteger; typedef ceres::Jet Nested; diff --git a/include/ceres/ordered_groups.h b/include/ceres/ordered_groups.h index aa1bd3a7d..3ff459e03 100644 --- a/include/ceres/ordered_groups.h +++ b/include/ceres/ordered_groups.h @@ -126,9 +126,9 @@ class OrderedGroups { return; } - typename std::map >::reverse_iterator it = + typename std::map>::reverse_iterator it = group_to_elements_.rbegin(); - std::map > new_group_to_elements; + std::map> new_group_to_elements; new_group_to_elements[it->first] = it->second; int new_group_id = it->first + 1; @@ -165,7 +165,7 @@ class OrderedGroups { // This function always succeeds, i.e., implicitly there exists a // group for every integer. int GroupSize(const int group) const { - typename std::map >::const_iterator it = + typename std::map>::const_iterator it = group_to_elements_.find(group); return (it == group_to_elements_.end()) ? 0 : it->second.size(); } @@ -187,7 +187,7 @@ class OrderedGroups { return group_to_elements_.begin()->first; } - const std::map >& group_to_elements() const { + const std::map>& group_to_elements() const { return group_to_elements_; } @@ -196,7 +196,7 @@ class OrderedGroups { } private: - std::map > group_to_elements_; + std::map> group_to_elements_; std::map element_to_group_; }; diff --git a/include/ceres/tiny_solver.h b/include/ceres/tiny_solver.h index c55375e6e..3cf1c3282 100644 --- a/include/ceres/tiny_solver.h +++ b/include/ceres/tiny_solver.h @@ -128,7 +128,7 @@ template > > + 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 6bdb2acef..c54a6e59a 100644 --- a/include/ceres/tiny_solver_autodiff_function.h +++ b/include/ceres/tiny_solver_autodiff_function.h @@ -115,7 +115,7 @@ class TinySolverAutoDiffFunction { // Copy the jacobian out of the derivative part of the residual jets. Eigen::Map > 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 e3217d077..d44bdeb8f 100644 --- a/include/ceres/tiny_solver_cost_function_adapter.h +++ b/include/ceres/tiny_solver_cost_function_adapter.h @@ -116,7 +116,7 @@ class TinySolverCostFunctionAdapter { // 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::Map> 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 a822d691a..9c1645466 100644 --- a/internal/ceres/block_random_access_sparse_matrix.cc +++ b/internal/ceres/block_random_access_sparse_matrix.cc @@ -51,7 +51,7 @@ using std::vector; BlockRandomAccessSparseMatrix::BlockRandomAccessSparseMatrix( const vector& blocks, - const set >& block_pairs) + const set>& 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 fb24900bc..5520d49eb 100644 --- a/internal/ceres/block_random_access_sparse_matrix.h +++ b/internal/ceres/block_random_access_sparse_matrix.h @@ -59,7 +59,7 @@ class BlockRandomAccessSparseMatrix : public BlockRandomAccessMatrix { // of this matrix. BlockRandomAccessSparseMatrix( const std::vector& blocks, - const std::set >& block_pairs); + const std::set>& 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 @@ class BlockRandomAccessSparseMatrix : public BlockRandomAccessMatrix { // 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, double*> > cell_values_; + std::vector, double*>> cell_values_; // The underlying matrix object which actually stores the cells. std::unique_ptr tsm_; diff --git a/internal/ceres/block_random_access_sparse_matrix_test.cc b/internal/ceres/block_random_access_sparse_matrix_test.cc index c5816d52a..bae33b991 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 @@ TEST(BlockRandomAccessSparseMatrix, GetCell) { blocks.push_back(5); const int num_rows = 3 + 4 + 5; - set< pair > block_pairs; + set> block_pairs; int num_nonzeros = 0; block_pairs.insert(make_pair(0, 0)); num_nonzeros += blocks[0] * blocks[0]; @@ -142,7 +142,7 @@ class BlockRandomAccessSparseMatrixTest : public ::testing::Test { virtual void SetUp() { vector blocks; blocks.push_back(1); - set< pair > block_pairs; + set> 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 47a98c274..2162b9f19 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 @@ void FillBlock(const vector& row_blocks, const vector& col_blocks, const int row_block_id, const int col_block_id, - vector >* triplets) { + vector>* 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 @@ TEST(_, ScalarMatrixToBlockMatrix) { 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 > triplets; + vector> 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 0444d45fe..1fc011681 100644 --- a/internal/ceres/compressed_row_jacobian_writer.cc +++ b/internal/ceres/compressed_row_jacobian_writer.cc @@ -71,7 +71,7 @@ void CompressedRowJacobianWriter::PopulateJacobianRowAndColumnBlockVectors( void CompressedRowJacobianWriter::GetOrderedParameterBlocks( const Program* program, int residual_id, - vector >* evaluated_jacobian_blocks) { + vector>* evaluated_jacobian_blocks) { const ResidualBlock* residual_block = program->residual_blocks()[residual_id]; const int num_parameter_blocks = residual_block->NumParameterBlocks(); @@ -208,7 +208,7 @@ void CompressedRowJacobianWriter::Write(int residual_id, program_->residual_blocks()[residual_id]; const int num_residuals = residual_block->NumResiduals(); - vector > evaluated_jacobian_blocks; + vector> 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 1cd01235c..9fb414e25 100644 --- a/internal/ceres/compressed_row_jacobian_writer.h +++ b/internal/ceres/compressed_row_jacobian_writer.h @@ -83,7 +83,7 @@ class CompressedRowJacobianWriter { static void GetOrderedParameterBlocks( const Program* program, int residual_id, - std::vector >* evaluated_jacobian_blocks); + std::vector>* evaluated_jacobian_blocks); // JacobianWriter interface. diff --git a/internal/ceres/coordinate_descent_minimizer.cc b/internal/ceres/coordinate_descent_minimizer.cc index 48fd04c34..087f01f77 100644 --- a/internal/ceres/coordinate_descent_minimizer.cc +++ b/internal/ceres/coordinate_descent_minimizer.cc @@ -81,7 +81,7 @@ bool CoordinateDescentMinimizer::Init( // Serialize the OrderedGroups into a vector of parameter block // offsets for parallel access. map parameter_block_index; - map > group_to_elements = ordering.group_to_elements(); + map> 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 @@ bool CoordinateDescentMinimizer::IsOrderingValid( const Program& program, const ParameterBlockOrdering& ordering, string* message) { - const map >& group_to_elements = + const map>& 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 0ee193f03..3bbcc2dd5 100644 --- a/internal/ceres/coordinate_descent_minimizer.h +++ b/internal/ceres/coordinate_descent_minimizer.h @@ -90,7 +90,7 @@ class CoordinateDescentMinimizer : public Minimizer { Solver::Summary* summary); std::vector parameter_blocks_; - std::vector > residual_blocks_; + std::vector> 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 cb280a368..068cd9c94 100644 --- a/internal/ceres/covariance.cc +++ b/internal/ceres/covariance.cc @@ -50,7 +50,7 @@ Covariance::~Covariance() { } bool Covariance::Compute( - const vector >& covariance_blocks, + const vector>& 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 70719b030..2552416f1 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc @@ -73,7 +73,7 @@ using std::sort; using std::swap; using std::vector; -typedef vector > CovarianceBlocks; +typedef vector> CovarianceBlocks; CovarianceImpl::CovarianceImpl(const Covariance::Options& options) : options_(options), @@ -102,7 +102,7 @@ template void CheckForDuplicates(vector blocks) { std::adjacent_find(blocks.begin(), blocks.end()); if (it != blocks.end()) { // In case there are duplicates, we search for their location. - map > blocks_map; + map> blocks_map; for (int i = 0; i < blocks.size(); ++i) { blocks_map[blocks[i]].push_back(i); } @@ -127,7 +127,7 @@ template void CheckForDuplicates(vector blocks) { bool CovarianceImpl::Compute(const CovarianceBlocks& covariance_blocks, ProblemImpl* problem) { - CheckForDuplicates >(covariance_blocks); + CheckForDuplicates>(covariance_blocks); problem_ = problem; parameter_block_to_row_index_.clear(); covariance_matrix_.reset(NULL); @@ -881,7 +881,7 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingEigenSparseQR() { jacobian.rows.data(), jacobian.cols.data(), jacobian.values.data()); event_logger.AddEvent("ConvertToSparseMatrix"); - Eigen::SparseQR > + Eigen::SparseQR> qr_solver(sparse_jacobian); event_logger.AddEvent("QRDecomposition"); diff --git a/internal/ceres/covariance_impl.h b/internal/ceres/covariance_impl.h index c3a9bc145..065e43c60 100644 --- a/internal/ceres/covariance_impl.h +++ b/internal/ceres/covariance_impl.h @@ -52,7 +52,7 @@ class CovarianceImpl { bool Compute( const std::vector >& covariance_blocks, + const double*>>& covariance_blocks, ProblemImpl* problem); bool Compute( @@ -72,7 +72,7 @@ class CovarianceImpl { bool ComputeCovarianceSparsity( const std::vector >& 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 afa9bb675..9c5513625 100644 --- a/internal/ceres/covariance_test.cc +++ b/internal/ceres/covariance_test.cc @@ -204,7 +204,7 @@ TEST(CovarianceImpl, ComputeCovarianceSparsity) { 6, 7, 8, 9}; - vector > covariance_blocks; + vector> 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 @@ TEST(CovarianceImpl, ComputeCovarianceSparsityWithConstantParameterBlock) { 3, 4, 5, 6, 3, 4, 5, 6}; - vector > covariance_blocks; + vector> 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 @@ TEST(CovarianceImpl, ComputeCovarianceSparsityWithFreeParameterBlock) { 3, 4, 5, 6, 3, 4, 5, 6}; - vector > covariance_blocks; + vector> 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 @@ TEST(CovarianceImpl, ComputeCovarianceSparsityWithFreeParameterBlock) { class CovarianceTest : public ::testing::Test { protected: - typedef map > BoundsMap; + typedef map> BoundsMap; virtual void SetUp() { double* x = parameters_; @@ -495,7 +495,7 @@ class CovarianceTest : public ::testing::Test { // Generate all possible combination of block pairs and check if the // covariance computation is correct. for (int i = 0; i <= 64; ++i) { - vector > covariance_blocks; + vector> covariance_blocks; if (i & 1) { covariance_blocks.push_back(all_covariance_blocks_[0]); } @@ -590,7 +590,7 @@ class CovarianceTest : public ::testing::Test { double parameters_[6]; Problem problem_; - vector > all_covariance_blocks_; + vector> all_covariance_blocks_; BoundsMap column_bounds_; BoundsMap local_column_bounds_; }; @@ -1089,7 +1089,7 @@ TEST_F(CovarianceTest, ComputeCovarianceFailure) { EXPECT_DEATH_IF_SUPPORTED(covariance.Compute(parameter_blocks, &problem_), "Covariance::Compute called with duplicate blocks " "at indices \\(0, 1\\) and \\(2, 3\\)"); - vector > covariance_blocks; + vector> 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 @@ class LargeScaleCovarianceTest : public ::testing::Test { int num_parameter_blocks_; Problem problem_; - vector > all_covariance_blocks_; + vector> 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 fd5601641..d68af22b3 100644 --- a/internal/ceres/cubic_interpolation_test.cc +++ b/internal/ceres/cubic_interpolation_test.cc @@ -220,7 +220,7 @@ class CubicInterpolatorTest : public ::testing::Test { } Grid1D grid(values_.get(), 0, kNumSamples); - CubicInterpolator > interpolator(grid); + CubicInterpolator> 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 @@ TEST(CubicInterpolator, JetEvaluation) { const double values[] = {1.0, 2.0, 2.0, 5.0, 3.0, 9.0, 2.0, 7.0}; Grid1D grid(values, 0, 4); - CubicInterpolator > interpolator(grid); + CubicInterpolator> interpolator(grid); double f[2], dfdx[2]; const double x = 2.5; @@ -327,7 +327,7 @@ class BiCubicInterpolatorTest : public ::testing::Test { } Grid2D grid(values_.get(), 0, kNumRows, 0, kNumCols); - BiCubicInterpolator > interpolator(grid); + BiCubicInterpolator> interpolator(grid); for (int j = 0; j < kNumRowSamples; ++j) { const double r = 1.0 + 7.0 / (kNumRowSamples - 1) * j; @@ -471,7 +471,7 @@ TEST(BiCubicInterpolator, JetEvaluation) { 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 1.0}; Grid2D grid(values, 0, 2, 0, 4); - BiCubicInterpolator > interpolator(grid); + BiCubicInterpolator> 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 626cdeeb2..29f8d104a 100644 --- a/internal/ceres/dynamic_autodiff_cost_function_test.cc +++ b/internal/ceres/dynamic_autodiff_cost_function_test.cc @@ -119,7 +119,7 @@ TEST(DynamicAutodiffCostFunctionTest, TestJacobian) { parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -186,7 +186,7 @@ TEST(DynamicAutodiffCostFunctionTest, JacobianWithFirstParameterBlockConstant) { parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -236,7 +236,7 @@ TEST(DynamicAutodiffCostFunctionTest, JacobianWithSecondParameterBlockConstant) parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -420,7 +420,7 @@ class ThreeParameterCostFunctorTest : public ::testing::Test { std::unique_ptr cost_function_; - vector > jacobian_vect_; + vector> jacobian_vect_; vector expected_residuals_; @@ -667,10 +667,10 @@ class SixParameterCostFunctorTest : public ::testing::Test { std::unique_ptr cost_function_; - vector > jacobian_vect_; + vector> jacobian_vect_; vector expected_residuals_; - vector > expected_jacobians_; + vector> 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 4f89145de..acc372aeb 100644 --- a/internal/ceres/dynamic_compressed_row_jacobian_writer.cc +++ b/internal/ceres/dynamic_compressed_row_jacobian_writer.cc @@ -67,7 +67,7 @@ void DynamicCompressedRowJacobianWriter::Write(int residual_id, program_->residual_blocks()[residual_id]; const int num_residuals = residual_block->NumResiduals(); - vector > evaluated_jacobian_blocks; + vector> 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 cab860bdd..ad41da7b1 100644 --- a/internal/ceres/dynamic_compressed_row_sparse_matrix.h +++ b/internal/ceres/dynamic_compressed_row_sparse_matrix.h @@ -91,8 +91,8 @@ class DynamicCompressedRowSparseMatrix : public CompressedRowSparseMatrix { void Finalize(int num_additional_elements); private: - std::vector > dynamic_cols_; - std::vector > dynamic_values_; + std::vector> dynamic_cols_; + std::vector> 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 e4db3c14d..b627eb7da 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 @@ TEST(DynamicNumericdiffCostFunctionTest, TestJacobian) { parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -187,7 +187,7 @@ TEST(DynamicNumericdiffCostFunctionTest, JacobianWithFirstParameterBlockConstant parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -237,7 +237,7 @@ TEST(DynamicNumericdiffCostFunctionTest, JacobianWithSecondParameterBlockConstan parameter_blocks[1] = ¶m_block_1[0]; // Prepare the jacobian. - vector > jacobian_vect(2); + vector> jacobian_vect(2); jacobian_vect[0].resize(21 * 10, -100000); jacobian_vect[1].resize(21 * 5, -100000); vector jacobian; @@ -421,7 +421,7 @@ class ThreeParameterCostFunctorTest : public ::testing::Test { std::unique_ptr cost_function_; - vector > jacobian_vect_; + vector> jacobian_vect_; vector expected_residuals_; diff --git a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc index 451cfde8e..a46c85edf 100644 --- a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc +++ b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc @@ -129,7 +129,7 @@ LinearSolver::Summary DynamicSparseNormalCholeskySolver::SolveImplUsingEigen( A->mutable_values()); Eigen::SparseMatrix lhs = a.transpose() * a; - Eigen::SimplicialLDLT > solver; + Eigen::SimplicialLDLT> solver; LinearSolver::Summary summary; summary.num_iterations = 1; diff --git a/internal/ceres/eigensparse.cc b/internal/ceres/eigensparse.cc index aa6b6a974..49450360a 100644 --- a/internal/ceres/eigensparse.cc +++ b/internal/ceres/eigensparse.cc @@ -117,11 +117,11 @@ EigenSparseCholesky* EigenSparseCholesky::Create( #if EIGEN_VERSION_AT_LEAST(3, 2, 2) typedef Eigen::SimplicialLDLT, Eigen::Upper, - Eigen::AMDOrdering > + Eigen::AMDOrdering> WithAMDOrdering; typedef Eigen::SimplicialLDLT, Eigen::Upper, - Eigen::NaturalOrdering > + Eigen::NaturalOrdering> WithNaturalOrdering; if (ordering_type == AMD) { return new EigenSparseCholeskyTemplate(); diff --git a/internal/ceres/gradient_checker_test.cc b/internal/ceres/gradient_checker_test.cc index 85d58b94d..92d7b269b 100644 --- a/internal/ceres/gradient_checker_test.cc +++ b/internal/ceres/gradient_checker_test.cc @@ -112,7 +112,7 @@ class GoodTestTerm : public CostFunction { private: int arity_; bool return_value_; - vector > a_; // our vectors. + vector> a_; // our vectors. }; class BadTestTerm : public CostFunction { @@ -165,7 +165,7 @@ class BadTestTerm : public CostFunction { private: int arity_; - vector > a_; // our vectors. + vector> 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 7cf1e45ba..6ae77f62f 100644 --- a/internal/ceres/gradient_checking_cost_function_test.cc +++ b/internal/ceres/gradient_checking_cost_function_test.cc @@ -126,7 +126,7 @@ class TestTerm : public CostFunction { private: int arity_; - vector > a_; + vector> a_; }; TEST(GradientCheckingCostFunction, ResidualsAndJacobiansArePreservedTest) { diff --git a/internal/ceres/graph.h b/internal/ceres/graph.h index 25bb14195..079d31d43 100644 --- a/internal/ceres/graph.h +++ b/internal/ceres/graph.h @@ -100,7 +100,7 @@ class Graph { private: std::unordered_set vertices_; - std::unordered_map > edges_; + std::unordered_map> 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 08837cf91..876846528 100644 --- a/internal/ceres/graph_algorithms.h +++ b/internal/ceres/graph_algorithms.h @@ -260,7 +260,7 @@ template WeightedGraph* Degree2MaximumSpanningForest(const WeightedGraph& graph) { // Array of edges sorted in decreasing order of their weights. - std::vector > > weighted_edges; + std::vector>> weighted_edges; WeightedGraph* forest = new WeightedGraph(); // 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 644054401..2aef32731 100644 --- a/internal/ceres/graph_algorithms_test.cc +++ b/internal/ceres/graph_algorithms_test.cc @@ -111,7 +111,8 @@ TEST(Degree2MaximumSpanningForest, PreserveWeights) { graph.AddEdge(0, 1, 0.5); graph.AddEdge(1, 0, 0.5); - std::unique_ptr > forest(Degree2MaximumSpanningForest(graph)); + std::unique_ptr > forest( + Degree2MaximumSpanningForest(graph)); const std::unordered_set& 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 8b2ff91c7..31cd82954 100644 --- a/internal/ceres/inner_product_computer_test.cc +++ b/internal/ceres/inner_product_computer_test.cc @@ -115,7 +115,7 @@ TEST(InnerProductComputer, NormalOperation) { random_matrix->num_cols(), random_matrix->num_nonzeros()); random_matrix->ToTripletSparseMatrix(&tsm); - std::vector > triplets; + std::vector> triplets; for (int i = 0; i < tsm.num_nonzeros(); ++i) { triplets.push_back(Eigen::Triplet( tsm.rows()[i], tsm.cols()[i], tsm.values()[i])); @@ -187,7 +187,7 @@ TEST(InnerProductComputer, SubMatrix) { random_matrix->num_cols(), random_matrix->num_nonzeros()); random_matrix->ToTripletSparseMatrix(&tsm); - std::vector > triplets; + std::vector> 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( diff --git a/internal/ceres/local_parameterization_test.cc b/internal/ceres/local_parameterization_test.cc index 41c78cb68..2465b41f7 100644 --- a/internal/ceres/local_parameterization_test.cc +++ b/internal/ceres/local_parameterization_test.cc @@ -378,8 +378,8 @@ struct EigenQuaternionPlus { q_delta.coeffs() << delta[0], delta[1], delta[2], T(1.0); } - Eigen::Map > x_plus_delta_ref(x_plus_delta); - Eigen::Map > x_ref(x); + Eigen::Map> x_plus_delta_ref(x_plus_delta); + Eigen::Map> x_ref(x); x_plus_delta_ref = q_delta * x_ref; return true; } @@ -440,9 +440,9 @@ struct HomogeneousVectorParameterizationPlus { template bool operator()(const Scalar* p_x, const Scalar* p_delta, Scalar* p_x_plus_delta) const { - Eigen::Map > x(p_x); - Eigen::Map > delta(p_delta); - Eigen::Map > x_plus_delta(p_x_plus_delta); + Eigen::Map> x(p_x); + Eigen::Map> delta(p_delta); + Eigen::Map> 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 8638f9073..f997d25b1 100644 --- a/internal/ceres/parallel_utils_test.cc +++ b/internal/ceres/parallel_utils_test.cc @@ -42,7 +42,7 @@ namespace internal { // indices that are in-range and unique. TEST(LinearIndexToUpperTriangularIndexTest, UniqueAndValid) { for (int n = 0; n < 100; n++) { - std::set > seen_pairs; + std::set> 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 a71c01955..ffae223be 100644 --- a/internal/ceres/parameter_block_ordering.cc +++ b/internal/ceres/parameter_block_ordering.cc @@ -162,7 +162,7 @@ void OrderingToGroupSizes(const ParameterBlockOrdering* ordering, return; } - const map >& group_to_elements = + const map>& 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 f3480a35e..86c136884 100644 --- a/internal/ceres/reorder_program.cc +++ b/internal/ceres/reorder_program.cc @@ -234,7 +234,7 @@ bool ApplyOrdering(const ProblemImpl::ParameterMap& parameter_map, program->mutable_parameter_blocks(); parameter_blocks->clear(); - const map >& groups = ordering.group_to_elements(); + const map>& groups = ordering.group_to_elements(); for (const auto& p : groups) { const set& 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 0fb9c309d..7934e365a 100644 --- a/internal/ceres/schur_complement_solver.cc +++ b/internal/ceres/schur_complement_solver.cc @@ -249,7 +249,7 @@ void SparseSchurComplementSolver::InitStorage( blocks_[i - num_eliminate_blocks] = bs->cols[i].size; } - set > block_pairs; + set> 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 296c09a64..3a09e8668 100644 --- a/internal/ceres/split.cc +++ b/internal/ceres/split.cc @@ -115,7 +115,7 @@ void SplitStringUsing(const string& full, const char* delim, vector* result) { result->reserve(result->size() + CalculateReserveForVector(full, delim)); - std::back_insert_iterator > it(*result); + std::back_insert_iterator> it(*result); SplitStringToIteratorUsing(full, delim, it); } diff --git a/internal/ceres/visibility.cc b/internal/ceres/visibility.cc index a446b6b89..aa195b9bf 100644 --- a/internal/ceres/visibility.cc +++ b/internal/ceres/visibility.cc @@ -53,7 +53,7 @@ using std::vector; void ComputeVisibility(const CompressedRowBlockStructure& block_structure, const int num_eliminate_blocks, - vector< set >* visibility) { + vector>* visibility) { CHECK_NOTNULL(visibility); // Clear the visibility vector and resize it to hold a @@ -79,7 +79,7 @@ void ComputeVisibility(const CompressedRowBlockStructure& block_structure, } WeightedGraph* CreateSchurComplementGraph( - const vector >& visibility) { + const vector>& 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 @@ WeightedGraph* CreateSchurComplementGraph( // cameras. However, to compute the sparsity structure of the Schur // Complement efficiently, its better to have the point->camera // mapping. - vector > inverse_visibility(num_points); + vector> inverse_visibility(num_points); for (int i = 0; i < visibility.size(); i++) { const set& visibility_set = visibility[i]; for (const int v : visibility_set) { diff --git a/internal/ceres/visibility.h b/internal/ceres/visibility.h index 605682f2e..e443766a6 100644 --- a/internal/ceres/visibility.h +++ b/internal/ceres/visibility.h @@ -54,7 +54,7 @@ struct CompressedRowBlockStructure; // points and f_blocks correspond to cameras. void ComputeVisibility(const CompressedRowBlockStructure& block_structure, int num_eliminate_blocks, - std::vector >* visibility); + std::vector>* visibility); // Given f_block visibility as computed by the ComputeVisibility // function above, construct and return a graph whose vertices are @@ -70,7 +70,7 @@ void ComputeVisibility(const CompressedRowBlockStructure& block_structure, // Caller acquires ownership of the returned WeightedGraph pointer // (heap-allocated). WeightedGraph* CreateSchurComplementGraph( - const std::vector >& visibility); + const std::vector>& visibility); } // namespace internal } // namespace ceres diff --git a/internal/ceres/visibility_based_preconditioner.cc b/internal/ceres/visibility_based_preconditioner.cc index b13c529d8..36247b708 100644 --- a/internal/ceres/visibility_based_preconditioner.cc +++ b/internal/ceres/visibility_based_preconditioner.cc @@ -123,7 +123,7 @@ VisibilityBasedPreconditioner::~VisibilityBasedPreconditioner() {} // preconditioner matrix. void VisibilityBasedPreconditioner::ComputeClusterJacobiSparsity( const CompressedRowBlockStructure& bs) { - vector > visibility; + vector> visibility; ComputeVisibility(bs, options_.elimination_groups[0], &visibility); CHECK_EQ(num_blocks_, visibility.size()); ClusterCameras(visibility); @@ -141,7 +141,7 @@ void VisibilityBasedPreconditioner::ComputeClusterJacobiSparsity( // forest. The set of edges in this forest are the cluster pairs. void VisibilityBasedPreconditioner::ComputeClusterTridiagonalSparsity( const CompressedRowBlockStructure& bs) { - vector > visibility; + vector> visibility; ComputeVisibility(bs, options_.elimination_groups[0], &visibility); CHECK_EQ(num_blocks_, visibility.size()); ClusterCameras(visibility); @@ -150,7 +150,7 @@ void VisibilityBasedPreconditioner::ComputeClusterTridiagonalSparsity( // 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 > cluster_visibility; + vector> cluster_visibility; ComputeClusterVisibility(visibility, &cluster_visibility); std::unique_ptr > cluster_graph( CHECK_NOTNULL(CreateClusterGraph(cluster_visibility))); @@ -484,8 +484,8 @@ void VisibilityBasedPreconditioner::ForestToClusterPairs( // of all its cameras. In other words, the set of points visible to // any camera in the cluster. void VisibilityBasedPreconditioner::ComputeClusterVisibility( - const vector >& visibility, - vector >* cluster_visibility) const { + const vector>& visibility, + vector>* 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 @@ void VisibilityBasedPreconditioner::ComputeClusterVisibility( // weights are the number of 3D points visible to cameras in both the // vertices. WeightedGraph* VisibilityBasedPreconditioner::CreateClusterGraph( - const vector >& cluster_visibility) const { + const vector>& cluster_visibility) const { WeightedGraph* cluster_graph = new WeightedGraph; 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 b47bb68d6..a03a582d6 100644 --- a/internal/ceres/visibility_based_preconditioner.h +++ b/internal/ceres/visibility_based_preconditioner.h @@ -152,14 +152,14 @@ class VisibilityBasedPreconditioner : public BlockSparseMatrixPreconditioner { LinearSolverTerminationType Factorize(); void ScaleOffDiagonalCells(); - void ClusterCameras(const std::vector >& visibility); + void ClusterCameras(const std::vector>& visibility); void FlattenMembershipMap(const std::unordered_map& membership_map, std::vector* membership_vector) const; void ComputeClusterVisibility( - const std::vector >& visibility, - std::vector >* cluster_visibility) const; + const std::vector>& visibility, + std::vector>* cluster_visibility) const; WeightedGraph* CreateClusterGraph( - const std::vector >& visibility) const; + const std::vector>& visibility) const; void ForestToClusterPairs(const WeightedGraph& forest, std::unordered_set, pair_hash>* cluster_pairs) const; void ComputeBlockPairsInPreconditioner(const CompressedRowBlockStructure& bs); @@ -181,7 +181,7 @@ class VisibilityBasedPreconditioner : public BlockSparseMatrixPreconditioner { // 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 > block_pairs_; + std::set> 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 437b5d4c8..a006d9804 100644 --- a/internal/ceres/visibility_based_preconditioner_test.cc +++ b/internal/ceres/visibility_based_preconditioner_test.cc @@ -196,11 +196,11 @@ namespace internal { // return &preconditioner_->cluster_membership_; // } -// const set >& get_block_pairs() { +// const set>& get_block_pairs() { // return preconditioner_->block_pairs_; // } -// set >* get_mutable_block_pairs() { +// set>* get_mutable_block_pairs() { // return &preconditioner_->block_pairs_; // } diff --git a/internal/ceres/visibility_test.cc b/internal/ceres/visibility_test.cc index 81ad99f9f..5028e01f4 100644 --- a/internal/ceres/visibility_test.cc +++ b/internal/ceres/visibility_test.cc @@ -100,7 +100,7 @@ TEST(VisibilityTest, SimpleMatrix) { } bs.cols.resize(num_cols); - vector< set > visibility; + vector< set> 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 @@ TEST(VisibilityTest, NoEBlocks) { } bs.cols.resize(num_cols); - vector > visibility; + vector> 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 > graph(CreateSchurComplementGraph(visibility)); + std::unique_ptr > 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);