|
| SparseMatrix () |
|
| SparseMatrix (std::initializer_list< std::initializer_list< Fractional > > init_list) |
|
| SparseMatrix (const SparseMatrix &)=delete |
| This type is neither copyable nor movable.
|
|
SparseMatrix & | operator= (const SparseMatrix &)=delete |
|
void | Clear () |
|
bool | IsEmpty () const |
|
void | CleanUp () |
|
bool | CheckNoDuplicates () const |
| Call CheckNoDuplicates() on all columns, useful for doing a DCHECK.
|
|
bool | IsCleanedUp () const |
| Call IsCleanedUp() on all columns, useful for doing a DCHECK.
|
|
void | SetNumRows (RowIndex num_rows) |
| Change the number of row of this matrix.
|
|
ColIndex | AppendEmptyColumn () |
| Appends an empty column and returns its index.
|
|
void | AppendUnitVector (RowIndex row, Fractional value) |
|
void | Swap (SparseMatrix *matrix) |
|
void | PopulateFromZero (RowIndex num_rows, ColIndex num_cols) |
|
void | PopulateFromIdentity (ColIndex num_cols) |
|
template<typename Matrix > |
void | PopulateFromTranspose (const Matrix &input) |
| Instantiate needed templates.
|
|
void | PopulateFromSparseMatrix (const SparseMatrix &matrix) |
|
template<typename Matrix > |
void | PopulateFromPermutedMatrix (const Matrix &a, const RowPermutation &row_perm, const ColumnPermutation &inverse_col_perm) |
|
void | PopulateFromLinearCombination (Fractional alpha, const SparseMatrix &a, Fractional beta, const SparseMatrix &b) |
|
void | PopulateFromProduct (const SparseMatrix &a, const SparseMatrix &b) |
| Multiplies SparseMatrix a by SparseMatrix b.
|
|
void | DeleteColumns (const DenseBooleanRow &columns_to_delete) |
|
void | DeleteRows (RowIndex num_rows, const RowPermutation &permutation) |
|
bool | AppendRowsFromSparseMatrix (const SparseMatrix &matrix) |
|
void | ApplyRowPermutation (const RowPermutation &row_perm) |
| Applies the row permutation.
|
|
Fractional | LookUpValue (RowIndex row, ColIndex col) const |
|
bool | Equals (const SparseMatrix &a, Fractional tolerance) const |
|
void | ComputeMinAndMaxMagnitudes (Fractional *min_magnitude, Fractional *max_magnitude) const |
|
RowIndex | num_rows () const |
| Return the matrix dimension.
|
|
ColIndex | num_cols () const |
|
const SparseColumn & | column (ColIndex col) const |
| Access the underlying sparse columns.
|
|
SparseColumn * | mutable_column (ColIndex col) |
|
EntryIndex | num_entries () const |
|
Fractional | ComputeOneNorm () const |
|
Fractional | ComputeInfinityNorm () const |
|
std::string | Dump () const |
| Returns a dense representation of the matrix.
|
|
SparseMatrix SparseMatrix is a class for sparse matrices suitable for computation. Data is represented using the so-called compressed-column storage scheme. Entries (row, col, value) are stored by column using a SparseColumn.
Citing [Duff et al, 1987], a matrix is sparse if many of its coefficients are zero and if there is an advantage in exploiting its zeros. For practical reasons, not all zeros are exploited (for example those that result from calculations.) The term entry refers to those coefficients that are handled explicitly. All non-zeros are entries while some zero coefficients may also be entries.
- Note
- no special ordering of entries is assumed.
Definition at line 70 of file sparse.h.
operations_research::glop::SparseMatrix::SparseMatrix |
( |
std::initializer_list< std::initializer_list< Fractional > > | init_list | ) |
|
Useful for testing. This makes it possible to write: SparseMatrix matrix { {1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
Definition at line 99 of file sparse.cc.
Returns true if the matrix equals a (with a maximum error smaller than given the tolerance).
Store all entries of current matrix in a dense column.
Check all entries of a are those stored in the dense column.
Store all entries of matrix a in a dense column.
Check all entries are those stored in the dense column a.
Definition at line 336 of file sparse.cc.
template<typename Matrix >
template void operations_research::glop::SparseMatrix::PopulateFromTranspose< SparseMatrix > |
( |
const Matrix & | input | ) |
|
Instantiate needed templates.
Populates the matrix from the transposed of the given matrix.
- Note
- this preserve the property of lower/upper triangular matrix to have the diagonal coefficients first/last in each columns. It actually sorts the entries in each columns by their indices.
We do a first pass on the input matrix to resize the new columns properly.
Definition at line 190 of file sparse.cc.