TR-mbed 1.0
Loading...
Searching...
No Matches
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
13namespace Eigen {
14
15namespace internal {
16
17template<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
23template<typename Derived>
24struct 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
35template<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
67template<typename Derived>
68class 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
141 {
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
155namespace internal {
156
157template<typename Derived>
159{
161
162};
163
164} // end namespace internal
165
166} // end namespace Eigen
167
168#endif // EIGEN_SOLVERBASE_H
BiCGSTAB< SparseMatrix< double > > solver
Definition BiCGSTAB_simple.cpp:5
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition Macros.h:1049
#define eigen_assert(x)
Definition Macros.h:1037
void adjoint(const MatrixType &m)
Definition adjoint.cpp:67
Scalar * b
Definition benchVecAdd.cpp:17
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition CwiseUnaryOp.h:56
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Pseudo expression representing a solving operation.
Definition Solve.h:63
A base class for matrix decomposition and solvers.
Definition SolverBase.h:69
AdjointReturnType adjoint() const
Definition SolverBase.h:140
internal::traits< Derived >::Scalar Scalar
Definition SolverBase.h:73
EigenBase< Derived > Base
Definition SolverBase.h:72
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition SolverBase.h:113
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
Definition SolverBase.h:130
@ RowsAtCompileTime
Definition SolverBase.h:80
@ NumDimensions
Definition SolverBase.h:90
@ ColsAtCompileTime
Definition SolverBase.h:81
@ MaxRowsAtCompileTime
Definition SolverBase.h:84
@ IsVectorAtCompileTime
Definition SolverBase.h:88
@ MaxSizeAtCompileTime
Definition SolverBase.h:86
@ MaxColsAtCompileTime
Definition SolverBase.h:85
@ SizeAtCompileTime
Definition SolverBase.h:82
SolverBase()
Definition SolverBase.h:94
~SolverBase()
Definition SolverBase.h:97
ConstTransposeReturnType transpose() const
Definition SolverBase.h:121
Scalar CoeffReturnType
Definition SolverBase.h:74
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition SolverBase.h:106
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:46
void _check_solve_assertion(const Rhs &b) const
Definition SolverBase.h:148
Expression of the transpose of a matrix.
Definition Transpose.h:54
return int(ret)+1
DenseIndex ret
Definition level1_cplx_impl.h:44
@ Rhs
Definition TensorContractionMapper.h:18
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
Definition BandTriangularSolver.h:13
Definition EigenBase.h:30
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition EigenBase.h:63
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:46
Definition Constants.h:522
Definition Constants.h:513
SolverBase< Derived > type
Definition SolverBase.h:160
Definition XprHelper.h:501
Definition UnaryFunctors.h:109
Definition XprHelper.h:282
CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< Scalar >, const Transpose< Derived > > type
Definition SolverBase.h:38
Transpose< Derived > type
Definition SolverBase.h:26
static void run(const type &transpose, const Rhs &b)
Definition SolverBase.h:29
Definition SolverBase.h:18
static void run(const Derived &solver, const Rhs &b)
Definition SolverBase.h:20
Definition ForwardDeclarations.h:17