MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / column_bmod

Method column_bmod

include/Eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h:55–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 */
54template <typename Scalar, typename StorageIndex>
55Index SparseLUImpl<Scalar,StorageIndex>::column_bmod(const Index jcol, const Index nseg, BlockScalarVector dense, ScalarVector& tempv,
56 BlockIndexVector segrep, BlockIndexVector repfnz, Index fpanelc, GlobalLU_t& glu)
57{
58 Index jsupno, k, ksub, krep, ksupno;
59 Index lptr, nrow, isub, irow, nextlu, new_next, ufirst;
60 Index fsupc, nsupc, nsupr, luptr, kfnz, no_zeros;
61 /* krep = representative of current k-th supernode
62 * fsupc = first supernodal column
63 * nsupc = number of columns in a supernode
64 * nsupr = number of rows in a supernode
65 * luptr = location of supernodal LU-block in storage
66 * kfnz = first nonz in the k-th supernodal segment
67 * no_zeros = no lf leading zeros in a supernodal U-segment
68 */
69
70 jsupno = glu.supno(jcol);
71 // For each nonzero supernode segment of U[*,j] in topological order
72 k = nseg - 1;
73 Index d_fsupc; // distance between the first column of the current panel and the
74 // first column of the current snode
75 Index fst_col; // First column within small LU update
76 Index segsize;
77 for (ksub = 0; ksub < nseg; ksub++)
78 {
79 krep = segrep(k); k--;
80 ksupno = glu.supno(krep);
81 if (jsupno != ksupno )
82 {
83 // outside the rectangular supernode
84 fsupc = glu.xsup(ksupno);
85 fst_col = (std::max)(fsupc, fpanelc);
86
87 // Distance from the current supernode to the current panel;
88 // d_fsupc = 0 if fsupc > fpanelc
89 d_fsupc = fst_col - fsupc;
90
91 luptr = glu.xlusup(fst_col) + d_fsupc;
92 lptr = glu.xlsub(fsupc) + d_fsupc;
93
94 kfnz = repfnz(krep);
95 kfnz = (std::max)(kfnz, fpanelc);
96
97 segsize = krep - kfnz + 1;
98 nsupc = krep - fst_col + 1;
99 nsupr = glu.xlsub(fsupc+1) - glu.xlsub(fsupc);
100 nrow = nsupr - d_fsupc - nsupc;
101 Index lda = glu.xlusup(fst_col+1) - glu.xlusup(fst_col);
102
103
104 // Perform a triangular solver and block update,
105 // then scatter the result of sup-col update to dense
106 no_zeros = kfnz - fst_col;
107 if(segsize==1)
108 LU_kernel_bmod<1>::run(segsize, dense, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
109 else
110 LU_kernel_bmod<Dynamic>::run(segsize, dense, tempv, glu.lusup, luptr, lda, nrow, glu.lsub, lptr, no_zeros);
111 } // end if jsupno
112 } // end for each segment

Callers

nothing calls this directly

Calls 5

runFunction · 0.85
noaliasMethod · 0.80
setZeroMethod · 0.45
dataMethod · 0.45
solveMethod · 0.45

Tested by

no test coverage detected