Two dimensional staggered grid class designed to be defined as instance member in recursive_configurable class.
More...
|
| | macarray2 (recursive_configurable *parent, const shape2 &shape, vec2< T > value=vec2< T >(), std::string core_name="") |
| | Constructor for macarray2. More...
|
| |
| | macarray2 (recursive_configurable *parent, std::string core_name="") |
| | Constructor for macarray2. More...
|
| |
| | macarray2 (std::string core_name="") |
| | Constructor for macarray2. More...
|
| |
| | macarray2 (const shape2 &shape, vec2< T > value=vec2< T >(), std::string core_name="") |
| | Constructor for macarray2. More...
|
| |
| | macarray2 (const macarray2 &v) |
| | Copy constructor for macarray2. 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...
|
| |
| macarray2 & | operator= (const macarray2 &array) |
| | Deep copy operation for macarray2. More...
|
| |
| void | copy (const macarray2 &array) |
| | Deep copy function for macarray2. More...
|
| |
| void | initialize (const shape2 &shape, vec2< T > value=vec2< T >()) |
| | Allocate grid memory with value. More...
|
| |
| void | set_touch_only_actives (bool touch_only_actives) |
| | Set whether to force grid manipulation only on active cells. If true, operatios such operator+=() only acts on active cells. More...
|
| |
| size_t | count () const |
| | Function to count the number of active cells. More...
|
| |
| std::array< std::vector< vec2i >, DIM2 > | actives () const |
| | Function to return the list of active cells positions. More...
|
| |
| void | activate (const std::array< std::vector< vec2i >, DIM2 > &active_entries, const std::array< vec2i, DIM2 > &offsets={vec2i(), vec2i()}) |
| | Activate cells at the positons of active_entries. More...
|
| |
| template<class Y > |
| void | activate_as (const macarray2< Y > &array, const std::array< vec2i, DIM2 > &offsets={vec2i(), 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 std::array< vec2i, DIM2 > &offsets={vec2i(), 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 macarray2< Y > &array, const std::array< vec2i, DIM2 > &offsets={vec2i(), 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 | activate_inside () |
| | Activate all the filled cells.
|
| |
| template<class Y > |
| void | copy_active_as (const macarray2< Y > &array, const vec2i &offset=vec2i()) |
| | Copy the states of active and inactive cells as same as input array with an offset. More...
|
| |
|
vec2< T > | get_background_value () const |
| | Get the background value (alternatively, initial value) of the grid.
|
| |
| void | set_background_value (const vec2< T > &value) |
| | Set the background value (alternatively, initial value) of the grid. More...
|
| |
| void | convert_to_full (array2< vec2< T > > &cell_array) const |
| | Convert staggered values to a cell centered full vector grid. More...
|
| |
| void | convert_to_full (macarray2< vec2< T > > &face_array) const |
| | Convert staggered values to the a centered full vector grid. More...
|
| |
| shape2 | shape () const |
| | Get the shape of the array. More...
|
| |
| shape2 | shape (int dim) const |
| | Get the shape of the staggered grid of a specified dimension. More...
|
| |
| void | clear () |
| | Clear out the grid. More...
|
| |
| void | clear (vec2< T > v) |
| | Clear out the grid with the new backgroud value. More...
|
| |
| bool | operator!= (const macarray2< T > &v) const |
| | Return if the grid is different from an input array. More...
|
| |
| bool | operator== (const macarray2< T > &v) const |
| | Return if the grid is same to an input array. More...
|
| |
| void | operator= (T v) |
| | Set all the grid values with an input value. More...
|
| |
| void | operator+= (const macarray2< T > &v) |
| | Increment all the values with the values of an input array. More...
|
| |
| void | operator-= (const macarray2< T > &v) |
| | Subtract all the values with the values of an input array. More...
|
| |
| void | operator+= (const vec2< T > &v) |
| | Increment all the grid values with an input vector value. More...
|
| |
| void | operator+= (T v) |
| | Increment all the grid values with an input value. More...
|
| |
| void | operator-= (const vec2< T > &v) |
| | Subtract all the grid values with an input vector value. More...
|
| |
| void | operator-= (T v) |
| | Subtract all the grid values with an input value. More...
|
| |
| void | operator*= (T v) |
| | Multiply all the grid values with an input value. More...
|
| |
| void | operator/= (const T &v) |
| | Divide all the grid values with an input value. More...
|
| |
| const array2< T > & | operator[] (int dim) const |
| | Get the read-only reference to the staggered array of a specified dimension. More...
|
| |
| array2< T > & | operator[] (int dim) |
| | Get the reference to the staggered array of a specified dimension. 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(typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in parallel. More...
|
| |
| void | parallel_all (std::function< void(typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in parallel. More...
|
| |
| void | parallel_op (std::function< void(typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in parallel. More...
|
| |
| void | parallel_actives (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in parallel. More...
|
| |
| void | parallel_all (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in parallel. More...
|
| |
| void | parallel_op (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in parallel. More...
|
| |
| void | parallel_actives (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it, int thread_index)> func) |
| | Loop over all the active cells in parallel. More...
|
| |
| void | parallel_all (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it, int thread_index)> func) |
| | Loop over all the cells in parallel. More...
|
| |
| void | parallel_op (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it, int thread_index)> func, bool type=ALL) |
| | Loop over cells in parallel. More...
|
| |
| void | const_parallel_actives (std::function< void(const typename array2< T >::const_iterator &it)> func) const |
| | Loop over all the active cells in parallel by read-only fashion. More...
|
| |
| void | const_parallel_all (std::function< void(const typename array2< T >::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 typename array2< T >::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 dim, int i, int j, const typename array2< T >::const_iterator &it)> func) const |
| | Loop over all the active cells in parallel by read-only fashion. More...
|
| |
| void | const_parallel_all (std::function< void(int dim, int i, int j, const typename array2< T >::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 dim, int i, int j, const typename array2< T >::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 dim, int i, int j, const typename array2< T >::const_iterator &it, 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 dim, int i, int j, const typename array2< T >::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 dim, int i, int j, const typename array2< T >::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(typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in serial order. More...
|
| |
| void | serial_all (std::function< void(typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in serial order. More...
|
| |
| void | serial_op (std::function< void(typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in serial order. More...
|
| |
| void | serial_actives (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in serial order. More...
|
| |
| void | serial_all (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in serial order. More...
|
| |
| void | serial_op (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in serial order. More...
|
| |
| void | const_serial_actives (std::function< void(const typename array2< T >::const_iterator &it)> func) const |
| | Loop over all the active cells in serial order by read-only fashion. More...
|
| |
| void | const_serial_all (std::function< void(const typename array2< T >::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 typename array2< T >::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 dim, int i, int j, const typename array2< T >::const_iterator &it)> func) const |
| | Loop over all the active cells in serial order by read-only fashion. More...
|
| |
| void | const_serial_all (std::function< void(int dim, int i, int j, const typename array2< T >::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 dim, int i, int j, const typename array2< T >::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(typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in serial order. More...
|
| |
| void | interruptible_serial_all (std::function< bool(typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in serial order. More...
|
| |
| void | interruptible_serial_op (std::function< bool(typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in serial order. More...
|
| |
| void | interruptible_serial_actives (std::function< bool(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the active cells in serial order. More...
|
| |
| void | interruptible_serial_all (std::function< bool(int dim, int i, int j, typename array2< T >::iterator &it)> func) |
| | Loop over all the cells in serial order. More...
|
| |
| void | interruptible_serial_op (std::function< bool(int dim, int i, int j, typename array2< T >::iterator &it)> func, bool type=ALL) |
| | Loop over cells in serial order. More...
|
| |
| void | interruptible_const_serial_actives (std::function< bool(const typename array2< T >::const_iterator &it)> func) const |
| | Loop over all the active cells in serial order by read-only fashion. More...
|
| |
| void | interruptible_const_serial_all (std::function< bool(const typename array2< T >::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 typename array2< T >::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 dim, int i, int j, const typename array2< T >::const_iterator &it)> 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 dim, int i, int j, const typename array2< T >::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 dim, int i, int j, const typename array2< T >::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 dim, int i, int j, typename array2< T >::iterator &it, int thread_index)> func, int count=1) |
| | Dilate cells. More...
|
| |
| void | dilate (std::function< void(int dim, int i, int j, typename array2< T >::iterator &it)> func, int count=1) |
| | Dilate cells. More...
|
| |
| void | dilate (int count=1) |
| | Dilate cells. More...
|
| |
| void | erode (std::function< bool(int dim, int i, int j, const typename array2< T >::const_iterator &it, int thread_index)> func, int count=1) |
| | Erode cells. More...
|
| |
| void | erode (std::function< void(int dim, int i, int j, const typename array2< T >::const_iterator &it)> func, int count=1) |
| | Erode cells. More...
|
| |
| void | erode (int count=1) |
| | Erode cells. 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...
|
| |
| type2 | type () const |
| | Get the type of this grid. More...
|
| |
| void | set_type (const type2 &type) |
| | Set the type of this grid. More...
|
| |
|
| 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...
|
| |
| virtual void | load (configuration &config) |
| | Load the program. Used to load files and libraries into memory. More...
|
| |
| virtual void | configure (configuration &config) |
| | Configure the program. Used to load and set parameters. More...
|
| |