SparseLibrary
Version 1.6.0
|
A single triplet value. More...
#include <Triplet.hpp>
Public Member Functions | |
ULI | i () const |
ULI | j () const |
void | rowOffset (ULI offset) |
Subtracts a given value from this nonzero row index. More... | |
void | setPosition (const unsigned long int i, const unsigned long int j) |
Set the coordinates of this nonzero. More... | |
void | setRowPosition (const unsigned long int i) |
Set the row coordinate of this nonzero. More... | |
void | setColumnPosition (const unsigned long int j) |
Set the column coordinate of this nonzero. More... | |
Triplet (ULI ii, ULI ij, T val) | |
Base constructor. More... | |
Triplet () | |
Base constructor. More... | |
Triplet (const Triplet< T > &toCopy) | |
Copy constructor. More... | |
void | transpose () |
Transposes this triplet, i.e., swapping the row and column value. More... | |
Static Public Member Functions | |
static std::vector< Triplet< T > > | load (const std::string fn, ULI &m, ULI &n) |
Loads an array of triplets from a binary file. More... | |
static std::vector< Triplet< T > > | loadCRS (const std::string fn, ULI &m, ULI &n) |
Loads a CRS text file and transforms it into a vector of Triplets. More... | |
static void | save (std::string fn, Triplet< T > *toWrite, const ULI m, const ULI n, const ULI s) |
Saves an array of triplets to a file, in binary format. More... | |
static void | save (std::string fn, std::vector< Triplet< T > > &toWrite, const ULI m, const ULI n) |
Saves a std::vector of triplets to a file, in binary format. More... | |
Public Attributes | |
T | value |
Value stored at this triplet. More... | |
Protected Attributes | |
ULI | row |
The row coordinate of this triplet. More... | |
ULI | column |
The column coordinate of this triplet. More... | |
A single triplet value.
Stores, at minimum, a row position, a column position, and a value of the template type.
Base constructor.
ii | row index. |
ij | column index. |
val | nonzero value. |
|
inline |
References Triplet< T >::row.
Referenced by ICRS< T, _i_value >::compareTriplets(), ZZ_ICRS< T >::compareTriplets(), vecBICRS< T, block_length_row, block_length_column, _i_value >::compareTriplets(), SVM< T >::compareTripletsC(), ZZ_CRS< T, _i_value >::compareTripletsLTR(), ZZ_CRS< T, _i_value >::compareTripletsRTL(), SVM< T >::find(), BlockOrderer< T >::left_horizontal(), Triplet< T >::load(), ZZ_CRS< T, _i_value >::load(), ZZ_ICRS< T >::load(), ICRS< T, _i_value >::load(), SVM< T >::load(), Triplet< T >::loadCRS(), BlockOrderer< T >::lower_vertical(), BlockOrderer< T >::middle(), BlockOrderer< T >::right_horizontal(), Triplet< T >::save(), Triplet< T >::setPosition(), BetaHilbert< T >::thread(), BlockOrderer< T >::upper_vertical(), SVM< T >::zax(), and SVM< T >::zxa().
|
inline |
References Triplet< T >::column.
Referenced by CuHyb::compareTriplets(), CRS< T >::compareTriplets(), McCRS< T >::compareTriplets(), ICRS< T, _i_value >::compareTriplets(), ZZ_ICRS< T >::compareTriplets(), vecBICRS< T, block_length_row, block_length_column, _i_value >::compareTriplets(), ZZ_CRS< T, _i_value >::compareTripletsLTR(), SVM< T >::compareTripletsR(), ZZ_CRS< T, _i_value >::compareTripletsRTL(), SVM< T >::find(), BlockOrderer< T >::left_horizontal(), CuHyb::load(), Triplet< T >::load(), ZZ_CRS< T, _i_value >::load(), ZZ_ICRS< T >::load(), CRS< T >::load(), ICRS< T, _i_value >::load(), McCRS< T >::load(), SVM< T >::load(), Triplet< T >::loadCRS(), BlockOrderer< T >::lower_vertical(), BlockOrderer< T >::middle(), vecBICRS< T, block_length_row, block_length_column, _i_value >::pColumnSort(), vecBICRS< T, block_length_row, block_length_column, _i_value >::pRowSort(), BlockOrderer< T >::right_horizontal(), Triplet< T >::save(), Triplet< T >::setPosition(), BlockOrderer< T >::upper_vertical(), SVM< T >::zax(), and SVM< T >::zxa().
|
inlinestatic |
Loads an array of triplets from a binary file.
Warning: there is a difference between 32 and 64 bits files!
fn | Filename of the file to load from. |
m | Reference to where the total number of rows is to-be stored. |
n | Reference to where the total number of columns is to-be stored. |
References Triplet< T >::i(), and Triplet< T >::j().
Referenced by Hilbert< T >::loadBinary(), HTS< T >::loadBinary(), and SparseMatrix< double, size_t >::loadFromFile().
|
inlinestatic |
Loads a CRS text file and transforms it into a vector of Triplets.
fn | Filename of the file to load from. |
m | Reference to where to store the number of rows of this matrix. |
n | Reference to where to store the number of columns of this matrix. |
References Triplet< T >::i(), and Triplet< T >::j().
Referenced by SparseMatrix< double, size_t >::loadFromFile().
|
inline |
Subtracts a given value from this nonzero row index.
References Triplet< T >::row.
|
inlinestatic |
Saves an array of triplets to a file, in binary format.
fn | Filename to save to (overwrite mode). |
toWrite | Array of triplets to write. |
m | Total number of rows in the matrix.+ |
n | Total number of columns in the matrix. |
s | Size of the array toWrite. |
References Triplet< T >::i(), Triplet< T >::j(), and Triplet< T >::value.
Referenced by Triplet< T >::save().
|
inlinestatic |
Saves a std::vector of triplets to a file, in binary format.
fn | Filename to save to (overwrite mode). |
toWrite | Vector of triplets to write. |
m | Total number of rows in the matrix. |
n | Total number of columns in the matrix. |
References Triplet< T >::save().
|
inline |
Set the column coordinate of this nonzero.
References Triplet< T >::row, and Triplet< T >::setPosition().
|
inline |
Set the coordinates of this nonzero.
References Triplet< T >::column, Triplet< T >::i(), Triplet< T >::j(), and Triplet< T >::row.
Referenced by Triplet< T >::setColumnPosition(), and Triplet< T >::setRowPosition().
|
inline |
Set the row coordinate of this nonzero.
References Triplet< T >::column, and Triplet< T >::setPosition().
|
inline |
Transposes this triplet, i.e., swapping the row and column value.
References Triplet< T >::column, and Triplet< T >::row.
|
protected |
The column coordinate of this triplet.
Referenced by Triplet< T >::j(), Triplet< T >::setPosition(), Triplet< T >::setRowPosition(), and Triplet< T >::transpose().
|
protected |
The row coordinate of this triplet.
Referenced by Triplet< T >::i(), Triplet< T >::rowOffset(), Triplet< T >::setColumnPosition(), Triplet< T >::setPosition(), and Triplet< T >::transpose().
T Triplet< T >::value |
Value stored at this triplet.
Referenced by CuHyb::load(), ZZ_CRS< T, _i_value >::load(), ZZ_ICRS< T >::load(), CRS< T >::load(), ICRS< T, _i_value >::load(), McCRS< T >::load(), SVM< T >::load(), SVM< T >::random_access(), Triplet< T >::save(), SVM< T >::zax(), and SVM< T >::zxa().