OR-Tools  8.2
SparseRow

Detailed Description

Definition at line 43 of file sparse_row.h.

Public Types

typedef ColIndex Index
 
typedef StrictITIVector< Index, FractionalDenseVector
 
typedef Permutation< IndexIndexPermutation
 
using Iterator = SparseRowIterator
 
using Entry = typename Iterator::Entry
 

Public Member Functions

 SparseRow ()
 
ColIndex EntryCol (EntryIndex i) const
 
Fractional EntryCoefficient (EntryIndex i) const
 
ColIndex GetFirstCol () const
 
ColIndex GetLastCol () const
 
void ApplyColPermutation (const ColumnPermutation &p)
 
void ApplyPartialColPermutation (const ColumnPermutation &p)
 
Iterator begin () const
 
Iterator end () const
 
void Clear ()
 
void ClearAndRelease ()
 
void Reserve (EntryIndex new_capacity)
 
bool IsEmpty () const
 
void CleanUp ()
 
bool IsCleanedUp () const
 
void Swap (SparseVector *other)
 
void PopulateFromSparseVector (const SparseVector &sparse_vector)
 
void PopulateFromDenseVector (const DenseVector &dense_vector)
 
void AppendEntriesWithOffset (const SparseVector &sparse_vector, Index offset)
 
bool CheckNoDuplicates () const
 
bool CheckNoDuplicates (StrictITIVector< Index, bool > *boolean_vector) const
 
void SetCoefficient (Index index, Fractional value)
 
void DeleteEntry (Index index)
 
void RemoveNearZeroEntries (Fractional threshold)
 
void RemoveNearZeroEntriesWithWeights (Fractional threshold, const DenseVector &weights)
 
void MoveEntryToFirstPosition (Index index)
 
void MoveEntryToLastPosition (Index index)
 
void MultiplyByConstant (Fractional factor)
 
void ComponentWiseMultiply (const DenseVector &factors)
 
void DivideByConstant (Fractional factor)
 
void ComponentWiseDivide (const DenseVector &factors)
 
void CopyToDenseVector (Index num_indices, DenseVector *dense_vector) const
 
void PermutedCopyToDenseVector (const IndexPermutation &index_perm, Index num_indices, DenseVector *dense_vector) const
 
void AddMultipleToDenseVector (Fractional multiplier, DenseVector *dense_vector) const
 
void AddMultipleToSparseVectorAndDeleteCommonIndex (Fractional multiplier, Index removed_common_index, Fractional drop_tolerance, SparseVector *accumulator_vector) const
 
void AddMultipleToSparseVectorAndIgnoreCommonIndex (Fractional multiplier, Index removed_common_index, Fractional drop_tolerance, SparseVector *accumulator_vector) const
 
void ApplyIndexPermutation (const IndexPermutation &index_perm)
 
void ApplyPartialIndexPermutation (const IndexPermutation &index_perm)
 
void MoveTaggedEntriesTo (const IndexPermutation &index_perm, SparseVector *output)
 
Fractional LookUpCoefficient (Index index) const
 
EntryIndex num_entries () const
 
Index GetFirstIndex () const
 
Fractional GetFirstCoefficient () const
 
Index GetLastIndex () const
 
Fractional GetLastCoefficient () const
 
::util::IntegerRange< EntryIndex > AllEntryIndices () const
 
bool IsEqualTo (const SparseVector &other) const
 
std::string DebugString () const
 

Protected Member Functions

void AddEntry (Index index, Fractional value)
 
void ResizeDown (EntryIndex new_size)
 
Index GetIndex (EntryIndex i) const
 
Fractional GetCoefficient (EntryIndex i) const
 
IndexMutableIndex (EntryIndex i)
 
FractionalMutableCoefficient (EntryIndex i)
 

Protected Attributes

std::unique_ptr< char[]> buffer_
 
EntryIndex num_entries_
 
EntryIndex capacity_
 
Indexindex_
 
Fractionalcoefficient_
 
bool may_contain_duplicates_
 

Member Typedef Documentation

◆ DenseVector

Definition at line 87 of file sparse_vector.h.

◆ Entry

using Entry = typename Iterator::Entry
inherited

Definition at line 91 of file sparse_vector.h.

◆ Index

typedef ColIndex Index
inherited

Definition at line 85 of file sparse_vector.h.

◆ IndexPermutation

typedef Permutation<Index> IndexPermutation
inherited

Definition at line 88 of file sparse_vector.h.

◆ Iterator

using Iterator = SparseRowIterator
inherited

Definition at line 90 of file sparse_vector.h.

Constructor & Destructor Documentation

◆ SparseRow()

SparseRow ( )
inline

Definition at line 45 of file sparse_row.h.

Member Function Documentation

◆ AddEntry()

void AddEntry ( Index  index,
Fractional  value 
)
inlineprotectedinherited

Definition at line 317 of file sparse_vector.h.

◆ AddMultipleToDenseVector()

void AddMultipleToDenseVector ( Fractional  multiplier,
DenseVector dense_vector 
) const
inherited

Definition at line 235 of file sparse_vector.h.

◆ AddMultipleToSparseVectorAndDeleteCommonIndex()

void AddMultipleToSparseVectorAndDeleteCommonIndex ( Fractional  multiplier,
Index  removed_common_index,
Fractional  drop_tolerance,
SparseVector< ColIndex, SparseRowIterator > *  accumulator_vector 
) const
inherited

Definition at line 243 of file sparse_vector.h.

◆ AddMultipleToSparseVectorAndIgnoreCommonIndex()

void AddMultipleToSparseVectorAndIgnoreCommonIndex ( Fractional  multiplier,
Index  removed_common_index,
Fractional  drop_tolerance,
SparseVector< ColIndex, SparseRowIterator > *  accumulator_vector 
) const
inherited

Definition at line 249 of file sparse_vector.h.

◆ AllEntryIndices()

::util::IntegerRange< EntryIndex > AllEntryIndices ( ) const
inlineinherited

Definition at line 302 of file sparse_vector.h.

◆ AppendEntriesWithOffset()

void AppendEntriesWithOffset ( const SparseVector< ColIndex, SparseRowIterator > &  sparse_vector,
Index  offset 
)
inherited

Definition at line 168 of file sparse_vector.h.

◆ ApplyColPermutation()

void ApplyColPermutation ( const ColumnPermutation p)
inline

Definition at line 52 of file sparse_row.h.

◆ ApplyIndexPermutation()

void ApplyIndexPermutation ( const IndexPermutation index_perm)
inherited

Definition at line 254 of file sparse_vector.h.

◆ ApplyPartialColPermutation()

void ApplyPartialColPermutation ( const ColumnPermutation p)
inline

Definition at line 55 of file sparse_row.h.

◆ ApplyPartialIndexPermutation()

void ApplyPartialIndexPermutation ( const IndexPermutation index_perm)
inherited

Definition at line 258 of file sparse_vector.h.

◆ begin()

SparseRowIterator begin
inherited

Definition at line 124 of file sparse_vector.h.

◆ CheckNoDuplicates() [1/2]

bool CheckNoDuplicates
inherited

Definition at line 174 of file sparse_vector.h.

◆ CheckNoDuplicates() [2/2]

bool CheckNoDuplicates ( StrictITIVector< Index, bool > *  boolean_vector) const
inherited

Definition at line 181 of file sparse_vector.h.

◆ CleanUp()

void CleanUp
inherited

Definition at line 142 of file sparse_vector.h.

◆ Clear()

void Clear
inherited

Definition at line 128 of file sparse_vector.h.

◆ ClearAndRelease()

void ClearAndRelease
inherited

Definition at line 131 of file sparse_vector.h.

◆ ComponentWiseDivide()

void ComponentWiseDivide ( const DenseVector factors)
inherited

Definition at line 221 of file sparse_vector.h.

◆ ComponentWiseMultiply()

void ComponentWiseMultiply ( const DenseVector factors)
inherited

Definition at line 213 of file sparse_vector.h.

◆ CopyToDenseVector()

void CopyToDenseVector ( Index  num_indices,
DenseVector dense_vector 
) const
inherited

Definition at line 225 of file sparse_vector.h.

◆ DebugString()

std::string DebugString
inherited

Definition at line 312 of file sparse_vector.h.

◆ DeleteEntry()

void DeleteEntry ( Index  index)
inherited

Definition at line 188 of file sparse_vector.h.

◆ DivideByConstant()

void DivideByConstant ( Fractional  factor)
inherited

Definition at line 217 of file sparse_vector.h.

◆ end()

SparseRowIterator end
inherited

Definition at line 125 of file sparse_vector.h.

◆ EntryCoefficient()

Fractional EntryCoefficient ( EntryIndex  i) const
inline

Definition at line 49 of file sparse_row.h.

◆ EntryCol()

ColIndex EntryCol ( EntryIndex  i) const
inline

Definition at line 48 of file sparse_row.h.

◆ GetCoefficient()

Fractional GetCoefficient ( EntryIndex  i) const
inlineprotectedinherited

Definition at line 349 of file sparse_vector.h.

◆ GetFirstCoefficient()

Fractional GetFirstCoefficient ( ) const
inlineinherited

Definition at line 283 of file sparse_vector.h.

◆ GetFirstCol()

ColIndex GetFirstCol ( ) const
inline

Definition at line 50 of file sparse_row.h.

◆ GetFirstIndex()

Index GetFirstIndex ( ) const
inlineinherited

Definition at line 279 of file sparse_vector.h.

◆ GetIndex()

Index GetIndex ( EntryIndex  i) const
inlineprotectedinherited

Definition at line 344 of file sparse_vector.h.

◆ GetLastCoefficient()

Fractional GetLastCoefficient ( ) const
inlineinherited

Definition at line 293 of file sparse_vector.h.

◆ GetLastCol()

ColIndex GetLastCol ( ) const
inline

Definition at line 51 of file sparse_row.h.

◆ GetLastIndex()

Index GetLastIndex ( ) const
inlineinherited

Definition at line 289 of file sparse_vector.h.

◆ IsCleanedUp()

bool IsCleanedUp
inherited

Definition at line 148 of file sparse_vector.h.

◆ IsEmpty()

bool IsEmpty
inherited

Definition at line 137 of file sparse_vector.h.

◆ IsEqualTo()

bool IsEqualTo ( const SparseVector< ColIndex, SparseRowIterator > &  other) const
inherited

Definition at line 308 of file sparse_vector.h.

◆ LookUpCoefficient()

Fractional LookUpCoefficient ( Index  index) const
inherited

Definition at line 267 of file sparse_vector.h.

◆ MoveEntryToFirstPosition()

void MoveEntryToFirstPosition ( Index  index)
inherited

Definition at line 201 of file sparse_vector.h.

◆ MoveEntryToLastPosition()

void MoveEntryToLastPosition ( Index  index)
inherited

Definition at line 205 of file sparse_vector.h.

◆ MoveTaggedEntriesTo()

void MoveTaggedEntriesTo ( const IndexPermutation index_perm,
SparseVector< ColIndex, SparseRowIterator > *  output 
)
inherited

Definition at line 262 of file sparse_vector.h.

◆ MultiplyByConstant()

void MultiplyByConstant ( Fractional  factor)
inherited

Definition at line 209 of file sparse_vector.h.

◆ MutableCoefficient()

Fractional & MutableCoefficient ( EntryIndex  i)
inlineprotectedinherited

Definition at line 362 of file sparse_vector.h.

◆ MutableIndex()

Index & MutableIndex ( EntryIndex  i)
inlineprotectedinherited

Definition at line 357 of file sparse_vector.h.

◆ num_entries()

EntryIndex num_entries ( ) const
inlineinherited

Definition at line 270 of file sparse_vector.h.

◆ PermutedCopyToDenseVector()

void PermutedCopyToDenseVector ( const IndexPermutation index_perm,
Index  num_indices,
DenseVector dense_vector 
) const
inherited

Definition at line 229 of file sparse_vector.h.

◆ PopulateFromDenseVector()

void PopulateFromDenseVector ( const DenseVector dense_vector)
inherited

Definition at line 160 of file sparse_vector.h.

◆ PopulateFromSparseVector()

void PopulateFromSparseVector ( const SparseVector< ColIndex, SparseRowIterator > &  sparse_vector)
inherited

Definition at line 156 of file sparse_vector.h.

◆ RemoveNearZeroEntries()

void RemoveNearZeroEntries ( Fractional  threshold)
inherited

Definition at line 192 of file sparse_vector.h.

◆ RemoveNearZeroEntriesWithWeights()

void RemoveNearZeroEntriesWithWeights ( Fractional  threshold,
const DenseVector weights 
)
inherited

Definition at line 196 of file sparse_vector.h.

◆ Reserve()

void Reserve ( EntryIndex  new_capacity)
inherited

Definition at line 134 of file sparse_vector.h.

◆ ResizeDown()

void ResizeDown ( EntryIndex  new_size)
inlineprotectedinherited

Definition at line 336 of file sparse_vector.h.

◆ SetCoefficient()

void SetCoefficient ( Index  index,
Fractional  value 
)
inherited

Definition at line 184 of file sparse_vector.h.

◆ Swap()

void Swap ( SparseVector< ColIndex, SparseRowIterator > *  other)
inherited

Definition at line 152 of file sparse_vector.h.

Member Data Documentation

◆ buffer_

std::unique_ptr<char[]> buffer_
protectedinherited

Definition at line 379 of file sparse_vector.h.

◆ capacity_

EntryIndex capacity_
protectedinherited

Definition at line 381 of file sparse_vector.h.

◆ coefficient_

Fractional* coefficient_
protectedinherited

Definition at line 385 of file sparse_vector.h.

◆ index_

Index* index_
protectedinherited

Definition at line 384 of file sparse_vector.h.

◆ may_contain_duplicates_

bool may_contain_duplicates_
mutableprotectedinherited

Definition at line 389 of file sparse_vector.h.

◆ num_entries_

EntryIndex num_entries_
protectedinherited

Definition at line 380 of file sparse_vector.h.


The documentation for this class was generated from the following file: