BitMagic-C++
Public Types | Public Member Functions
bm::sparse_vector_scanner< SV >::pipeline< Opt > Class Template Reference

Pipeline to run multiple searches against a particular SV faster using cache optimizations. More...

#include <bmsparsevec_algo.h>

Public Types

typedef aggregator_type::template pipeline< Opt > aggregator_pipeline_type
 

Public Member Functions

 pipeline (const SV &sv)
 
run_optionsoptions () BMNOEXCEPT
 Set pipeline run options. More...
 
const run_optionsget_options () const BMNOEXCEPT
 Get pipeline run options. More...
 
void set_search_mask (const bvector_type *bv_mask) BMNOEXCEPT
 Set pipeline mask bit-vector to restrict the search space. More...
 
void set_search_count_limit (size_type limit) BMNOEXCEPT
 Set search limit for results. More...
 
void set_or_target (bvector_type *bv_or) BMNOEXCEPT
 Attach OR (aggregator vector). More...
 

pipeline fill-in methods

class sparse_vector_scanner
 
const SV & sv_
 target sparse vector ref More...
 
aggregator_pipeline_type agg_pipe_
 traget aggregator pipeline More...
 
remap_vector_type remap_value_vect_
 remap buffer More...
 
const bvector_typebv_and_mask_
 
size_t eff_slices_
 number of effectice NOT NULL value slices More...
 
void add (const typename SV::value_type *str)
 Add new search string. More...
 
void complete ()
 Prepare pipeline for the execution (resize and init internal structures) Once complete, you cannot add() to it. More...
 
bool is_complete () const BMNOEXCEPT
  More...
 
size_type size () const BMNOEXCEPT
  More...
 
bvect_vector_typeget_bv_res_vector () BMNOEXCEPT
 Return results vector used for pipeline execution. More...
 
bv_count_vector_typeget_bv_count_vector () BMNOEXCEPT
 Return results vector count used for pipeline execution. More...
 
aggregator_pipeline_typeget_aggregator_pipe () BMNOEXCEPT
 get aggregator pipeline (access to compute internals) More...
 
 pipeline (const pipeline &)=delete
 
pipelineoperator= (const pipeline &)=delete
 

Detailed Description

template<typename SV>
template<class Opt = bm::agg_run_options<>>
class bm::sparse_vector_scanner< SV >::pipeline< Opt >

Pipeline to run multiple searches against a particular SV faster using cache optimizations.

USAGE:

Examples
strsvsample07.cpp.

Definition at line 537 of file bmsparsevec_algo.h.

Member Function Documentation

◆ add()

template<typename SV >
template<class Opt >
void bm::sparse_vector_scanner< SV >::pipeline< Opt >::add ( const typename SV::value_type *  str)

Add new search string.

Parameters
str- zero terminated string pointer to configure a search for

Definition at line 2948 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::add_agg_char(), and BM_ASSERT.

Referenced by main().

◆ complete()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
void bm::sparse_vector_scanner< SV >::pipeline< Opt >::complete ( )
inline

Prepare pipeline for the execution (resize and init internal structures) Once complete, you cannot add() to it.

Definition at line 593 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

Referenced by main().

◆ get_aggregator_pipe()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
aggregator_pipeline_type& bm::sparse_vector_scanner< SV >::pipeline< Opt >::get_aggregator_pipe ( )
inline

get aggregator pipeline (access to compute internals)

Definition at line 615 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

◆ get_bv_count_vector()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
bv_count_vector_type& bm::sparse_vector_scanner< SV >::pipeline< Opt >::get_bv_count_vector ( )
inline

Return results vector count used for pipeline execution.

Definition at line 607 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

◆ get_bv_res_vector()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
bvect_vector_type& bm::sparse_vector_scanner< SV >::pipeline< Opt >::get_bv_res_vector ( )
inline

Return results vector used for pipeline execution.

Definition at line 603 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

Referenced by main().

◆ get_options()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
const run_options& bm::sparse_vector_scanner< SV >::pipeline< Opt >::get_options ( ) const
inline

Get pipeline run options.

Definition at line 553 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

◆ is_complete()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
bool bm::sparse_vector_scanner< SV >::pipeline< Opt >::is_complete ( ) const
inline

◆ options()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
run_options& bm::sparse_vector_scanner< SV >::pipeline< Opt >::options ( )
inline

Set pipeline run options.

Definition at line 549 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

Referenced by main().

◆ set_or_target()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
void bm::sparse_vector_scanner< SV >::pipeline< Opt >::set_or_target ( bvector_type bv_or)
inline

Attach OR (aggregator vector).

Pipeline results all will be OR-ed (UNION) into the OR target vector

Parameters
bv_or- OR target vector

Definition at line 578 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

◆ set_search_count_limit()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
void bm::sparse_vector_scanner< SV >::pipeline< Opt >::set_search_count_limit ( size_type  limit)
inline

Set search limit for results.

Requires that bit-counting to be enabled in the template parameters. Warning: search limit is approximate (for performance reasons) so it can occasinally find more than requested. It cannot find less. Search limit works for individual results (not ORed aggregate)

Parameters
limit- search limit (target population count to search for)

Definition at line 570 of file bmsparsevec_algo.h.

References bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_.

◆ set_search_mask()

template<typename SV >
template<class Opt >
void bm::sparse_vector_scanner< SV >::pipeline< Opt >::set_search_mask ( const bvector_type bv_mask)

Set pipeline mask bit-vector to restrict the search space.

Parameters
bv_mask- pointer to bit-vector restricting search to vector indexes marked as 1s. Pointer ownership is not transferred, NULL value resets the mask. bv_mask defines the mask for all added searches.

Definition at line 2937 of file bmsparsevec_algo.h.

◆ size()

template<typename SV >
template<class Opt = bm::agg_run_options<>>
size_type bm::sparse_vector_scanner< SV >::pipeline< Opt >::size ( ) const
inline

Field Documentation

◆ agg_pipe_

template<typename SV >
template<class Opt = bm::agg_run_options<>>
aggregator_pipeline_type bm::sparse_vector_scanner< SV >::pipeline< Opt >::agg_pipe_
protected

◆ eff_slices_

template<typename SV >
template<class Opt = bm::agg_run_options<>>
size_t bm::sparse_vector_scanner< SV >::pipeline< Opt >::eff_slices_
protected

number of effectice NOT NULL value slices

Definition at line 628 of file bmsparsevec_algo.h.

◆ remap_value_vect_

template<typename SV >
template<class Opt = bm::agg_run_options<>>
remap_vector_type bm::sparse_vector_scanner< SV >::pipeline< Opt >::remap_value_vect_
protected

remap buffer

Definition at line 626 of file bmsparsevec_algo.h.

◆ sv_

template<typename SV >
template<class Opt = bm::agg_run_options<>>
const SV& bm::sparse_vector_scanner< SV >::pipeline< Opt >::sv_
protected

target sparse vector ref

Definition at line 624 of file bmsparsevec_algo.h.


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