OR-Tools  9.6
SparseVectorView< T >

Detailed Description

template<typename T>
class operations_research::math_opt::SparseVectorView< T >

Definition at line 88 of file sparse_vector_view.h.

Classes

class  const_iterator
 

Public Types

using value_type = std::pair< int64_t, T >
 

Public Member Functions

 SparseVectorView (absl::Span< const int64_t > ids, absl::Span< const T > values)
 
 SparseVectorView ()
 
const_iterator begin () const
 
const_iterator end () const
 
absl::Span< const int64_t > ids () const
 
int64_t ids (int index) const
 
int ids_size () const
 
absl::Span< const T > values () const
 
int values_size () const
 
const T & values (int index) const
 
template<typename IndexType >
absl::flat_hash_map< IndexType, T > as_map ()
 

Member Typedef Documentation

◆ value_type

using value_type = std::pair<int64_t, T>

Definition at line 90 of file sparse_vector_view.h.

Constructor & Destructor Documentation

◆ SparseVectorView() [1/2]

SparseVectorView ( absl::Span< const int64_t >  ids,
absl::Span< const T >  values 
)
inline

Definition at line 117 of file sparse_vector_view.h.

◆ SparseVectorView() [2/2]

SparseVectorView ( )
inline

Definition at line 119 of file sparse_vector_view.h.

Member Function Documentation

◆ as_map()

absl::flat_hash_map< IndexType, T > as_map

Definition at line 237 of file sparse_vector_view.h.

◆ begin()

SparseVectorView< T >::const_iterator begin
inline

Definition at line 223 of file sparse_vector_view.h.

◆ end()

SparseVectorView< T >::const_iterator end
inline

Definition at line 230 of file sparse_vector_view.h.

◆ ids() [1/2]

absl::Span<const int64_t> ids ( ) const
inline

Definition at line 124 of file sparse_vector_view.h.

◆ ids() [2/2]

int64_t ids ( int  index) const
inline

Definition at line 125 of file sparse_vector_view.h.

◆ ids_size()

int ids_size ( ) const
inline

Definition at line 126 of file sparse_vector_view.h.

◆ values() [1/2]

absl::Span<const T> values ( ) const
inline

Definition at line 127 of file sparse_vector_view.h.

◆ values() [2/2]

const T& values ( int  index) const
inline

Definition at line 129 of file sparse_vector_view.h.

◆ values_size()

int values_size ( ) const
inline

Definition at line 128 of file sparse_vector_view.h.


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