BitMagic-C++
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes
bm::bv_ref_vector< BV > Class Template Reference

List of reference bit-vectors with their true index associations. More...

#include <bmxor.h>

Public Types

typedef BV bvector_type
 
typedef bvector_type::size_type size_type
 
typedef bvector_typebvector_type_ptr
 
typedef const bvector_typebvector_type_const_ptr
 
typedef bvector_type::allocator_type bv_allocator_type
 

Public Member Functions

void reset ()
 reset the collection (resize(0))
 
void add (const bvector_type *bv, size_type ref_idx)
 Add reference vector.
 
size_type size () const BMNOEXCEPT
 Get reference list size.
 
const bvector_typeget_bv (size_type idx) const BMNOEXCEPT
 Get reference vector by the index in this ref-vector.
 
size_type get_row_idx (size_type idx) const BMNOEXCEPT
 Get reference row index by the index in this ref-vector.
 
size_type find (std::size_t ref_idx) const BMNOEXCEPT
 Find vector index by the reference index.
 
template<class BMATR >
void build (const BMATR &bmatr)
 build vector of references from a basic bit-matrix all NULL rows are skipped, not added to the ref.vector
 

Static Public Member Functions

static size_type not_found () BMNOEXCEPT
 not-found value for find methods
 

Protected Types

typedef bm::heap_vector< bvector_type_const_ptr, bv_allocator_type, true > bvptr_vector_type
 
typedef bm::heap_vector< std::size_t, bv_allocator_type, true > bv_plain_vector_type
 

Protected Attributes

bvptr_vector_type ref_bvects_
 reference vector pointers
 
bv_plain_vector_type ref_bvects_rows_
 reference vector row idxs
 

Detailed Description

template<typename BV>
class bm::bv_ref_vector< BV >

List of reference bit-vectors with their true index associations.

Each referece vector would have two alternative indexes:

Definition at line 240 of file bmxor.h.

Member Typedef Documentation

◆ bv_allocator_type

template<typename BV >
typedef bvector_type::allocator_type bm::bv_ref_vector< BV >::bv_allocator_type

Definition at line 247 of file bmxor.h.

◆ bv_plain_vector_type

template<typename BV >
typedef bm::heap_vector<std::size_t, bv_allocator_type, true> bm::bv_ref_vector< BV >::bv_plain_vector_type
protected

Definition at line 312 of file bmxor.h.

◆ bvector_type

template<typename BV >
typedef BV bm::bv_ref_vector< BV >::bvector_type

Definition at line 243 of file bmxor.h.

◆ bvector_type_const_ptr

template<typename BV >
typedef const bvector_type* bm::bv_ref_vector< BV >::bvector_type_const_ptr

Definition at line 246 of file bmxor.h.

◆ bvector_type_ptr

template<typename BV >
typedef bvector_type* bm::bv_ref_vector< BV >::bvector_type_ptr

Definition at line 245 of file bmxor.h.

◆ bvptr_vector_type

template<typename BV >
typedef bm::heap_vector<bvector_type_const_ptr, bv_allocator_type, true> bm::bv_ref_vector< BV >::bvptr_vector_type
protected

Definition at line 311 of file bmxor.h.

◆ size_type

template<typename BV >
typedef bvector_type::size_type bm::bv_ref_vector< BV >::size_type

Definition at line 244 of file bmxor.h.

Member Function Documentation

◆ add()

template<typename BV >
void bm::bv_ref_vector< BV >::add ( const bvector_type bv,
size_type  ref_idx 
)
inline

Add reference vector.

Parameters
bv- bvector pointer
ref_idx- reference (row) index

Definition at line 262 of file bmxor.h.

References BM_ASSERT, bm::bv_ref_vector< BV >::ref_bvects_, and bm::bv_ref_vector< BV >::ref_bvects_rows_.

Referenced by bm::bv_ref_vector< BV >::build().

◆ build()

template<typename BV >
template<class BMATR >
void bm::bv_ref_vector< BV >::build ( const BMATR &  bmatr)
inline

build vector of references from a basic bit-matrix all NULL rows are skipped, not added to the ref.vector

Definition at line 298 of file bmxor.h.

References bm::bv_ref_vector< BV >::add(), and bm::bv_ref_vector< BV >::reset().

◆ find()

template<typename BV >
size_type bm::bv_ref_vector< BV >::find ( std::size_t  ref_idx) const
inline

Find vector index by the reference index.

Returns
~0 if not found

Definition at line 286 of file bmxor.h.

References bm::bv_ref_vector< BV >::not_found(), bm::bv_ref_vector< BV >::ref_bvects_rows_, and bm::bv_ref_vector< BV >::size().

◆ get_bv()

template<typename BV >
const bvector_type * bm::bv_ref_vector< BV >::get_bv ( size_type  idx) const
inline

Get reference vector by the index in this ref-vector.

Definition at line 273 of file bmxor.h.

References bm::bv_ref_vector< BV >::ref_bvects_.

◆ get_row_idx()

template<typename BV >
size_type bm::bv_ref_vector< BV >::get_row_idx ( size_type  idx) const
inline

Get reference row index by the index in this ref-vector.

Definition at line 277 of file bmxor.h.

References bm::bv_ref_vector< BV >::ref_bvects_rows_.

◆ not_found()

template<typename BV >
static size_type bm::bv_ref_vector< BV >::not_found ( )
inlinestatic

not-found value for find methods

Definition at line 282 of file bmxor.h.

Referenced by bm::bv_ref_vector< BV >::find().

◆ reset()

template<typename BV >
void bm::bv_ref_vector< BV >::reset ( )
inline

reset the collection (resize(0))

Definition at line 251 of file bmxor.h.

References bm::bv_ref_vector< BV >::ref_bvects_, and bm::bv_ref_vector< BV >::ref_bvects_rows_.

Referenced by bm::bv_ref_vector< BV >::build().

◆ size()

template<typename BV >
size_type bm::bv_ref_vector< BV >::size ( ) const
inline

Get reference list size.

Definition at line 270 of file bmxor.h.

References bm::bv_ref_vector< BV >::ref_bvects_.

Referenced by bm::bv_ref_vector< BV >::find().

Field Documentation

◆ ref_bvects_

template<typename BV >
bvptr_vector_type bm::bv_ref_vector< BV >::ref_bvects_
protected

◆ ref_bvects_rows_

template<typename BV >
bv_plain_vector_type bm::bv_ref_vector< BV >::ref_bvects_rows_
protected

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