BitMagic-C++
|
Integer set to set transformation (functional image in groups theory) https://en.wikipedia.org/wiki/Image_(mathematics) More...
#include <bmsparsevec_algo.h>
Data Structures | |
struct | gather_buffer |
Public Types | |
typedef SV::bvector_type | bvector_type |
typedef SV::value_type | value_type |
typedef SV::size_type | size_type |
typedef bvector_type::allocator_type::allocator_pool_type | allocator_pool_type |
Public Member Functions | |
set2set_11_transform () | |
~set2set_11_transform () | |
const bvector_type & | get_bv_zero () const |
Get read access to zero-elements vector Zero vector gets populated after attach_sv() is called or as a side-effect of remap() with immediate sv param. More... | |
void | remap (const bvector_type &bv_in, bvector_type &bv_out) |
Perform remapping (Image function) (based on attached translation table) More... | |
void | remap (const bvector_type &bv_in, const SV &sv_brel, bvector_type &bv_out) |
Perform remapping (Image function) More... | |
bool | remap (size_type id_from, const SV &sv_brel, size_type &id_to) |
Remap single set element. More... | |
void | run (const bvector_type &bv_in, const SV &sv_brel, bvector_type &bv_out) |
Run remap transformation. More... | |
void | attach_sv (const SV *sv_brel, bool compute_stats=false) |
Attach a translation table vector for remapping (Image function) More... | |
Protected Types | |
enum | gather_window_size { sv_g_size = 1024 * 8 } |
typedef gather_buffer< sv_g_size > | gather_buffer_type |
Protected Member Functions | |
void | one_pass_run (const bvector_type &bv_in, const SV &sv_brel, bvector_type &bv_out) |
set2set_11_transform (const set2set_11_transform &)=delete | |
void | operator= (const set2set_11_transform &)=delete |
Protected Attributes | |
const SV * | sv_ptr_ |
current translation table vector More... | |
gather_buffer_type * | gb_ |
intermediate buffers More... | |
bvector_type | bv_product_ |
temp vector More... | |
bool | have_stats_ |
flag of statistics presense More... | |
bvector_type | bv_zero_ |
bit-vector for zero elements More... | |
allocator_pool_type | pool_ |
Integer set to set transformation (functional image in groups theory) https://en.wikipedia.org/wiki/Image_(mathematics)
Input sets gets translated through the function, which is defined as "one to one (or NULL)" binary relation object (sparse_vector). Also works for M:1 relationships.
Definition at line 453 of file bmsparsevec_algo.h.
typedef bvector_type::allocator_type::allocator_pool_type bm::set2set_11_transform< SV >::allocator_pool_type |
Definition at line 459 of file bmsparsevec_algo.h.
typedef SV::bvector_type bm::set2set_11_transform< SV >::bvector_type |
Definition at line 456 of file bmsparsevec_algo.h.
|
protected |
Definition at line 548 of file bmsparsevec_algo.h.
typedef SV::size_type bm::set2set_11_transform< SV >::size_type |
Definition at line 458 of file bmsparsevec_algo.h.
typedef SV::value_type bm::set2set_11_transform< SV >::value_type |
Definition at line 457 of file bmsparsevec_algo.h.
|
protected |
Enumerator | |
---|---|
sv_g_size |
Definition at line 544 of file bmsparsevec_algo.h.
bm::set2set_11_transform< SV >::set2set_11_transform | ( | ) |
Definition at line 573 of file bmsparsevec_algo.h.
References bm::set2set_11_transform< SV >::gb_.
bm::set2set_11_transform< SV >::~set2set_11_transform | ( | ) |
Definition at line 586 of file bmsparsevec_algo.h.
References bm::set2set_11_transform< SV >::gb_.
|
protecteddelete |
void bm::set2set_11_transform< SV >::attach_sv | ( | const SV * | sv_brel, |
bool | compute_stats = false |
||
) |
Attach a translation table vector for remapping (Image function)
sv_brel | - binary relation sparse vector pointer (pass NULL to detach) |
compute_stats | - flag to perform computation of some statistics later used in remapping. This only make sense for series of remappings on the same translation vector. |
Definition at line 596 of file bmsparsevec_algo.h.
References bm::bvector< Alloc >::mem_pool_guard::assign_if_not_set(), bm::set2set_11_transform< SV >::bv_zero_, bm::sparse_vector_scanner< SV >::find_zero(), bm::set2set_11_transform< SV >::have_stats_, bm::set2set_11_transform< SV >::pool_, and bm::set2set_11_transform< SV >::sv_ptr_.
Referenced by bm::set2set_11_transform< SV >::remap().
|
inline |
Get read access to zero-elements vector Zero vector gets populated after attach_sv() is called or as a side-effect of remap() with immediate sv param.
Definition at line 470 of file bmsparsevec_algo.h.
|
protected |
Definition at line 759 of file bmsparsevec_algo.h.
|
protecteddelete |
void bm::set2set_11_transform< SV >::remap | ( | const bvector_type & | bv_in, |
bvector_type & | bv_out | ||
) |
Perform remapping (Image function) (based on attached translation table)
bv_in | - input set, defined as a bit-vector |
bv_out | - output set as a bit-vector |
Definition at line 662 of file bmsparsevec_algo.h.
References bm::bvector< Alloc >::mem_pool_guard::assign_if_not_set(), BM_ASSERT, bm::BM_SORTED, bm::BM_SORTED_UNIFORM, bm::set2set_11_transform< SV >::bv_product_, bm::set2set_11_transform< SV >::bv_zero_, bm::set2set_11_transform< SV >::gb_, bm::set2set_11_transform< SV >::have_stats_, bm::set2set_11_transform< SV >::pool_, bm::set_block_shift, bm::set2set_11_transform< SV >::sv_g_size, and bm::set2set_11_transform< SV >::sv_ptr_.
Referenced by main(), and bm::set2set_11_transform< SV >::remap().
void bm::set2set_11_transform< SV >::remap | ( | const bvector_type & | bv_in, |
const SV & | sv_brel, | ||
bvector_type & | bv_out | ||
) |
Perform remapping (Image function)
bv_in | - input set, defined as a bit-vector |
sv_brel | - binary relation (translation table) sparse vector |
bv_out | - output set as a bit-vector |
Definition at line 645 of file bmsparsevec_algo.h.
References bm::bvector< Alloc >::mem_pool_guard::assign_if_not_set(), bm::set2set_11_transform< SV >::attach_sv(), bm::set2set_11_transform< SV >::bv_product_, bm::set2set_11_transform< SV >::bv_zero_, bm::set2set_11_transform< SV >::pool_, and bm::set2set_11_transform< SV >::remap().
bool bm::set2set_11_transform< SV >::remap | ( | size_type | id_from, |
const SV & | sv_brel, | ||
size_type & | id_to | ||
) |
Remap single set element.
id_from | - input value |
sv_brel | - translation table sparse vector |
id_to | - out value |
Definition at line 624 of file bmsparsevec_algo.h.
|
inline |
Run remap transformation.
bv_in | - input set, defined as a bit-vector |
sv_brel | - translation table sparse vector |
bv_out | - output set as a bit-vector |
Definition at line 511 of file bmsparsevec_algo.h.
Referenced by main().
|
protected |
temp vector
Definition at line 558 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::remap().
|
protected |
bit-vector for zero elements
Definition at line 561 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::attach_sv(), and bm::set2set_11_transform< SV >::remap().
|
protected |
intermediate buffers
Definition at line 557 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::remap(), bm::set2set_11_transform< SV >::set2set_11_transform(), and bm::set2set_11_transform< SV >::~set2set_11_transform().
|
protected |
flag of statistics presense
Definition at line 560 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::attach_sv(), and bm::set2set_11_transform< SV >::remap().
|
protected |
Definition at line 563 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::attach_sv(), and bm::set2set_11_transform< SV >::remap().
|
protected |
current translation table vector
Definition at line 556 of file bmsparsevec_algo.h.
Referenced by bm::set2set_11_transform< SV >::attach_sv(), and bm::set2set_11_transform< SV >::remap().