00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __SPARSE_MATRIX_H__
00021 #define __SPARSE_MATRIX_H__
00022
00023 #ifdef __cplusplus
00024 extern "C"{
00025 #endif
00026
00027 #include "types.h"
00028 #include "cell.h"
00029 #include "linked_list.h"
00030
00040 struct SSparseMatrix
00041 {
00042 pSLinkedList m_pRowsList;
00043 pSLinkedList m_pColumnsList;
00044 unsigned int m_NbRows;
00045 unsigned int m_NbColumns;
00046 };
00047
00048 typedef struct SSparseMatrix * pSSparseMatrix;
00049
00050
00058 pSSparseMatrix Lidy_CreateSparseMatrix( unsigned int NbRows, unsigned int NbColumns );
00059
00060
00067 unsigned int Lidy_GetCurrentNbRows( pSSparseMatrix SparseMatrix );
00068
00069
00076 unsigned int Lidy_GetCurrentNbColumns( pSSparseMatrix SparseMatrix );
00077
00078
00089 void Lidy_SetValue( pSSparseMatrix SparseMatrix, Real Value, unsigned int RowIndex, unsigned int ColumnIndex );
00090
00099 pSCell Lidy_GetCell( pSSparseMatrix SparseMatrix, unsigned int RowIndex, unsigned int ColumnIndex );
00100
00101
00110 Bool Lidy_DeleteCellInSparseMatrix( pSSparseMatrix SparseMatrix, unsigned int RowIndex, unsigned int ColumnIndex );
00111
00112
00119 void Lidy_DisplaySparseMatrix( pSSparseMatrix SparseMatrix );
00120
00121
00129 pSSparseMatrix Lidy_MultiplySparseMatrices( pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2 );
00130
00131
00139 pSSparseMatrix Lidy_MultiplySparseMatrixByScalar( pSSparseMatrix SparseMatrix, Real Value );
00140
00141
00149 pSSparseMatrix Lidy_DivideSparseMatrixByScalar( pSSparseMatrix SparseMatrix, Real Value );
00150
00151
00159 pSSparseMatrix Lidy_AddSparseMatrices( pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2 );
00160
00161
00169 pSSparseMatrix Lidy_SubstractSparseMatrices( pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2 );
00170
00171
00178 pSSparseMatrix Lidy_TransposeSparseMatrix( pSSparseMatrix SparseMatrix );
00179
00180
00188 pSSparseMatrix Lidy_PowerSparseMatrix( pSSparseMatrix SparseMatrix, unsigned int N );
00189
00190
00197 pSSparseMatrix Lidy_LoadSparseMatrixFromXMLFile( const char * Filename );
00198
00199
00207 pSSparseMatrix Lidy_LoadSparseMatrix( const char * Filename );
00208
00209
00217 Bool Lidy_SaveSparseMatrixInXMLFile( pSSparseMatrix SparseMatrix, const char * Filename );
00218
00219
00228 Bool Lidy_SaveSparseMatrix( pSSparseMatrix SparseMatrix, const char * Filename );
00229
00230
00237 void Lidy_ClearSparseMatrix( pSSparseMatrix SparseMatrix );
00238
00239
00246 void Lidy_DeleteSparseMatrix( pSSparseMatrix SparseMatrix );
00247
00248 #ifdef __cplusplus
00249 }
00250 #endif
00251
00252 #endif //__SPARSE_MATRIX_H__