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 DOF (3) |
Definition at line 32 of file sp_matrix.h.
#define FIRST | ( | b | ) | ((b).mat[0]) |
Definition at line 52 of file sp_matrix.h.
#define M_COMPAT_DIM | ( | m, | |
n | |||
) | ((m).cols == (n).rows) |
Definition at line 47 of file sp_matrix.h.
#define M_EQUAL_DIM | ( | m, | |
n | |||
) | (((m).rows == (n).rows) && ((m).cols == (n).cols)) |
Definition at line 48 of file sp_matrix.h.
#define MAX_COLS (7) |
Definition at line 19 of file sp_matrix.h.
#define MAX_ROWS (7) |
Definition at line 18 of file sp_matrix.h.
Definition at line 40 of file sp_matrix.h.
Definition at line 41 of file sp_matrix.h.
Definition at line 39 of file sp_matrix.h.
#define MV_COMPAT_DIM | ( | m, | |
v | |||
) | ((m).cols == (v).elements) |
Definition at line 50 of file sp_matrix.h.
#define RANGE | ( | b | ) | ((b).range) |
Definition at line 55 of file sp_matrix.h.
#define SECOND | ( | b | ) | ((b).mat[1]) |
Definition at line 53 of file sp_matrix.h.
#define SQUARE | ( | x | ) | ((x)*(x)) |
Definition at line 57 of file sp_matrix.h.
#define THIRD | ( | b | ) | ((b).mat[2]) |
Definition at line 54 of file sp_matrix.h.
#define V_EQUAL_DIM | ( | v, | |
w | |||
) | (((v).elements == (w).elements)) |
Definition at line 49 of file sp_matrix.h.
#define VDATA | ( | v, | |
i | |||
) | ((v).data[i]) |
Definition at line 44 of file sp_matrix.h.
#define VELEMENTS | ( | v | ) | ((v).elements) |
Definition at line 43 of file sp_matrix.h.
MATRIX create_matrix | ( | int | rows, |
int | cols | ||
) |
Definition at line 5 of file sp_matrix.c.
VECTOR create_vector | ( | int | elements | ) |
Definition at line 71 of file sp_matrix.c.
float cross_product | ( | MATRIX const * | m, |
int | f1, | ||
int | c1, | ||
int | f2, | ||
int | c2 | ||
) |
Definition at line 129 of file sp_matrix.c.
int determinant | ( | MATRIX const * | m, |
float * | result | ||
) |
Definition at line 138 of file sp_matrix.c.
void diagonal_matrix | ( | MATRIX * | m, |
int | dim, | ||
float | el1, | ||
float | el2, | ||
float | el3 | ||
) |
void initialize_matrix | ( | MATRIX * | m, |
int | rows, | ||
int | cols | ||
) |
Definition at line 28 of file sp_matrix.c.
void initialize_vector | ( | VECTOR * | v, |
int | elements | ||
) |
Definition at line 92 of file sp_matrix.c.
int inverse_matrix | ( | MATRIX const * | m, |
MATRIX * | n | ||
) |
Definition at line 166 of file sp_matrix.c.
int multiply_matrix_vector | ( | MATRIX const * | m, |
VECTOR const * | v, | ||
VECTOR * | r | ||
) |
Definition at line 223 of file sp_matrix.c.
void print_matrix | ( | char * | message, |
MATRIX const * | m | ||
) |
Definition at line 49 of file sp_matrix.c.
void print_vector | ( | char * | message, |
VECTOR const * | v | ||
) |
Definition at line 109 of file sp_matrix.c.