Shiokaze Framework
A research-oriented fluid solver for computer graphics
bitarray2 Class Reference

Two dimensional bit grid class designed to be defined as instance member in recursive_configurable class. More...

#include <bitarray2.h>

Inheritance diagram for bitarray2:
recursive_configurable messageable configurable

Classes

class  const_iterator
 Read-only iterator. More...
 
class  iterator
 Writable iterator. More...
 
struct  type2
 Collection of properties of this grid. More...
 

Public Types

enum  { ACTIVES = true, ALL = false }
 
- Public Types inherited from configurable
using environment_map = std::map< std::string, const void * >
 Type for environment_map.
 

Public Member Functions

 bitarray2 (recursive_configurable *parent, const shape2 &shape, std::string core_name="")
 Constructor for bitarray2. More...
 
 bitarray2 (recursive_configurable *parent, std::string core_name="")
 Constructor for bitarray2. More...
 
 bitarray2 (std::string core_name="")
 Constructor for bitarray2. More...
 
 bitarray2 (const shape2 &shape, std::string core_name="")
 Constructor for bitarray2. More...
 
virtual bool send_message (std::string message, void *ptr) override
 Send a message to the core module. More...
 
virtual bool const_send_message (std::string message, void *ptr) const override
 Send a message to the core module. More...
 
 bitarray2 (const bitarray2 &array)
 Copy constructor for bitarray2. More...
 
bitarray2operator= (const bitarray2 &array)
 Deep copy operation for bitarray2. More...
 
void copy (const bitarray2 &array)
 Deep copy function for bitarray2. More...
 
shape2 shape () const
 Get the shape of the array. More...
 
void initialize (const shape2 &shape)
 Allocate grid memory with value. More...
 
size_t count () const
 Function to count the number of active cells. More...
 
std::vector< vec2iactives () const
 Function to return the list of active cells positions. More...
 
void activate (const std::vector< vec2i > &active_entries, const vec2i &offset=vec2i())
 Activate cells at the positons of active_entries with an offset. More...
 
template<class Y >
void activate_as (const array2< Y > &array, const vec2i &offset=vec2i())
 Activate cells at the same positons where an input array is active with an offset. More...
 
template<class Y >
void activate_as_bit (const Y &array, const vec2i &offset=vec2i())
 Activate cells at the same positons where an input array is active with an offset. More...
 
template<class Y >
void activate_inside_as (const array2< Y > &array, const vec2i &offset=vec2i())
 Activate cells at the same positons where an input array is filled with an offset. More...
 
void activate_all ()
 Activate all the cells.
 
void copy_active_as (const bitarray2 &array, const vec2i &offset=vec2i())
 Copy the states of active and inactive cells as same as input array with an offset. More...
 
void clear ()
 Clear out the grid. More...
 
void set (int i, int j)
 Set bit on grid. More...
 
void set (const vec2i &pi)
 Set bit on grid. More...
 
bool operator() (int i, int j) const
 Get if a position on grid is active. More...
 
bool operator() (const vec2i &pi) const
 Get if a position on grid is active. More...
 
bool safe_get (int i, int j) const
 Get if a position on grid is active. (i,j) can be safely out of the domain. More...
 
bool safe_get (const vec2i &pi) const
 Get if a position on grid is active. pi can be safely out of the domain. More...
 
void set_off (int i, int j)
 Set a position on grid inactive. More...
 
void set_off (const vec2i &pi)
 Set a position on grid inactive. More...
 
bool operator!= (const bitarray2 &array) const
 Return if the grid is different from an input array. More...
 
bool operator== (const bitarray2 &v) const
 Return if the grid is same to an input array. More...
 
void set_thread_num (int number)
 Set the number of threads for parallel processing on this grid. More...
 
int get_thread_num () const
 Get the current number of threads for parallel processing on this grid. More...
 
void parallel_actives (std::function< void(iterator &it)> func)
 Loop over all the active cells in parallel. More...
 
void parallel_all (std::function< void(iterator &it)> func)
 Loop over all the cells in parallel. More...
 
void parallel_op (std::function< void(iterator &it)> func, bool type=ALL)
 Loop over cells in parallel. More...
 
void parallel_actives (std::function< void(int i, int j, iterator &it)> func)
 Loop over all the active cells in parallel. More...
 
void parallel_all (std::function< void(int i, int j, iterator &it)> func)
 Loop over all the cells in parallel. More...
 
void parallel_op (std::function< void(int i, int j, iterator &it)> func, bool type=ALL)
 Loop over cells in parallel. More...
 
void parallel_actives (std::function< void(int i, int j, iterator &it, int thread_index)> func)
 Loop over all the active cells in parallel. More...
 
void parallel_all (std::function< void(int i, int j, iterator &it, int thread_index)> func)
 Loop over all the cells in parallel. More...
 
void parallel_op (std::function< void(int i, int j, iterator &it, int thread_index)> func, bool type=ALL)
 Loop over cells in parallel. More...
 
void const_parallel_all (std::function< void(const const_iterator &it)> func) const
 Loop over all the cells in parallel by read-only fashion. More...
 
void const_parallel_op (std::function< void(const const_iterator &it)> func, bool type=ALL) const
 Loop over cells in parallel by read-only fashion. More...
 
void const_parallel_actives (std::function< void(int i, int j)> func) const
 Loop over all the active cells in parallel by read-only fashion. More...
 
void const_parallel_all (std::function< void(int i, int j, const const_iterator &it)> func) const
 Loop over all the cells in parallel by read-only fashion. More...
 
void const_parallel_op (std::function< void(int i, int j, const const_iterator &it)> func, bool type=ALL) const
 Loop over cells in parallel by read-only fashion. More...
 
void const_parallel_actives (std::function< void(int i, int j, int thread_index)> func) const
 Loop over all the active cells in parallel by read-only fashion. More...
 
void const_parallel_all (std::function< void(int i, int j, const const_iterator &it, int thread_index)> func) const
 Loop over all the cells in parallel by read-only fashion. More...
 
void const_parallel_op (std::function< void(int i, int j, const const_iterator &it, int thread_index)> func, bool type=ALL) const
 Loop over cells in parallel by read-only fashion. More...
 
void serial_actives (std::function< void(iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void serial_all (std::function< void(iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void serial_op (std::function< void(iterator &it)> func, bool type=ALL)
 Loop over cells in serial order. More...
 
void serial_actives (std::function< void(int i, int j, iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void serial_all (std::function< void(int i, int j, iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void serial_op (std::function< void(int i, int j, iterator &it)> func, bool type=ALL)
 Loop over cells in serial order. More...
 
void const_serial_all (std::function< void(const const_iterator &it)> func) const
 Loop over all the cells in serial order by read-only fashion. More...
 
void const_serial_op (std::function< void(const const_iterator &it)> func, bool type=ALL) const
 Loop over the cells in serial order by read-only fashion. More...
 
void const_serial_actives (std::function< void(int i, int j)> func) const
 Loop over all the active cells in serial order by read-only fashion. More...
 
void const_serial_all (std::function< void(int i, int j, const const_iterator &it)> func) const
 Loop over all the cells in serial order by read-only fashion. More...
 
void const_serial_op (std::function< void(int i, int j, const const_iterator &it)> func, bool type=ALL) const
 Loop over cells in serial order by read-only fashion. More...
 
void interruptible_serial_actives (std::function< bool(iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void interruptible_serial_all (std::function< bool(iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void interruptible_serial_op (std::function< bool(iterator &it)> func, bool type=ALL)
 Loop over cells in serial order. More...
 
void interruptible_serial_actives (std::function< bool(int i, int j, iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void interruptible_serial_all (std::function< bool(int i, int j, iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void interruptible_serial_op (std::function< bool(int i, int j, iterator &it)> func, bool type=ALL)
 Loop over cells in serial order. More...
 
void interruptible_const_serial_all (std::function< bool(const const_iterator &it)> func) const
 Loop over all the cells in serial order by read-only fashion. More...
 
void interruptible_const_serial_op (std::function< bool(const const_iterator &it)> func, bool type=ALL) const
 Loop over cells in serial order by read-only fashion. More...
 
void interruptible_const_serial_actives (std::function< bool(int i, int j)> func) const
 Loop over all the active cells in serial order by read-only fashion. More...
 
void interruptible_const_serial_all (std::function< bool(int i, int j, const const_iterator &it)> func) const
 Loop over all the cells in serial order by read-only fashion. More...
 
void interruptible_const_serial_op (std::function< bool(int i, int j, const const_iterator &it)> func, bool type=ALL) const
 Loop over cells in serial order by read-only fashion. More...
 
void dilate (std::function< void(int i, int j, iterator &it, int thread_index)> func, int count=1)
 Dilate cells. More...
 
void dilate (std::function< void(int i, int j, iterator &it)> func, int count=1)
 Dilate cells. More...
 
void dilate (int count=1)
 Dilate cells. More...
 
void erode (std::function< bool(int i, int j, int thread_index)> func, int count=1)
 Erode cells. More...
 
void erode (std::function< bool(int i, int j)> func, int count=1)
 Erode cells. More...
 
void erode (int count=1)
 Erode cells. More...
 
void swap (bitarray2 &rhs)
 Swap array. More...
 
parallel_driverget_parallel_driver ()
 Get the instance of parallel_driver of this grid. More...
 
const parallel_driverget_parallel_driver () const
 Get the const instance of parallel_driver of this grid. More...
 
void set_core_name (std::string core_name)
 Set the core name of module of this grid. More...
 
std::string get_core_name () const
 Get the core name of module of this grid. More...
 
const array_core2get_core () const
 Get pointer to the core module. More...
 
array_core2get_core ()
 Get pointer to the core module. More...
 
type2 type () const
 Get the type of this grid. More...
 
void set_type (const type2 &type)
 Set the type of this grid. More...
 
- Public Member Functions inherited from recursive_configurable
 recursive_configurable ()=default
 Default constructor.
 
virtual void recursive_load (configuration &config)
 Load the program itself and relay the same to its children. Used to load files and libraries into memory. More...
 
virtual void recursive_configure (configuration &config)
 Configure the program itself and relay the same to its children. Used to load and set parameters. More...
 
virtual void recursive_initialize (const configurable::environment_map &environment=configurable::environment_map())
 Initialize the program itself and relay the same to its children. Used to get things ready for actual use. More...
 
virtual bool is_ready () const
 Get if the instance is initialized. More...
 
virtual void add_child (configurable *child)
 Add a child instance. More...
 
virtual void add_child (recursive_configurable *child)
 Add a child instance. More...
 
virtual void remove_child (configurable *child)
 Remove a child instance. More...
 
virtual void remove_child (recursive_configurable *child)
 Remove a child instance. More...
 
virtual void setup_now (configuration &config=get_global_configuration()) override
 Run recursive_load - recursive_configure - recursive_initialize processes.
 
virtual bool not_recursive () override
 Check if this instance is not derived from recursive_configurable. More...
 
void set_environment (std::string name, const void *value)
 Set the pointer to an environmental value associated with an input name. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from configurable
static configurationset_global_configuration (const configuration &config)
 Assign the global settings of the program. More...
 
static configurationget_global_configuration ()
 Get the global settings of the program. More...
 
template<class T >
static const T & get_env (const environment_map &environment, std::string key)
 Extract an specified type of pointer from the input environment. More...
 
- Protected Member Functions inherited from configurable
bool check_set (const environment_map &environment, std::vector< std::string > names)
 Check if the values for a variable keys exist. More...
 

Detailed Description

Two dimensional bit grid class designed to be defined as instance member in recursive_configurable class.

Constructor & Destructor Documentation

◆ bitarray2() [1/5]

bitarray2::bitarray2 ( recursive_configurable parent,
const shape2 shape,
std::string  core_name = "" 
)
inline

Constructor for bitarray2.

Parameters
[in]parentPointer to a parent recursive_configurable instance. Can be nullptr.
[in]shapeShape of the grid
[in]core_nameCore module name. Default value is "tiledarray2".

◆ bitarray2() [2/5]

bitarray2::bitarray2 ( recursive_configurable parent,
std::string  core_name = "" 
)
inline

Constructor for bitarray2.

Parameters
[in]parentPointer to a parent recursive_configurable instance. Can be nullptr.
[in]core_nameCore module name. Default value is "tiledarray2".

◆ bitarray2() [3/5]

bitarray2::bitarray2 ( std::string  core_name = "")
inline

Constructor for bitarray2.

Parameters
[in]core_nameCore module name. Default value is "tiledarray2".

◆ bitarray2() [4/5]

bitarray2::bitarray2 ( const shape2 shape,
std::string  core_name = "" 
)
inline

Constructor for bitarray2.

Parameters
[in]shapeShape of the grid
[in]core_nameCore module name. Default value is "tiledarray2".

◆ bitarray2() [5/5]

bitarray2::bitarray2 ( const bitarray2 array)
inline

Copy constructor for bitarray2.

Parameters
[in]arrayReference to an instance of array to copy from.

Member Function Documentation

◆ activate()

void bitarray2::activate ( const std::vector< vec2i > &  active_entries,
const vec2i offset = vec2i() 
)
inline

Activate cells at the positons of active_entries with an offset.

Parameters
[in]active_entriesThe list of target positions to activate.
[in]offsetOffset applied to the active_entries.

◆ activate_as()

template<class Y >
void bitarray2::activate_as ( const array2< Y > &  array,
const vec2i offset = vec2i() 
)
inline

Activate cells at the same positons where an input array is active with an offset.

Parameters
[in]arrayTarget array.
[in]offsetOffset applied to the target array.

◆ activate_as_bit()

template<class Y >
void bitarray2::activate_as_bit ( const Y &  array,
const vec2i offset = vec2i() 
)
inline

Activate cells at the same positons where an input array is active with an offset.

Parameters
[in]arrayTarget array.
[in]offsetOffset applied to the target array.

◆ activate_inside_as()

template<class Y >
void bitarray2::activate_inside_as ( const array2< Y > &  array,
const vec2i offset = vec2i() 
)
inline

Activate cells at the same positons where an input array is filled with an offset.

Parameters
[in]arrayTarget array.
[in]offsetOffset applied to the target array.

◆ actives()

std::vector<vec2i> bitarray2::actives ( ) const
inline

Function to return the list of active cells positions.

Returns
The list of active cells positions.

◆ clear()

void bitarray2::clear ( )
inline

Clear out the grid.

Note that size, the memory allocation, background values and the information regarding level set or fillable left intact.

◆ const_parallel_actives() [1/2]

void bitarray2::const_parallel_actives ( std::function< void(int i, int j)>  func) const
inline

Loop over all the active cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_parallel_actives() [2/2]

void bitarray2::const_parallel_actives ( std::function< void(int i, int j, int thread_index)>  func) const
inline

Loop over all the active cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_parallel_all() [1/3]

void bitarray2::const_parallel_all ( std::function< void(const const_iterator &it)>  func) const
inline

Loop over all the cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_parallel_all() [2/3]

void bitarray2::const_parallel_all ( std::function< void(int i, int j, const const_iterator &it)>  func) const
inline

Loop over all the cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_parallel_all() [3/3]

void bitarray2::const_parallel_all ( std::function< void(int i, int j, const const_iterator &it, int thread_index)>  func) const
inline

Loop over all the cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_parallel_op() [1/3]

void bitarray2::const_parallel_op ( std::function< void(const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ const_parallel_op() [2/3]

void bitarray2::const_parallel_op ( std::function< void(int i, int j, const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ const_parallel_op() [3/3]

void bitarray2::const_parallel_op ( std::function< void(int i, int j, const const_iterator &it, int thread_index)>  func,
bool  type = ALL 
) const
inline

Loop over cells in parallel by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ const_send_message()

virtual bool bitarray2::const_send_message ( std::string  message,
void *  ptr 
) const
inlineoverridevirtual

Send a message to the core module.

Parameters
[in]messageMessage
[in]ptrPointer to some value.
Returns
true if handled false otherwise.

Reimplemented from messageable.

◆ const_serial_actives()

void bitarray2::const_serial_actives ( std::function< void(int i, int j)>  func) const
inline

Loop over all the active cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_serial_all() [1/2]

void bitarray2::const_serial_all ( std::function< void(const const_iterator &it)>  func) const
inline

Loop over all the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_serial_all() [2/2]

void bitarray2::const_serial_all ( std::function< void(int i, int j, const const_iterator &it)>  func) const
inline

Loop over all the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ const_serial_op() [1/2]

void bitarray2::const_serial_op ( std::function< void(const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ const_serial_op() [2/2]

void bitarray2::const_serial_op ( std::function< void(int i, int j, const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ copy()

void bitarray2::copy ( const bitarray2 array)
inline

Deep copy function for bitarray2.

Parameters
[in]arrayReference to an instance of array to copy from.

◆ copy_active_as()

void bitarray2::copy_active_as ( const bitarray2 array,
const vec2i offset = vec2i() 
)
inline

Copy the states of active and inactive cells as same as input array with an offset.

Parameters
[in]arrayTarget input array from which the states to be copied.
[in]offsetOffset

◆ count()

size_t bitarray2::count ( ) const
inline

Function to count the number of active cells.

Returns
Active cell count.

◆ dilate() [1/3]

void bitarray2::dilate ( int  count = 1)
inline

Dilate cells.

Parameters
[in]countNumber of dilation count.

◆ dilate() [2/3]

void bitarray2::dilate ( std::function< void(int i, int j, iterator &it)>  func,
int  count = 1 
)
inline

Dilate cells.

Parameters
[in]funcFunction that specifies what value to assign on dilated cells.
[in]countNumber of dilation count.

◆ dilate() [3/3]

void bitarray2::dilate ( std::function< void(int i, int j, iterator &it, int thread_index)>  func,
int  count = 1 
)
inline

Dilate cells.

Parameters
[in]funcFunction that specifies what value to assign on dilated cells.
[in]countNumber of dilation count.

◆ erode() [1/3]

void bitarray2::erode ( int  count = 1)
inline

Erode cells.

Parameters
[in]countNumber of erode count.

◆ erode() [2/3]

void bitarray2::erode ( std::function< bool(int i, int j)>  func,
int  count = 1 
)
inline

Erode cells.

Parameters
[in]funcFunction that specifies whether to inactivate the cell.
[in]countNumber of erode count.

◆ erode() [3/3]

void bitarray2::erode ( std::function< bool(int i, int j, int thread_index)>  func,
int  count = 1 
)
inline

Erode cells.

Parameters
[in]funcFunction that specifies whether to inactivate the cell.
[in]countNumber of erode count.

◆ get_core() [1/2]

array_core2* bitarray2::get_core ( )
inline

Get pointer to the core module.

Returns
Pointer to the core module.

◆ get_core() [2/2]

const array_core2* bitarray2::get_core ( ) const
inline

Get pointer to the core module.

Returns
Pointer to the core module.

◆ get_core_name()

std::string bitarray2::get_core_name ( ) const
inline

Get the core name of module of this grid.

Returns
Name of the core name.

◆ get_parallel_driver() [1/2]

parallel_driver& bitarray2::get_parallel_driver ( )
inline

Get the instance of parallel_driver of this grid.

Returns
Instance of parallel_driver of this grid.

◆ get_parallel_driver() [2/2]

const parallel_driver& bitarray2::get_parallel_driver ( ) const
inline

Get the const instance of parallel_driver of this grid.

Returns
Const instance of parallel_driver of this grid.

◆ get_thread_num()

int bitarray2::get_thread_num ( ) const
inline

Get the current number of threads for parallel processing on this grid.

Returns
number Number of threads.

◆ initialize()

void bitarray2::initialize ( const shape2 shape)
inline

Allocate grid memory with value.

Parameters
[in]shapeShape of the grid.

◆ interruptible_const_serial_actives()

void bitarray2::interruptible_const_serial_actives ( std::function< bool(int i, int j)>  func) const
inline

Loop over all the active cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_const_serial_all() [1/2]

void bitarray2::interruptible_const_serial_all ( std::function< bool(const const_iterator &it)>  func) const
inline

Loop over all the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_const_serial_all() [2/2]

void bitarray2::interruptible_const_serial_all ( std::function< bool(int i, int j, const const_iterator &it)>  func) const
inline

Loop over all the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_const_serial_op() [1/2]

void bitarray2::interruptible_const_serial_op ( std::function< bool(const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.
[in]typeType of target cells. ACTIVE or ALL. Stop the loop if return true.

◆ interruptible_const_serial_op() [2/2]

void bitarray2::interruptible_const_serial_op ( std::function< bool(int i, int j, const const_iterator &it)>  func,
bool  type = ALL 
) const
inline

Loop over cells in serial order by read-only fashion.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.
[in]typeType of target cells. ACTIVE or ALL. Stop the loop if return true.

◆ interruptible_serial_actives() [1/2]

void bitarray2::interruptible_serial_actives ( std::function< bool(int i, int j, iterator &it)>  func)
inline

Loop over all the active cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_serial_actives() [2/2]

void bitarray2::interruptible_serial_actives ( std::function< bool(iterator &it)>  func)
inline

Loop over all the active cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_serial_all() [1/2]

void bitarray2::interruptible_serial_all ( std::function< bool(int i, int j, iterator &it)>  func)
inline

Loop over all the cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_serial_all() [2/2]

void bitarray2::interruptible_serial_all ( std::function< bool(iterator &it)>  func)
inline

Loop over all the cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.

◆ interruptible_serial_op() [1/2]

void bitarray2::interruptible_serial_op ( std::function< bool(int i, int j, iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL. Stop the loop if return true.

◆ interruptible_serial_op() [2/2]

void bitarray2::interruptible_serial_op ( std::function< bool(iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed. Stop the loop if return true.
[in]typeType of target cells. ACTIVE or ALL.

◆ operator!=()

bool bitarray2::operator!= ( const bitarray2 array) const
inline

Return if the grid is different from an input array.

Parameters
[in]arrayTarget array to compare.
Returns
true if the array is different from the input array and false otherwise.

◆ operator()() [1/2]

bool bitarray2::operator() ( const vec2i pi) const
inline

Get if a position on grid is active.

Parameters
[in]piposition on grid.
Returns
true if active flase if inactive.

◆ operator()() [2/2]

bool bitarray2::operator() ( int  i,
int  j 
) const
inline

Get if a position on grid is active.

Parameters
[in]iposition on x coordiante.
[in]jposition on y coordinate.
Returns
true if active flase if inactive.

◆ operator=()

bitarray2& bitarray2::operator= ( const bitarray2 array)
inline

Deep copy operation for bitarray2.

Parameters
[in]arrayReference to an instance of array to copy from.

◆ operator==()

bool bitarray2::operator== ( const bitarray2 v) const
inline

Return if the grid is same to an input array.

Parameters
[in]arrayTarget array to compare.
Returns
true if the array is the same to the input and false otherwise.

◆ parallel_actives() [1/3]

void bitarray2::parallel_actives ( std::function< void(int i, int j, iterator &it)>  func)
inline

Loop over all the active cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_actives() [2/3]

void bitarray2::parallel_actives ( std::function< void(int i, int j, iterator &it, int thread_index)>  func)
inline

Loop over all the active cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_actives() [3/3]

void bitarray2::parallel_actives ( std::function< void(iterator &it)>  func)
inline

Loop over all the active cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_all() [1/3]

void bitarray2::parallel_all ( std::function< void(int i, int j, iterator &it)>  func)
inline

Loop over all the cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_all() [2/3]

void bitarray2::parallel_all ( std::function< void(int i, int j, iterator &it, int thread_index)>  func)
inline

Loop over all the cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_all() [3/3]

void bitarray2::parallel_all ( std::function< void(iterator &it)>  func)
inline

Loop over all the cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ parallel_op() [1/3]

void bitarray2::parallel_op ( std::function< void(int i, int j, iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ parallel_op() [2/3]

void bitarray2::parallel_op ( std::function< void(int i, int j, iterator &it, int thread_index)>  func,
bool  type = ALL 
)
inline

Loop over cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ parallel_op() [3/3]

void bitarray2::parallel_op ( std::function< void(iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in parallel.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ safe_get() [1/2]

bool bitarray2::safe_get ( const vec2i pi) const
inline

Get if a position on grid is active. pi can be safely out of the domain.

Parameters
[in]piposition on grid.
Returns
true if active flase if inactive.

◆ safe_get() [2/2]

bool bitarray2::safe_get ( int  i,
int  j 
) const
inline

Get if a position on grid is active. (i,j) can be safely out of the domain.

Parameters
[in]iposition on x coordiante.
[in]jposition on y coordinate.
Returns
true if active flase if inactive.

◆ send_message()

virtual bool bitarray2::send_message ( std::string  message,
void *  ptr 
)
inlineoverridevirtual

Send a message to the core module.

Parameters
[in]messageMessage
[in]ptrPointer to some value.
Returns
true if handled false otherwise.

Reimplemented from messageable.

◆ serial_actives() [1/2]

void bitarray2::serial_actives ( std::function< void(int i, int j, iterator &it)>  func)
inline

Loop over all the active cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ serial_actives() [2/2]

void bitarray2::serial_actives ( std::function< void(iterator &it)>  func)
inline

Loop over all the active cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ serial_all() [1/2]

void bitarray2::serial_all ( std::function< void(int i, int j, iterator &it)>  func)
inline

Loop over all the cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ serial_all() [2/2]

void bitarray2::serial_all ( std::function< void(iterator &it)>  func)
inline

Loop over all the cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.

◆ serial_op() [1/2]

void bitarray2::serial_op ( std::function< void(int i, int j, iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ serial_op() [2/2]

void bitarray2::serial_op ( std::function< void(iterator &it)>  func,
bool  type = ALL 
)
inline

Loop over cells in serial order.

Parameters
[in]funcFunction that defines how each grid cell is processed.
[in]typeType of target cells. ACTIVE or ALL.

◆ set() [1/2]

void bitarray2::set ( const vec2i pi)
inline

Set bit on grid.

Parameters
[in]piposition on grid
[in]valueValue to set at the position.

◆ set() [2/2]

void bitarray2::set ( int  i,
int  j 
)
inline

Set bit on grid.

Parameters
[in]iposition on x coordiante.
[in]jposition on y coordinate.

◆ set_core_name()

void bitarray2::set_core_name ( std::string  core_name)
inline

Set the core name of module of this grid.

Parameters
[in]Nameof the core name.

◆ set_off() [1/2]

void bitarray2::set_off ( const vec2i pi)
inline

Set a position on grid inactive.

Parameters
[in]piposition on grid

◆ set_off() [2/2]

void bitarray2::set_off ( int  i,
int  j 
)
inline

Set a position on grid inactive.

Parameters
[in]iposition on x coordiante.
[in]jposition on y coordinate.

◆ set_thread_num()

void bitarray2::set_thread_num ( int  number)
inline

Set the number of threads for parallel processing on this grid.

Parameters
[in]numberNumber of threads.

◆ set_type()

void bitarray2::set_type ( const type2 type)
inline

Set the type of this grid.

Parameters
[in]typeAn instance of type to set.

◆ shape()

shape2 bitarray2::shape ( ) const
inline

Get the shape of the array.

Returns
Shape of the array.

◆ swap()

void bitarray2::swap ( bitarray2 rhs)
inline

Swap array.

Parameters
[in]rhsArray to swap.

◆ type()

type2 bitarray2::type ( ) const
inline

Get the type of this grid.

Returns
Type of this grid.

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