NAME
Matrix - KJB library matrix type
SYNOPSIS
#include "m/m_matrix.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
typedef struct Matrix
{
int num_rows;
int num_cols;
double **elements;
int max_num_elements;
int max_num_rows;
int max_num_cols;
}
Matrix;
PARAMETERS
-
int num_rows
-
Current number of rows from the callers point of view.
-
int num_cols
-
Current number of cols from the callers point of view.
-
double **elements
-
A pointer to row pointers.
-
int max_num_elements
-
Private: The number of elements that can be stored.
-
int max_num_rows
-
Private: The number of rows that we have pointers for.
-
int max_num_cols
-
Private: The current wrapping count.
DESCRIPTION
This type is the matrix type for the KJB library and is used by many
routines. It stores a matrix with num_rows rows and num_cols cols. If "mp"
is a pointer to the type Matrix, then mp->elements[ row ][ col ] accesses
the element (row, col), and mp->elements[ row ] accesses the row'th row.
Note that counting starts at 0. The elements of the matrix are doubles.
The matrix rows may or may not be stored consecutively in memory. Because of
this, and because some routines may (most don't) take advantage of knowlege
of the internal structure for performance, it is important NOT to swap rows
by swapping pointers -- the elements should be copied.
The sizes (num_rows and num_cols) must both be nonnegative.
Conventionally, num_rows and num_cols are both positive;
however, it is also acceptable to have num_rows and num_cols both zero.
Anything else (such as a mix of positive and zero sizes) is regarded as a
bug in the calling program -- set_bug(3) is called and (if it returns)
ERROR is returned.
WARNING
As described above, the user of this library must take care with
assumptions about the structure of the array embedded in the matrix type.
RELATED
get_target_matrix, free_matrix
matrices, data types
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Kobus Barnard
SEE ALSO
get_zero_matrix
,
create_identity_matrix