48 template<
int D,
class T,
int max_capacity=100,
int max_depth=10>
53 static const int N = 1<<D;
216 std::bitset<D> periodic=0,
Ntree *
parent=0,
int subquad=0);
319 template<
int D,
class T,
int max_capacity,
int max_depth>
322 std::bitset<D> periodic,
325 lower_left_(lower_left),
329 my_subquad_(subquad),
330 my_depth_(parent?parent->my_depth_+1:0),
335 template<
int D,
class T,
int max_capacity,
int max_depth>
341 for (
size_t n = 0 ; n < static_cast<size_t>(
N) ; ++
n )
345 template<
int D,
class T,
int max_capacity,
int max_depth>
347 ntree_(&q), top_(&q), node_(n)
356 template<
int D,
class T,
int max_capacity,
int max_depth>
363 template<
int D,
class T,
int max_capacity,
int max_depth>
366 std::vector<std::pair<Position<D>,T> > result;
371 template<
int D,
class T,
int max_capacity,
int max_depth>
374 std::vector<std::pair<Position<D>,T> > result;
379 template<
int D,
class T,
int max_capacity,
int max_depth>
382 return insert(val.first,val.second);
385 template<
int D,
class T,
int max_capacity,
int max_depth>
388 return insert(val.first,val.second);
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
~Ntree()
Delete Ntree recursively.
Definition: ntree.h:336
masked_iterator & operator++()
Move the iterator to the next node inside the mask within the tree.
Definition: ntree_impl.h:287
const Name N("N")
Specific to population point process model (pp_pop_psc_delta)
Definition: nest_names.h:203
const Mask< D > * mask_
Definition: ntree.h:203
index current_anchor_
Definition: ntree.h:206
bool is_leaf() const
Definition: ntree.h:357
int my_subquad_
This Ntree's subquad number within parent.
Definition: ntree.h:310
iterator begin()
This function returns a node iterator which will traverse the subtree below this Ntree.
Definition: ntree.h:258
Iterator iterating the nodes in a Quadtree inside a Mask.
Definition: ntree.h:128
Ntree * top_
Definition: ntree.h:200
bool leaf_
Definition: ntree.h:305
void next_leaf_()
Move to the next leaf quadrant, or set ntree_ to 0 if there are no more leaves.
Definition: ntree_impl.h:67
value_type & operator*()
Definition: ntree.h:84
const Name extent("extent")
Definition: topology_names.h:47
iterator & operator++()
Move the iterator to the next node within the tree.
Definition: ntree_impl.h:49
T mapped_type
Definition: ntree.h:56
void next_anchor_()
Go to the next anchor image.
Definition: ntree_impl.h:168
const Name lower_left("lower_left")
Definition: topology_names.h:66
index node_
Definition: ntree.h:202
const value_type & const_reference
Definition: ntree.h:59
void split_()
Change a leaf ntree to a regular ntree with four children regions.
Definition: ntree_impl.h:397
void next_leaf_()
Find the next leaf which is not outside the mask.
Definition: ntree_impl.h:182
int subquad_(const Position< D > &)
Definition: ntree_impl.h:316
masked_iterator operator++(int)
Postfix increment operator.
Definition: ntree.h:154
masked_iterator masked_end()
Definition: ntree.h:272
const Name parent("parent")
Node parameter.
Definition: nest_names.h:220
void first_leaf_inside_()
Set the allin_top_ to the current quadrant, and find the first leaf below the current quadrant...
Definition: ntree_impl.h:276
Abstract base class for masks with given dimension.
Definition: mask.h:90
bool operator==(const masked_iterator &other) const
Iterators are equal if they point to the same node in the same ntree.
Definition: ntree.h:165
A Ntree object represents a subtree or leaf in a Ntree structure.
Definition: ntree.h:49
const Name anchor("anchor")
Definition: topology_names.h:50
static const int N
Definition: ntree.h:53
Ntree * parent_
Definition: ntree.h:309
bool operator!=(const iterator &other) const
Definition: ntree.h:109
bool operator!=(const masked_iterator &other) const
Definition: ntree.h:167
Position< D > lower_left_
Definition: ntree.h:302
bool operator==(const iterator &other) const
Iterators are equal if they point to the same node in the same ntree.
Definition: ntree.h:107
const Name other("other")
Node type.
Definition: nest_names.h:216
iterator insert(Position< D > pos, const T &node)
Traverse quadtree structure from current ntree.
Definition: ntree_impl.h:362
Iterator iterating the nodes in a Quadtree.
Definition: ntree.h:64
value_type * operator->()
Definition: ntree.h:85
std::pair< Position< D >, T > value_type
Definition: ntree.h:57
void first_leaf_()
Find the first leaf which is not outside the mask.
Definition: ntree_impl.h:257
friend class masked_iterator
Definition: ntree.h:316
Position< D > extent_
Definition: ntree.h:303
Position< D > key_type
Definition: ntree.h:55
value_type * operator->()
Definition: ntree.h:142
int my_depth_
This Ntree's depth in the tree.
Definition: ntree.h:311
Ntree * allin_top_
Definition: ntree.h:201
void init_()
Initialize.
Definition: ntree_impl.h:143
Ntree * ntree_
Definition: ntree.h:120
Ntree * top_
Definition: ntree.h:121
std::vector< Position< D > > anchors_
Definition: ntree.h:205
value_type & reference
Definition: ntree.h:58
index node_
Definition: ntree.h:122
std::bitset< D > periodic_
periodic b.c.
Definition: ntree.h:313
iterator()
Initialize an invalid iterator.
Definition: ntree.h:69
Position< D > anchor_
Definition: ntree.h:204
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.
Definition: ntree.h:320
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
friend class iterator
Definition: ntree.h:315
std::vector< value_type > nodes_
Definition: ntree.h:307
Ntree * ntree_
Definition: ntree.h:199
const Name mask("mask")
Definition: topology_names.h:57
std::vector< value_type > get_nodes()
Definition: ntree.h:364
value_type & operator*()
Definition: ntree.h:141
Ntree * children_[N]
Definition: ntree.h:312
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...
Definition: ntree.h:269
iterator operator++(int)
Postfix increment operator.
Definition: ntree.h:96
void append_nodes_(std::vector< value_type > &)
Append this ntree's nodes to the vector.
iterator end()
Definition: ntree.h:261
masked_iterator()
Initialize an invalid iterator.
Definition: ntree.h:133