SolverBase.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_SOLVERBASE_H
11 #define EIGEN_SOLVERBASE_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
17 template<typename Derived>
19  template<bool Transpose_, typename Rhs>
20  static void run(const Derived& solver, const Rhs& b) { solver.template _check_solve_assertion<Transpose_>(b); }
21 };
22 
23 template<typename Derived>
24 struct solve_assertion<Transpose<Derived> >
25 {
27 
28  template<bool Transpose_, typename Rhs>
29  static void run(const type& transpose, const Rhs& b)
30  {
32  }
33 };
34 
35 template<typename Scalar, typename Derived>
37 {
39 
40  template<bool Transpose_, typename Rhs>
41  static void run(const type& adjoint, const Rhs& b)
42  {
44  }
45 };
46 } // end namespace internal
47 
67 template<typename Derived>
68 class SolverBase : public EigenBase<Derived>
69 {
70  public:
71 
75 
76  template<typename Derived_>
78 
79  enum {
91  };
92 
95  {}
96 
98  {}
99 
100  using Base::derived;
101 
104  template<typename Rhs>
105  inline const Solve<Derived, Rhs>
106  solve(const MatrixBase<Rhs>& b) const
107  {
109  return Solve<Derived, Rhs>(derived(), b.derived());
110  }
111 
122  {
124  }
125 
140  inline AdjointReturnType adjoint() const
141  {
142  return AdjointReturnType(derived().transpose());
143  }
144 
145  protected:
146 
147  template<bool Transpose_, typename Rhs>
148  void _check_solve_assertion(const Rhs& b) const {
150  eigen_assert(derived().m_isInitialized && "Solver is not initialized.");
151  eigen_assert((Transpose_?derived().cols():derived().rows())==b.rows() && "SolverBase::solve(): invalid number of rows of the right hand side matrix b");
152  }
153 };
154 
155 namespace internal {
156 
157 template<typename Derived>
159 {
161 
162 };
163 
164 } // end namespace internal
165 
166 } // end namespace Eigen
167 
168 #endif // EIGEN_SOLVERBASE_H
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::MatrixXpr
Definition: Constants.h:522
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::SolverBase::Scalar
internal::traits< Derived >::Scalar Scalar
Definition: SolverBase.h:73
Eigen::EigenBase::derived
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
Eigen::SolverBase::_check_solve_assertion
void _check_solve_assertion(const Rhs &b) const
Definition: SolverBase.h:148
b
Scalar * b
Definition: benchVecAdd.cpp:17
Eigen::EigenBase
Definition: EigenBase.h:29
Eigen::internal::solve_assertion< Transpose< Derived > >::type
Transpose< Derived > type
Definition: SolverBase.h:26
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::SolverBase::Base
EigenBase< Derived > Base
Definition: SolverBase.h:72
ret
DenseIndex ret
Definition: level1_cplx_impl.h:44
type
Definition: pytypes.h:1525
Eigen::internal::solve_assertion
Definition: SolverBase.h:18
Eigen::SolverBase::IsVectorAtCompileTime
@ IsVectorAtCompileTime
Definition: SolverBase.h:88
solver
BiCGSTAB< SparseMatrix< double > > solver
Definition: BiCGSTAB_simple.cpp:5
Eigen::Transpose
Expression of the transpose of a matrix.
Definition: Transpose.h:52
EIGEN_ONLY_USED_FOR_DEBUG
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:1049
Eigen::SolverBase::NumDimensions
@ NumDimensions
Definition: SolverBase.h:90
Eigen::SolverBase::ColsAtCompileTime
@ ColsAtCompileTime
Definition: SolverBase.h:81
Eigen::internal::solve_assertion< CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< Scalar >, const Transpose< Derived > > >::type
CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< Scalar >, const Transpose< Derived > > type
Definition: SolverBase.h:38
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::SolverBase::transpose
ConstTransposeReturnType transpose() const
Definition: SolverBase.h:121
Eigen::SolverStorage
Definition: Constants.h:513
Eigen::internal::generic_xpr_base< Derived, MatrixXpr, SolverStorage >::type
SolverBase< Derived > type
Definition: SolverBase.h:160
Eigen::internal::generic_xpr_base
Definition: XprHelper.h:501
Eigen::internal::solve_assertion::run
static void run(const Derived &solver, const Rhs &b)
Definition: SolverBase.h:20
Eigen::internal::solve_assertion< Transpose< Derived > >::run
static void run(const type &transpose, const Rhs &b)
Definition: SolverBase.h:29
Eigen::internal::add_const
Definition: Meta.h:208
Eigen::SolverBase::SizeAtCompileTime
@ SizeAtCompileTime
Definition: SolverBase.h:82
Eigen::SolverBase::AdjointReturnType
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
Definition: SolverBase.h:130
Eigen::SolverBase::MaxRowsAtCompileTime
@ MaxRowsAtCompileTime
Definition: SolverBase.h:84
Eigen::SolverBase::MaxColsAtCompileTime
@ MaxColsAtCompileTime
Definition: SolverBase.h:85
Eigen::Solve
Pseudo expression representing a solving operation.
Definition: Solve.h:62
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::SolverBase::CoeffReturnType
Scalar CoeffReturnType
Definition: SolverBase.h:74
Eigen::internal::Rhs
@ Rhs
Definition: TensorContractionMapper.h:18
Eigen::CwiseUnaryOp
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Eigen::SolverBase::adjoint
AdjointReturnType adjoint() const
Definition: SolverBase.h:140
Eigen::SolverBase::MaxSizeAtCompileTime
@ MaxSizeAtCompileTime
Definition: SolverBase.h:86
Eigen::SolverBase::SolverBase
SolverBase()
Definition: SolverBase.h:94
Eigen::internal::conditional
Definition: Meta.h:109
Eigen::internal::solve_assertion< CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< Scalar >, const Transpose< Derived > > >::run
static void run(const type &adjoint, const Rhs &b)
Definition: SolverBase.h:41
Eigen::SolverBase::ConstTransposeReturnType
internal::add_const< Transpose< const Derived > >::type ConstTransposeReturnType
Definition: SolverBase.h:113
Eigen::Transpose::nestedExpression
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE internal::remove_all< MatrixTypeNested >::type & nestedExpression() const
Definition: Transpose.h:76
internal
Definition: BandTriangularSolver.h:13
Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Eigen::EigenBase::rows
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:60
Eigen::EigenBase::cols
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:63
adjoint
void adjoint(const MatrixType &m)
Definition: adjoint.cpp:67
Eigen::internal::size_at_compile_time
Definition: XprHelper.h:281
Eigen::SolverBase::RowsAtCompileTime
@ RowsAtCompileTime
Definition: SolverBase.h:80
Eigen::SolverBase::~SolverBase
~SolverBase()
Definition: SolverBase.h:97
Eigen::internal::scalar_conjugate_op
Definition: UnaryFunctors.h:109
Eigen::SolverBase::solve
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
Eigen::SolverBase
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:68


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:23