Eigen::internal::LU_kernel_bmod< SegSizeAtCompileTime > Struct Template Reference

#include <SparseLU_kernel_bmod.h>

Static Public Member Functions

template<typename BlockScalarVector , typename ScalarVector , typename IndexVector >
static EIGEN_DONT_INLINE void run (const Index segsize, BlockScalarVector &dense, ScalarVector &tempv, ScalarVector &lusup, Index &luptr, const Index lda, const Index nrow, IndexVector &lsub, const Index lptr, const Index no_zeros)
 Performs numeric block updates from a given supernode to a single column. More...
 

Member Function Documentation

◆ run()

template<int SegSizeAtCompileTime>
template<typename BlockScalarVector , typename ScalarVector , typename IndexVector >
EIGEN_DONT_INLINE void Eigen::internal::LU_kernel_bmod< SegSizeAtCompileTime >::run ( const Index  segsize,
BlockScalarVector &  dense,
ScalarVector &  tempv,
ScalarVector &  lusup,
Index luptr,
const Index  lda,
const Index  nrow,
IndexVector &  lsub,
const Index  lptr,
const Index  no_zeros 
)
static

Performs numeric block updates from a given supernode to a single column.

Parameters
segsizeSize of the segment (and blocks ) to use for updates
[in,out]densePacked values of the original matrix
tempvtemporary vector to use for updates
lusuparray containing the supernodes
ldaLeading dimension in the supernode
nrowNumber of rows in the rectangular part of the supernode
lsubcompressed row subscripts of supernodes
lptrpointer to the first column of the current supernode in lsub
no_zerosNumber of nonzeros elements before the diagonal part of the supernode
46  {
47  typedef typename ScalarVector::Scalar Scalar;
48  // First, copy U[*,j] segment from dense(*) to tempv(*)
49  // The result of triangular solve is in tempv[*];
50  // The result of matric-vector update is in dense[*]
51  Index isub = lptr + no_zeros;
52  Index i;
53  Index irow;
54  for (i = 0; i < ((SegSizeAtCompileTime == Dynamic) ? segsize : SegSizeAtCompileTime); i++) {
55  irow = lsub(isub);
56  tempv(i) = dense(irow);
57  ++isub;
58  }
59  // Dense triangular solve -- start effective triangle
60  luptr += lda * no_zeros + no_zeros;
61  // Form Eigen matrix and vector
62  Map<Matrix<Scalar, SegSizeAtCompileTime, SegSizeAtCompileTime, ColMajor>, 0, OuterStride<> > A(
63  &(lusup.data()[luptr]), segsize, segsize, OuterStride<>(lda));
64  Map<Matrix<Scalar, SegSizeAtCompileTime, 1> > u(tempv.data(), segsize);
65 
66  u = A.template triangularView<UnitLower>().solve(u);
67 
68  // Dense matrix-vector product y <-- B*x
69  luptr += segsize;
71  Index ldl = internal::first_multiple(nrow, PacketSize);
72  Map<Matrix<Scalar, Dynamic, SegSizeAtCompileTime, ColMajor>, 0, OuterStride<> > B(&(lusup.data()[luptr]), nrow,
73  segsize, OuterStride<>(lda));
74  Index aligned_offset = internal::first_default_aligned(tempv.data() + segsize, PacketSize);
75  Index aligned_with_B_offset = (PacketSize - internal::first_default_aligned(B.data(), PacketSize)) % PacketSize;
76  Map<Matrix<Scalar, Dynamic, 1>, 0, OuterStride<> > l(tempv.data() + segsize + aligned_offset + aligned_with_B_offset,
77  nrow, OuterStride<>(ldl));
78 
79  l.noalias() = B * u;
80 
81  // Scatter tempv[] into SPA dense[] as a temporary storage
82  isub = lptr + no_zeros;
83  for (i = 0; i < ((SegSizeAtCompileTime == Dynamic) ? segsize : SegSizeAtCompileTime); i++) {
84  irow = lsub(isub++);
85  dense(irow) = tempv(i);
86  }
87 
88  // Scatter l into SPA dense[]
89  for (i = 0; i < nrow; i++) {
90  irow = lsub(isub++);
91  dense(irow) -= l(i);
92  }
93 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
SCALAR Scalar
Definition: bench_gemm.cpp:45
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:48
Definition: matrices.h:74
const char const int const RealScalar const RealScalar const int * lda
Definition: level2_cplx_impl.h:20
Index first_multiple(Index size, Index base)
Definition: Memory.h:559
static Index first_default_aligned(const DenseBase< Derived > &m)
Definition: DenseCoeffsBase.h:539
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
@ size
Definition: GenericPacketMath.h:113

References Eigen::Dynamic, Eigen::internal::first_default_aligned(), Eigen::internal::first_multiple(), i, and lda.

Referenced by Eigen::internal::SparseLUImpl< MatrixType_::Scalar, MatrixType_::StorageIndex >::column_bmod(), and Eigen::internal::SparseLUImpl< Scalar, StorageIndex >::panel_bmod().


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