10 #ifndef EIGEN_SOLVEWITHGUESS_H
11 #define EIGEN_SOLVEWITHGUESS_H
17 template<
typename Decomposition,
typename RhsType,
typename GuessType>
class SolveWithGuess;
34 template<
typename Decomposition,
typename RhsType,
typename GuessType>
35 struct traits<SolveWithGuess<Decomposition, RhsType, GuessType> >
36 : traits<Solve<Decomposition,RhsType> >
42 template<
typename Decomposition,
typename RhsType,
typename GuessType>
43 class SolveWithGuess :
public internal::generic_xpr_base<SolveWithGuess<Decomposition,RhsType,GuessType>, MatrixXpr, typename internal::traits<RhsType>::StorageKind>::type
46 typedef typename internal::traits<SolveWithGuess>::Scalar
Scalar;
47 typedef typename internal::traits<SolveWithGuess>::PlainObject
PlainObject;
48 typedef typename internal::generic_xpr_base<SolveWithGuess<Decomposition,RhsType,GuessType>,
MatrixXpr,
typename internal::traits<RhsType>::StorageKind>::type
Base;
49 typedef typename internal::ref_selector<SolveWithGuess>::type
Nested;
77 template<
typename Decomposition,
typename RhsType,
typename GuessType>
78 struct evaluator<
SolveWithGuess<Decomposition,RhsType, GuessType> >
79 :
public evaluator<typename SolveWithGuess<Decomposition,RhsType,GuessType>::PlainObject>
82 typedef typename SolveType::PlainObject PlainObject;
83 typedef evaluator<PlainObject> Base;
85 evaluator(
const SolveType& solve)
86 : m_result(solve.
rows(), solve.
cols())
88 internal::construct_at<Base>(
this, m_result);
89 m_result = solve.guess();
90 solve.dec()._solve_with_guess_impl(solve.rhs(), m_result);
99 template<
typename DstXprType,
typename DecType,
typename RhsType,
typename GuessType,
typename Scalar>
100 struct Assignment<DstXprType, SolveWithGuess<DecType,RhsType,GuessType>,
internal::assign_op<Scalar,Scalar>, Dense2Dense>
102 typedef SolveWithGuess<DecType,RhsType,GuessType> SrcXprType;
103 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<Scalar,Scalar> &)
105 Index dstRows = src.rows();
106 Index dstCols = src.cols();
107 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
108 dst.resize(dstRows, dstCols);
111 src.dec()._solve_with_guess_impl(src.rhs(), dst);
RowXpr row(Index i)
This is the const version of row(). */.
ColXpr col(Index i)
This is the const version of col().
#define EIGEN_DEVICE_FUNC
Pseudo expression representing a solving operation.
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
internal::traits< SolveWithGuess >::PlainObject PlainObject
const GuessType & m_guess
Scalar coeff(Index i) const
const GuessType & guess() const
const RhsType & rhs() const
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Scalar coeff(Index row, Index col) const
const Decomposition & dec() const
internal::generic_xpr_base< SolveWithGuess< Decomposition, RhsType, GuessType >, MatrixXpr, typename internal::traits< RhsType >::StorageKind >::type Base
internal::traits< SolveWithGuess >::Scalar Scalar
const Decomposition & m_dec
internal::ref_selector< SolveWithGuess >::type Nested
SolveWithGuess(const Decomposition &dec, const RhsType &rhs, const GuessType &guess)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.