| 21 | */ |
| 22 | template <typename Scalar, typename StorageIndex> |
| 23 | void 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. |
nothing calls this directly
no outgoing calls
no test coverage detected