Eigen::internal::trsmKernelL< 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::trsmKernelL< Scalar, Index, Mode, Conjugate, TriStorageOrder, OtherInnerStride, Specialized >::kernel ( Index  size,
Index  otherSize,
const Scalar _tri,
Index  triStride,
Scalar _other,
Index  otherIncr,
Index  otherStride 
)
static
44  {
45  typedef const_blas_data_mapper<Scalar, Index, TriStorageOrder> TriMapper;
46  typedef blas_data_mapper<Scalar, Index, ColMajor, Unaligned, OtherInnerStride> OtherMapper;
47  TriMapper tri(_tri, triStride);
48  OtherMapper other(_other, otherStride, otherIncr);
49 
50  enum { IsLower = (Mode & Lower) == Lower };
51  conj_if<Conjugate> conj;
52 
53  // tr solve
54  for (Index k = 0; k < size; ++k) {
55  // TODO write a small kernel handling this (can be shared with trsv)
56  Index i = IsLower ? k : -k - 1;
57  Index rs = size - k - 1; // remaining size
58  Index s = TriStorageOrder == RowMajor ? (IsLower ? 0 : i + 1) : IsLower ? i + 1 : i - rs;
59 
60  Scalar a = (Mode & UnitDiag) ? Scalar(1) : Scalar(Scalar(1) / conj(tri(i, i)));
61  for (Index j = 0; j < otherSize; ++j) {
62  if (TriStorageOrder == RowMajor) {
63  Scalar b(0);
64  const Scalar* l = &tri(i, s);
65  typename OtherMapper::LinearMapper r = other.getLinearMapper(s, j);
66  for (Index i3 = 0; i3 < k; ++i3) b += conj(l[i3]) * r(i3);
67 
68  other(i, j) = (other(i, j) - b) * a;
69  } else {
70  Scalar& otherij = other(i, j);
71  otherij *= a;
72  Scalar b = otherij;
73  typename OtherMapper::LinearMapper r = other.getLinearMapper(s, j);
74  typename TriMapper::LinearMapper l = tri.getLinearMapper(s, i);
75  for (Index i3 = 0; i3 < rs; ++i3) r(i3) -= b * conj(l(i3));
76  }
77  }
78  }
79 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Tridiagonalization< MatrixXf > tri
Definition: Tridiagonalization_compute.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
@ UnitDiag
Definition: Constants.h:215
@ Lower
Definition: Constants.h:211
@ RowMajor
Definition: Constants.h:320
RealScalar s
Definition: level1_cplx_impl.h:130
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
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

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

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


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