mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
matrix
This commit is contained in:
parent
9ab799afde
commit
0c78fe56a7
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user