TSparseMtx::TripletsToSparse Method

Overload List

#SignatureDescription
1void 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.
2void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<float> &SrcValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
3void 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).
4void TripletsToSparse(int RowCount, int ColCount, const DewArray<int> &SrcRow, const DewArray<int> &SrcColumn, const DewArray<TSCplx> &SrcCValues, double Threshold = 0, bool PreserveZeroDiagElem = true);
5void TripletsToSparse(int RowCount, int ColCount, TMtx *SrcTriplets);Convert triplets to sparse format.

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.

#NameTypeDescription
1RowCountint
2ColCountint
3SrcRowconst DewArray<int> &
4SrcColumnconst DewArray<int> &
5SrcValuesconst DewArray<double> &
6Threshold = 0double
7PreserveZeroDiagElem = truebool
Remarks:

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.

See Also: TSparseMtx::SparseToTriplets
Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler

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);

#NameTypeDescription
1RowCountint
2ColCountint
3SrcRowconst DewArray<int> &
4SrcColumnconst DewArray<int> &
5SrcValuesconst DewArray<float> &
6Threshold = 0double
7PreserveZeroDiagElem = truebool
Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler

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).

#NameTypeDescription
1RowCountint
2ColCountint
3SrcRowconst DewArray<int> &
4SrcColumnconst DewArray<int> &
5SrcCValuesconst DewArray<TCplx> &
6Threshold = 0double
7PreserveZeroDiagElem = truebool
Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler

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);

#NameTypeDescription
1RowCountint
2ColCountint
3SrcRowconst DewArray<int> &
4SrcColumnconst DewArray<int> &
5SrcCValuesconst DewArray<TSCplx> &
6Threshold = 0double
7PreserveZeroDiagElem = truebool
Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler

Overload 5: void TripletsToSparse(int RowCount, int ColCount, TMtx *SrcTriplets);

Convert triplets to sparse format.

#NameTypeDescription
1RowCountint
2ColCountint
3SrcTripletsTMtx *
Remarks:

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.

Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler