Eigen::internal::trsmKernelR< Scalar, Index, Mode, Conjugate, TriStorageOrder, OtherInnerStride, Specialized > Struct Template Reference

#include <TriangularSolverMatrix.h>

Static Public Member Functions

static void kernel (Index size, Index otherSize, const Scalar *_tri, Index triStride, Scalar *_other, Index otherIncr, Index otherStride)
 

Member Function Documentation

◆ kernel()

template<typename Scalar , typename Index , int Mode, bool Conjugate, int TriStorageOrder, int OtherInnerStride, bool Specialized>
EIGEN_STRONG_INLINE void Eigen::internal::trsmKernelR< Scalar, Index, Mode, Conjugate, TriStorageOrder, OtherInnerStride, Specialized >::kernel ( Index  size,
Index  otherSize,
const Scalar _tri,
Index  triStride,
Scalar _other,
Index  otherIncr,
Index  otherStride 
)
static
86  {
87  typedef typename NumTraits<Scalar>::Real RealScalar;
88  typedef blas_data_mapper<Scalar, Index, ColMajor, Unaligned, OtherInnerStride> LhsMapper;
89  typedef const_blas_data_mapper<Scalar, Index, TriStorageOrder> RhsMapper;
90  LhsMapper lhs(_other, otherStride, otherIncr);
91  RhsMapper rhs(_tri, triStride);
92 
93  enum { RhsStorageOrder = TriStorageOrder, IsLower = (Mode & Lower) == Lower };
94  conj_if<Conjugate> conj;
95 
96  for (Index k = 0; k < size; ++k) {
97  Index j = IsLower ? size - k - 1 : k;
98 
99  typename LhsMapper::LinearMapper r = lhs.getLinearMapper(0, j);
100  for (Index k3 = 0; k3 < k; ++k3) {
101  Scalar b = conj(rhs(IsLower ? j + 1 + k3 : k3, j));
102  typename LhsMapper::LinearMapper a = lhs.getLinearMapper(0, IsLower ? j + 1 + k3 : k3);
103  for (Index i = 0; i < otherSize; ++i) r(i) -= a(i) * b;
104  }
105  if ((Mode & UnitDiag) == 0) {
106  Scalar inv_rjj = RealScalar(1) / conj(rhs(j, j));
107  for (Index i = 0; i < otherSize; ++i) r(i) *= inv_rjj;
108  }
109  }
110 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
@ UnitDiag
Definition: Constants.h:215
@ Lower
Definition: Constants.h:211
const Scalar * a
Definition: level2_cplx_impl.h:32
char char char int int * k
Definition: level2_impl.h:374
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
Definition: AutoDiffScalar.h:482
r
Definition: UniformPSDSelfTest.py:20
T Real
Definition: NumTraits.h:183
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References a, b, Eigen::conj(), i, j, k, Eigen::Lower, UniformPSDSelfTest::r, size, and Eigen::UnitDiag.

Referenced by Eigen::internal::trsmKernelR< double, Index, Mode, false, TriStorageOrder, 1, true >::kernel(), and Eigen::internal::trsmKernelR< float, Index, Mode, false, TriStorageOrder, 1, true >::kernel().


The documentation for this struct was generated from the following files: