NDEVR
API Documentation
TreeBoundarySorter< t_dims, t_type >

A tree sorter that supports both center-based and boundary-based spatial partitioning. More...

Inheritance diagram for TreeBoundarySorter< t_dims, t_type >:
[legend]
Collaboration diagram for TreeBoundarySorter< t_dims, t_type >:
[legend]

Public Member Functions

template<bool t_has_nans, class t_list_type>
void createBoundarySortList (const Buffer< uint04 > &indices, const t_list_type &locations)
 Creates sorted index lists based on element bounding boxes.
template<bool t_has_nans, class t_list_type>
void createCenterSortList (const Buffer< uint04 > &indices, const t_list_type &locations)
 Creates sorted index lists based on element centers.
template<bool t_has_nans, class t_list_type>
void createHashSortList (const Buffer< uint04 > &indices, const t_list_type &locations)
 Creates sorted index lists using a hash-based lookup for sparse element sets.
template<class t_list_type>
Bounds< t_dims, t_type > getBounds (uint04 start, uint04 finish, const t_list_type &locations) const
 Computes the tight bounding box for a range of sorted elements.
uint04 getMedian (uint01 dimension, uint04 start, uint04 end)
 Finds the median element and partitions all sorted lists accordingly.
template<class t_list_type>
Vector< 2, Bounds< t_dims, t_type > > getMedianBounds (uint01 dimension, uint04 start, uint04 end, const t_list_type &locations)
 Computes the bounding boxes for both sides of a median split.
template<bool t_has_nans, class t_center_buffer, class t_bounds_buffer>
void sortList (uint01 dimension, const t_center_buffer &centers, const t_bounds_buffer &bounds)
 Sorts the index lists for a given dimension by center, min, and max values.
Public Member Functions inherited from TreeSorterBase< t_dims, t_type >
void getList (uint01 dimension, uint04 start, uint04 end, Buffer< uint04 > &values, uint04 index_offset)
 Copies a range of the center-ordered index list into the output buffer.

Protected Attributes

bool m_uses_boundary = true
 Whether boundary-based sorting is enabled.
Buffer< uint04max_ordered [t_dims]
 Pre-sorted index arrays by maximum bound for each dimension.
Buffer< uint04min_ordered [t_dims]
 Pre-sorted index arrays by minimum bound for each dimension.
Protected Attributes inherited from TreeSorterBase< t_dims, t_type >
Buffer< uint04center_ordered [t_dims]
 Pre-sorted index arrays by center value for each dimension.
Buffer< uint04temp_array
 Temporary index buffer for partitioning operations.
Buffer< bool > temp_memory
 Temporary boolean buffer for partitioning operations.

Additional Inherited Members

Static Protected Member Functions inherited from TreeSorterBase< t_dims, t_type >
static void _sortList (const Buffer< bool > &list_sorter, Buffer< uint04 > &list, Buffer< uint04 > &temp, uint04 start, uint04 end)
 Partitions a list into two halves based on a boolean mask.

Detailed Description

template<uint01 t_dims, class t_type>
class TreeBoundarySorter< t_dims, t_type >

A tree sorter that supports both center-based and boundary-based spatial partitioning.


Definition at line 112 of file TreeSorter.h.

Member Function Documentation

◆ createBoundarySortList()

template<uint01 t_dims, class t_type>
template<bool t_has_nans, class t_list_type>
void TreeBoundarySorter< t_dims, t_type >::createBoundarySortList ( const Buffer< uint04 > & indices,
const t_list_type & locations )
inline

Creates sorted index lists based on element bounding boxes.

Parameters
[in]indicesThe element indices to sort.
[in]locationsThe element locations with bounding information.

Definition at line 140 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::center_ordered, IsInvalid(), m_uses_boundary, sortList(), TreeSorterBase< t_dims, t_type >::temp_array, and TreeSorterBase< t_dims, t_type >::temp_memory.

◆ createCenterSortList()

template<uint01 t_dims, class t_type>
template<bool t_has_nans, class t_list_type>
void TreeBoundarySorter< t_dims, t_type >::createCenterSortList ( const Buffer< uint04 > & indices,
const t_list_type & locations )
inline

Creates sorted index lists based on element centers.

Parameters
[in]indicesThe element indices to sort.
[in]locationsThe element locations.

Definition at line 119 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::center_ordered, m_uses_boundary, sortList(), TreeSorterBase< t_dims, t_type >::temp_array, and TreeSorterBase< t_dims, t_type >::temp_memory.

◆ createHashSortList()

template<uint01 t_dims, class t_type>
template<bool t_has_nans, class t_list_type>
void TreeBoundarySorter< t_dims, t_type >::createHashSortList ( const Buffer< uint04 > & indices,
const t_list_type & locations )
inline

Creates sorted index lists using a hash-based lookup for sparse element sets.

Parameters
[in]indicesThe element indices to sort.
[in]locationsThe element locations.

Definition at line 169 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::center_ordered, m_uses_boundary, sortList(), TreeSorterBase< t_dims, t_type >::temp_array, and TreeSorterBase< t_dims, t_type >::temp_memory.

◆ getBounds()

template<uint01 t_dims, class t_type>
template<class t_list_type>
Bounds< t_dims, t_type > TreeBoundarySorter< t_dims, t_type >::getBounds ( uint04 start,
uint04 finish,
const t_list_type & locations ) const
inline

Computes the tight bounding box for a range of sorted elements.

Parameters
[in]startThe start index.
[in]finishThe end index.
[in]locationsThe element locations.
Returns
The bounding box encompassing the specified range.

Definition at line 262 of file TreeSorter.h.

References Bounds< t_dims, t_type, t_vertex >::center(), TreeSorterBase< t_dims, t_type >::center_ordered, m_uses_boundary, max_ordered, and min_ordered.

◆ getMedian()

template<uint01 t_dims, class t_type>
uint04 TreeBoundarySorter< t_dims, t_type >::getMedian ( uint01 dimension,
uint04 start,
uint04 end )
inline

Finds the median element and partitions all sorted lists accordingly.

Parameters
[in]dimensionThe dimension to find the median along.
[in]startThe start index.
[in]endThe end index.
Returns
The index of the median element.

Definition at line 415 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::_sortList(), TreeSorterBase< t_dims, t_type >::center_ordered, m_uses_boundary, max_ordered, min_ordered, TreeSorterBase< t_dims, t_type >::temp_array, and TreeSorterBase< t_dims, t_type >::temp_memory.

◆ getMedianBounds()

template<uint01 t_dims, class t_type>
template<class t_list_type>
Vector< 2, Bounds< t_dims, t_type > > TreeBoundarySorter< t_dims, t_type >::getMedianBounds ( uint01 dimension,
uint04 start,
uint04 end,
const t_list_type & locations )
inline

Computes the bounding boxes for both sides of a median split.

Parameters
[in]dimensionThe dimension to split along.
[in]startThe start index.
[in]endThe end index.
[in]locationsThe element locations.
Returns
A pair of bounding boxes for the left and right partitions.

Definition at line 290 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::center_ordered, IsValid(), m_uses_boundary, max_ordered, min_ordered, and TreeSorterBase< t_dims, t_type >::temp_memory.

◆ sortList()

template<uint01 t_dims, class t_type>
template<bool t_has_nans, class t_center_buffer, class t_bounds_buffer>
void TreeBoundarySorter< t_dims, t_type >::sortList ( uint01 dimension,
const t_center_buffer & centers,
const t_bounds_buffer & bounds )
inline

Sorts the index lists for a given dimension by center, min, and max values.

Parameters
[in]dimensionThe dimension to sort by.
[in]centersThe center values for each element.
[in]boundsThe bounding boxes for each element.

Definition at line 201 of file TreeSorter.h.

References TreeSorterBase< t_dims, t_type >::center_ordered, IsInvalid(), m_uses_boundary, max_ordered, and min_ordered.

Referenced by createBoundarySortList(), createCenterSortList(), and createHashSortList().


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