#include <CS_CRS.hpp>
Collaboration diagram for CS_CRS< T >:
Public Member Functions | |
CS_CRS (const ULI number_of_nonzeros, const ULI number_of_rows, const ULI number_of_cols, const T zero) | |
Base constructor which only initialises the internal arrays. | |
CS_CRS (CRS< T > &toCopy) | |
Copy constructor. | |
CS_CRS (CS_CRS< T > &toCopy) | |
Copy constructor. | |
CS_CRS (std::vector< Triplet< T > > input, unsigned long int currow, unsigned long int curcol, T &zero) | |
Constructor which transforms a collection of input triplets to CRS format. | |
CS_CRS (std::vector< Triplet< T > > input, T &zero) | |
Constructor which transforms a collection of input triplets to CRS format. | |
T & | random_access (ULI i, ULI j) |
Method which provides random matrix access to the stored sparse matrix. | |
T * | zax (T *x_orig) |
Calculates and returns z=Ax. | |
~CS_CRS () | |
Base deconstructor. | |
Protected Member Functions | |
bool | find (ULI col_index, ULI search_start, ULI search_end, ULI &ret) |
Helper function which finds a value with a given column index on a given subrange of indeces. | |
Static Protected Member Functions | |
int | compareTriplets (const void *left, const void *right) |
Comparation function for 1D columnwise sort. | |
Protected Attributes | |
CS_ELEMENT< ULI > * | nnz |
Number of non-zeros. | |
CS_ELEMENT< ULI > * | nor |
Number of rows. | |
CS_ELEMENT< ULI > * | noc |
Number of columns. | |
CS_ARRAY< ULI > * | row_start |
Array keeping track of individual row starting indeces. | |
CS_ARRAY< T > * | nzs |
Array containing the actual nnz non-zeros. | |
CS_ARRAY< ULI > * | col_ind |
Array containing the column indeces corresponding to the elements in nzs. | |
CS_ELEMENT< T > * | zero_element |
Which element is considered as zero. |
|
Base constructor which only initialises the internal arrays. Note that to gain a valid CRS structure, these arrays have to be filled by some external mechanism (i.e., after calling this constructor, the internal arrays contain garbage, resuling in invalid datastructure).
|
|
Copy constructor.
|
|
Constructor which transforms a collection of input triplets to CRS format. The input collection is considered to have at most one triplet with unique pairs of indeces. Unspecified behaviour occurs when this assumption is not met.
|
|
Constructor which transforms a collection of input triplets to CRS format. The input collection is considered to have at most one triplet with unique pairs of indeces. Unspecified behaviour occurs when this assumption is not met.
|
|
Comparation function for 1D columnwise sort.
|
|
Helper function which finds a value with a given column index on a given subrange of indeces.
|
|
Method which provides random matrix access to the stored sparse matrix.
|
|
Calculates and returns z=Ax. The vectors x should have appropiately set length; this is not enforced. Memory leaks, segmentation faults, the works; one or more of these will occur if dimensions do not make sense. The return array is allocated to a length equal to the number of rows in this function. Cache simulation is only performed on access to elements from A, x or z.
|