CSol
Public Member Functions | List of all members
SparseMatrix Class Reference

OpenCL linear algebra sparse matrix class. More...

#include <csol_la.h>

Inheritance diagram for SparseMatrix:
[legend]

Public Member Functions

 SparseMatrix (LinearAlgebra &, int)
 SparseMatrix constructor. More...
 
 SparseMatrix (LinearAlgebra &, const SparseMatrix &)
 SparseMatrix copy constructor. More...
 
 ~SparseMatrix ()
 
Vector operator* (const Vector &) const
 SparseMatrix vector multiplication operator. More...
 
SparseMatrixoperator= (const SparseMatrix &)
 SparseMatrix assignment operator. More...
 
void reserve (int, int, int)
 SparseMatrix entry reservation. More...
 
void write (REAL *)
 SparseMatrix write operation. More...
 
- Public Member Functions inherited from Matrix
 Matrix (LinearAlgebra &LA_)
 
 ~Matrix ()
 

Additional Inherited Members

- Protected Attributes inherited from Matrix
LinearAlgebraLA
 

Detailed Description

The sparse matrix class is in co-ordinate list format: [row(int)] [column(int)] [value(REAL)]

Constructor & Destructor Documentation

SparseMatrix ( LinearAlgebra LA_,
int  nNonZeros_ 
)

Empty sparse matrix constructor, values are set to zero.

Parameters
LA_linear algebra instance handle.
nNonZeros_number of non-zero entries in sparse matrix.
SparseMatrix ( LinearAlgebra LA_,
const SparseMatrix r_ 
)
Parameters
LA_linear algebra instance handle.
r_sparse matrix to copy.
~SparseMatrix ( )
inline

Member Function Documentation

Vector operator* ( const Vector r_) const
virtual

Multiplies sparse matrix with vector.

Parameters
r_multiplication vector.

Implements Matrix.

SparseMatrix & operator= ( const SparseMatrix r_)

Copies sparse matrix values, matrices must be same dimensions.

Parameters
r_sparse matrix to copy.
void reserve ( int  i,
int  j,
int  index 
)

Reserves a non-zero entry of row i and column j with an user-defined memory index value. The index is used to define the memory index location when copying the sparse matrix data values back from memory.

Parameters
irow.
jcolumn.
indexuser-defined index.
void write ( REAL *  v_)

Writes values from sparse matrix OpenCL buffer into memory. The memory locations for row i and column j is determined by the index value passed to the reserve function.

Parameters
v_pointer to memory.