Int_matrix - Int_matrix type
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
typedef struct Int_matrix
Current number of rows from the callers point of view.
Current number of cols from the callers point of view.
Where the data is.
Private: The number of elements that can be stored.
Private: The number of rows that we have pointers for.
Private: The current wrapping count.
This type is the int_matrix type for the KJB library and is used by many
routines. It stores a int_matrix with num_rows rows and num_cols cols. If "mp"
is a pointer to the type Int_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 integer array 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. Even if
no routines make use of the internal structutre, swapping rows by swapping
pointers will make it so that the memory does not get free'd properly.
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.
As described above, the user of this library must take care with
assumptions about the structure of the array embedded in the int_matrix
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.