sparse_matrix.h File Reference

#include "types.h"
#include "cell.h"
#include "linked_list.h"

Include dependency graph for sparse_matrix.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SSparseMatrix
 The SSparseMatrix structure handle sparse matrices. More...

Typedefs

typedef struct SSparseMatrixpSSparseMatrix

Functions

pSSparseMatrix Lidy_CreateSparseMatrix (unsigned int NbRows, unsigned int NbColumns)
 Create and allocate a new sparse matrix.
unsigned int Lidy_GetCurrentNbRows (pSSparseMatrix SparseMatrix)
 Get the current number of rows in the sparse matrix (often different from the real number of rows).
unsigned int Lidy_GetCurrentNbColumns (pSSparseMatrix SparseMatrix)
 Get the current number of columns in the sparse matrix (often different from the real number of columns).
void Lidy_SetValue (pSSparseMatrix SparseMatrix, Real Value, unsigned int RowIndex, unsigned int ColumnIndex)
 Set a floating-point value in a cell identified by a row index and a column index. The value is set only if the value is not near from zero. Otherwise, it call 'DeleteCellInSparseMatrix' and delete the cell is possible.
pSCell Lidy_GetCell (pSSparseMatrix SparseMatrix, unsigned int RowIndex, unsigned int ColumnIndex)
 Get a whole cell in a sparse matrix identified by a row index and a column index.
Bool Lidy_DeleteCellInSparseMatrix (pSSparseMatrix SparseMatrix, unsigned int RowIndex, unsigned int ColumnIndex)
 Delete cell in a sparse matrix identified by a row index and a column index.
void Lidy_DisplaySparseMatrix (pSSparseMatrix SparseMatrix)
 Display a sparse matrix.
pSSparseMatrix Lidy_MultiplySparseMatrices (pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2)
 Multiply two sparse matrices.
pSSparseMatrix Lidy_MultiplySparseMatrixByScalar (pSSparseMatrix SparseMatrix, Real Value)
 Multiply a sparse matrix by a scalar.
pSSparseMatrix Lidy_DivideSparseMatrixByScalar (pSSparseMatrix SparseMatrix, Real Value)
 Divide a sparse matrix by a scalar. The division is processed only if Value is not near from zero.
pSSparseMatrix Lidy_AddSparseMatrices (pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2)
pSSparseMatrix Lidy_SubstractSparseMatrices (pSSparseMatrix SparseMatrix1, pSSparseMatrix SparseMatrix2)
 Substract two sparse matrices.
pSSparseMatrix Lidy_TransposeSparseMatrix (pSSparseMatrix SparseMatrix)
 Get the transposee of a sparse matrix.
pSSparseMatrix Lidy_PowerSparseMatrix (pSSparseMatrix SparseMatrix, unsigned int N)
pSSparseMatrix Lidy_LoadSparseMatrixFromXMLFile (const char *Filename)
 Load a file in XML format into a sparse matrix.
pSSparseMatrix Lidy_LoadSparseMatrix (const char *Filename)
 Load a file into a sparse matrix according to the extension of Filename. For instance, if the extension is 'xml', it call 'LoadSparseMatrixInXMLFile'.
Bool Lidy_SaveSparseMatrixInXMLFile (pSSparseMatrix SparseMatrix, const char *Filename)
 Save a sparse matrix into a XML file.
Bool Lidy_SaveSparseMatrix (pSSparseMatrix SparseMatrix, const char *Filename)
 Save a sparse matrix into a file according the extension of Filename. For instance, if the extension is 'xml', it call 'SaveSparseMatrixInXMLFile'.
void Lidy_ClearSparseMatrix (pSSparseMatrix SparseMatrix)
 Clear a sparse matrix if SparseMatrix is not null.
void Lidy_DeleteSparseMatrix (pSSparseMatrix SparseMatrix)
 Delete a sparse matrix if SparseMatrix is not null.


Typedef Documentation

typedef struct SSparseMatrix* pSSparseMatrix

Definition at line 48 of file sparse_matrix.h.


Function Documentation

pSSparseMatrix Lidy_CreateSparseMatrix ( unsigned int  NbRows,
unsigned int  NbColumns 
)

Create and allocate a new sparse matrix.

Parameters:
NbRows is the number of rows greater (It must be greater or equal to one)
NbColumns is the number of columns different from zero (It must be greater or equal to one)
Returns:
Return the sparse matrix created if success, or else NULL

unsigned int Lidy_GetCurrentNbRows ( pSSparseMatrix  SparseMatrix  ) 

Get the current number of rows in the sparse matrix (often different from the real number of rows).

Parameters:
SparseMatrix is the sparse matrix where the current number of rows is obtained
Returns:
Return the current number of rows if success or else -1

unsigned int Lidy_GetCurrentNbColumns ( pSSparseMatrix  SparseMatrix  ) 

Get the current number of columns in the sparse matrix (often different from the real number of columns).

Parameters:
SparseMatrix is the sparse matrix where the current number of columns is obtained
Returns:
Return the current number of columns if success or else -1

void Lidy_SetValue ( pSSparseMatrix  SparseMatrix,
Real  Value,
unsigned int  RowIndex,
unsigned int  ColumnIndex 
)

Set a floating-point value in a cell identified by a row index and a column index. The value is set only if the value is not near from zero. Otherwise, it call 'DeleteCellInSparseMatrix' and delete the cell is possible.

Parameters:
SparseMatrix is the sparse matrix where the value can be set
Value is the floating-point value to set
RowIndex represent the row index into the sparse matrix
ColumnIndex represent the row index into the sparse matrix
Returns:
Nothing

pSCell Lidy_GetCell ( pSSparseMatrix  SparseMatrix,
unsigned int  RowIndex,
unsigned int  ColumnIndex 
)

Get a whole cell in a sparse matrix identified by a row index and a column index.

Parameters:
SparseMatrix is the sparse matrix where the cell can be get
RowIndex represent the row index into the sparse matrix
ColumnIndex represent the row index into the sparse matrix
Returns:
Return the cell obtained if success or else NULL

Bool Lidy_DeleteCellInSparseMatrix ( pSSparseMatrix  SparseMatrix,
unsigned int  RowIndex,
unsigned int  ColumnIndex 
)

Delete cell in a sparse matrix identified by a row index and a column index.

Parameters:
SparseMatrix is the sparse matrix where the cell is deleted
RowIndex represent the row index into the sparse matrix
ColumnIndex represent the row index into the sparse matrix
Returns:
Return true if success, or else false

void Lidy_DisplaySparseMatrix ( pSSparseMatrix  SparseMatrix  ) 

Display a sparse matrix.

Parameters:
SparseMatrix is the sparse matrix to display
Returns:
Nothing

pSSparseMatrix Lidy_MultiplySparseMatrices ( pSSparseMatrix  SparseMatrix1,
pSSparseMatrix  SparseMatrix2 
)

Multiply two sparse matrices.

Parameters:
SparseMatrix1 represent the first sparse matrix
SparseMatrix2 represent the second sparse matrix
Returns:
Return matrical multiplication between SparseMatrix1 and SparseMatrix2 if success, or else NULL

pSSparseMatrix Lidy_MultiplySparseMatrixByScalar ( pSSparseMatrix  SparseMatrix,
Real  Value 
)

Multiply a sparse matrix by a scalar.

Parameters:
SparseMatrix represent the sparse matrix
Value is the scalar value
Returns:
Return scalar multiplication between SparseMatrix and Value if success, or else NULL

pSSparseMatrix Lidy_DivideSparseMatrixByScalar ( pSSparseMatrix  SparseMatrix,
Real  Value 
)

Divide a sparse matrix by a scalar. The division is processed only if Value is not near from zero.

Parameters:
SparseMatrix represent the sparse matrix
Value is the scalar value
Returns:
Return scalar division between SparseMatrix and Value if success, or else NULL

pSSparseMatrix Lidy_AddSparseMatrices ( pSSparseMatrix  SparseMatrix1,
pSSparseMatrix  SparseMatrix2 
)

pSSparseMatrix Lidy_SubstractSparseMatrices ( pSSparseMatrix  SparseMatrix1,
pSSparseMatrix  SparseMatrix2 
)

Substract two sparse matrices.

Parameters:
SparseMatrix1 represent the first sparse matrix
SparseMatrix2 represent the second sparse matrix
Returns:
Return matrical substraction between SparseMatrix1 and SparseMatrix2 if success, or else NULL

pSSparseMatrix Lidy_TransposeSparseMatrix ( pSSparseMatrix  SparseMatrix  ) 

Get the transposee of a sparse matrix.

Parameters:
SparseMatrix represent the sparse matrix to transpose
Returns:
Return the transposee of SparseMatrix if success, or else NULL

pSSparseMatrix Lidy_PowerSparseMatrix ( pSSparseMatrix  SparseMatrix,
unsigned int  N 
)

pSSparseMatrix Lidy_LoadSparseMatrixFromXMLFile ( const char *  Filename  ) 

Load a file in XML format into a sparse matrix.

Parameters:
Filename is the name of the xml file where is stored the sparse matrix description
Returns:
Return true if the loading has succeeded, or else false

pSSparseMatrix Lidy_LoadSparseMatrix ( const char *  Filename  ) 

Load a file into a sparse matrix according to the extension of Filename. For instance, if the extension is 'xml', it call 'LoadSparseMatrixInXMLFile'.

Parameters:
Filename is the name of the file where is stored the sparse matrix description
Returns:
Return true if the loading has succeeded, or else false

Bool Lidy_SaveSparseMatrixInXMLFile ( pSSparseMatrix  SparseMatrix,
const char *  Filename 
)

Save a sparse matrix into a XML file.

Parameters:
SparseMatrix is the sparse matrix to save
Filename is the name of the xml file where the sparse matrix will be stored
Returns:
Return true if the saving has succeeded, or else false

Bool Lidy_SaveSparseMatrix ( pSSparseMatrix  SparseMatrix,
const char *  Filename 
)

Save a sparse matrix into a file according the extension of Filename. For instance, if the extension is 'xml', it call 'SaveSparseMatrixInXMLFile'.

Parameters:
SparseMatrix is the sparse matrix to save
Filename is the name of the file where the sparse matrix will be stored
Returns:
Return true if the saving has succeeded, or else false

void Lidy_ClearSparseMatrix ( pSSparseMatrix  SparseMatrix  ) 

Clear a sparse matrix if SparseMatrix is not null.

Parameters:
SparseMatrix is the sparse matrix to clear
Returns:
Nothing

void Lidy_DeleteSparseMatrix ( pSSparseMatrix  SparseMatrix  ) 

Delete a sparse matrix if SparseMatrix is not null.

Parameters:
SparseMatrix is the sparse matrix to delete
Returns:
Nothing


Generated on Mon Oct 12 05:24:52 2009 for Lidy by  doxygen 1.5.8