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

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

#include <bitarray3.h>

Inheritance diagram for bitarray3:
recursive_configurable messageable configurable

Classes

class  const_iterator
 Read-only iterator. More...
 
class  iterator
 Writable iterator. More...
 
struct  type3
 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

 bitarray3 (recursive_configurable *parent, const shape3 &shape, std::string core_name="")
 Constructor for bitarray3. More...
 
 bitarray3 (recursive_configurable *parent, std::string core_name="")
 Constructor for bitarray3. More...
 
 bitarray3 (std::string core_name="")
 Constructor for bitarray3. More...
 
 bitarray3 (const shape3 &shape, std::string core_name="")
 Constructor for bitarray3. 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...
 
 bitarray3 (const bitarray3 &array)
 Copy constructor for bitarray3. More...
 
bitarray3operator= (const bitarray3 &array)
 Deep copy operation for bitarray3. More...
 
void copy (const bitarray3 &array)
 Deep copy function for bitarray3. More...
 
shape3 shape () const
 Get the shape of the array. More...
 
void initialize (const shape3 &shape)
 Allocate grid memory with value. More...
 
size_t count () const
 Function to count the number of active cells. More...
 
std::vector< vec3iactives () const
 
void activate (const std::vector< vec3i > &active_entries, const vec3i &offset=vec3i())
 Activate cells at the positons of active_entries with an offset. More...
 
template<class Y >
void activate_as (const array3< Y > &array, const vec3i &offset=vec3i())
 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 vec3i &offset=vec3i())
 Activate cells at the same positons where an input array is active with an offset. More...
 
template<class Y >
void activate_inside_as (const array3< Y > &array, const vec3i &offset=vec3i())
 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 bitarray3 &array, const vec3i &offset=vec3i())
 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, int k)
 Set value on grid. More...
 
void set (const vec3i &pi)
 Set value on grid. More...
 
bool operator() (int i, int j, int k) const
 Get if a position on grid is active. More...
 
bool operator() (const vec3i &pi) const
 Get if a position on grid is active. More...
 
bool safe_get (int i, int j, int k) const
 Get if a position on grid is active. (i,j,k) can be safely out of the domain. More...
 
bool safe_get (const vec3i &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, int k)
 Set a position on grid inactive. More...
 
void set_off (const vec3i &pi)
 Set a position on grid inactive. More...
 
bool operator!= (const bitarray3 &array) const
 Return if the grid is different from an input array. More...
 
bool operator== (const bitarray3 &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, int k, iterator &it)> func)
 Loop over all the active cells in parallel. More...
 
void parallel_all (std::function< void(int i, int j, int k, iterator &it)> func)
 Loop over all the cells in parallel. More...
 
void parallel_op (std::function< void(int i, int j, int k, iterator &it)> func, bool type=ALL)
 Loop over cells in parallel. More...
 
void parallel_actives (std::function< void(int i, int j, int k, 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, int k, iterator &it, int thread_index)> func)
 Loop over all the cells in parallel. More...
 
void parallel_op (std::function< void(int i, int j, int k, 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, int k)> 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, int k, 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, int k, 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 k, 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, int k, 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, int k, 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, int k, iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void serial_all (std::function< void(int i, int j, int k, iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void serial_op (std::function< void(int i, int j, int k, 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, int k)> 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, int k, 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, int k, 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, int k, iterator &it)> func)
 Loop over all the active cells in serial order. More...
 
void interruptible_serial_all (std::function< bool(int i, int j, int k, iterator &it)> func)
 Loop over all the cells in serial order. More...
 
void interruptible_serial_op (std::function< bool(int i, int j, int k, 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, int k)> 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, int k, 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, int k, 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, int k, iterator &it, int thread_index)> func, int count=1)
 Dilate cells. More...
 
void dilate (std::function< void(int i, int j, int k, 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 k, int thread_index)> func, int count=1)
 Erode cells. More...
 
void erode (std::function< bool(int i, int j, int k)> func, int count=1)
 Erode cells. More...
 
void erode (int count=1)
 Erode cells. More...
 
void swap (bitarray3 &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_core3get_core () const
 Get pointer to the core module. More...
 
array_core3get_core ()
 Get pointer to the core module. More...
 
type3 type () const
 Get the type of this grid. More...
 
void set_type (const type3 &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

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

Constructor & Destructor Documentation

◆ bitarray3() [1/5]

bitarray3::bitarray3 ( recursive_configurable parent,
const shape3 shape,
std::string  core_name = "" 
)
inline

Constructor for bitarray3.

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 "tiledarray3".

◆ bitarray3() [2/5]

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

Constructor for bitarray3.

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

◆ bitarray3() [3/5]

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

Constructor for bitarray3.

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

◆ bitarray3() [4/5]

bitarray3::bitarray3 ( const shape3 shape,
std::string  core_name = "" 
)
inline

Constructor for bitarray3.

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

◆ bitarray3() [5/5]

bitarray3::bitarray3 ( const bitarray3 array)
inline

Copy constructor for bitarray3.

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

Member Function Documentation

◆ activate()

void bitarray3::activate ( const std::vector< vec3i > &  active_entries,
const vec3i offset = vec3i() 
)
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 bitarray3::activate_as ( const array3< Y > &  array,
const vec3i offset = vec3i() 
)
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 bitarray3::activate_as_bit ( const Y &  array,
const vec3i offset = vec3i() 
)
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 bitarray3::activate_inside_as ( const array3< Y > &  array,
const vec3i offset = vec3i() 
)
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.

◆ clear()

void bitarray3::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 bitarray3::const_parallel_actives ( std::function< void(int i, int j, int k)>  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 bitarray3::const_parallel_actives ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::const_parallel_all ( std::function< void(int i, int j, int k, 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 bitarray3::const_parallel_all ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::const_parallel_op ( std::function< void(int i, int j, int k, 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 bitarray3::const_parallel_op ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::const_serial_actives ( std::function< void(int i, int j, int k)>  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 bitarray3::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 bitarray3::const_serial_all ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::const_serial_op ( std::function< void(int i, int j, int k, 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 bitarray3::copy ( const bitarray3 array)
inline

Deep copy function for bitarray3.

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

◆ copy_active_as()

void bitarray3::copy_active_as ( const bitarray3 array,
const vec3i offset = vec3i() 
)
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 bitarray3::count ( ) const
inline

Function to count the number of active cells.

Returns
Active cell count.

◆ dilate() [1/3]

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

Dilate cells.

Parameters
[in]countNumber of dilation count.

◆ dilate() [2/3]

void bitarray3::dilate ( std::function< void(int i, int j, int k, 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 bitarray3::dilate ( std::function< void(int i, int j, int k, 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 bitarray3::erode ( int  count = 1)
inline

Erode cells.

Parameters
[in]countNumber of erode count.

◆ erode() [2/3]

void bitarray3::erode ( std::function< bool(int i, int j, int k)>  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 bitarray3::erode ( std::function< bool(int i, int j, int k, 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_core3* bitarray3::get_core ( )
inline

Get pointer to the core module.

Returns
Pointer to the core module.

◆ get_core() [2/2]

const array_core3* bitarray3::get_core ( ) const
inline

Get pointer to the core module.

Returns
Pointer to the core module.

◆ get_core_name()

std::string bitarray3::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& bitarray3::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& bitarray3::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 bitarray3::get_thread_num ( ) const
inline

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

Returns
number Number of threads.

◆ initialize()

void bitarray3::initialize ( const shape3 shape)
inline

Allocate grid memory with value.

Parameters
[in]shapeShape or the grid.

◆ interruptible_const_serial_actives()

void bitarray3::interruptible_const_serial_actives ( std::function< bool(int i, int j, int k)>  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 bitarray3::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 bitarray3::interruptible_const_serial_all ( std::function< bool(int i, int j, int k, 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 bitarray3::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 bitarray3::interruptible_const_serial_op ( std::function< bool(int i, int j, int k, 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 bitarray3::interruptible_serial_actives ( std::function< bool(int i, int j, int k, 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 bitarray3::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 bitarray3::interruptible_serial_all ( std::function< bool(int i, int j, int k, 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 bitarray3::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 bitarray3::interruptible_serial_op ( std::function< bool(int i, int j, int k, 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 bitarray3::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 bitarray3::operator!= ( const bitarray3 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 bitarray3::operator() ( const vec3i 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 bitarray3::operator() ( int  i,
int  j,
int  k 
) const
inline

Get if a position on grid is active.

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

◆ operator=()

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

Deep copy operation for bitarray3.

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

◆ operator==()

bool bitarray3::operator== ( const bitarray3 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 bitarray3::parallel_actives ( std::function< void(int i, int j, int k, 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 bitarray3::parallel_actives ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::parallel_all ( std::function< void(int i, int j, int k, 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 bitarray3::parallel_all ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::parallel_op ( std::function< void(int i, int j, int k, 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 bitarray3::parallel_op ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::safe_get ( const vec3i 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 bitarray3::safe_get ( int  i,
int  j,
int  k 
) const
inline

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

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

◆ send_message()

virtual bool bitarray3::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 bitarray3::serial_actives ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::serial_all ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::serial_op ( std::function< void(int i, int j, int k, 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 bitarray3::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 bitarray3::set ( const vec3i pi)
inline

Set value on grid.

Parameters
[in]piposition on grid

◆ set() [2/2]

void bitarray3::set ( int  i,
int  j,
int  k 
)
inline

Set value on grid.

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

◆ set_core_name()

void bitarray3::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 bitarray3::set_off ( const vec3i pi)
inline

Set a position on grid inactive.

Parameters
[in]piposition on grid

◆ set_off() [2/2]

void bitarray3::set_off ( int  i,
int  j,
int  k 
)
inline

Set a position on grid inactive.

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

◆ set_thread_num()

void bitarray3::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 bitarray3::set_type ( const type3 type)
inline

Set the type of this grid.

Parameters
[in]typeAn instance of type to set.

◆ shape()

shape3 bitarray3::shape ( ) const
inline

Get the shape of the array.

Returns
Shape of the array.

◆ swap()

void bitarray3::swap ( bitarray3 rhs)
inline

Swap array.

Parameters
[in]rhsArray to swap.

◆ type()

type3 bitarray3::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: