10 #ifndef EIGEN_SOLVERBASE_H
11 #define EIGEN_SOLVERBASE_H
13 #include "./InternalHeaderCheck.h"
19 template<
typename Derived>
20 struct solve_assertion {
21 template<
bool Transpose_,
typename Rhs>
22 static void run(
const Derived& solver,
const Rhs& b) { solver.template _check_solve_assertion<Transpose_>(b); }
25 template<
typename Derived>
26 struct solve_assertion<Transpose<Derived> >
28 typedef Transpose<Derived> type;
30 template<
bool Transpose_,
typename Rhs>
31 static void run(
const type& transpose,
const Rhs& b)
33 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<true>(transpose.nestedExpression(), b);
37 template<
typename Scalar,
typename Derived>
38 struct solve_assertion<CwiseUnaryOp<
Eigen::internal::scalar_conjugate_op<Scalar>, const Transpose<Derived> > >
40 typedef CwiseUnaryOp<Eigen::internal::scalar_conjugate_op<Scalar>,
const Transpose<Derived> > type;
42 template<
bool Transpose_,
typename Rhs>
43 static void run(
const type& adjoint,
const Rhs& b)
45 internal::solve_assertion<internal::remove_all_t<Transpose<Derived> >>::template run<true>(adjoint.nestedExpression(), b);
69 template<
typename Derived>
75 typedef typename internal::traits<Derived>::Scalar Scalar;
76 typedef Scalar CoeffReturnType;
78 template<
typename Derived_>
79 friend struct internal::solve_assertion;
82 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
83 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
84 SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
85 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
86 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
87 MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
88 internal::traits<Derived>::MaxColsAtCompileTime),
89 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
90 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
91 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2
105 template<
typename Rhs>
106 inline const Solve<Derived, Rhs>
109 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<false>(
derived(), b);
128 typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
130 const ConstTransposeReturnType
141 inline const AdjointReturnType
adjoint()
const
148 template<
bool Transpose_,
typename Rhs>
149 void _check_solve_assertion(
const Rhs& b)
const {
150 EIGEN_ONLY_USED_FOR_DEBUG(b);
151 eigen_assert(
derived().m_isInitialized &&
"Solver is not initialized.");
152 eigen_assert((Transpose_?
derived().
cols():
derived().
rows())==b.rows() &&
"SolverBase::solve(): invalid number of rows of the right hand side matrix b");
158 template<
typename Derived>
159 struct generic_xpr_base<Derived, MatrixXpr, SolverStorage>
161 typedef SolverBase<Derived> type;
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:58
Derived & derived()
Definition: EigenBase.h:48
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
Pseudo expression representing a solving operation.
Definition: Solve.h:65
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:71
Derived & derived()
Definition: EigenBase.h:48
SolverBase()
Definition: SolverBase.h:95
const ConstTransposeReturnType transpose() const
Definition: SolverBase.h:122
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:107
const AdjointReturnType adjoint() const
Definition: SolverBase.h:141
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Namespace containing all symbols from the Eigen library.
Definition: Core:139
Definition: EigenBase.h:32
Derived & derived()
Definition: EigenBase.h:48
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:65
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:62