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 typename Decomposition::MatrixType MatrixType;
38 typedef Matrix<
typename RhsType::Scalar,
39 MatrixType::ColsAtCompileTime,
40 RhsType::ColsAtCompileTime,
41 RhsType::PlainObject::Options,
42 MatrixType::MaxColsAtCompileTime,
43 RhsType::MaxColsAtCompileTime> PlainObject;
46 template<
typename Decomposition,
typename RhsType>
47 struct traits<Solve<Decomposition, RhsType> >
48 : traits<typename solve_traits<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>::PlainObject>
50 typedef typename solve_traits<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>::PlainObject PlainObject;
51 typedef typename promote_index_type<typename Decomposition::StorageIndex, typename RhsType::StorageIndex>::type StorageIndex;
52 typedef traits<PlainObject> BaseTraits;
55 CoeffReadCost = Dynamic
62 template<
typename Decomposition,
typename RhsType>
63 class Solve :
public SolveImpl<Decomposition,RhsType,typename internal::traits<RhsType>::StorageKind>
66 typedef typename internal::traits<Solve>::PlainObject PlainObject;
67 typedef typename internal::traits<Solve>::StorageIndex StorageIndex;
69 Solve(
const Decomposition &dec,
const RhsType &rhs)
70 : m_dec(dec), m_rhs(rhs)
73 EIGEN_DEVICE_FUNC Index rows()
const {
return m_dec.cols(); }
74 EIGEN_DEVICE_FUNC Index cols()
const {
return m_rhs.cols(); }
76 EIGEN_DEVICE_FUNC
const Decomposition& dec()
const {
return m_dec; }
77 EIGEN_DEVICE_FUNC
const RhsType& rhs()
const {
return m_rhs; }
80 const Decomposition &m_dec;
86 template<
typename Decomposition,
typename RhsType>
87 class SolveImpl<Decomposition,RhsType,
Dense>
88 :
public MatrixBase<Solve<Decomposition,RhsType> >
95 EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
99 Scalar coeff(Index row, Index col) const;
100 Scalar coeff(Index i) const;
104 template<typename Decomposition, typename RhsType, typename StorageKind>
105 class SolveImpl : public
internal::generic_xpr_base<
Solve<Decomposition,RhsType>,
MatrixXpr, StorageKind>::type
108 typedef typename internal::generic_xpr_base<Solve<Decomposition,RhsType>, MatrixXpr, StorageKind>::type Base;
114 template<
typename Decomposition,
typename RhsType>
115 struct evaluator<Solve<Decomposition,RhsType> >
116 :
public evaluator<typename Solve<Decomposition,RhsType>::PlainObject>
118 typedef Solve<Decomposition,RhsType> SolveType;
119 typedef typename SolveType::PlainObject PlainObject;
120 typedef evaluator<PlainObject> Base;
122 EIGEN_DEVICE_FUNC
explicit evaluator(
const SolveType& solve)
123 : m_result(solve.rows(), solve.cols())
125 ::new (static_cast<Base*>(
this)) Base(m_result);
126 solve.dec()._solve_impl(solve.rhs(), m_result);
130 PlainObject m_result;
135 template<typename DstXprType, typename DecType, typename RhsType, typename Scalar>
136 struct Assignment<DstXprType, Solve<DecType,RhsType>,
internal::assign_op<Scalar>, Dense2Dense, Scalar>
138 typedef Solve<DecType,RhsType> SrcXprType;
139 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<Scalar> &)
142 src.dec()._solve_impl(src.rhs(), dst);
150 #endif // EIGEN_SOLVE_H
const unsigned int RowMajorBit
Definition: Constants.h:53
Definition: Constants.h:494
Definition: Eigen_Colamd.h:54
Definition: Constants.h:482
Pseudo expression representing a solving operation.
Definition: Solve.h:63
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48