MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / run

Method run

include/Eigen/src/SparseLU/SparseLU_kernel_bmod.h:43–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41template <int SegSizeAtCompileTime>
42template <typename BlockScalarVector, typename ScalarVector, typename IndexVector>
43EIGEN_DONT_INLINE void LU_kernel_bmod<SegSizeAtCompileTime>::run(const Index segsize, BlockScalarVector& dense,
44 ScalarVector& tempv, ScalarVector& lusup, Index& luptr,
45 const Index lda, const Index nrow, IndexVector& lsub,
46 const Index lptr, const Index no_zeros) {
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;
70 const Index PacketSize = internal::packet_traits<Scalar>::size;
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}
94
95template <>
96struct LU_kernel_bmod<1> {

Callers

nothing calls this directly

Calls 5

first_default_alignedFunction · 0.85
dataMethod · 0.45
solveMethod · 0.45
noaliasMethod · 0.45
coeffMethod · 0.45

Tested by

no test coverage detected