10#ifndef EIGEN_SPARSETRIANGULARSOLVER_H
11#define EIGEN_SPARSETRIANGULARSOLVER_H
17template<
typename Lhs,
typename Rhs,
int Mode,
18 int UpLo = (Mode &
Lower)
27template<
typename Lhs,
typename Rhs,
int Mode>
64template<
typename Lhs,
typename Rhs,
int Mode>
75 for(
Index i=lhs.rows()-1 ;
i>=0 ; --
i)
80 while(
it &&
it.index()<
i)
88 else if (
it &&
it.index() ==
i)
92 tmp -=
it.value() * other.coeff(
it.index(),
col);
103template<
typename Lhs,
typename Rhs,
int Mode>
120 while(
it &&
it.index()<
i)
127 if (
it &&
it.index()==
i)
130 other.coeffRef(
it.index(),
col) -=
tmp *
it.value();
138template<
typename Lhs,
typename Rhs,
int Mode>
149 for(
Index i=lhs.cols()-1;
i>=0; --
i)
158 while(
it &&
it.index()!=
i)
161 other.coeffRef(
i,
col) /=
it.value();
164 for(;
it &&
it.index()<
i; ++
it)
165 other.coeffRef(
it.index(),
col) -=
tmp *
it.value();
174#ifndef EIGEN_PARSED_BY_DOXYGEN
176template<
typename ExpressionType,
unsigned int Mode>
177template<
typename OtherDerived>
178void TriangularViewImpl<ExpressionType,Mode,Sparse>::solveInPlace(MatrixBase<OtherDerived>& other)
const
185 typedef typename internal::conditional<
copy,
187 OtherCopy otherCopy(other.derived());
189 internal::sparse_solve_triangular_selector<ExpressionType, typename internal::remove_reference<OtherCopy>::type, Mode>::run(derived().nestedExpression(), otherCopy);
200template<
typename Lhs,
typename Rhs,
int Mode,
201 int UpLo = (Mode &
Lower)
210template<
typename Lhs,
typename Rhs,
int Mode,
int UpLo>
218 const bool IsLower = (UpLo==
Lower);
222 Rhs res(other.rows(), other.cols());
223 res.reserve(other.nonZeros());
236 for(
Index i=IsLower?0:lhs.cols()-1;
237 IsLower?
i<lhs.cols():
i>=0;
245 typename Lhs::InnerIterator
it(lhs,
i);
254 ci /= lhs.coeff(
i,
i);
266 for(;
it &&
it.index()<
i; ++
it)
286 other =
res.markAsRValue();
292#ifndef EIGEN_PARSED_BY_DOXYGEN
293template<
typename ExpressionType,
unsigned int Mode>
294template<
typename OtherDerived>
295void TriangularViewImpl<ExpressionType,Mode,Sparse>::solveInPlace(SparseMatrixBase<OtherDerived>& other)
const
306 internal::sparse_solve_triangular_sparse_selector<ExpressionType, OtherDerived, Mode>::run(derived().nestedExpression(), other.derived());
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define eigen_assert(x)
Definition Macros.h:1037
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
SCALAR Scalar
Definition bench_gemm.cpp:46
Definition AmbiVector.h:285
@ UnitDiag
Definition Constants.h:213
@ ZeroDiag
Definition Constants.h:215
@ Lower
Definition Constants.h:209
@ Upper
Definition Constants.h:211
@ ColMajor
Definition Constants.h:319
const unsigned int RowMajorBit
Definition Constants.h:66
int EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition level1_impl.h:29
@ Lhs
Definition TensorContractionMapper.h:19
@ Rhs
Definition TensorContractionMapper.h:18
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
uint8_t count
Definition ref_serial.h:256
Definition CoreEvaluators.h:91
Matrix< typename traits< T >::Scalar, Rows, Cols,(MaxRows==1 &&MaxCols!=1) ? RowMajor :ColMajor, MaxRows, MaxCols > type
Definition XprHelper.h:391
evaluator< Lhs >::InnerIterator LhsIterator
Definition TriangularSolver.h:108
static void run(const Lhs &lhs, Rhs &other)
Definition TriangularSolver.h:109
evaluator< Lhs > LhsEval
Definition TriangularSolver.h:107
Rhs::Scalar Scalar
Definition TriangularSolver.h:106
Rhs::Scalar Scalar
Definition TriangularSolver.h:30
evaluator< Lhs > LhsEval
Definition TriangularSolver.h:31
static void run(const Lhs &lhs, Rhs &other)
Definition TriangularSolver.h:33
evaluator< Lhs >::InnerIterator LhsIterator
Definition TriangularSolver.h:32
Rhs::Scalar Scalar
Definition TriangularSolver.h:141
static void run(const Lhs &lhs, Rhs &other)
Definition TriangularSolver.h:144
evaluator< Lhs > LhsEval
Definition TriangularSolver.h:142
evaluator< Lhs >::InnerIterator LhsIterator
Definition TriangularSolver.h:143
evaluator< Lhs >::InnerIterator LhsIterator
Definition TriangularSolver.h:69
Rhs::Scalar Scalar
Definition TriangularSolver.h:67
evaluator< Lhs > LhsEval
Definition TriangularSolver.h:68
static void run(const Lhs &lhs, Rhs &other)
Definition TriangularSolver.h:70
Definition TriangularSolver.h:24
Rhs::Scalar Scalar
Definition TriangularSolver.h:213
promote_index_type< typenametraits< Lhs >::StorageIndex, typenametraits< Rhs >::StorageIndex >::type StorageIndex
Definition TriangularSolver.h:215
static void run(const Lhs &lhs, Rhs &other)
Definition TriangularSolver.h:216
Definition TriangularSolver.h:207
Definition ForwardDeclarations.h:17