Registered Member
|
Hi,
I would like to construct a series of matrix which similar to each other. I tried to construct like below. However it cannot work. Would you pls help to give suggestion? Thank you.
|
Moderator
|
The ligne SpMat "C[n](Sum_nonzeros_C, Sum_nonzeros_C);" is not legal C++, better use a std::vector:
vector<SpMat> C(n, SpMat(Sum_nonzeros_C, Sum_nonzeros_C) ); Then, I guess the main loop should be: for(int i=0; i<n;i++) and you probably also need to clear CT at each iteration. It is also strange that the number of rows/columns are the same as the number of non-zeros. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]