barry: Your go-to motif accountant
0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
|
Baseline class for binary arrays. More...
#include <barraydense-bones.hpp>
Public Member Functions | |||||||||||||
bool | operator== (const BArrayDense< Cell_Type, Data_Type > &Array_) | ||||||||||||
~BArrayDense () | |||||||||||||
void | out_of_range (size_t i, size_t j) const | ||||||||||||
Cell_Type | get_cell (size_t i, size_t j, bool check_bounds=true) const | ||||||||||||
std::vector< Cell_Type > | get_col_vec (size_t i, bool check_bounds=true) const | ||||||||||||
std::vector< Cell_Type > | get_row_vec (size_t i, bool check_bounds=true) const | ||||||||||||
void | get_col_vec (std::vector< Cell_Type > *x, size_t i, bool check_bounds=true) const | ||||||||||||
void | get_row_vec (std::vector< Cell_Type > *x, size_t i, bool check_bounds=true) const | ||||||||||||
BArrayDenseRow< Cell_Type, Data_Type > & | row (size_t i, bool check_bounds=true) | ||||||||||||
const BArrayDenseRow_const< Cell_Type, Data_Type > | row (size_t i, bool check_bounds=true) const | ||||||||||||
BArrayDenseCol< Cell_Type, Data_Type > & | col (size_t j, bool check_bounds=true) | ||||||||||||
const BArrayDenseCol_const< Cell_Type, Data_Type > | col (size_t j, bool check_bounds=true) const | ||||||||||||
Entries< Cell_Type > | get_entries () const | ||||||||||||
Get the edgelist. More... | |||||||||||||
void | transpose () | ||||||||||||
void | clear (bool hard=true) | ||||||||||||
void | resize (size_t N_, size_t M_) | ||||||||||||
void | reserve () | ||||||||||||
void | print (const char *fmt=nullptr,...) const | ||||||||||||
bool | is_dense () const noexcept | ||||||||||||
const std::vector< Cell_Type > & | get_data () const | ||||||||||||
const Cell_Type | rowsum (size_t i) const | ||||||||||||
const Cell_Type | colsum (size_t i) const | ||||||||||||
Constructors | |||||||||||||
| |||||||||||||
BArrayDense () | |||||||||||||
Zero-size array. More... | |||||||||||||
BArrayDense (size_t N_, size_t M_, Cell_Type value=static_cast< Cell_Type >(0)) | |||||||||||||
Empty array. More... | |||||||||||||
BArrayDense (size_t N_, size_t M_, const std::vector< size_t > &source, const std::vector< size_t > &target, const std::vector< Cell_Type > &value, bool add=true) | |||||||||||||
Edgelist with data. More... | |||||||||||||
BArrayDense (size_t N_, size_t M_, const std::vector< size_t > &source, const std::vector< size_t > &target, bool add=true) | |||||||||||||
Edgelist with no data (simpler) More... | |||||||||||||
BArrayDense (const BArrayDense< Cell_Type, Data_Type > &Array_, bool copy_data=false) | |||||||||||||
Copy constructor. More... | |||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator= (const BArrayDense< Cell_Type, Data_Type > &Array_) | ||||||||||||
Assignment constructor. More... | |||||||||||||
BArrayDense (BArrayDense< Cell_Type, Data_Type > &&x) noexcept | |||||||||||||
Move operator. More... | |||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator= (BArrayDense< Cell_Type, Data_Type > &&x) noexcept | ||||||||||||
Move assignment. More... | |||||||||||||
void | set_data (Data_Type *data_, bool delete_data_=false) | ||||||||||||
Set the data object. More... | |||||||||||||
Data_Type * | D_ptr () | ||||||||||||
const Data_Type * | D_ptr () const | ||||||||||||
Data_Type & | D () | ||||||||||||
const Data_Type & | D () const | ||||||||||||
Queries | |||||||||||||
| |||||||||||||
bool | is_empty (size_t i, size_t j, bool check_bounds=true) const | ||||||||||||
size_t | nrow () const noexcept | ||||||||||||
size_t | ncol () const noexcept | ||||||||||||
size_t | nnozero () const noexcept | ||||||||||||
Cell< Cell_Type > | default_val () const | ||||||||||||
Cell-wise insertion/deletion | |||||||||||||
| |||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator+= (const std::pair< size_t, size_t > &coords) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator-= (const std::pair< size_t, size_t > &coords) | ||||||||||||
BArrayDenseCell< Cell_Type, Data_Type > | operator() (size_t i, size_t j, bool check_bounds=true) | ||||||||||||
const Cell_Type | operator() (size_t i, size_t j, bool check_bounds=true) const | ||||||||||||
void | rm_cell (size_t i, size_t j, bool check_bounds=true, bool check_exists=true) | ||||||||||||
void | insert_cell (size_t i, size_t j, const Cell< Cell_Type > &v, bool check_bounds, bool) | ||||||||||||
void | insert_cell (size_t i, size_t j, Cell_Type v, bool check_bounds, bool) | ||||||||||||
void | swap_cells (size_t i0, size_t j0, size_t i1, size_t j1, bool check_bounds=true, int check_exists=CHECK::BOTH, int *report=nullptr) | ||||||||||||
void | toggle_cell (size_t i, size_t j, bool check_bounds=true, int check_exists=EXISTS::UKNOWN) | ||||||||||||
void | toggle_lock (size_t i, size_t j, bool check_bounds=true) | ||||||||||||
Column/row wise interchange | |||||||||||||
void | swap_rows (size_t i0, size_t i1, bool check_bounds=true) | ||||||||||||
void | swap_cols (size_t j0, size_t j1, bool check_bounds=true) | ||||||||||||
void | zero_row (size_t i, bool check_bounds=true) | ||||||||||||
void | zero_col (size_t j, bool check_bounds=true) | ||||||||||||
Arithmetic operators | |||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator+= (const BArrayDense< Cell_Type, Data_Type > &rhs) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator+= (const Cell_Type &rhs) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator-= (const BArrayDense< Cell_Type, Data_Type > &rhs) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator-= (const Cell_Type &rhs) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator/= (const Cell_Type &rhs) | ||||||||||||
BArrayDense< Cell_Type, Data_Type > & | operator*= (const Cell_Type &rhs) | ||||||||||||
Public Attributes | |
bool | visited = false |
Baseline class for binary arrays.
BArrayDense
class objects are arbitrary dense-arrays. The data is stored internally in the el
member, which can be accessed using the member function get_data()
, by column.
Cell_Type | Type of cell (any type). |
Data_Type | Data type of the array (bool default). |
Definition at line 33 of file barraydense-bones.hpp.
|
inline |
Zero-size array.
Definition at line 79 of file barraydense-bones.hpp.
|
inline |
Empty array.
Definition at line 82 of file barraydense-bones.hpp.
|
inline |
Edgelist with data.
Definition at line 35 of file barraydense-meat.hpp.
|
inline |
Edgelist with no data (simpler)
Definition at line 86 of file barraydense-meat.hpp.
|
inline |
Copy constructor.
Definition at line 135 of file barraydense-meat.hpp.
|
inlinenoexcept |
Move operator.
Definition at line 229 of file barraydense-meat.hpp.
|
inline |
Definition at line 310 of file barraydense-meat.hpp.
|
inline |
Definition at line 911 of file barraydense-meat.hpp.
|
inline |
Definition at line 504 of file barraydense-meat.hpp.
|
inline |
Definition at line 490 of file barraydense-meat.hpp.
|
inline |
Definition at line 1014 of file barraydense-meat.hpp.
|
inline |
Definition at line 345 of file barraydense-meat.hpp.
|
inline |
Definition at line 350 of file barraydense-meat.hpp.
|
inline |
Definition at line 335 of file barraydense-meat.hpp.
|
inline |
Definition at line 340 of file barraydense-meat.hpp.
|
inline |
Definition at line 577 of file barraydense-meat.hpp.
|
inline |
Definition at line 376 of file barraydense-meat.hpp.
|
inline |
Definition at line 424 of file barraydense-meat.hpp.
|
inline |
Definition at line 442 of file barraydense-meat.hpp.
|
inline |
Definition at line 1004 of file barraydense-meat.hpp.
|
inline |
Get the edgelist.
Entries
is a class with three objects: Two std::vector
with the row and column coordinates respectively, and one std::vector
with the corresponding value of the cell.
Definition at line 516 of file barraydense-meat.hpp.
|
inline |
Definition at line 391 of file barraydense-meat.hpp.
|
inline |
Definition at line 409 of file barraydense-meat.hpp.
|
inline |
Definition at line 703 of file barraydense-meat.hpp.
|
inline |
Definition at line 669 of file barraydense-meat.hpp.
|
inlinenoexcept |
Definition at line 256 of file barraydense-bones.hpp.
|
inline |
Definition at line 545 of file barraydense-meat.hpp.
|
inlinenoexcept |
Definition at line 562 of file barraydense-meat.hpp.
|
inlinenoexcept |
Definition at line 566 of file barraydense-meat.hpp.
|
inlinenoexcept |
Definition at line 558 of file barraydense-meat.hpp.
|
inline |
Definition at line 621 of file barraydense-meat.hpp.
|
inline |
Definition at line 632 of file barraydense-meat.hpp.
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator*= | ( | const Cell_Type & | rhs | ) |
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator+= | ( | const BArrayDense< Cell_Type, Data_Type > & | rhs | ) |
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator+= | ( | const Cell_Type & | rhs | ) |
|
inline |
Definition at line 582 of file barraydense-meat.hpp.
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator-= | ( | const BArrayDense< Cell_Type, Data_Type > & | rhs | ) |
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator-= | ( | const Cell_Type & | rhs | ) |
|
inline |
Definition at line 601 of file barraydense-meat.hpp.
BArrayDense<Cell_Type,Data_Type>& BArrayDense< Cell_Type, Data_Type >::operator/= | ( | const Cell_Type & | rhs | ) |
|
inlinenoexcept |
Move assignment.
Definition at line 247 of file barraydense-meat.hpp.
|
inline |
Assignment constructor.
Definition at line 179 of file barraydense-meat.hpp.
|
inline |
Definition at line 291 of file barraydense-meat.hpp.
|
inline |
Definition at line 355 of file barraydense-meat.hpp.
|
inline |
Definition at line 970 of file barraydense-meat.hpp.
|
inline |
Definition at line 961 of file barraydense-meat.hpp.
|
inline |
Definition at line 925 of file barraydense-meat.hpp.
|
inline |
Definition at line 646 of file barraydense-meat.hpp.
|
inline |
Definition at line 476 of file barraydense-meat.hpp.
|
inline |
Definition at line 463 of file barraydense-meat.hpp.
|
inline |
Definition at line 1009 of file barraydense-meat.hpp.
|
inline |
Set the data object.
data_ | |
delete_data_ |
Definition at line 319 of file barraydense-meat.hpp.
|
inline |
Definition at line 734 of file barraydense-meat.hpp.
|
inline |
Definition at line 818 of file barraydense-meat.hpp.
|
inline |
Definition at line 790 of file barraydense-meat.hpp.
|
inline |
Definition at line 771 of file barraydense-meat.hpp.
void BArrayDense< Cell_Type, Data_Type >::toggle_lock | ( | size_t | i, |
size_t | j, | ||
bool | check_bounds = true |
||
) |
|
inline |
Definition at line 883 of file barraydense-meat.hpp.
|
inline |
Definition at line 864 of file barraydense-meat.hpp.
|
inline |
Definition at line 845 of file barraydense-meat.hpp.
|
friend |
Definition at line 1 of file barraydense-bones.hpp.
|
friend |
Definition at line 1 of file barraydense-bones.hpp.
|
friend |
Definition at line 1 of file barraydense-bones.hpp.
|
friend |
Definition at line 1 of file barraydense-bones.hpp.
|
friend |
Definition at line 1 of file barraydense-bones.hpp.
bool BArrayDense< Cell_Type, Data_Type >::visited = false |
This is as a reference, if we need to iterate through the cells and we need to keep track which were visited, we use this as a reference. So that if cell.visited = true and visited = true, it means that we haven't been here yet. Ideally, any routine using this->visited should switch it at the beginning of the routine.
Definition at line 63 of file barraydense-bones.hpp.