Skip to content
Snippets Groups Projects
Commit c912f78e authored by Tuomas Karna's avatar Tuomas Karna
Browse files

fullMatrix::resize also uses setAll(0.) instead of scale(0.)

parent 15bd96b9
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ class fullVector ...@@ -63,7 +63,7 @@ class fullVector
{ {
return _data[i]; return _data[i];
} }
inline scalar norm() inline scalar norm() const
{ {
scalar n = 0.; scalar n = 0.;
for(int i = 0; i < _r; ++i) n += _data[i] * _data[i]; for(int i = 0; i < _r; ++i) n += _data[i] * _data[i];
...@@ -142,7 +142,7 @@ class fullMatrix ...@@ -142,7 +142,7 @@ class fullMatrix
#endif #endif
(*this)(r, c) = v; (*this)(r, c) = v;
} }
inline scalar norm() inline scalar norm() const
{ {
scalar n = 0.; scalar n = 0.;
for(int i = 0; i < _r; ++i) for(int i = 0; i < _r; ++i)
...@@ -192,7 +192,7 @@ class fullMatrix ...@@ -192,7 +192,7 @@ class fullMatrix
_data = new scalar[_r * _c]; _data = new scalar[_r * _c];
_own_data = true; _own_data = true;
if(resetValue) if(resetValue)
scale(0.); setAll(0.);
return true; return true;
} }
else{ else{
...@@ -200,7 +200,7 @@ class fullMatrix ...@@ -200,7 +200,7 @@ class fullMatrix
_c = c; _c = c;
} }
if(resetValue) if(resetValue)
scale(0.); setAll(0.);
return false; // no reallocation return false; // no reallocation
} }
void setAsProxy(const fullMatrix<scalar> &original) void setAsProxy(const fullMatrix<scalar> &original)
......
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