-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampleDataSheet.cpp
60 lines (47 loc) · 924 Bytes
/
SampleDataSheet.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* This is a class used for in VisAtom, a visualiztion tool for
atomistic simulations.
AUTHOR: Qing HOU
INSTITUTION: Institute of Nuclear Science and Technology, Sichuan University
HISTROTY: First version: 1998
LAST MODIFICATION: 2013
*/
//#include <Glc.h>
#include <math.h>
#include <stdio.h>
#include "SampleDataSheet.h"
SampleDataSheet::SampleDataSheet()
{
m_nCol = m_nRow = 0;
m_Data = NULL;
return;
}
SampleDataSheet::SampleDataSheet(int ncol, int nrow)
{
m_nCol = ncol;
m_nRow = nrow;
if(m_nCol*m_nRow > 0)
{
int i;
m_Data = new double*[m_nCol];
for(i=0; i<m_nCol; i++) m_Data[i] = new double[m_nRow];
}
return;
}
SampleDataSheet::~SampleDataSheet()
{
if(m_Data)
{
int i;
for(i=0; i<m_nCol; i++)
{
if(m_Data[i])
{
delete(m_Data[i]);
m_Data[i] = NULL;
}
}
}
m_nCol=m_nRow=0;
m_Data=NULL;
return;
}