Overload List
Overload 1: void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<double> &SrcValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
Convert triplets to sparse format.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | RowCount | int | |
| 2 | ColCount | int | |
| 3 | SrcRow | const DewArray<int> & | |
| 4 | SrcColumn | const DewArray<int> & | |
| 5 | SrcValues | const DewArray<double> & | |
| 6 | Threshold = 0 | double | |
| 7 | PreserveZeroDiagElem = true | bool |
A sparse matrix can also be presented as pairs of the three elements called triplets. For each non zero value in the matrix we specify it's position: Row, Column, and it's Value. MatrixSize defines the size of the matrix and sets the Size and Cols properties. The maximum row and column index may not exceed rowCount and colCount. This is usually the most efficient way to convert a given dense matrix to sparse format. The values do not need to be ordered, the same coordinates can appear more than once. All values having the same coordinates will be summed together. This routine can therefore also be used as a way to sum multiple sparse matrices. Triplets can be represented by three arrays: Row, Column and Values or they can all be stored in one TMtx matrix.
By default any zeros on the main diagonal will be preserved. Set the last parameter to false to drop them on conversion.
Overload 2: void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<float> &SrcValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
| # | Name | Type | Description |
|---|---|---|---|
| 1 | RowCount | int | |
| 2 | ColCount | int | |
| 3 | SrcRow | const DewArray<int> & | |
| 4 | SrcColumn | const DewArray<int> & | |
| 5 | SrcValues | const DewArray<float> & | |
| 6 | Threshold = 0 | double | |
| 7 | PreserveZeroDiagElem = true | bool |
Overload 3: void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<TCplx> &SrcCValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
Convert triplets to sparse format (complex version).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | RowCount | int | |
| 2 | ColCount | int | |
| 3 | SrcRow | const DewArray<int> & | |
| 4 | SrcColumn | const DewArray<int> & | |
| 5 | SrcCValues | const DewArray<TCplx> & | |
| 6 | Threshold = 0 | double | |
| 7 | PreserveZeroDiagElem = true | bool |
Overload 4: void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<TSCplx> &SrcCValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
| # | Name | Type | Description |
|---|---|---|---|
| 1 | RowCount | int | |
| 2 | ColCount | int | |
| 3 | SrcRow | const DewArray<int> & | |
| 4 | SrcColumn | const DewArray<int> & | |
| 5 | SrcCValues | const DewArray<TSCplx> & | |
| 6 | Threshold = 0 | double | |
| 7 | PreserveZeroDiagElem = true | bool |
Overload 5: void TripletsToSparse(int RowCount, int ColCount, TMtx *SrcTriplets);
Convert triplets to sparse format.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | RowCount | int | |
| 2 | ColCount | int | |
| 3 | SrcTriplets | TMtx * |
The triplets are stored in the Triplets matrix. First row are row indices, second row are column indices and the third row stores the values. If the matrix is complex, the row and column indicies are stored in the real part of the complex values.