Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::VectorWithSparseUsage< T > Class Template Reference

#include <presolve_util.h>

Classes

class  View
 Taking a view allow to cache the never changing addresses. More...
 

Public Member Functions

View ClearedView (int size)
 This reserve the size for using indices in [0, size).
 

Detailed Description

template<typename T>
class operations_research::sat::VectorWithSparseUsage< T >

Same as a vector<T> or hash_map<int, T> where the index are in [0, size), but optimized for the case where only a few entries are touched before the vector need to be reset to zero and used again.

Todo
(user): Maybe a SparseBitset + sparse clear is better. But this is a worth alternative to test IMO.

Definition at line 162 of file presolve_util.h.

Member Function Documentation

◆ ClearedView()

template<typename T>
View operations_research::sat::VectorWithSparseUsage< T >::ClearedView ( int size)
inline

This reserve the size for using indices in [0, size).

Definition at line 194 of file presolve_util.h.


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