10 #ifndef EIGEN_BAND_TRIANGULARSOLVER_H
11 #define EIGEN_BAND_TRIANGULARSOLVER_H
19 template <
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
int StorageOrder>
22 template <
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar>
26 enum { IsLower = (Mode &
Lower) ? 1 : 0 };
30 std::conditional_t<ConjLhs, const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,
LhsMap>,
34 for (
int col = 0;
col < other.cols(); ++
col) {
35 for (
int ii = 0; ii <
size; ++ii) {
36 int i = IsLower ? ii :
size - ii - 1;
38 int actual_start = IsLower ?
k - actual_k : 1;
41 other.coeffRef(
i,
col) -= cjLhs.row(
i)
42 .segment(actual_start, actual_k)
44 .cwiseProduct(other.col(
col).segment(IsLower ?
i - actual_k :
i + 1, actual_k))
47 if ((Mode &
UnitDiag) == 0) other.coeffRef(
i,
col) /= cjLhs(
i, IsLower ?
k : 0);
53 template <
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar>
57 enum { IsLower = (Mode &
Lower) ? 1 : 0 };
61 std::conditional_t<ConjLhs, const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,
LhsMap>,
65 for (
int col = 0;
col < other.cols(); ++
col) {
66 for (
int ii = 0; ii <
size; ++ii) {
67 int i = IsLower ? ii :
size - ii - 1;
69 int actual_start = IsLower ? 1 :
k - actual_k;
71 if ((Mode &
UnitDiag) == 0) other.coeffRef(
i,
col) /= cjLhs(IsLower ? 0 :
k,
i);
74 other.col(
col).segment(IsLower ?
i + 1 :
i - actual_k, actual_k) -=
75 other.coeff(
i,
col) * cjLhs.col(
i).segment(actual_start, actual_k);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:104
#define min(a, b)
Definition: datatypes.h:22
@ UnitDiag
Definition: Constants.h:215
@ Lower
Definition: Constants.h:211
@ ColMajor
Definition: Constants.h:318
@ RowMajor
Definition: Constants.h:320
char char char int int * k
Definition: level2_impl.h:374
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Definition: Eigen_Colamd.h:49
static void run(Index size, Index k, const LhsScalar *_lhs, Index lhsStride, RhsScalar *_other)
Definition: BandTriangularSolver.h:58
Map< Matrix< RhsScalar, Dynamic, 1 > > RhsMap
Definition: BandTriangularSolver.h:56
Map< const Matrix< LhsScalar, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > LhsMap
Definition: BandTriangularSolver.h:55
Map< const Matrix< LhsScalar, Dynamic, Dynamic, RowMajor >, 0, OuterStride<> > LhsMap
Definition: BandTriangularSolver.h:24
Map< Matrix< RhsScalar, Dynamic, 1 > > RhsMap
Definition: BandTriangularSolver.h:25
static void run(Index size, Index k, const LhsScalar *_lhs, Index lhsStride, RhsScalar *_other)
Definition: BandTriangularSolver.h:27
Definition: BandTriangularSolver.h:20