mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Replacing old style typedefs with new style usings
Change-Id: I85d353708fc431df8312a2337d0508df6aee071f
This commit is contained in:
@@ -55,18 +55,18 @@ struct SparseTypesTrait {};
|
||||
|
||||
template <>
|
||||
struct SparseTypesTrait<double> {
|
||||
typedef DenseVector_Double DenseVector;
|
||||
typedef SparseMatrix_Double SparseMatrix;
|
||||
typedef SparseOpaqueSymbolicFactorization SymbolicFactorization;
|
||||
typedef SparseOpaqueFactorization_Double NumericFactorization;
|
||||
using DenseVector = DenseVector_Double;
|
||||
using SparseMatrix = SparseMatrix_Double;
|
||||
using SymbolicFactorization = SparseOpaqueSymbolicFactorization;
|
||||
using NumericFactorization = SparseOpaqueFactorization_Double;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct SparseTypesTrait<float> {
|
||||
typedef DenseVector_Float DenseVector;
|
||||
typedef SparseMatrix_Float SparseMatrix;
|
||||
typedef SparseOpaqueSymbolicFactorization SymbolicFactorization;
|
||||
typedef SparseOpaqueFactorization_Float NumericFactorization;
|
||||
using DenseVector = DenseVector_Float;
|
||||
using SparseMatrix = SparseMatrix_Float;
|
||||
using SymbolicFactorization = SparseOpaqueSymbolicFactorization;
|
||||
using NumericFactorization = SparseOpaqueFactorization_Float;
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
|
||||
@@ -298,20 +298,19 @@ class DynamicTwoParameterBlockFunctor {
|
||||
};
|
||||
|
||||
// Check that AutoDiff(Functor1) == AutoDiff(CostToFunctor(AutoDiff(Functor1)))
|
||||
#define TEST_BODY(Functor1) \
|
||||
TEST(CostFunctionToFunctor, Functor1) { \
|
||||
typedef AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES> \
|
||||
CostFunction1; \
|
||||
typedef CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES> FunctionToFunctor; \
|
||||
typedef AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES> \
|
||||
CostFunction2; \
|
||||
\
|
||||
std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
|
||||
new FunctionToFunctor(new CostFunction1(new Functor1)))); \
|
||||
\
|
||||
std::unique_ptr<CostFunction> actual_cost_function( \
|
||||
new CostFunction1(new Functor1)); \
|
||||
ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
|
||||
#define TEST_BODY(Functor1) \
|
||||
TEST(CostFunctionToFunctor, Functor1) { \
|
||||
using CostFunction1 = AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES>; \
|
||||
using FunctionToFunctor = CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES>; \
|
||||
using CostFunction2 = \
|
||||
AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES>; \
|
||||
\
|
||||
std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
|
||||
new FunctionToFunctor(new CostFunction1(new Functor1)))); \
|
||||
\
|
||||
std::unique_ptr<CostFunction> actual_cost_function( \
|
||||
new CostFunction1(new Functor1)); \
|
||||
ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
|
||||
}
|
||||
|
||||
#define PARAMETER_BLOCK_SIZES 2
|
||||
|
||||
@@ -392,10 +392,10 @@ class TypedLinearSolver : public LinearSolver {
|
||||
// Linear solvers that depend on access to the low level structure of
|
||||
// a SparseMatrix.
|
||||
// clang-format off
|
||||
typedef TypedLinearSolver<BlockSparseMatrix> BlockSparseMatrixSolver; // NOLINT
|
||||
typedef TypedLinearSolver<CompressedRowSparseMatrix> CompressedRowSparseMatrixSolver; // NOLINT
|
||||
typedef TypedLinearSolver<DenseSparseMatrix> DenseSparseMatrixSolver; // NOLINT
|
||||
typedef TypedLinearSolver<TripletSparseMatrix> TripletSparseMatrixSolver; // NOLINT
|
||||
using BlockSparseMatrixSolver = TypedLinearSolver<BlockSparseMatrix>; // NOLINT
|
||||
using CompressedRowSparseMatrixSolver = TypedLinearSolver<CompressedRowSparseMatrix>; // NOLINT
|
||||
using DenseSparseMatrixSolver = TypedLinearSolver<DenseSparseMatrix>; // NOLINT
|
||||
using TripletSparseMatrixSolver = TypedLinearSolver<TripletSparseMatrix>; // NOLINT
|
||||
// clang-format on
|
||||
|
||||
} // namespace ceres::internal
|
||||
|
||||
@@ -274,7 +274,7 @@ class CERES_NO_EXPORT SuiteSparseCholesky final : public SparseCholesky {
|
||||
|
||||
#else // CERES_NO_SUITESPARSE
|
||||
|
||||
typedef void cholmod_factor;
|
||||
using cholmod_factor = void;
|
||||
|
||||
#include "ceres/internal/disable_warnings.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user