-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfloat2.h
62 lines (47 loc) · 843 Bytes
/
float2.h
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
55
56
57
58
59
60
61
62
#ifndef FLOAT2_H
#define FLOAT2_H
/*
Peter Latham
July, 1997
Creates an object of the form:
x[i][j] - floating point array.
m[i] - number of elements in x[i].
n - number of elements in x.
E.G., if
x[0] = 7 1.3 2
x[1] =
x[2] = 4.2 -19
x[3] = -3 -2 1.4 18.5
then
m[0] = 3
m[1] = 0
m[2] = 2
m[3] = 4
n = 4
*/
#include <fstream>
#include <cstdlib>
class float2
{
private:
public:
int n;
int* m;
double** x;
// overloaded constructor. commented out so that class float2.h can
// be included without worrying about float2.h, I think.
// float2();
// destructor
~float2()
{
/*
for some reason, code bombs when this line is included.
for (int i=0; i < n; i++) delete [] x[i];
*/
delete [] x;
delete [] m;
}
// initializer
void init_float2(int n, int* m, double** x);
};
#endif