sp_matrix.h File Reference
Go to the source code of this file.
Classes |
struct | BMAT |
struct | MATRIX |
struct | VECTOR |
Defines |
#define | DOF (3) |
#define | FIRST(b) ((b).mat[0]) |
#define | M_COMPAT_DIM(m, n) ((m).cols == (n).rows) |
#define | M_EQUAL_DIM(m, n) (((m).rows == (n).rows) && ((m).cols == (n).cols)) |
#define | M_SQUARE(m) ((m).rows == (m).cols) |
#define | MAX_COLS (7) |
#define | MAX_ROWS (7) |
#define | MCOLS(m) ((m).cols) |
#define | MDATA(m, i, j) ((m).data[i][j]) |
#define | MROWS(m) ((m).rows) |
#define | MV_COMPAT_DIM(m, v) ((m).cols == (v).elements) |
#define | RANGE(b) ((b).range) |
#define | SECOND(b) ((b).mat[1]) |
#define | SQUARE(x) ((x)*(x)) |
#define | THIRD(b) ((b).mat[2]) |
#define | V_EQUAL_DIM(v, w) (((v).elements == (w).elements)) |
#define | VDATA(v, i) ((v).data[i]) |
#define | VELEMENTS(v) ((v).elements) |
Functions |
MATRIX | create_matrix (int rows, int cols) |
VECTOR | create_vector (int elements) |
float | cross_product (MATRIX const *m, int f1, int c1, int f2, int c2) |
int | determinant (MATRIX const *m, float *result) |
void | diagonal_matrix (MATRIX *m, int dim, float el1, float el2, float el3) |
void | initialize_matrix (MATRIX *m, int rows, int cols) |
void | initialize_vector (VECTOR *v, int elements) |
int | inverse_matrix (MATRIX const *m, MATRIX *n) |
int | multiply_matrix_vector (MATRIX const *m, VECTOR const *v, VECTOR *r) |
void | print_matrix (char *message, MATRIX const *m) |
void | print_vector (char *message, VECTOR const *v) |
Define Documentation
#define FIRST |
( |
b |
|
) |
((b).mat[0]) |
#define M_COMPAT_DIM |
( |
m, |
|
|
n |
|
) |
((m).cols == (n).rows) |
#define M_EQUAL_DIM |
( |
m, |
|
|
n |
|
) |
(((m).rows == (n).rows) && ((m).cols == (n).cols)) |
#define M_SQUARE |
( |
m |
|
) |
((m).rows == (m).cols) |
#define MCOLS |
( |
m |
|
) |
((m).cols) |
#define MDATA |
( |
m, |
|
|
i, |
|
|
j |
|
) |
((m).data[i][j]) |
#define MROWS |
( |
m |
|
) |
((m).rows) |
#define MV_COMPAT_DIM |
( |
m, |
|
|
v |
|
) |
((m).cols == (v).elements) |
#define RANGE |
( |
b |
|
) |
((b).range) |
#define SECOND |
( |
b |
|
) |
((b).mat[1]) |
#define SQUARE |
( |
x |
|
) |
((x)*(x)) |
#define THIRD |
( |
b |
|
) |
((b).mat[2]) |
#define V_EQUAL_DIM |
( |
v, |
|
|
w |
|
) |
(((v).elements == (w).elements)) |
#define VDATA |
( |
v, |
|
|
i |
|
) |
((v).data[i]) |
#define VELEMENTS |
( |
v |
|
) |
((v).elements) |
Function Documentation
MATRIX create_matrix |
( |
int |
rows, |
|
|
int |
cols | |
|
) |
| | |
VECTOR create_vector |
( |
int |
elements |
) |
|
float cross_product |
( |
MATRIX const * |
m, |
|
|
int |
f1, |
|
|
int |
c1, |
|
|
int |
f2, |
|
|
int |
c2 | |
|
) |
| | |
int determinant |
( |
MATRIX const * |
m, |
|
|
float * |
result | |
|
) |
| | |
void diagonal_matrix |
( |
MATRIX * |
m, |
|
|
int |
dim, |
|
|
float |
el1, |
|
|
float |
el2, |
|
|
float |
el3 | |
|
) |
| | |
void initialize_matrix |
( |
MATRIX * |
m, |
|
|
int |
rows, |
|
|
int |
cols | |
|
) |
| | |
void initialize_vector |
( |
VECTOR * |
v, |
|
|
int |
elements | |
|
) |
| | |
void print_matrix |
( |
char * |
message, |
|
|
MATRIX const * |
m | |
|
) |
| | |
void print_vector |
( |
char * |
message, |
|
|
VECTOR const * |
v | |
|
) |
| | |