10 #ifndef EIGEN_SOLVERBASE_H 11 #define EIGEN_SOLVERBASE_H 17 template<
typename Derived>
18 struct solve_assertion {
19 template<
bool Transpose_,
typename Rhs>
20 static void run(
const Derived& solver,
const Rhs& b) { solver.template _check_solve_assertion<Transpose_>(b); }
23 template<
typename Derived>
24 struct solve_assertion<Transpose<Derived> >
26 typedef Transpose<Derived> type;
28 template<
bool Transpose_,
typename Rhs>
29 static void run(
const type& transpose,
const Rhs& b)
31 internal::solve_assertion<typename internal::remove_all<Derived>::type>::template run<true>(transpose.nestedExpression(), b);
35 template<
typename Scalar,
typename Derived>
36 struct solve_assertion<CwiseUnaryOp<
Eigen::internal::scalar_conjugate_op<Scalar>, const Transpose<Derived> > >
38 typedef CwiseUnaryOp<Eigen::internal::scalar_conjugate_op<Scalar>,
const Transpose<Derived> > type;
40 template<
bool Transpose_,
typename Rhs>
41 static void run(
const type& adjoint,
const Rhs& b)
43 internal::solve_assertion<typename internal::remove_all<Transpose<Derived> >::type>::template run<true>(adjoint.nestedExpression(), b);
67 template<
typename Derived>
73 typedef typename internal::traits<Derived>::Scalar Scalar;
74 typedef Scalar CoeffReturnType;
76 template<
typename Derived_>
77 friend struct internal::solve_assertion;
80 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
81 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
82 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
83 internal::traits<Derived>::ColsAtCompileTime>::ret),
84 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
85 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
86 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
87 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
88 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
89 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
90 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2
104 template<
typename Rhs>
108 internal::solve_assertion<typename internal::remove_all<Derived>::type>::template run<false>(derived(), b);
123 return ConstTransposeReturnType(derived());
127 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
129 ConstTransposeReturnType
130 >::type AdjointReturnType;
142 return AdjointReturnType(derived().transpose());
147 template<
bool Transpose_,
typename Rhs>
148 void _check_solve_assertion(
const Rhs& b)
const {
149 EIGEN_ONLY_USED_FOR_DEBUG(b);
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");
157 template<
typename Derived>
158 struct generic_xpr_base<Derived, MatrixXpr, SolverStorage>
168 #endif // EIGEN_SOLVERBASE_H const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
Expression of the transpose of a matrix.
Definition: Transpose.h:52
Namespace containing all symbols from the Eigen library.
Definition: Core:141
Derived & derived()
Definition: EigenBase.h:46
Definition: EigenBase.h:29
ConstTransposeReturnType transpose() const
Definition: SolverBase.h:121
Definition: Eigen_Colamd.h:50
SolverBase()
Definition: SolverBase.h:94
Pseudo expression representing a solving operation.
Definition: Solve.h:62
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
AdjointReturnType adjoint() const
Definition: SolverBase.h:140
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:68
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48