15 template<
typename Decomposition,
typename RhsType,
typename StorageKind>
class SolveImpl;
32 template<
typename Decomposition,
typename RhsType,
typename StorageKind>
struct solve_traits;
34 template<
typename Decomposition,
typename RhsType>
35 struct solve_traits<Decomposition,RhsType,Dense>
37 typedef Matrix<
typename RhsType::Scalar,
38 Decomposition::ColsAtCompileTime,
39 RhsType::ColsAtCompileTime,
40 RhsType::PlainObject::Options,
41 Decomposition::MaxColsAtCompileTime,
42 RhsType::MaxColsAtCompileTime> PlainObject;
45 template<
typename Decomposition,
typename RhsType>
46 struct traits<Solve<Decomposition, RhsType> >
47 : traits<typename solve_traits<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>::PlainObject>
49 typedef typename solve_traits<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>::PlainObject PlainObject;
50 typedef typename promote_index_type<typename Decomposition::StorageIndex, typename RhsType::StorageIndex>::type StorageIndex;
51 typedef traits<PlainObject> BaseTraits;
54 CoeffReadCost = HugeCost
61 template<
typename Decomposition,
typename RhsType>
62 class Solve :
public SolveImpl<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>
65 typedef typename internal::traits<Solve>::PlainObject PlainObject;
66 typedef typename internal::traits<Solve>::StorageIndex StorageIndex;
68 Solve(
const Decomposition &dec,
const RhsType &rhs)
69 : m_dec(dec), m_rhs(rhs)
72 EIGEN_DEVICE_FUNC Index rows()
const {
return m_dec.cols(); }
73 EIGEN_DEVICE_FUNC Index cols()
const {
return m_rhs.cols(); }
75 EIGEN_DEVICE_FUNC
const Decomposition& dec()
const {
return m_dec; }
76 EIGEN_DEVICE_FUNC
const RhsType& rhs()
const {
return m_rhs; }
79 const Decomposition &m_dec;
85 template<
typename Decomposition,
typename RhsType>
86 class SolveImpl<Decomposition,RhsType,
Dense>
87 :
public MatrixBase<Solve<Decomposition,RhsType> >
94 EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
98 Scalar coeff(Index row, Index col) const;
99 Scalar coeff(Index i) const;
103 template<typename Decomposition, typename RhsType, typename StorageKind>
104 class SolveImpl : public
internal::generic_xpr_base<
Solve<Decomposition,RhsType>,
MatrixXpr, StorageKind>::type
107 typedef typename internal::generic_xpr_base<Solve<Decomposition,RhsType>, MatrixXpr, StorageKind>::type Base;
113 template<
typename Decomposition,
typename RhsType>
114 struct evaluator<Solve<Decomposition,RhsType> >
115 :
public evaluator<typename Solve<Decomposition,RhsType>::PlainObject>
117 typedef Solve<Decomposition,RhsType> SolveType;
118 typedef typename SolveType::PlainObject PlainObject;
119 typedef evaluator<PlainObject> Base;
123 EIGEN_DEVICE_FUNC
explicit evaluator(
const SolveType& solve)
124 : m_result(solve.rows(), solve.cols())
126 ::new (static_cast<Base*>(
this)) Base(m_result);
127 solve.dec()._solve_impl(solve.rhs(), m_result);
131 PlainObject m_result;
136 template<typename DstXprType, typename DecType, typename RhsType, typename Scalar>
137 struct Assignment<DstXprType, Solve<DecType,RhsType>,
internal::assign_op<Scalar>, Dense2Dense, Scalar>
139 typedef Solve<DecType,RhsType> SrcXprType;
140 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<Scalar> &)
143 src.dec()._solve_impl(src.rhs(), dst);
148 template<
typename DstXprType,
typename DecType,
typename RhsType,
typename Scalar>
149 struct Assignment<DstXprType, Solve<Transpose<const DecType>,RhsType>,
internal::assign_op<Scalar>, Dense2Dense, Scalar>
151 typedef Solve<Transpose<const DecType>,RhsType> SrcXprType;
152 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<Scalar> &)
154 src.dec().nestedExpression().template _solve_impl_transposed<false>(src.rhs(), dst);
159 template<
typename DstXprType,
typename DecType,
typename RhsType,
typename Scalar>
160 struct Assignment<DstXprType, Solve<CwiseUnaryOp<
internal::scalar_conjugate_op<typename DecType::Scalar>, const Transpose<const DecType> >,RhsType>, internal::assign_op<Scalar>, Dense2Dense, Scalar>
162 typedef Solve<CwiseUnaryOp<internal::scalar_conjugate_op<typename DecType::Scalar>,
const Transpose<const DecType> >,RhsType> SrcXprType;
163 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<Scalar> &)
165 src.dec().nestedExpression().nestedExpression().template _solve_impl_transposed<true>(src.rhs(), dst);
173 #endif // EIGEN_SOLVE_H
const unsigned int RowMajorBit
Definition: Constants.h:61
Definition: Constants.h:505
Definition: Eigen_Colamd.h:54
Definition: Constants.h:490
Pseudo expression representing a solving operation.
Definition: Solve.h:62
const unsigned int EvalBeforeNestingBit
Definition: Constants.h:65
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48