bm::bv_ref_vector< BV > Class Template Reference

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

`#include <bmxor.h>`

Inheritance diagram for bm::bv_ref_vector< BV >:
[legend]

## Public Types

typedef BV | bvector_type
typedef bvector_type::size_type | size_type
typedef bvector_type * | bvector_type_ptr
typedef const bvector_type * | bvector_type_const_ptr
typedef bvector_type::allocator_type | bv_allocator_type
typedef bm::block_match_chain< size_type > | block_match_chain_type
typedef bm::dynamic_heap_matrix< block_match_chain_type, bv_allocator_type > | matrix_chain_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_type * | get_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.
size_type | find_bv (const bvector_type *bv) const BMNOEXCEPT
| Find vector index by the pointer.
void | fill_alloc_digest (bvector_type &bv_blocks) const
| Fill block allocation digest for all vectors in the reference collection.
template<class BMATR>
void | build (const BMATR &bmatr)
| Reset and build vector of references from a basic bit-matrix all NULL rows are skipped, not added to the ref.vector.
template<typename BMATR>
void | add_vectors (const BMATR &bmatr)
| Append basic bit-matrix to the list of reference vectors.
template<class SV>
void | add_sparse_vector (const SV &sv)
| Add bit-transposed sparse vector as a bit-matrix.
void | resize_xor_matrix (matrix_chain_type &matr, size_type total_blocks) const
| Utility function to resize matrix based on number of vectors and blocks.
bool | build_nb_digest_and_xor_matrix (matrix_chain_type &matr, bvector_type &bv_blocks) const
| Calculate blocks digest and resize XOR distance matrix based on total number of available blocks.

## 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_plane_vector_type

## Protected Attributes

unsigned | rows_acc_ = 0
| total rows accumulator
bvptr_vector_type | ref_bvects_
| reference vector pointers
bv_plane_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:

- index(position) in the reference list
- index(row) in the external bit-matrix (plane index)

Definition at line 623 of file bmxor.h.

## Member Typedef Documentation

## block_match_chain_type

template<typename BV>

typedef bm::block_match_chain<size_type> bm::bv_ref_vector< BV >::block_match_chain_type

Definition at line 633 of file bmxor.h.

## bv_allocator_type

template<typename BV>

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

Definition at line 630 of file bmxor.h.

## bv_plane_vector_type

template<typename BV>

typedef bm::heap_vector<std::size_t, bv_allocator_type, true> bm::bv_ref_vector< BV >::bv_plane_vector_type

protected

Definition at line 772 of file bmxor.h.

## bvector_type

template<typename BV>

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

Definition at line 626 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 629 of file bmxor.h.

## bvector_type_ptr

template<typename BV>

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

Definition at line 628 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 771 of file bmxor.h.

## matrix_chain_type

template<typename BV>

typedef bm::dynamic_heap_matrix<block_match_chain_type, bv_allocator_type> bm::bv_ref_vector< BV >::matrix_chain_type

Definition at line 636 of file bmxor.h.

## size_type

template<typename BV>

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

Definition at line 627 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 652 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::add_vectors().

## add_sparse_vector()

template<typename BV>
template<class SV>

void bm::bv_ref_vector< BV >::add_sparse_vector | ( | const SV & | sv | ) |

inline

Add bit-transposed sparse vector as a bit-matrix.

See also
  add_vectors

Examples
  rscsample05.cpp.

Definition at line 739 of file bmxor.h.

Referenced by serialize_df2().

## add_vectors()

template<typename BV>
template<typename BMATR>

void bm::bv_ref_vector< BV >::add_vectors | ( | const BMATR & | bmatr | ) |

inline

Append basic bit-matrix to the list of reference vectors.

See also
  build
  add_sparse_vector

Examples
  rscsample05.cpp.

Definition at line 726 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::add_sparse_vector(), bm::bv_ref_vector< bvector_type >::build(), and deserialize_df2().

## build()

template<typename BV>
template<class BMATR>

void bm::bv_ref_vector< BV >::build | ( | const BMATR & | bmatr | ) |

inline

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

See also
  add_vectors

Definition at line 716 of file bmxor.h.

## build_nb_digest_and_xor_matrix()

template<typename BV>

bool bm::bv_ref_vector< BV >::build_nb_digest_and_xor_matrix | ( | matrix_chain_type & | matr,
|  | bvector_type & | bv_blocks ) const

inline

Calculate blocks digest and resize XOR distance matrix based on total number of available blocks.

Returns
  true if created ok (false if no blocks found)

Definition at line 759 of file bmxor.h.

Referenced by bm::compute_sim_matrix_plan_builder< BV >::build_plan().

## fill_alloc_digest()

template<typename BV>

void bm::bv_ref_vector< BV >::fill_alloc_digest | ( | bvector_type & | bv_blocks | ) | const

inline

Fill block allocation digest for all vectors in the reference collection.

Parameters

  bv_blocks | - [out] bvector of blocks statistics

Definition at line 699 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::build_nb_digest_and_xor_matrix(), and bm::bv_ref_vector< bvector_type >::fill_alloc_digest().

## 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 676 of file bmxor.h.

## find_bv()

template<typename BV>

size_type bm::bv_ref_vector< BV >::find_bv | ( | const bvector_type * | bv | ) | const

inline

Find vector index by the pointer.

Returns
  ~0 if not found

Definition at line 687 of file bmxor.h.

## 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 663 of file bmxor.h.

## 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 667 of file bmxor.h.

## not_found()

template<typename BV>

size_type bm::bv_ref_vector< BV >::not_found | ( |  | ) |

inline static

not-found value for find methods

Definition at line 672 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::find(), and bm::bv_ref_vector< bvector_type >::find_bv().

## reset()

template<typename BV>

void bm::bv_ref_vector< BV >::reset | ( |  | ) |

inline

reset the collection (resize(0))

Definition at line 641 of file bmxor.h.

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

## resize_xor_matrix()

template<typename BV>

void bm::bv_ref_vector< BV >::resize_xor_matrix | ( | matrix_chain_type & | matr,
|  | size_type | total_blocks ) const

inline

Utility function to resize matrix based on number of vectors and blocks.

Definition at line 746 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::build_nb_digest_and_xor_matrix().

## size()

template<typename BV>

size_type bm::bv_ref_vector< BV >::size | ( |  | ) | const

inline

Get reference list size.

Definition at line 660 of file bmxor.h.

Referenced by bm::bv_ref_vector< bvector_type >::fill_alloc_digest(), bm::bv_ref_vector< bvector_type >::find(), and bm::bv_ref_vector< bvector_type >::find_bv().

## Field Documentation

## ref_bvects_

template<typename BV>

bvptr_vector_type bm::bv_ref_vector< BV >::ref_bvects_

protected

reference vector pointers

Definition at line 776 of file bmxor.h.

## ref_bvects_rows_

template<typename BV>

bv_plane_vector_type bm::bv_ref_vector< BV >::ref_bvects_rows_

protected

reference vector row idxs

Definition at line 777 of file bmxor.h.

## rows_acc_

template<typename BV>

unsigned bm::bv_ref_vector< BV >::rows_acc_ = 0

protected

total rows accumulator

Definition at line 775 of file bmxor.h.

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

- bmxor.h