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

Method countnz

include/Eigen/Eigen/src/SparseLU/SparseLU_Utils.h:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 */
22template <typename Scalar, typename StorageIndex>
23void SparseLUImpl<Scalar,StorageIndex>::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu)
24{
25 nnzL = 0;
26 nnzU = (glu.xusub)(n);
27 Index nsuper = (glu.supno)(n);
28 Index jlen;
29 Index i, j, fsupc;
30 if (n <= 0 ) return;
31 // For each supernode
32 for (i = 0; i <= nsuper; i++)
33 {
34 fsupc = glu.xsup(i);
35 jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc);
36
37 for (j = fsupc; j < glu.xsup(i+1); j++)
38 {
39 nnzL += jlen;
40 nnzU += j - fsupc + 1;
41 jlen--;
42 }
43 }
44}
45
46/**
47 * \brief Fix up the data storage lsub for L-subscripts.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected