NEST
2.6.0,not_revisioned_source_dir@0
|
A Ntree object represents a subtree or leaf in a Ntree structure. More...
#include <ntree.h>
Classes | |
class | iterator |
Iterator iterating the nodes in a Quadtree. More... | |
class | masked_iterator |
Iterator iterating the nodes in a Quadtree inside a Mask. More... | |
Public Types | |
typedef Position< D > | key_type |
typedef T | mapped_type |
typedef std::pair< Position< D > , T > | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
Public Member Functions | |
Ntree (const Position< D > &lower_left, const Position< D > &extent, std::bitset< D > periodic=0, Ntree *parent=0, int subquad=0) | |
Create a Ntree that covers the region defined by the two input positions. More... | |
~Ntree () | |
Delete Ntree recursively. More... | |
iterator | insert (Position< D > pos, const T &node) |
Traverse quadtree structure from current ntree. More... | |
iterator | insert (const value_type &val) |
std::multimap like insert method More... | |
iterator | insert (iterator, const value_type &val) |
STL container compatible insert method (the first argument is ignored) More... | |
std::vector< value_type > | get_nodes () |
std::vector< value_type > | get_nodes (const Mask< D > &mask, const Position< D > &anchor) |
Applies a Mask to this ntree. More... | |
iterator | begin () |
This function returns a node iterator which will traverse the subtree below this Ntree. More... | |
iterator | end () |
masked_iterator | masked_begin (const Mask< D > &mask, const Position< D > &anchor) |
This function returns a masked node iterator which will traverse the subtree below this Ntree, skipping nodes outside the mask. More... | |
masked_iterator | masked_end () |
bool | is_leaf () const |
Static Public Attributes | |
static const int | N = 1<<D |
Protected Member Functions | |
void | split_ () |
Change a leaf ntree to a regular ntree with four children regions. More... | |
void | append_nodes_ (std::vector< value_type > &) |
Append this ntree's nodes to the vector. More... | |
void | append_nodes_ (std::vector< value_type > &, const Mask< D > &, const Position< D > &) |
Append this ntree's nodes inside the mask to the vector. More... | |
int | subquad_ (const Position< D > &) |
Protected Attributes | |
Position< D > | lower_left_ |
Position< D > | extent_ |
bool | leaf_ |
std::vector< value_type > | nodes_ |
Ntree * | parent_ |
int | my_subquad_ |
This Ntree's subquad number within parent. More... | |
int | my_depth_ |
This Ntree's depth in the tree. More... | |
Ntree * | children_ [N] |
std::bitset< D > | periodic_ |
periodic b.c. More... | |
Friends | |
class | iterator |
class | masked_iterator |
A Ntree object represents a subtree or leaf in a Ntree structure.
Any ntree covers a specific region in space. A leaf ntree contains a list of items and their corresponding positions. A branch ntree contains a list of N=1<<D other ntrees, each covering a region corresponding to the upper-left, lower-left, upper-right and lower-left corner of their mother ntree.
typedef const value_type& nest::Ntree< D, T, max_capacity, max_depth >::const_reference |
typedef Position<D> nest::Ntree< D, T, max_capacity, max_depth >::key_type |
typedef T nest::Ntree< D, T, max_capacity, max_depth >::mapped_type |
typedef value_type& nest::Ntree< D, T, max_capacity, max_depth >::reference |
typedef std::pair<Position<D>,T> nest::Ntree< D, T, max_capacity, max_depth >::value_type |
nest::Ntree< D, T, max_capacity, max_depth >::Ntree | ( | const Position< D > & | lower_left, |
const Position< D > & | extent, | ||
std::bitset< D > | periodic = 0 , |
||
Ntree< D, T, max_capacity, max_depth > * | parent = 0 , |
||
int | subquad = 0 |
||
) |
Create a Ntree that covers the region defined by the two input positions.
lower_left | Lower left corner of ntree. |
extent | Size (width,height) of ntree. |
nest::Ntree< D, T, max_capacity, max_depth >::~Ntree | ( | ) |
Delete Ntree recursively.
References nest::names::n, and nest::names::N.
|
protected |
Append this ntree's nodes to the vector.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::get_nodes().
|
protected |
Append this ntree's nodes inside the mask to the vector.
|
inline |
This function returns a node iterator which will traverse the subtree below this Ntree.
References nest::Ntree< D, T, max_capacity, max_depth >::iterator.
|
inline |
std::vector< std::pair< Position< D >, T > > nest::Ntree< D, T, max_capacity, max_depth >::get_nodes | ( | ) |
References nest::Ntree< D, T, max_capacity, max_depth >::append_nodes_().
std::vector< std::pair< Position< D >, T > > nest::Ntree< D, T, max_capacity, max_depth >::get_nodes | ( | const Mask< D > & | mask, |
const Position< D > & | anchor | ||
) |
Applies a Mask to this ntree.
mask | mask to apply. |
anchor | position to center mask in. |
References nest::Ntree< D, T, max_capacity, max_depth >::append_nodes_().
Ntree< D, T, max_capacity, max_depth >::iterator nest::Ntree< D, T, max_capacity, max_depth >::insert | ( | Position< D > | pos, |
const T & | node | ||
) |
Traverse quadtree structure from current ntree.
Inserts node in correct leaf in quadtree.
References assert(), nest::Ntree< D, T, max_capacity, max_depth >::children_, nest::Ntree< D, T, max_capacity, max_depth >::extent_, nest::Ntree< D, T, max_capacity, max_depth >::insert(), nest::Ntree< D, T, max_capacity, max_depth >::iterator, nest::Ntree< D, T, max_capacity, max_depth >::leaf_, nest::Ntree< D, T, max_capacity, max_depth >::lower_left_, nest::Ntree< D, T, max_capacity, max_depth >::my_depth_, nest::Ntree< D, T, max_capacity, max_depth >::nodes_, nest::Ntree< D, T, max_capacity, max_depth >::periodic_, nest::Ntree< D, T, max_capacity, max_depth >::split_(), and nest::Ntree< D, T, max_capacity, max_depth >::subquad_().
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert(), nest::FreeLayer< D >::insert_local_positions_ntree_(), nest::GridLayer< D >::insert_local_positions_ntree_(), and nest::Ntree< D, T, max_capacity, max_depth >::split_().
iterator nest::Ntree< D, T, max_capacity, max_depth >::insert | ( | const value_type & | val | ) |
std::multimap like insert method
iterator nest::Ntree< D, T, max_capacity, max_depth >::insert | ( | iterator | , |
const value_type & | val | ||
) |
STL container compatible insert method (the first argument is ignored)
bool nest::Ntree< D, T, max_capacity, max_depth >::is_leaf | ( | ) | const |
References nest::Ntree< D, T, max_capacity, max_depth >::leaf_.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::iterator::iterator().
|
inline |
This function returns a masked node iterator which will traverse the subtree below this Ntree, skipping nodes outside the mask.
References nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator.
|
inline |
|
protected |
Change a leaf ntree to a regular ntree with four children regions.
References assert(), nest::Ntree< D, T, max_capacity, max_depth >::children_, nest::Ntree< D, T, max_capacity, max_depth >::extent_, nest::Ntree< D, T, max_capacity, max_depth >::insert(), nest::Ntree< D, T, max_capacity, max_depth >::leaf_, nest::Ntree< D, T, max_capacity, max_depth >::lower_left_, nest::Ntree< D, T, max_capacity, max_depth >::N, nest::Ntree< D, T, max_capacity, max_depth >::nodes_, and nest::Ntree< D, T, max_capacity, max_depth >::subquad_().
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert().
|
protected |
References nest::Ntree< D, T, max_capacity, max_depth >::extent_, and nest::Ntree< D, T, max_capacity, max_depth >::lower_left_.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert(), and nest::Ntree< D, T, max_capacity, max_depth >::split_().
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
This Ntree's depth in the tree.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert().
|
protected |
This Ntree's subquad number within parent.
|
static |
|
protected |
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert(), nest::Ntree< D, T, max_capacity, max_depth >::iterator::iterator(), nest::Ntree< D, T, max_capacity, max_depth >::iterator::operator*(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator*(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator++(), nest::Ntree< D, T, max_capacity, max_depth >::iterator::operator->(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator->(), and nest::Ntree< D, T, max_capacity, max_depth >::split_().
|
protected |
|
protected |
periodic b.c.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::insert(), and nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator().