forked from skutsaev/hellweg2d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.h
More file actions
58 lines (47 loc) · 1.16 KB
/
Matrix.h
File metadata and controls
58 lines (47 loc) · 1.16 KB
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
//---------------------------------------------------------------------------
#ifndef MatrixH
#define MatrixH
#include "Types.h"
namespace HellwegMatrix{
//---------------------------------------------------------------------------
class TMatrix
{
private:
FILE *logfile;
int N;
int M;
int K;
int *Piv;
double **A;
double **X;//LU
double **CreateArray(int N0=0,int M0=0);
void ChangeDim(int N0,int M0);
void DeleteArray(double **B,int N0=0,int M0=0);
double **CloneArray(double **B);
void CopyArray(double **B,double **C);
void Decomposite_LU();
void Inverse_LU();
void InverseUpper();
void InverseLower();
public:
__fastcall TMatrix(int N0,int M0);
__fastcall ~TMatrix();
void Dim(int *N0,int *M0);
void SetElement(int I,int J,double x);
double GetElement(int I,int J);
void SetPivot(int I,double x);
double GetPivot(int I);
TMatrix operator+(TMatrix& B);
TMatrix operator*(TMatrix& B);
TMatrix &operator=(TMatrix& B);
TMatrix &operator*=(TMatrix& B);
void Transpose();
void Inverse();
bool IsSquare();
bool IsDiagonal();
void Ones();
void Zeros();
};
};
//---------------------------------------------------------------------------
#endif