29 #ifndef SPARSELU_COPY_TO_UCOL_H
30 #define SPARSELU_COPY_TO_UCOL_H
49 template <
typename Scalar,
typename StorageIndex>
53 Index ksub, krep, ksupno;
55 Index jsupno = glu.supno(jcol);
58 Index k = nseg - 1, i;
59 StorageIndex nextu = glu.xusub(jcol);
60 Index kfnz, isub, segsize;
63 for (ksub = 0; ksub < nseg; ksub++)
65 krep = segrep(k); k--;
66 ksupno = glu.supno(krep);
67 if (jsupno != ksupno )
70 if (kfnz != emptyIdxLU)
72 fsupc = glu.xsup(ksupno);
73 isub = glu.xlsub(fsupc) + kfnz - fsupc;
74 segsize = krep - kfnz + 1;
75 new_next = nextu + segsize;
76 while (new_next > glu.nzumax)
78 mem = memXpand<ScalarVector>(glu.ucol, glu.nzumax, nextu, UCOL, glu.num_expansions);
80 mem = memXpand<IndexVector>(glu.usub, glu.nzumax, nextu, USUB, glu.num_expansions);
85 for (i = 0; i < segsize; i++)
87 irow = glu.lsub(isub);
88 glu.usub(nextu) = perm_r(irow);
89 glu.ucol(nextu) = dense(irow);
90 dense(irow) = Scalar(0.0);
100 glu.xusub(jcol + 1) = nextu;
107 #endif // SPARSELU_COPY_TO_UCOL_H