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

#include <util.h>

Public Member Functions

void ClearAndReserve (size_t size)
 
T * data () const
 
T * begin () const
 
T * end () const
 
size_t size () const
 
bool empty () const
 
operator[] (int i) const
 
T & operator[] (int i)
 
back () const
 
T & back ()
 
void clear ()
 
void resize (size_t size)
 
void pop_back ()
 
void push_back (T t)
 

Detailed Description

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

We often have a vector with fixed capacity reserved outside the hot loops. Using this class instead save the capacity but most importantly link a lot less code for the push_back() calls which allow more inlining.

Todo
(user): Add more functions and unit-test.

Definition at line 163 of file util.h.

Member Function Documentation

◆ back() [1/2]

template<typename T >
T & operations_research::sat::FixedCapacityVector< T >::back ( )
inline

Definition at line 180 of file util.h.

◆ back() [2/2]

template<typename T >
T operations_research::sat::FixedCapacityVector< T >::back ( ) const
inline

Definition at line 179 of file util.h.

◆ begin()

template<typename T >
T * operations_research::sat::FixedCapacityVector< T >::begin ( ) const
inline

Definition at line 171 of file util.h.

◆ clear()

template<typename T >
void operations_research::sat::FixedCapacityVector< T >::clear ( )
inline

Definition at line 182 of file util.h.

◆ ClearAndReserve()

template<typename T >
void operations_research::sat::FixedCapacityVector< T >::ClearAndReserve ( size_t size)
inline

Definition at line 165 of file util.h.

◆ data()

template<typename T >
T * operations_research::sat::FixedCapacityVector< T >::data ( ) const
inline

Definition at line 170 of file util.h.

◆ empty()

template<typename T >
bool operations_research::sat::FixedCapacityVector< T >::empty ( ) const
inline

Definition at line 174 of file util.h.

◆ end()

template<typename T >
T * operations_research::sat::FixedCapacityVector< T >::end ( ) const
inline

Definition at line 172 of file util.h.

◆ operator[]() [1/2]

template<typename T >
T & operations_research::sat::FixedCapacityVector< T >::operator[] ( int i)
inline

Definition at line 177 of file util.h.

◆ operator[]() [2/2]

template<typename T >
T operations_research::sat::FixedCapacityVector< T >::operator[] ( int i) const
inline

Definition at line 176 of file util.h.

◆ pop_back()

template<typename T >
void operations_research::sat::FixedCapacityVector< T >::pop_back ( )
inline

Definition at line 184 of file util.h.

◆ push_back()

template<typename T >
void operations_research::sat::FixedCapacityVector< T >::push_back ( T t)
inline

Definition at line 185 of file util.h.

◆ resize()

template<typename T >
void operations_research::sat::FixedCapacityVector< T >::resize ( size_t size)
inline

Definition at line 183 of file util.h.

◆ size()

template<typename T >
size_t operations_research::sat::FixedCapacityVector< T >::size ( ) const
inline

Definition at line 173 of file util.h.


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