MRPTree v0.5.0.0 lib 0.5.0.0
MR 2^P Trees (MRPTree)
Loading...
Searching...
No Matches
mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim > Class Template Reference

Template Class used to house an MR_rect_tree. More...

#include <MR_rect_tree.hpp>

Template Parameter Types

typedef MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim > this_t
 Externally exposed typedef for spc_real_t.
 
typedef spc_real_t src_t
 Externally exposed typedef for spc_real_t.
 

Domain Real Coordinates

typedef std::vector< src_tdrtv_t
 std::vector for values in the domain space.
 
typedef std::array< src_t, dom_dim > drta_t
 An std::array for points in the domain space.
 
typedef std::conditional< std::cmp_equal(dom_dim, 1), src_t, drta_t >::type drpt_t
 For values in the domain space.
 
typedef drpt_t real_domain_t
 A nicely descriptive typedef for drpt_t.
 

Range Real Coordinates

typedef std::vector< src_trrtv_t
 std::vector for values in the range space.
 
typedef std::array< src_t, rng_dim > rrta_t
 An std::array for points in the range space.
 
typedef std::conditional< std::cmp_equal(rng_dim, 1), src_t, rrta_t >::type rrpt_t
 For values in the range space.
 
typedef rrpt_t real_range_t
 A nicely descriptive typedef for rrpt_t.
 

Domain Integer Coordinates

typedef priv_dic_t dic_t
 Unsigned integer type large large enough to hold an integer coordiante component.
 
typedef priv_diti_t diti_t
 Unsigned integer type large large enough to hold an integer coordiante tuple.
 
typedef std::array< dic_t, 3 > dita_t
 Domain point given as an std::array integer tuple.
 
typedef std::vector< dic_tditv_t
 Domain point given as an std::vector integer tuple.
 
typedef std::vector< diti_tditi_list_t
 A std::vector used to pass lists of diti_t types around.
 
typedef std::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int8_t), dic_bits), uint8_t, typenamestd::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int16_t), dic_bits), uint16_t, typenamestd::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int32_t), dic_bits), uint32_t, uint64_t >::type >::type >::type priv_dic_t
 
typedef std::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int8_t), diti_bits), uint8_t, typenamestd::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int16_t), diti_bits), uint16_t, typenamestd::conditional< std::cmp_greater_equal(CHAR_BIT *sizeof(int32_t), diti_bits), uint32_t, uint64_t >::type >::type >::type priv_diti_t
 
static constexpr int dic_bits = max_level+1
 The number of bits used by a single component of an integer coordinate tuple.
 
static constexpr int diti_bits = dic_bits * dom_dim
 The number of bits used by an entire integer coordinate tuple.
 
static constexpr dic_t dic_max = (static_cast<dic_t>(1) << max_level)
 Maximum allowd for a dic_t.
 
static constexpr dic_t dic_ctr = (static_cast<dic_t>(1) << (max_level-1))
 Center value for a dic_t.
 
static constexpr dic_t dic_min = 0
 Minimum allowd for a dic_t.
 
static constexpr diti_t diti_ones = ~static_cast<diti_t>(0)
 
static constexpr diti_t diti_msk0 = static_cast<diti_t>(~(diti_ones << dic_bits))
 

Function Types

typedef std::function< rrpt_t(drpt_t)> drpt2rrpt_func_t
 Real input sample function.
 
typedef std::function< bool(diti_t)> diti2bool_func_t
 Integer input predicate function.
 
typedef std::function< bool(drpt_t)> drpt2bool_func_t
 Real input predicate function.
 
typedef std::function< src_t(drpt_t)> drpt2real_func_t
 Real input, single real variable output function.
 

Template Parameter Constants

static constexpr int domain_dimension = dom_dim
 The value of the template parameter dom_dim.
 
static constexpr int range_dimension = rng_dim
 The value of the template parameter rng_dim.
 
static constexpr int maximum_level = max_level
 The value of the template parameter max_level.
 

Data Members

drpt_t bbox_min
 Holds the minimal point for the real domain range.
 
drpt_t bbox_max
 Holds the maximal point for the real domain range.
 
drpt_t bbox_delta
 The wdith of the real domain range.
 
std::unordered_map< diti_t, rrpt_tsamples
 Holds the sampled data.
 

Constructors

 MR_rect_tree ()
 Set real coordinates to defaults.
 
 MR_rect_tree (drpt_t new_bbox_min, drpt_t new_bbox_max)
 Set real coordinate as specified.
 

Construction Helpers

void update_bbox_delta ()
 Update the value of bbox_delta.
 
void set_bbox (drpt_t new_bbox_min, drpt_t new_bbox_max)
 Set the bounding box.
 
void set_bbox_default ()
 Set the bounding box to the default: -1 for all minimum components and +1 for all maximum components.
 
void set_bbox_min (drpt_t new_bbox_min)
 Set the bounding box minimum.
 
void set_bbox_max (drpt_t new_bbox_max)
 Set the bounding box max_level.
 

Basic Class Info

drpt_t get_bbox_min () const
 Return the bounding box minimum point.
 
drpt_t get_bbox_max () const
 Return the bounding box minimum point.
 
drpt_t get_bbox_delta () const
 Return the bounding box minimum point.
 
rrpt_t get_sample (diti_t vertex) const
 Return the sample value for vertex.
 
rrta_t get_sample_rrta (diti_t vertex) const
 Return the sample value for vertex as an rrta_t (an std::array)
 
std::unordered_map< diti_t, rrpt_t >::const_iterator cbegin_samples ()
 Provide a constant forward iterator for the sample data.
 
std::unordered_map< diti_t, rrpt_t >::const_iterator cend_samples ()
 Provide a constant end iterator for the sample data.
 

Cell Oriented Coordinate Computation

These functions compute theoretical values based on a given cell center coordinate, and have nothing to do with sample state.

For example, the ccc_get_top_cell() function returns the coordinates that would be used to identify the tree's top cell; however, this function tells us nothing about if that cell exists (as been sampled) in the tree.

In general these routines are optimized for performance, and do not preform any error checking.

  • Many functions require a valid cell coordinate (that is a coordinate that could be the center of a cell). For example, if one of these functions is given 0, then erroneous results are likely because 0 represents the coordinate for the corner of a tree which can never the the center of a cell.
  • When possible, the fewest coordinate components are used. For example ccc_cell_level() uses just the first coordinate in it's computation.
diti_t ccc_get_top_cell () const
 Compute the top cell coordinates for the tree.
 
dic_t ccc_cell_level (diti_t cell) const
 Compute cell level.
 
dic_t ccc_cell_quarter_width (diti_t cell) const
 Compute cell quarter width.
 
dic_t ccc_cell_half_width (diti_t cell) const
 Compute cell half width.
 
dic_t ccc_cell_full_width (diti_t cell) const
 Compute cell full width.
 
diti_t ccc_cell_get_corner_min (diti_t cell) const
 Cell first corner.
 
diti_t ccc_cell_get_corner_max (diti_t cell) const
 Cell last corner.
 
diti_list_t ccc_get_corners (diti_t cell) const
 Return a list of the corners of the given cell.
 
diti_list_t ccc_get_corners (diti_t cell, int index, int direction) const
 Return a list of the corners of the given cell.
 
diti_list_t ccc_get_neighbors (diti_t cell) const
 Return a list of potential neighbor cells of the specified cell Note the cells are not in canonical order!
 
diti_t ccc_get_neighbor (diti_t cell, int index, int direction) const
 Return the potential neighbor cell along the given axis in the specified direction.
 
diti_list_t ccc_get_children (diti_t cell) const
 Return a list of child cells of the specified cell.
 
diti_list_t ccc_get_children (diti_t cell, int index, int direction) const
 Return a list of child cells of the specified cell An empty vector is returned if no children are possible.
 
diti_list_t ccc_get_vertexes (diti_t cell) const
 Return a list of the vertexes (corners and center) of the given cell.
 

Low Level Integer Tuple Computation

These functions encapsulate various coordinate computations.

In general these routines are optimized for performance, and do not preform any error checking. For example it is possible to underflow/overflow with inappropriate values.

dic_t cuc_get_crd (diti_t diti, int index) const
 Extract a component from a tuple.
 
diti_t cuc_inc_crd (diti_t diti, int index, dic_t value) const
 Incriment a component in a a tuple.
 
diti_t cuc_dec_crd (diti_t diti, int index, dic_t value) const
 Decriment a component in a a tuple.
 
diti_t cuc_dec_all_crd (diti_t diti, dic_t value) const
 Decriment all components in a a tuple.
 
diti_t cuc_inc_all_crd (diti_t diti, dic_t value) const
 Incriment all components in a a tuple.
 
diti_t cuc_set_all_crd (dic_t value) const
 Set all components in a a tuple to a constant.
 
diti_list_t cuc_two_cross (diti_t diti, dic_t delta) const
 Compute cross product points centered at diti and delta away Examples:
 
diti_list_t cuc_two_cross (diti_t diti, dic_t delta, int index, int direction) const
 Compute directional cross product points centered at diti and delta away.
 
diti_list_t cuc_axis_cross (diti_t diti, dic_t delta) const
 Compute axis aligned cross points centered at diti and delta away Axis aligned cross points that fall outside of the domain will not be returned.
 

Easy way to treat rrpt_t & drpt_t types as indexable regardless of dom_dim & rng_dim.

src_t rng_at (rrpt_t value, int index) const
 
src_t dom_at (drpt_t value, int index) const
 

Packed Integer Tuple <-> std::array of Integer Tuple Conversions

diti_t dita_to_diti (const dita_t &dita) const
 Convert an std::array of integer coordinate tuple to an packed integer coordinate tuple.
 
dita_t diti_to_dita (diti_t diti) const
 Convert a packed integer coordinate tuple to an std::array of integer coordinate tuple Note dita_t is always an std::array even when dom_dim==1.
 

Integer Tuple to Domain Space Tuple Conversion

drpt_t diti_to_drpt (diti_t diti) const
 Convert a packed integer coordinate tuple to the coorisponding coordinate in drpt_t Note this function might return a scalar (float, double, etc...) or a std::array!
 
drta_t diti_to_drta (diti_t diti) const
 Convert a packed integer coordinate tuple to the coorisponding std::array tuple of src_t Unlike diti_to_drpt, this function ALWAYS returns an std::array!
 

Function Sampleing

Note that refine_grid() is a hybrid in that it can be used for both refinement and for sampling.

void sample_cell (diti_t cell, drpt2rrpt_func_t func)
 Sample a cell.
 
void sample_cell (drpt2rrpt_func_t func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool sample_point_maybe (diti_t diti, drpt2rrpt_func_t func)
 Sample a point if it has not already been sampled.
 
void sample_point (diti_t diti, drpt2rrpt_func_t func)
 Sample, or resample, a point.
 

Real Range Space Computation

bool rrpt_is_nan (rrpt_t val) const
 Test if a point in the range space contains a NaN coordinate value.
 
src_t rrpt_distance_inf (rrpt_t val1, rrpt_t val2) const
 Distance between two points in the range space using the infinity norm (max absolute value)
 

Real Domain Space Computation

src_t drpt_distance_inf (drpt_t val1, drpt_t val2) const
 Distance between two points in the domain space using the infinity norm (max absolute value)
 
drpt_t drpt_midpoint (drpt_t val1, drpt_t val2) const
 Return the midpoint between two points in the domain space.
 

Tree/Cell Refinement

Three general function smalpling stratigies are provided:

bool refine_once (diti_t cell, drpt2rrpt_func_t func)
 Refine a cell if possible.
 
void refine_grid (diti_t cell, int level_delta, drpt2rrpt_func_t func)
 Sample a function uniformly across given cell to the given level.
 
void refine_grid (int level_delta, drpt2rrpt_func_t func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void refine_recursive (diti_t cell, int level, drpt2rrpt_func_t func)
 Refine a cell until refined cells reach specified level.
 
void refine_recursive (int level, drpt2rrpt_func_t func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void refine_recursive_cell_pred (diti_t cell, int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 Refine a cells matching predicate until refined cells reach specified level.
 
void refine_leaves_recursive_cell_pred (diti_t cell, int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 Refine a cells matching predicate until refined cells reach specified level.
 
void refine_leaves_recursive_cell_pred (int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
int refine_leaves_once_if_cell_pred (diti_t cell, int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 Refine each leaf cell if pred returns true and the cell level is less than the given level value.
 
int refine_leaves_once_if_cell_pred (int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
int refine_leaves_atomically_if_cell_pred (diti_t cell, int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 Repeatedly refine leaves of the given cell for which pred is true.
 
int refine_leaves_atomically_if_cell_pred (int level, drpt2rrpt_func_t func, diti2bool_func_t pred)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void refine_recursive_if_cell_vertex_is_nan (int level, drpt2rrpt_func_t func)
 Refine a cells with NaNs until refined cells reach specified level.
 
int refine_leaves_once_if_unbalanced (int level_delta, drpt2rrpt_func_t func)
 Refine leaf cells if they are unbalanced at the given level.
 
void balance_tree (int level_delta, drpt2rrpt_func_t func)
 Balance the cell to the given level.
 

Cell Predicates

bool cell_good_cords (diti_t cell) const
 Check if cell coordinates are in range to be a cell center.
 
bool cell_exists (diti_t cell) const
 Test if a cell has been sampled.
 
bool cell_is_sampled (diti_t cell) const
 Test if a cell has been sampled.
 
bool cell_vertex_is_nan (diti_t cell)
 Test if a cell has a vertex with a NaN value for a sample.
 
bool cell_corner_is_nan (diti_t cell)
 Test if a cell has an corner with a NaN value for a sample.
 
bool cell_has_child (diti_t cell) const
 Test if a cell has children.
 
bool cell_has_no_child (diti_t cell) const
 Test if a cell has no children.
 
bool cell_can_have_children (diti_t cell) const
 Test if a cell can have children (it not of minimal size)
 
bool cell_has_neighbor (diti_t cell, int index, int direction)
 Test if the specified neighbor cell exixts (is smapled).
 
bool cell_cross_sdf (diti_t cell, drpt2real_func_t sdf)
 Test if a cell crosses, or is on, a signed distance function boundry.
 
bool cell_near_domain_point (drpt_t domain_point, src_t epsilon, diti_t cell)
 Test if a cell contains, or is close to, a point in the domain.
 
bool cell_near_domain_level (diti_t cell, int domain_index, src_t domain_level, src_t epsilon)
 Test if a cell crosses the given domain component value.
 
bool cell_below_domain_level (diti_t cell, int domain_index, src_t domain_level)
 Test if a cell is below the given domain component value.
 
bool cell_above_domain_level (diti_t cell, int domain_index, src_t domain_level)
 Test if a cell above the given domain component value.
 
bool cell_cross_range_level (diti_t cell, int range_index, src_t range_level)
 Test if a cell crosses the given range component value.
 
bool cell_below_range_level (diti_t cell, int range_index, src_t range_level)
 Test if a cell is below given range component value.
 
bool cell_above_range_level (diti_t cell, int range_index, src_t range_level)
 Test if a cell is above given range component value.
 
bool cell_is_unbalanced (int level_delta, diti_t cell)
 Test if a cell is unbalanced at the given level.
 

Vertex Predicates

bool vertex_is_nan (diti_t vertex)
 Test if a vertex is NaN or, when it is an std::array, if it contains a NaN element.
 
bool vertex_exists (diti_t vertex) const
 Point has been sampled.
 

Extract Cells

diti_list_t get_leaf_cells (diti_t cell) const
 Extract a list of all leaf cells starting from the given cell.
 
diti_list_t get_leaf_cells () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
diti_list_t get_leaf_cells_pred (diti_t cell, diti2bool_func_t pred) const
 Extract a list of all leaf cells starting from the given cell that match the given predicate.
 
diti_list_t get_leaf_cells (diti_t cell, int index, int direction) const
 Extract a list of all leaf cells starting from the given cell.
 
int count_leaf_cells (diti_t cell) const
 Count the number of leaf cells starting from the given cell.
 
diti_list_t get_existing_neighbor (diti_t cell, int index, int direction) const
 Return a list of sampled neighbors to the given cell.
 
int get_smallest_neighbor_level (diti_t cell) const
 Return the level of the smallest, existing neighbor.
 

Debug

std::string diti_to_string (diti_t diti, bool include_domain, bool do_hex) const
 Convert a diti_t to a string representation.
 
std::string diti_to_string (diti_t diti, bool include_domain) const
 
std::string diti_to_string (diti_t diti) const
 
std::string drpt_to_string (drpt_t x) const
 Convert a drpt_t to a string representation.
 
std::string rrpt_to_string (rrpt_t x) const
 Convert rrpt value to a string representation.
 
void dump_tree (int max_num_print) const
 Dump tree to STDOUT.
 
int dump_tree_datafile (std::string file_name) const
 Dump tree points to file – one tuple per line with domain coordinates followed by range values.
 

Detailed Description

template<int max_level, class spc_real_t, int dom_dim, int rng_dim>
requires ((max_level>0) && (dom_dim>0) && (rng_dim>0) && (dom_dim*max_level<=CHAR_BIT*sizeof(uint64_t)) && (std::is_floating_point<spc_real_t>::value))
class mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >

Template Class used to house an MR_rect_tree.

Overview

This class forms the primary component of the MR \(2^P\mathrm{-Tree}\) library (also known as "MRPTree"). In terms of this library, a quadtree is a \(2^2\mathrm{-Tree}\) and an octree is a \(2^3\mathrm{-Tree}\) – in essence this class implements a universal data structure capable of holding such trees of any dimension. Contrary to the name, this is all achieved without using any tree-like data structures at all!

The dom_dim template parameter corresponds to the "@f$P@f$" in the exponent. If one wishes to implement a quadtree, then dom_dim should be set to 2. For octrees the value of dom_dim should be set to 3. We are not limited to dimensions 2 & 3 – for example, we could make 1D "bitrees" or a 4D "space time trees".

This class makes the unusual assumption that the sampled data stored in the tree is a finite, real vector space. So instead of using a template parameter to specify the type of the sampled data, we provide 1) a type for the vector space scalar (spc_real_t) and 2) a dimension (rng_dim). In other words these trees are optimized to model model functions \(f:\mathbb{R}^d\rightarrow\mathbb{R}^r\) where \(d\) and \(r\) are template parameters(dom_dim & rng_dim respectively).

The max_level parameter will seem odd for anyone who has used a traditional quadtree/octree library. As a practical matter trees in traditional libraries are limited to a shallow depths (say 10 or 12 levels); however, the code bases themselves don't usually place an explicit limit on depth. In this library the maximum depth must be specified from the start.

As an example, suppose we have a function \(f:\mathbb{R}^2\rightarrow\mathbb{R}^3\) we wish to sample. For this application we might use the following values:

  • spc_real_t = double
  • dom_dim = 2
  • rng_dim = 3
  • max_level = 15

We could use an alternate value for max_level, but I think 15 is a good balance. We can do quadtrees at this depth using 32-bit integer keys, and we can do octrees with 64-bit integer keys.

Naming Conventions

  • Methods for numeric computation on coordinate tuples (diti_t types). These methods have nothing to do with cell sample status – just coordinates!
    • ccc_ – Cell Coordinate Computation: Coordinates are interpreted as cell coordinate centers
    • cuc_ – Coordinate Utility Computation: Coordinate are not necessarily cell coordinate centers
  • Type Naming Conventions
    • Coordinates
      • dic_t (domain Integer Coordinate) – A single integer
      • src_t (domain/range space Real Coordinate) – Floating point
    • Domain Integer Coordinate Tuples
      • diti_t (domain int tuple Integer) – Encoded as a packed integer
      • dita_t (domain int tuple Array) – As a dom_dim element std::array
      • ditv_t (domain int tuple Vector) – As a dom_dim element std::vector
    • Domain/range real Coordinate tuples
      • rrta_t & drta_t (range/domain real tuple Array) – As a dom_dim or rng_dim element std::array
      • rrtv_t & drtv_t (range/domain real tuple Vector) – As a dom_dim or rng_dim element std::vector
      • rrpt_t & drpt_t (range/domain real psudo-tuple) – As a src_t when dim==1, and an array otherwise Function arguments of type "`foo_t`" are frequently called "`foo`".

Details

Template Parameters
max_levelThe maximum depth of the tree – use one minus a power of two for highest performance.
spc_real_tThe base floating type to use for both domain & range.
dom_dimDomain dimension.
rng_dimRange dimension.

Definition at line 134 of file MR_rect_tree.hpp.

Member Typedef Documentation

◆ dic_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
priv_dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dic_t

Unsigned integer type large large enough to hold an integer coordiante component.

Definition at line 238 of file MR_rect_tree.hpp.

◆ dita_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::array<dic_t, 3> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dita_t

Domain point given as an std::array integer tuple.

Definition at line 244 of file MR_rect_tree.hpp.

◆ diti2bool_func_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::function<bool(diti_t)> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti2bool_func_t

Integer input predicate function.

Definition at line 267 of file MR_rect_tree.hpp.

◆ diti_list_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::vector<diti_t> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_list_t

A std::vector used to pass lists of diti_t types around.


Definition at line 250 of file MR_rect_tree.hpp.

◆ diti_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
priv_diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_t

Unsigned integer type large large enough to hold an integer coordiante tuple.

Definition at line 241 of file MR_rect_tree.hpp.

◆ ditv_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::vector<dic_t> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ditv_t

Domain point given as an std::vector integer tuple.

Definition at line 247 of file MR_rect_tree.hpp.

◆ drpt2bool_func_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::function<bool(drpt_t)> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt2bool_func_t

Real input predicate function.

Definition at line 270 of file MR_rect_tree.hpp.

◆ drpt2real_func_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::function<src_t(drpt_t)> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt2real_func_t

Real input, single real variable output function.

Definition at line 273 of file MR_rect_tree.hpp.

◆ drpt2rrpt_func_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::function<rrpt_t(drpt_t)> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt2rrpt_func_t

Real input sample function.

Definition at line 264 of file MR_rect_tree.hpp.

◆ drpt_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::conditional<std::cmp_equal(dom_dim,1),src_t,drta_t>::type mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt_t

For values in the domain space.

  • When dom_dim==1, this will be src_t
  • When dom_dim!=1, this will be drta_t (an std::array)

Definition at line 172 of file MR_rect_tree.hpp.

◆ drta_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::array<src_t, dom_dim> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drta_t

An std::array for points in the domain space.

Definition at line 167 of file MR_rect_tree.hpp.

◆ drtv_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::vector<src_t> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drtv_t

std::vector for values in the domain space.

Definition at line 164 of file MR_rect_tree.hpp.

◆ priv_dic_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int8_t),dic_bits),uint8_t,typenamestd::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int16_t),dic_bits),uint16_t,typenamestd::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int32_t),dic_bits),uint32_t,uint64_t>::type>::type>::type mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::priv_dic_t
private

Definition at line 221 of file MR_rect_tree.hpp.

◆ priv_diti_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int8_t),diti_bits),uint8_t,typenamestd::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int16_t),diti_bits),uint16_t,typenamestd::conditional<std::cmp_greater_equal(CHAR_BIT*sizeof(int32_t),diti_bits),uint32_t,uint64_t>::type>::type>::type mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::priv_diti_t
private

Definition at line 228 of file MR_rect_tree.hpp.

◆ real_domain_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::real_domain_t

A nicely descriptive typedef for drpt_t.

Definition at line 175 of file MR_rect_tree.hpp.

◆ real_range_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
rrpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::real_range_t

A nicely descriptive typedef for rrpt_t.

Definition at line 194 of file MR_rect_tree.hpp.

◆ rrpt_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::conditional<std::cmp_equal(rng_dim,1),src_t,rrta_t>::type mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrpt_t

For values in the range space.

  • When rng_dim==1, this will be src_t
  • When rng_dim!=1, this will be a rrta_t (an std::array)

Definition at line 191 of file MR_rect_tree.hpp.

◆ rrta_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::array<src_t, rng_dim> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrta_t

An std::array for points in the range space.

Definition at line 186 of file MR_rect_tree.hpp.

◆ rrtv_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::vector<src_t> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrtv_t

std::vector for values in the range space.

Definition at line 183 of file MR_rect_tree.hpp.

◆ src_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
spc_real_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::src_t

Externally exposed typedef for spc_real_t.

Definition at line 156 of file MR_rect_tree.hpp.

◆ this_t

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
MR_rect_tree<max_level, spc_real_t, dom_dim, rng_dim> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::this_t

Externally exposed typedef for spc_real_t.

Definition at line 153 of file MR_rect_tree.hpp.

Constructor & Destructor Documentation

◆ MR_rect_tree() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::MR_rect_tree ( )
inline

Set real coordinates to defaults.

see: set_bbox_default().

Definition at line 305 of file MR_rect_tree.hpp.

◆ MR_rect_tree() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::MR_rect_tree ( drpt_t new_bbox_min,
drpt_t new_bbox_max )
inline

Set real coordinate as specified.

Parameters
new_bbox_minValue to use for bounding box minimum point
new_bbox_maxValue to use for bounding box maximum point

Definition at line 310 of file MR_rect_tree.hpp.

Member Function Documentation

◆ balance_tree()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::balance_tree ( int level_delta,
drpt2rrpt_func_t func )
inline

Balance the cell to the given level.

This is a convenience function combining refine_leaves_atomically_if_cell_pred(), cell_is_unbalanced(), & ccc_get_top_cell().

Parameters
level_deltaThe Level.
funcFunction to sample

Definition at line 1146 of file MR_rect_tree.hpp.

◆ cbegin_samples()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::unordered_map< diti_t, rrpt_t >::const_iterator mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cbegin_samples ( )
inline

Provide a constant forward iterator for the sample data.

Sample data is stored as a pair with the first element being the packed integer domain coordinates and the second being the sampled data.

Definition at line 397 of file MR_rect_tree.hpp.

◆ ccc_cell_full_width()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_full_width ( diti_t cell) const
inline

Compute cell full width.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
Returns
Full width of the given cell.

Definition at line 448 of file MR_rect_tree.hpp.

◆ ccc_cell_get_corner_max()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_get_corner_max ( diti_t cell) const
inline

Cell last corner.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
Returns
Last corner of given cell

Definition at line 460 of file MR_rect_tree.hpp.

◆ ccc_cell_get_corner_min()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_get_corner_min ( diti_t cell) const
inline

Cell first corner.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
Returns
First corner of given cell

Definition at line 454 of file MR_rect_tree.hpp.

◆ ccc_cell_half_width()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_half_width ( diti_t cell) const
inline

Compute cell half width.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
Returns
Half width of the given cell.

Definition at line 442 of file MR_rect_tree.hpp.

◆ ccc_cell_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_level ( diti_t cell) const
inline

Compute cell level.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Only uses the last dic in the cell to compute value. Thus inconsistant components will not be detected.
Parameters
cellInput cell
Returns
The level of the given cell.

Definition at line 430 of file MR_rect_tree.hpp.

◆ ccc_cell_quarter_width()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_cell_quarter_width ( diti_t cell) const
inline

Compute cell quarter width.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
Returns
Quarter width of the given cell.

Definition at line 436 of file MR_rect_tree.hpp.

◆ ccc_get_children() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_children ( diti_t cell) const
inline

Return a list of child cells of the specified cell.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords() If cell can't have children because it is at max_level, then an empty vector is returned.
This isn't a check for existing, sampled children – it simply returns the coordinates of potential children.
Parameters
cellInput cell

Definition at line 504 of file MR_rect_tree.hpp.

◆ ccc_get_children() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_children ( diti_t cell,
int index,
int direction ) const
inline

Return a list of child cells of the specified cell An empty vector is returned if no children are possible.

Warning
This isn't a check for existing, sampled children – it simply returns the coordinates of potential children.
Parameters
cellInput cell
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.

Definition at line 519 of file MR_rect_tree.hpp.

◆ ccc_get_corners() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_corners ( diti_t cell) const
inline

Return a list of the corners of the given cell.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell

Definition at line 465 of file MR_rect_tree.hpp.

◆ ccc_get_corners() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_corners ( diti_t cell,
int index,
int direction ) const
inline

Return a list of the corners of the given cell.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.

Definition at line 472 of file MR_rect_tree.hpp.

◆ ccc_get_neighbor()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_neighbor ( diti_t cell,
int index,
int direction ) const
inline

Return the potential neighbor cell along the given axis in the specified direction.

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.
Returns
A neighbor cell coordinate or 0 if no neighbor exists. Note 0 is a valid coordinate, but not the center of any cell.

Definition at line 486 of file MR_rect_tree.hpp.

◆ ccc_get_neighbors()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_neighbors ( diti_t cell) const
inline

Return a list of potential neighbor cells of the specified cell Note the cells are not in canonical order!

Warning
No error checking – cell must be a valid center coordinate. See: cell_good_cords()
Parameters
cellInput cell

Definition at line 478 of file MR_rect_tree.hpp.

◆ ccc_get_top_cell()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_top_cell ( ) const
inline

Compute the top cell coordinates for the tree.

Warning
Just returns the coordinates regardless of if the top cell exists (is sampled).
Returns
Top cell coordinate for the tree.

Definition at line 423 of file MR_rect_tree.hpp.

◆ ccc_get_vertexes()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::ccc_get_vertexes ( diti_t cell) const
inline

Return a list of the vertexes (corners and center) of the given cell.

Parameters
cellInput cell

Definition at line 529 of file MR_rect_tree.hpp.

◆ cell_above_domain_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_above_domain_level ( diti_t cell,
int domain_index,
src_t domain_level )
inline

Test if a cell above the given domain component value.

Parameters
cellInput Cell
domain_indexThe index of the domain component we are testing
domain_levelThe level, or value, of the domain component we are testing
Returns
true if the cell above the domain level.

Definition at line 1303 of file MR_rect_tree.hpp.

◆ cell_above_range_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_above_range_level ( diti_t cell,
int range_index,
src_t range_level )
inline

Test if a cell is above given range component value.

Parameters
cellInput Cell
range_indexThe index of the range component we are testing
range_levelThe level, or value, of the range component we are testing
Returns
true if the cell is above the range level.

Definition at line 1338 of file MR_rect_tree.hpp.

◆ cell_below_domain_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_below_domain_level ( diti_t cell,
int domain_index,
src_t domain_level )
inline

Test if a cell is below the given domain component value.

Parameters
cellInput Cell
domain_indexThe index of the domain component we are testing
domain_levelThe level, or value, of the domain component we are testing
Returns
true if the cell below the domain level.

Definition at line 1294 of file MR_rect_tree.hpp.

◆ cell_below_range_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_below_range_level ( diti_t cell,
int range_index,
src_t range_level )
inline

Test if a cell is below given range component value.

Parameters
cellInput Cell
range_indexThe index of the range component we are testing
range_levelThe level, or value, of the range component we are testing
Returns
true if the cell is below the range level.

Definition at line 1328 of file MR_rect_tree.hpp.

◆ cell_can_have_children()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_can_have_children ( diti_t cell) const
inline

Test if a cell can have children (it not of minimal size)

Parameters
cellInput cell

Definition at line 1220 of file MR_rect_tree.hpp.

◆ cell_corner_is_nan()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_corner_is_nan ( diti_t cell)
inline

Test if a cell has an corner with a NaN value for a sample.

Parameters
cellInput cell

Definition at line 1199 of file MR_rect_tree.hpp.

◆ cell_cross_range_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_cross_range_level ( diti_t cell,
int range_index,
src_t range_level )
inline

Test if a cell crosses the given range component value.

See cell_cross_sdf for algorithm notes.

Parameters
cellInput Cell
range_indexThe index of the range component we are testing
range_levelThe level, or value, of the range component we are testing
Returns
true if the cell crosses the range level.

Definition at line 1313 of file MR_rect_tree.hpp.

◆ cell_cross_sdf()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_cross_sdf ( diti_t cell,
drpt2real_func_t sdf )
inline

Test if a cell crosses, or is on, a signed distance function boundry.

"Crossing" is defined as: The center is zero or any corner has a diffrent sign from the center.

Warning
Incorrect result if ALL vertexes of the cell are zero.
Parameters
cellInput Cell
sdfSigned distance function
Returns
true if the cell crosses, or is on, the signed distance function boundry.

Definition at line 1242 of file MR_rect_tree.hpp.

◆ cell_exists()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_exists ( diti_t cell) const
inline

Test if a cell has been sampled.

Warning
Simply checks that cell has been sampled – identical to vertex_exists().
Parameters
cellInput cell

Definition at line 1178 of file MR_rect_tree.hpp.

◆ cell_good_cords()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_good_cords ( diti_t cell) const
inline

Check if cell coordinates are in range to be a cell center.

Parameters
cellInput cell
Returns
True if cell is in bounds, false otherwise

Definition at line 1159 of file MR_rect_tree.hpp.

◆ cell_has_child()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_has_child ( diti_t cell) const
inline

Test if a cell has children.

Warning
Assumes the tree is well formed, and only checks that the "lower left" child's center been sampled!
Parameters
cellInput cell

Definition at line 1207 of file MR_rect_tree.hpp.

◆ cell_has_neighbor()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_has_neighbor ( diti_t cell,
int index,
int direction )
inline

Test if the specified neighbor cell exixts (is smapled).

Parameters
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.
cellInput cell

Definition at line 1228 of file MR_rect_tree.hpp.

◆ cell_has_no_child()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_has_no_child ( diti_t cell) const
inline

Test if a cell has no children.

Warning
Assumes the tree is well formed, and only checks that the "lower left" child's center been sampled!
Parameters
cellInput cell

Definition at line 1214 of file MR_rect_tree.hpp.

◆ cell_is_sampled()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_is_sampled ( diti_t cell) const
inline

Test if a cell has been sampled.

Warning
Simply checks that cell has been sampled – identical to vertex_exists().
Parameters
cellInput cell

Definition at line 1185 of file MR_rect_tree.hpp.

◆ cell_is_unbalanced()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_is_unbalanced ( int level_delta,
diti_t cell )
inline

Test if a cell is unbalanced at the given level.

Parameters
cellInput Cell
level_deltaSigned distance function
Returns
true if the cell is unbalanced at the given level.

Definition at line 1347 of file MR_rect_tree.hpp.

◆ cell_near_domain_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_near_domain_level ( diti_t cell,
int domain_index,
src_t domain_level,
src_t epsilon )
inline

Test if a cell crosses the given domain component value.

Parameters
cellInput Cell
domain_indexThe index of the domain component we are testing
domain_levelThe level, or value, of the domain component we are testing
epsilonUsed to fuzz floating point comparisons
Returns
true if the cell crosses the domain level.

Definition at line 1284 of file MR_rect_tree.hpp.

◆ cell_near_domain_point()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_near_domain_point ( drpt_t domain_point,
src_t epsilon,
diti_t cell )
inline

Test if a cell contains, or is close to, a point in the domain.

Parameters
domain_pointThe point in the domain
epsilonHow close the point must be
cellInput Cell
Returns
true if a cell contains, or is close to, a domain_point.

Definition at line 1266 of file MR_rect_tree.hpp.

◆ cell_vertex_is_nan()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_vertex_is_nan ( diti_t cell)
inline

Test if a cell has a vertex with a NaN value for a sample.

Parameters
cellInput cell

Definition at line 1192 of file MR_rect_tree.hpp.

Referenced by mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_recursive_if_cell_vertex_is_nan().

◆ cend_samples()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::unordered_map< diti_t, rrpt_t >::const_iterator mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cend_samples ( )
inline

Provide a constant end iterator for the sample data.

see: cbegin_samples().

Definition at line 401 of file MR_rect_tree.hpp.

◆ count_leaf_cells()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::count_leaf_cells ( diti_t cell) const
inline

Count the number of leaf cells starting from the given cell.

Parameters
cellStarting cell

Definition at line 1434 of file MR_rect_tree.hpp.

◆ cuc_axis_cross()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_axis_cross ( diti_t diti,
dic_t delta ) const
inline

Compute axis aligned cross points centered at diti and delta away Axis aligned cross points that fall outside of the domain will not be returned.

For example, if diti=0, then we get no points to the left. Examples:

  • dom_dom==1 => {diti-delta, diti+delta}
  • dom_dom==2 => {diti+[0, -delta], diti+[0, +delta], diti+[-delta, 0], diti+[+delta, 0]}
  • dom_dom==3 => {diti+[0, 0, -delta], diti+[0, 0, +delta], diti+[0, -delta, 0], diti+[0, +delta, 0], diti+[-delta, 0, 0], diti+[+delta, 0, 0]}
    Parameters
    ditiCenter coordinates for the cross
    deltaThe Distance for the cross points
    Returns
    Last of cross product points

Definition at line 685 of file MR_rect_tree.hpp.

◆ cuc_dec_all_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_dec_all_crd ( diti_t diti,
dic_t value ) const
inline

Decriment all components in a a tuple.

Parameters
ditiThe input tuple
valueAmout by which to decrement each component
Returns
New tuple with decrimented components

Definition at line 568 of file MR_rect_tree.hpp.

◆ cuc_dec_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_dec_crd ( diti_t diti,
int index,
dic_t value ) const
inline

Decriment a component in a a tuple.

Parameters
ditiThe input tuple
indexWhich component to incriment
valueAmout by which to decrement the component
Returns
New tuple with the specified component decrimented

Definition at line 562 of file MR_rect_tree.hpp.

◆ cuc_get_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_get_crd ( diti_t diti,
int index ) const
inline

Extract a component from a tuple.

Parameters
ditiThe input tuple
indexWhich component to extract
Returns
The component at index position

Definition at line 548 of file MR_rect_tree.hpp.

◆ cuc_inc_all_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_inc_all_crd ( diti_t diti,
dic_t value ) const
inline

Incriment all components in a a tuple.

Parameters
ditiThe input tuple
valueAmout by which to increment each component
Returns
New tuple with incrimented components

Definition at line 586 of file MR_rect_tree.hpp.

◆ cuc_inc_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_inc_crd ( diti_t diti,
int index,
dic_t value ) const
inline

Incriment a component in a a tuple.

Parameters
ditiThe input tuple
indexWhich component to incriment
valueAmout by which to increment the component
Returns
New tuple with the specified component incrimented

Definition at line 555 of file MR_rect_tree.hpp.

◆ cuc_set_all_crd()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_set_all_crd ( dic_t value) const
inline

Set all components in a a tuple to a constant.

Parameters
valueThe value for each component
Returns
New tuple

Definition at line 603 of file MR_rect_tree.hpp.

◆ cuc_two_cross() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_two_cross ( diti_t diti,
dic_t delta ) const
inline

Compute cross product points centered at diti and delta away Examples:

  • dom_dom==1 => {diti-delta, diti+delta}
  • dom_dom==2 => {diti+[-delta, -delta], diti+[-delta, +delta], diti+[+delta, -delta], diti+[+delta, +delta]}
  • dom_dom==3 => {diti+[-delta, -delta, -delta], ..., diti+[+delta, +delta, +delta]} – this list will have 8 points
    Parameters
    ditiCenter coordinates for the cross product points
    deltaThe Distance for the cross product points
    Returns
    Last of cross product points

Definition at line 623 of file MR_rect_tree.hpp.

◆ cuc_two_cross() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cuc_two_cross ( diti_t diti,
dic_t delta,
int index,
int direction ) const
inline

Compute directional cross product points centered at diti and delta away.

Warning
If diti is close to an corner, then some of the cross product points may be out of range! Examples:
  • dom_dom==1, index==0, direction==-1 => {diti-delta}
  • dom_dom==1, index==0, direction== 1 => {diti+delta}
  • dom_dom==2, index==0, direction==-1 => {diti+[-delta, -delta], diti+[-delta, +delta] }
  • dom_dom==2, index==0, direction== 1 => { diti+[+delta, -delta], diti+[+delta, +delta]}
  • dom_dom==2, index==1, direction==-1 => {diti+[-delta, -delta], diti+[+delta, -delta] }
  • dom_dom==2, index==1, direction== 1 => { diti+[-delta, +delta], diti+[+delta, +delta]}
Parameters
ditiCenter coordinates for the cross product points
deltaThe Distance for the cross product points.
indexThe index to hold constant. Must be in [0, dom_dom-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.
Returns
List of cross product points

Definition at line 654 of file MR_rect_tree.hpp.

◆ dita_to_diti()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dita_to_diti ( const dita_t & dita) const
inline

Convert an std::array of integer coordinate tuple to an packed integer coordinate tuple.

Parameters
ditaThe std::array of integer coordinate
Returns
New packed integer tuple.

Definition at line 733 of file MR_rect_tree.hpp.

◆ diti_to_dita()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dita_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_dita ( diti_t diti) const
inline

Convert a packed integer coordinate tuple to an std::array of integer coordinate tuple Note dita_t is always an std::array even when dom_dim==1.

Parameters
ditiPacked integer coordinate tuple
Returns
New std::array of integer coordinate tuple

Definition at line 748 of file MR_rect_tree.hpp.

◆ diti_to_drpt()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_drpt ( diti_t diti) const
inline

Convert a packed integer coordinate tuple to the coorisponding coordinate in drpt_t Note this function might return a scalar (float, double, etc...) or a std::array!

Parameters
ditiInput integer tuple
Returns
domain space value.

Definition at line 768 of file MR_rect_tree.hpp.

◆ diti_to_drta()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drta_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_drta ( diti_t diti) const
inline

Convert a packed integer coordinate tuple to the coorisponding std::array tuple of src_t Unlike diti_to_drpt, this function ALWAYS returns an std::array!

Parameters
ditiInput integer tuple
Returns
domain space value.

Definition at line 785 of file MR_rect_tree.hpp.

◆ diti_to_string() [1/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::string mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_string ( diti_t diti) const
inline

◆ diti_to_string() [2/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::string mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_string ( diti_t diti,
bool include_domain ) const
inline

◆ diti_to_string() [3/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::string mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_to_string ( diti_t diti,
bool include_domain,
bool do_hex ) const
inline

Convert a diti_t to a string representation.

Parameters
ditiThe diti_t to convert
do_hexPrint hex if true
include_domainWhen true, also include the real coordinates in the string representation.

Definition at line 1501 of file MR_rect_tree.hpp.

◆ dom_at()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
src_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dom_at ( drpt_t value,
int index ) const
inline

Definition at line 717 of file MR_rect_tree.hpp.

◆ drpt_distance_inf()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
src_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt_distance_inf ( drpt_t val1,
drpt_t val2 ) const
inline

Distance between two points in the domain space using the infinity norm (max absolute value)

Parameters
val1Value in domain space
val2Value in domain space

Definition at line 881 of file MR_rect_tree.hpp.

◆ drpt_midpoint()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt_midpoint ( drpt_t val1,
drpt_t val2 ) const
inline

Return the midpoint between two points in the domain space.

Parameters
val1Value in domain space
val2Value in domain space

Definition at line 895 of file MR_rect_tree.hpp.

◆ drpt_to_string()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::string mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::drpt_to_string ( drpt_t x) const
inline

Convert a drpt_t to a string representation.

Definition at line 1522 of file MR_rect_tree.hpp.

◆ dump_tree()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dump_tree ( int max_num_print) const
inline

Dump tree to STDOUT.

Parameters
max_num_printMaximum number of samples to print. Use 0 to print all samples.

Definition at line 1551 of file MR_rect_tree.hpp.

◆ dump_tree_datafile()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dump_tree_datafile ( std::string file_name) const
inline

Dump tree points to file – one tuple per line with domain coordinates followed by range values.

Definition at line 1576 of file MR_rect_tree.hpp.

◆ get_bbox_delta()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_bbox_delta ( ) const
inline

Return the bounding box minimum point.

Definition at line 378 of file MR_rect_tree.hpp.

◆ get_bbox_max()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_bbox_max ( ) const
inline

Return the bounding box minimum point.

Definition at line 375 of file MR_rect_tree.hpp.

◆ get_bbox_min()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_bbox_min ( ) const
inline

Return the bounding box minimum point.

Definition at line 372 of file MR_rect_tree.hpp.

◆ get_existing_neighbor()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_existing_neighbor ( diti_t cell,
int index,
int direction ) const
inline

Return a list of sampled neighbors to the given cell.

Warning
Unlike ccc_get_neighbor(), this member returns a list of existing (sampled) cell centers.
Parameters
cellInput cell. Must be a valid cell. – no error checking.
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.
Returns
List of existing neighbors.

Definition at line 1453 of file MR_rect_tree.hpp.

◆ get_leaf_cells() [1/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_leaf_cells ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1399 of file MR_rect_tree.hpp.

◆ get_leaf_cells() [2/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_leaf_cells ( diti_t cell) const
inline

Extract a list of all leaf cells starting from the given cell.

Parameters
cellStarting cell

Definition at line 1385 of file MR_rect_tree.hpp.

◆ get_leaf_cells() [3/3]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_leaf_cells ( diti_t cell,
int index,
int direction ) const
inline

Extract a list of all leaf cells starting from the given cell.

Parameters
cellInput cell. Must be a valid cell. – no error checking.
indexThe index of the axis. Must be in [0, dom_dim-1]. No error checking.
directionThe direction on the given index. Must be 1 or -1. No error checking.

Definition at line 1419 of file MR_rect_tree.hpp.

◆ get_leaf_cells_pred()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_list_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_leaf_cells_pred ( diti_t cell,
diti2bool_func_t pred ) const
inline

Extract a list of all leaf cells starting from the given cell that match the given predicate.

Warning
The given cell need not match the predicate.
Parameters
cellStarting cell
predPredicate function.

Definition at line 1407 of file MR_rect_tree.hpp.

◆ get_sample()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
rrpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_sample ( diti_t vertex) const
inline

Return the sample value for vertex.

Parameters
vertexInput vertex

Definition at line 382 of file MR_rect_tree.hpp.

◆ get_sample_rrta()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
rrta_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_sample_rrta ( diti_t vertex) const
inline

Return the sample value for vertex as an rrta_t (an std::array)

Parameters
vertexInput vertex

Definition at line 386 of file MR_rect_tree.hpp.

◆ get_smallest_neighbor_level()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::get_smallest_neighbor_level ( diti_t cell) const
inline

Return the level of the smallest, existing neighbor.

Returns -1 if no neighbors exist.

Parameters
cellInput cell. Must be a valid cell. – no error checking.

Definition at line 1468 of file MR_rect_tree.hpp.

◆ refine_grid() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_grid ( diti_t cell,
int level_delta,
drpt2rrpt_func_t func )
inline

Sample a function uniformly across given cell to the given level.

The given cell need not exist in the tree yet.

Warning
Will resample previously sampled points in the cell.
Parameters
cellThe cell to sample within
level_deltaThe relative level at which to sample level_delta=0 is equivalent to calling sample_cell(cell, func). level_delta=1 is equivalent to calling sample_cell(cell, func) followed by refine_once(cell, func).
funcFunction to use for samples

Definition at line 946 of file MR_rect_tree.hpp.

◆ refine_grid() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_grid ( int level_delta,
drpt2rrpt_func_t func )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1004 of file MR_rect_tree.hpp.

◆ refine_leaves_atomically_if_cell_pred() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_atomically_if_cell_pred ( diti_t cell,
int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

Repeatedly refine leaves of the given cell for which pred is true.

Apply refine_leaves_once_if_cell_pred() repeatedly untill no new cells are refined.

Parameters
cellInput cell. Must be a valid cell. – no error checking.
levelMaximum level of refinded cells. -1 means refine to the limit.
funcFunction to sample
predPredicate function.

Definition at line 1106 of file MR_rect_tree.hpp.

◆ refine_leaves_atomically_if_cell_pred() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_atomically_if_cell_pred ( int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1114 of file MR_rect_tree.hpp.

◆ refine_leaves_once_if_cell_pred() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_once_if_cell_pred ( diti_t cell,
int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

Refine each leaf cell if pred returns true and the cell level is less than the given level value.

All leaf cells are tested with the predicate first. Then the list of cells requiring refinement are refined. This guarantees that no leaf cell will be refined more than once even if the refinement process would impact the value of the predicate. This can produce qualitatively different behavior than refine_leaves_recursive_cell_pred() when used with predicates like cell_is_unbalanced().

Parameters
cellInput cell. Must be a valid cell. – no error checking.
levelMaximum level of refinded cells. -1 means refine to the limit.
funcFunction to sample
predPredicate function.

Definition at line 1080 of file MR_rect_tree.hpp.

◆ refine_leaves_once_if_cell_pred() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_once_if_cell_pred ( int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1094 of file MR_rect_tree.hpp.

◆ refine_leaves_once_if_unbalanced()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_once_if_unbalanced ( int level_delta,
drpt2rrpt_func_t func )
inline

Refine leaf cells if they are unbalanced at the given level.

This is a convenience function combining refine_leaves_atomically_if_cell_pred(), cell_is_unbalanced(), & ccc_get_top_cell().

The primary use case is to demonstrate the step wise balancing of a tree.

Parameters
level_deltaThe Level.
funcFunction to sample

Definition at line 1136 of file MR_rect_tree.hpp.

◆ refine_leaves_recursive_cell_pred() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_recursive_cell_pred ( diti_t cell,
int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

Refine a cells matching predicate until refined cells reach specified level.

Warning
cell must exist (i.e. must be sampled)
Parameters
cellCell to refine
levelMaximum level of refinded cells. -1 means refine to the limit.
funcFunction to use for samples
predPredicate function.

Definition at line 1060 of file MR_rect_tree.hpp.

◆ refine_leaves_recursive_cell_pred() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_leaves_recursive_cell_pred ( int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1066 of file MR_rect_tree.hpp.

◆ refine_once()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_once ( diti_t cell,
drpt2rrpt_func_t func )
inline

Refine a cell if possible.

Parameters
cellCell to refine – no error checking!!
funcFunction to use for samples
Returns
1 if cell was refined, and 0 otherwise – i.e. the number of cells refined.

Definition at line 925 of file MR_rect_tree.hpp.

◆ refine_recursive() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_recursive ( diti_t cell,
int level,
drpt2rrpt_func_t func )
inline

Refine a cell until refined cells reach specified level.

Note
Unlike most of the other refine functions, this one will sample the given cell. i.e. the provided cell need not be already sampled. This difference is because this function is frequently called to initially sample a tree.
Parameters
cellCell to refine
levelMaximum level of refined cells. -1 means refine to the limit.
funcFunction to use for samples

Definition at line 1016 of file MR_rect_tree.hpp.

◆ refine_recursive() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_recursive ( int level,
drpt2rrpt_func_t func )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1027 of file MR_rect_tree.hpp.

◆ refine_recursive_cell_pred()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_recursive_cell_pred ( diti_t cell,
int level,
drpt2rrpt_func_t func,
diti2bool_func_t pred )
inline

Refine a cells matching predicate until refined cells reach specified level.

Warning
cell must exist (i.e. must be sampled)
Note
Nothing happens if pred isn't true for cell. i.e. this is a worker function to refine a cell with a known condition until the condition is no longer true, or a maximum level has been reached. This is normally the wrong function to call with the ccc_get_top_cell(). If you wish to refine recursively all cells in a tree that match a predicate, then use refine_leaves_recursive_cell_pred().
Parameters
cellCell to refine
levelMaximum level of refinded cells. -1 means refine to the limit.
funcFunction to use for samples
predPredicate function.

Definition at line 1043 of file MR_rect_tree.hpp.

◆ refine_recursive_if_cell_vertex_is_nan()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::refine_recursive_if_cell_vertex_is_nan ( int level,
drpt2rrpt_func_t func )
inline

Refine a cells with NaNs until refined cells reach specified level.

This is a convenience function combining refine_recursive_cell_pred(), cell_vertex_is_nan(), & ccc_get_top_cell().

Parameters
levelMaximum level of refinded cells. -1 means refine to the limit.
funcFunction to use for samples

Definition at line 1124 of file MR_rect_tree.hpp.

References mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::cell_vertex_is_nan().

◆ rng_at()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
src_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rng_at ( rrpt_t value,
int index ) const
inline

Definition at line 708 of file MR_rect_tree.hpp.

◆ rrpt_distance_inf()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
src_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrpt_distance_inf ( rrpt_t val1,
rrpt_t val2 ) const
inline

Distance between two points in the range space using the infinity norm (max absolute value)

Parameters
val1Value in range space
val2Value in range space

Definition at line 862 of file MR_rect_tree.hpp.

◆ rrpt_is_nan()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrpt_is_nan ( rrpt_t val) const
inline

Test if a point in the range space contains a NaN coordinate value.

Parameters
valValue in space

Definition at line 851 of file MR_rect_tree.hpp.

◆ rrpt_to_string()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::string mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::rrpt_to_string ( rrpt_t x) const
inline

Convert rrpt value to a string representation.

Definition at line 1536 of file MR_rect_tree.hpp.

◆ sample_cell() [1/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::sample_cell ( diti_t cell,
drpt2rrpt_func_t func )
inline

Sample a cell.

Parameters
cellCell to sample
funcFunction to use for samples

Definition at line 807 of file MR_rect_tree.hpp.

◆ sample_cell() [2/2]

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::sample_cell ( drpt2rrpt_func_t func)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 816 of file MR_rect_tree.hpp.

◆ sample_point()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::sample_point ( diti_t diti,
drpt2rrpt_func_t func )
inline

Sample, or resample, a point.

Parameters
ditiPoint at which to sample
funcFunction to sample

Definition at line 838 of file MR_rect_tree.hpp.

◆ sample_point_maybe()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::sample_point_maybe ( diti_t diti,
drpt2rrpt_func_t func )
inline

Sample a point if it has not already been sampled.

Parameters
ditiPoint at which to sample
funcFunction to sample
Returns
true if we sampled the point, and false otherwise.

Definition at line 824 of file MR_rect_tree.hpp.

◆ set_bbox()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::set_bbox ( drpt_t new_bbox_min,
drpt_t new_bbox_max )
inline

Set the bounding box.

Parameters
new_bbox_minValue to use for bounding box minimum point
new_bbox_maxValue to use for bounding box maximum point

Definition at line 340 of file MR_rect_tree.hpp.

◆ set_bbox_default()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::set_bbox_default ( )
inline

Set the bounding box to the default: -1 for all minimum components and +1 for all maximum components.

Definition at line 347 of file MR_rect_tree.hpp.

◆ set_bbox_max()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::set_bbox_max ( drpt_t new_bbox_max)
inline

Set the bounding box max_level.

Parameters
new_bbox_maxValue to use for bounding box maximum point

Definition at line 364 of file MR_rect_tree.hpp.

◆ set_bbox_min()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::set_bbox_min ( drpt_t new_bbox_min)
inline

Set the bounding box minimum.

Parameters
new_bbox_minValue to use for bounding box minimum point

Definition at line 360 of file MR_rect_tree.hpp.

◆ update_bbox_delta()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
void mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::update_bbox_delta ( )
inline

Update the value of bbox_delta.

Use this after modifying the value of bbox_min or bbox_max.

Definition at line 319 of file MR_rect_tree.hpp.

◆ vertex_exists()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::vertex_exists ( diti_t vertex) const
inline

Point has been sampled.

Parameters
vertexInput vertex

Definition at line 1374 of file MR_rect_tree.hpp.

◆ vertex_is_nan()

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
bool mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::vertex_is_nan ( diti_t vertex)
inline

Test if a vertex is NaN or, when it is an std::array, if it contains a NaN element.

Parameters
vertexInput vertex

Definition at line 1364 of file MR_rect_tree.hpp.

Member Data Documentation

◆ bbox_delta

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::bbox_delta
private

The wdith of the real domain range.

Definition at line 293 of file MR_rect_tree.hpp.

◆ bbox_max

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::bbox_max
private

Holds the maximal point for the real domain range.

Definition at line 292 of file MR_rect_tree.hpp.

◆ bbox_min

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
drpt_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::bbox_min
private

Holds the minimal point for the real domain range.

Definition at line 291 of file MR_rect_tree.hpp.

◆ dic_bits

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dic_bits = max_level+1
staticconstexpr

The number of bits used by a single component of an integer coordinate tuple.

Warning
dic_bits >= sizeof(dic_t), but it might not be equal.

Definition at line 203 of file MR_rect_tree.hpp.

◆ dic_ctr

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dic_ctr = (static_cast<dic_t>(1) << (max_level-1))
staticconstexpr

Center value for a dic_t.

Definition at line 254 of file MR_rect_tree.hpp.

◆ dic_max

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dic_max = (static_cast<dic_t>(1) << max_level)
staticconstexpr

Maximum allowd for a dic_t.

Definition at line 252 of file MR_rect_tree.hpp.

◆ dic_min

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
dic_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::dic_min = 0
staticconstexpr

Minimum allowd for a dic_t.

Definition at line 256 of file MR_rect_tree.hpp.

◆ diti_bits

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_bits = dic_bits * dom_dim
staticconstexpr

The number of bits used by an entire integer coordinate tuple.

Warning
diti_bits >= sizeof(diti_t), but it might not be equal.

Definition at line 207 of file MR_rect_tree.hpp.

◆ diti_msk0

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_msk0 = static_cast<diti_t>(~(diti_ones << dic_bits))
staticconstexprprivate

Definition at line 284 of file MR_rect_tree.hpp.

◆ diti_ones

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
diti_t mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::diti_ones = ~static_cast<diti_t>(0)
staticconstexprprivate

Definition at line 282 of file MR_rect_tree.hpp.

◆ domain_dimension

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::domain_dimension = dom_dim
staticconstexpr

The value of the template parameter dom_dim.

Definition at line 141 of file MR_rect_tree.hpp.

◆ maximum_level

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::maximum_level = max_level
staticconstexpr

The value of the template parameter max_level.

Definition at line 145 of file MR_rect_tree.hpp.

◆ range_dimension

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
int mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::range_dimension = rng_dim
staticconstexpr

The value of the template parameter rng_dim.

Definition at line 143 of file MR_rect_tree.hpp.

◆ samples

template<int max_level, class spc_real_t , int dom_dim, int rng_dim>
std::unordered_map<diti_t, rrpt_t> mjr::MR_rect_tree< max_level, spc_real_t, dom_dim, rng_dim >::samples
private

Holds the sampled data.

Definition at line 295 of file MR_rect_tree.hpp.


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