This commit is contained in:
Joachim Schoeberl 2014-04-28 07:14:13 +00:00
parent 9ab799afde
commit 0c78fe56a7

View File

@ -158,25 +158,29 @@ class MatrixFixWidth
protected: protected:
int height; int height;
double * data; double * data;
bool ownmem;
public: public:
/// ///
MatrixFixWidth () MatrixFixWidth ()
{ height = 0; data = 0; } { height = 0; data = 0; ownmem = false; }
/// ///
MatrixFixWidth (int h) MatrixFixWidth (int h)
{ height = h; data = new double[WIDTH*height]; } { height = h; data = new double[WIDTH*height]; ownmem = true; }
///
MatrixFixWidth (int h, double * adata)
{ height = h; data = adata; ownmem = false; }
/// ///
~MatrixFixWidth () ~MatrixFixWidth ()
{ delete [] data; } { if (ownmem) delete [] data; }
void SetSize (int h) void SetSize (int h)
{ {
if (h != height) if (h != height)
{ {
delete data; if (ownmem) delete data;
height = h; height = h;
data = new double[WIDTH*height]; data = new double[WIDTH*height];
ownmem = true;
} }
} }