Skip to content
Snippets Groups Projects
Commit c8fdec46 authored by Jesper Andersson's avatar Jesper Andersson
Browse files

Added Matthews changes from branch 1.21.2.1

parent 61dc4c18
No related branches found
No related tags found
No related merge requests found
......@@ -384,7 +384,7 @@ SpMat<T>::SpMat(const NEWMAT::GeneralMatrix& M)
// First find # of non-zeros elements in column
unsigned int cnz = 0;
for (unsigned int i=0; i<_m; i++) {
if (m[i*_n+c]) cnz++;
if (m[i+_m*c]) cnz++;
}
if (cnz) {
std::vector<unsigned int>& ri = _ri[c];
......@@ -392,7 +392,7 @@ SpMat<T>::SpMat(const NEWMAT::GeneralMatrix& M)
ri.resize(cnz);
val.resize(cnz);
for (unsigned int rii=0, i=0; i<_m; i++) {
if (double v = m[i*_n+c]) {
if (double v = m[i+_m*c]) {
ri[rii] = i;
val[rii] = v;
rii++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment