11#ifndef EIGEN_SOLVERBASE_H
12#define EIGEN_SOLVERBASE_H
15#include "./InternalHeaderCheck.h"
21template <
typename Derived>
22struct solve_assertion {
23 template <
bool Transpose_,
typename Rhs>
24 static void run(
const Derived& solver,
const Rhs& b) {
25 solver.template _check_solve_assertion<Transpose_>(b);
29template <
typename Derived>
30struct solve_assertion<Transpose<Derived>> {
31 using type = Transpose<Derived>;
33 template <
bool Transpose_,
typename Rhs>
34 static void run(
const type& transpose,
const Rhs& b) {
35 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<true>(transpose.nestedExpression(), b);
39template <
typename Scalar,
typename Derived>
40struct solve_assertion<CwiseUnaryOp<Eigen::internal::scalar_conjugate_op<Scalar>, const Transpose<Derived>>> {
41 using type = CwiseUnaryOp<Eigen::internal::scalar_conjugate_op<Scalar>,
const Transpose<Derived>>;
43 template <
bool Transpose_,
typename Rhs>
44 static void run(
const type& adjoint,
const Rhs& b) {
45 internal::solve_assertion<internal::remove_all_t<Transpose<Derived>>>::template run<true>(
46 adjoint.nestedExpression(), b);
72template <
typename Derived>
76 using Scalar =
typename internal::traits<Derived>::Scalar;
77 using CoeffReturnType = Scalar;
79 template <
typename Derived_>
80 friend struct internal::solve_assertion;
91 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
92 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
93 SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::value),
94 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
95 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
96 MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
97 internal::traits<Derived>::MaxColsAtCompileTime),
98 IsVectorAtCompileTime =
99 internal::traits<Derived>::MaxRowsAtCompileTime == 1 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
100 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0
101 : bool(IsVectorAtCompileTime) ? 1
112 template <
typename Rhs>
114 internal::solve_assertion<internal::remove_all_t<Derived>>::template run<false>(
derived(), b);
127 inline const ConstTransposeReturnType
transpose()
const {
return ConstTransposeReturnType(
derived()); }
130 using AdjointReturnType =
131 std::conditional_t<NumTraits<Scalar>::IsComplex,
133 const ConstTransposeReturnType>;
146 template <
bool Transpose_,
typename Rhs>
147 void _check_solve_assertion(
const Rhs& b)
const {
148 EIGEN_ONLY_USED_FOR_DEBUG(b);
149 eigen_assert(
derived().m_isInitialized &&
"Solver is not initialized.");
151 "SolverBase::solve(): invalid number of rows of the right hand side matrix b");
157template <
typename Derived>
158struct generic_xpr_base<Derived, MatrixXpr, SolverStorage> {
159 using type = SolverBase<Derived>;
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition CwiseUnaryOp.h:55
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:53
Pseudo expression representing a solving operation.
Definition Solve.h:63
Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition SolverBase.h:113
constexpr Derived & derived()
Definition EigenBase.h:50
const ConstTransposeReturnType transpose() const
Definition SolverBase.h:127
const AdjointReturnType adjoint() const
Definition SolverBase.h:143
Expression of the transpose of a matrix.
Definition Transpose.h:57
ComputationInfo
Definition Constants.h:455
Definition EigenBase.h:34
constexpr Index cols() const noexcept
Definition EigenBase.h:62
constexpr Derived & derived()
Definition EigenBase.h:50
constexpr Index rows() const noexcept
Definition EigenBase.h:60