00001 #ifndef GA_MATRIX
00002 #define GA_MATRIX
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00040 #include "GA_vector.h"
00041
00042 #ifdef __cplusplus
00043 extern "C"
00044 {
00045 #endif
00046
00067 struct GAMatrixInt_Impl
00068 {
00071 int** elts;
00074 int rows;
00077 int cols;
00080 int refs;
00081 };
00082
00085 typedef struct GAMatrixInt_Impl GAMatrixInt;
00086
00100 GAMatrixInt* GA_matrix_create_int(int rows, int cols);
00101
00114 GAMatrixInt* GA_matrix_create_square_int(int size);
00115
00127 GAMatrixInt* GA_matrix_ref_int(GAMatrixInt* matrix);
00128
00137 void GA_matrix_destroy_int(GAMatrixInt* matrix);
00138
00150 int* GA_matrix_get_elt_int(GAMatrixInt* matrix, int row, int col);
00151
00162 GAMatrixInt* GA_matrix_init_from_array_int(GAMatrixInt* matrix, int* source,
00163 int srcSize);
00164
00177 GAMatrixInt* GA_matrix_create_from_array_int(int* source, int rows, int cols);
00178
00187 GAMatrixInt* GA_matrix_init_zero_int(GAMatrixInt* matrix);
00188
00198 GAMatrixInt* GA_matrix_init_unit_int(GAMatrixInt* matrix);
00199
00208 GAMatrixInt* GA_matrix_print_int(GAMatrixInt* matrix);
00209
00230 struct GAMatrixReal_Impl
00231 {
00234 double** elts;
00237 int rows;
00240 int cols;
00243 int refs;
00244 };
00245
00248 typedef struct GAMatrixReal_Impl GAMatrixReal;
00249
00263 GAMatrixReal* GA_matrix_create_real(int rows, int cols);
00264
00277 GAMatrixReal* GA_matrix_create_square_real(int size);
00278
00290 GAMatrixReal* GA_matrix_ref_real(GAMatrixReal* matrix);
00291
00300 void GA_matrix_destroy_real(GAMatrixReal* matrix);
00301
00313 double* GA_matrix_get_elt_real(GAMatrixReal* matrix, int row, int col);
00314
00325 GAMatrixReal* GA_matrix_init_from_array_real(GAMatrixReal* matrix,
00326 double* source, int srcSize);
00327
00340 GAMatrixReal* GA_matrix_create_from_array_real(double* source, int rows,
00341 int cols);
00342
00351 GAMatrixReal* GA_matrix_init_zero_real(GAMatrixReal* matrix);
00352
00362 GAMatrixReal* GA_matrix_init_unit_real(GAMatrixReal* matrix);
00363
00379 GAMatrixInt* GA_matrix_to_bin_real(GAMatrixReal* matrix, GAVectorReal* lookup,
00380 GAClampMode clamp);
00381
00390 GAMatrixReal* GA_matrix_print_real(GAMatrixReal* matrix);
00391
00392 #ifdef __cplusplus
00393 }
00394 #endif
00395 #endif