10 #ifndef EIGEN_SOLVERBASE_H 11 #define EIGEN_SOLVERBASE_H 14 #include "./InternalHeaderCheck.h" 20 template <
typename Derived>
21 struct solve_assertion {
22 template <
bool Transpose_,
typename Rhs>
23 static void run(
const Derived& solver,
const Rhs& b) {
24 solver.template _check_solve_assertion<Transpose_>(b);
28 template <
typename Derived>
29 struct solve_assertion<Transpose<Derived>> {
30 typedef Transpose<Derived> type;
32 template <
bool Transpose_,
typename Rhs>
33 static void run(
const type& transpose,
const Rhs& b) {
34 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<true>(transpose.nestedExpression(), b);
38 template <
typename Scalar,
typename Derived>
39 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) {
44 internal::solve_assertion<internal::remove_all_t<Transpose<Derived>>>::template run<true>(
45 adjoint.nestedExpression(), b);
71 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;
90 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
91 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
92 SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
93 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
94 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
95 MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
96 internal::traits<Derived>::MaxColsAtCompileTime),
97 IsVectorAtCompileTime =
98 internal::traits<Derived>::MaxRowsAtCompileTime == 1 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
99 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0
100 : bool(IsVectorAtCompileTime) ? 1
113 template <
typename Rhs>
115 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<false>(
derived(), b);
131 typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
133 const ConstTransposeReturnType>
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.");
152 "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> {
160 typedef SolverBase<Derived> type;
167 #endif // EIGEN_SOLVERBASE_H const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:114
constexpr Derived & derived()
Definition: EigenBase.h:49
const AdjointReturnType adjoint() const
Definition: SolverBase.h:144
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
constexpr Index rows() const noexcept
Definition: EigenBase.h:59
Definition: EigenBase.h:33
constexpr Index cols() const noexcept
Definition: EigenBase.h:61
constexpr Derived & derived()
Definition: EigenBase.h:49
const ConstTransposeReturnType transpose() const
Definition: SolverBase.h:128
SolverBase()
Definition: SolverBase.h:105
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:52
ComputationInfo
Definition: Constants.h:438
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:72
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52