Hello,

I am trying to resize a sparse matrix, but it appears to eliminate non-zeros coefficients? See below code and output. Many thanks for the help!

Regards,

Colin

Code:

int nnz=44330306;

int[int] I(nnz),J(nnz);

complex[int] C(nnz);

{

ifstream fileI(dir+“Qu_Chol.txt”);

for(int i=0; i<nnz; i++) fileI >> I[i] >> J[i] >> C[i];

}

matrix QuChol=[I,J,C];

cout << "QuChol.n = " <<QuChol.n << endl;

cout << "QuChol.m = " <<QuChol.m << endl;

cout << "QuChol.nbcoef = " <<QuChol.nbcoef << endl;

QuChol.resize(191720,191720);

cout << "QuChol.n = " <<QuChol.n << endl;

cout << "QuChol.m = " <<QuChol.m << endl;

cout << "QuChol.nbcoef = " <<QuChol.nbcoef << endl;

Output:

– Raw Matrix nxm =170260x170260 nb none zero coef. 44330306

QuChol.n = 170260

QuChol.m = 170260

QuChol.nbcoef = 44330306

QuChol.n = 191720

QuChol.m = 191720

QuChol.nbcoef = 44150820