File view_vector_dok_binary.hpp

Typedefs

typedef BinaryDokVectorAllocator<BinaryDokVector> AllocatedBinaryDokVector

Allocates the memory, a BinaryDokVector provides access to.

class BinaryDokVector
#include <view_vector_dok_binary.hpp>

A view that provides access to binary values stored in a sparse vector in the dictionary of keys (DOK) format.

Public Types

typedef uint32 index_type

The type of the indices, the view provides access to.

typedef std::unordered_set<uint32>::const_iterator index_const_iterator

An iterator that provides read-only access to the indices in the view.

Public Functions

inline BinaryDokVector(std::unordered_set<uint32> *indices)
Parameters:

indices – A pointer to an object of type std::unordered_set that stores the indices of all non-zero elements in the view

inline BinaryDokVector(const BinaryDokVector &other)
Parameters:

other – A reference to an object of type BinaryDokVector that should be copied

inline BinaryDokVector(BinaryDokVector &&other)
Parameters:

other – A reference to an object of type BinaryDokVector that should be moved

inline virtual ~BinaryDokVector()
inline index_const_iterator indices_cbegin() const

Returns an index_const_iterator to the beginning of the indices in the view.

Returns:

An index_const_iterator to the beginning

inline index_const_iterator indices_cend() const

Returns an index_const_iterator to the end of the indices in the view.

Returns:

An index_const_iterator to the end

inline bool operator[](index_type index) const

Returns the value of the element at a specific index.

Parameters:

index – The index of the element

Returns:

The value of the element at the given index

inline void set(index_type index, bool value)

Sets the value of the element at a specific index.

Parameters:
  • index – The index of the element

  • value – The value to be set

inline void clear()

Sets all values stored in the view to zero.

Protected Attributes

std::unordered_set<uint32> *indices_

A pointer to an object of type std::unordered_set that stores the indices of all non-zero elements in the view.

template<typename Vector>
class BinaryDokVectorAllocator : public Vector<T>
#include <view_vector_dok_binary.hpp>

Allocates the memory for a view that provides access to binary values stored in a sparse vector in the dictionary of keys (DOK) format.

Template Parameters:

Vector – The type of the view

Public Functions

inline BinaryDokVectorAllocator()
inline BinaryDokVectorAllocator(const BinaryDokVectorAllocator &other)
Parameters:

other – A reference to an object of type BinaryDokVectorAllocator that should be copied

inline BinaryDokVectorAllocator(BinaryDokVectorAllocator &&other)
Parameters:

other – A reference to an object of type BinaryDokVectorAllocator that should be moved

inline virtual ~BinaryDokVectorAllocator() override