MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / run

Method run

Externals/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h:40–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38template <int SegSizeAtCompileTime>
39template <typename BlockScalarVector, typename ScalarVector, typename IndexVector, typename Index>
40EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const int segsize, BlockScalarVector& dense, ScalarVector& tempv, ScalarVector& lusup, Index& luptr, const Index lda,
41 const Index nrow, IndexVector& lsub, const Index lptr, const Index no_zeros)
42{
43 typedef typename ScalarVector::Scalar Scalar;
44 // First, copy U[*,j] segment from dense(*) to tempv(*)
45 // The result of triangular solve is in tempv[*];
46 // The result of matric-vector update is in dense[*]
47 Index isub = lptr + no_zeros;
48 int i;
49 Index irow;
50 for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
51 {
52 irow = lsub(isub);
53 tempv(i) = dense(irow);
54 ++isub;
55 }
56 // Dense triangular solve -- start effective triangle
57 luptr += lda * no_zeros + no_zeros;
58 // Form Eigen matrix and vector
59 Map<Matrix<Scalar,SegSizeAtCompileTime,SegSizeAtCompileTime>, 0, OuterStride<> > A( &(lusup.data()[luptr]), segsize, segsize, OuterStride<>(lda) );
60 Map<Matrix<Scalar,SegSizeAtCompileTime,1> > u(tempv.data(), segsize);
61
62 u = A.template triangularView<UnitLower>().solve(u);
63
64 // Dense matrix-vector product y <-- B*x
65 luptr += segsize;
66 const Index PacketSize = internal::packet_traits<Scalar>::size;
67 Index ldl = internal::first_multiple(nrow, PacketSize);
68 Map<Matrix<Scalar,Dynamic,SegSizeAtCompileTime>, 0, OuterStride<> > B( &(lusup.data()[luptr]), nrow, segsize, OuterStride<>(lda) );
69 Index aligned_offset = internal::first_aligned(tempv.data()+segsize, PacketSize);
70 Index aligned_with_B_offset = (PacketSize-internal::first_aligned(B.data(), PacketSize))%PacketSize;
71 Map<Matrix<Scalar,Dynamic,1>, 0, OuterStride<> > l(tempv.data()+segsize+aligned_offset+aligned_with_B_offset, nrow, OuterStride<>(ldl) );
72
73 l.setZero();
74 internal::sparselu_gemm<Scalar>(l.rows(), l.cols(), B.cols(), B.data(), B.outerStride(), u.data(), u.outerStride(), l.data(), l.outerStride());
75
76 // Scatter tempv[] into SPA dense[] as a temporary storage
77 isub = lptr + no_zeros;
78 for (i = 0; i < ((SegSizeAtCompileTime==Dynamic)?segsize:SegSizeAtCompileTime); i++)
79 {
80 irow = lsub(isub++);
81 dense(irow) = tempv(i);
82 }
83
84 // Scatter l into SPA dense[]
85 for (i = 0; i < nrow; i++)
86 {
87 irow = lsub(isub++);
88 dense(irow) -= l(i);
89 }
90}
91
92template <> struct LU_kernel_bmod<1>
93{

Callers

nothing calls this directly

Calls 10

first_multipleFunction · 0.85
coeffRefMethod · 0.80
first_alignedFunction · 0.50
dataMethod · 0.45
solveMethod · 0.45
setZeroMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
outerStrideMethod · 0.45
coeffMethod · 0.45

Tested by

no test coverage detected