Skip to content
Snippets Groups Projects
Commit c313cbbd authored by Amaury Johnen's avatar Amaury Johnen
Browse files

fix bug

parent fed83644
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,6 @@ class fullVector ...@@ -80,7 +80,6 @@ class fullVector
_r = r; _r = r;
_data = original._data + r_start; _data = original._data + r_start;
} }
#ifndef SWIG // NO FRIEND CLASS SUPPORT FOR SWIG !! FIX IT
void setAsProxy(const fullMatrix<scalar> &original, int c) void setAsProxy(const fullMatrix<scalar> &original, int c)
{ {
if(_own_data && _data) delete [] _data; if(_own_data && _data) delete [] _data;
...@@ -88,7 +87,6 @@ class fullVector ...@@ -88,7 +87,6 @@ class fullVector
_r = original._r; _r = original._r;
_data = original._data + c * _r; _data = original._data + c * _r;
} }
#endif // SWIG
inline void scale(const scalar s) inline void scale(const scalar s)
{ {
if(s == 0.) if(s == 0.)
...@@ -152,6 +150,7 @@ class fullMatrix ...@@ -152,6 +150,7 @@ class fullMatrix
bool _own_data; // should data be freed on delete ? bool _own_data; // should data be freed on delete ?
int _r, _c; // size of the matrix int _r, _c; // size of the matrix
scalar *_data; // pointer on the first element scalar *_data; // pointer on the first element
friend class fullVector<scalar>;
public: public:
// constructor and destructor // constructor and destructor
...@@ -219,7 +218,7 @@ class fullMatrix ...@@ -219,7 +218,7 @@ class fullMatrix
scalar n = 0.; scalar n = 0.;
for(int i = 0; i < _r; ++i) for(int i = 0; i < _r; ++i)
for(int j = 0; j < _c; ++j) for(int j = 0; j < _c; ++j)
n += (*this)(i, j) * (*this)(i, j); n += (*this)(i, j) * (*this)(i, j);
return sqrt(n); return sqrt(n);
} }
bool resize(int r, int c, bool resetValue = true) // data will be owned (same as constructor) bool resize(int r, int c, bool resetValue = true) // data will be owned (same as constructor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment