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>
105 inline const Solve<Derived, Rhs>
108 internal::solve_assertion<typename internal::remove_all<Derived>::type>::template run<false>(
derived(), b);
113 typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
123 return ConstTransposeReturnType(
derived());
127 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
129 ConstTransposeReturnType
130 >::type AdjointReturnType;
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>
160 typedef SolverBase<Derived> type;
168 #endif // EIGEN_SOLVERBASE_H