-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMatrix.h
executable file
·48 lines (35 loc) · 1.02 KB
/
Matrix.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
#ifndef _matrix_h_
#define _matrix_h_
typedef struct {
int lb1,
ub1,
lb2,
ub2;
char *mat_sto;
double **el;
} dmat;
void print_mat (dmat mat);
dmat newdmat (int rs,int re,int cs,int ce,int * error);
int matmul (dmat a,dmat b,dmat c);
/*
Copy dynamic Iliffe matrix A into RSLT.
Bounds need not be the same but the dimensions must be.
*/
int matcopy (dmat A, dmat RSLT);
/*
Generate the transpose of a dynamic Iliffe matrix.
*/
int transpose (dmat A, dmat ATrans);
/*
In-place Iliffe matrix inversion using full pivoting.
The standard Gauss-Jordan method is used.
The return value is the determinant.
*/
double matinvert (dmat a);
/*
Solve the overconstrained linear system Ma = b using a least
squares error (pseudo inverse) approach.
*/
int solve_system (dmat M, dmat a,dmat b);
#define freemat(m) free((m).mat_sto) ; free((m).el)
#endif