73 const index to)
const = 0;
83 const index to)
const = 0;
117 virtual void dump_nodes(std::ostream & os)
const = 0;
281 const index to)
const;
284 const index to)
const;
294 const index to)
const;
297 const index to)
const;
509 return ntree_->masked_begin(
dynamic_cast<const Mask<D>&
>(*mask_),anchor);
510 }
catch (std::bad_cast
e) {
511 throw BadProperty(
"Mask is incompatible with layer.");
519 return ntree_->masked_end();
527 for(
int i=0;i<D;++i) {
528 lower_left_[i] = -0.5;
537 lower_left_(l.lower_left_),
539 periodic_(l.periodic_)
547 if (cached_ntree_layer_ == get_gid()) {
548 clear_ntree_cache_();
551 if (cached_vector_layer_ == get_gid()) {
552 clear_vector_cache_();
559 const index to)
const
561 return compute_displacement(from_pos,get_position(to));
567 const index to)
const
569 return std::vector<double_t>(compute_displacement(
Position<D>(from_pos), to));
575 const index to)
const
577 return compute_displacement(from_pos, to).length();
583 const index to)
const
585 return compute_displacement(
Position<D>(from_pos), to).length();
592 return std::vector<double_t>(get_position(sind));
600 cached_ntree_layer_ = -1;
607 if (cached_vector_ != 0)
608 delete cached_vector_;
610 cached_vector_layer_ = -1;
vector< Node * >::iterator local_end()
Return iterator to the end of the local child-list.
Definition: subnet.h:246
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
Position< D > get_center() const
Definition: layer.h:241
This class is a representation of the dictionary of connection properties given as an argument to the...
Definition: connection_creator.h:65
lockPTR< Ntree< D, index > > ntree_
Definition: layer.h:467
int int_t
Integer number with at least 16 bit.
Definition: nest.h:95
Base class for all subnet nodes.
Definition: subnet.h:67
Position< D > lower_left_
lower left corner (minimum coordinates) of layer
Definition: layer.h:393
virtual void connect(AbstractLayer &target, ConnectionCreator &connector)=0
Connect this layer to the given target layer.
Mask oriented in the opposite direction.
Definition: mask.h:411
Ntree< D, index >::masked_iterator begin(const Position< D > &anchor)
Iterate over nodes inside mask.
Definition: layer.h:506
MaskedLayer(Layer< D > &layer, Selector filter, const MaskDatum &mask, bool include_global, bool allow_oversized)
Regular constructor.
Definition: layer.h:473
lockPTR< Ntree< D, index > > get_local_positions_ntree(Selector filter=Selector())
Get positions for local nodes in layer.
Definition: layer_impl.h:109
Definition: lockptrdatum.h:40
Iterator iterating the nodes in a Quadtree inside a Mask.
Definition: ntree.h:128
const Name layer("layer")
Definition: topology_names.h:82
Layer()
Creates an empty layer.
Definition: layer.h:524
void clear_vector_cache_() const
Clear the cache for global position information.
Definition: layer.h:605
Ntree< D, index >::masked_iterator end()
Definition: layer.h:517
void get_status(DictionaryDatum &) const
Export properties of the layer by setting entries in the status dictionary.
Definition: layer_impl.h:79
virtual void dump_nodes(std::ostream &os) const =0
Write layer data to stream.
lockPTR< Ntree< D, index > > do_get_global_positions_ntree_(const Selector &filter)
Definition: layer_impl.h:157
static lockPTR< Ntree< D, index > > cached_ntree_
Global position information for a single layer.
Definition: layer.h:400
virtual void dump_connections(std::ostream &out, const Token &syn_model)=0
Dumps information about all connections of the given type having their source in the given layer to t...
const Name extent("extent")
Definition: topology_names.h:47
const Position< D > & get_extent() const
Definition: layer.h:235
const Name lower_left("lower_left")
Definition: topology_names.h:66
~Layer()
Virtual destructor.
Definition: layer.h:545
Contains rules for selecting nodes from a layer when connecting.
Definition: selector.h:36
const Name depth("depth")
Definition: topology_names.h:46
Position< D > extent_
size of layer
Definition: layer.h:394
Class for applying masks to layers.
Definition: connection_creator.h:42
std::bitset< D > periodic_
periodic b.c.
Definition: layer.h:395
virtual void insert_global_positions_ntree_(Ntree< D, index > &tree, const Selector &filter)=0
Insert global position info into ntree.
Abstract base class for masks with given dimension.
Definition: mask.h:90
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
void connect(AbstractLayer &target, ConnectionCreator &connector)
Connect this layer to the given target layer.
Definition: layer_impl.h:98
Abstract base class for Layer of given dimension (D=2 or 3).
Definition: connection_creator.h:39
void clear_ntree_cache_() const
Clear the cache for global position information.
Definition: layer.h:597
static Selector cached_selector_
Definition: layer.h:402
virtual Position< D > get_position(index sind) const =0
Get position of node.
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
Abstract base class for Layers of unspecified dimension.
Definition: layer.h:44
bool is_subnet() const
Layers do not allow entry to the ChangeSubnet command, nodes can not be added by the user...
Definition: layer.h:362
virtual Position< D > compute_displacement(const Position< D > &from_pos, const Position< D > &to_pos) const
Returns displacement of a position from another position.
Definition: layer_impl.h:43
virtual void insert_global_positions_vector_(std::vector< std::pair< Position< D >, index > > &, const Selector &filter)=0
Insert global position info into vector.
~MaskedLayer()
Definition: layer.h:500
static std::vector< std::pair< Position< D >, index > > * cached_vector_
Definition: layer.h:401
static index create_layer(const DictionaryDatum &)
Factory function for layers.
Definition: layer.cpp:41
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition: exceptions.h:420
const Position< D > & get_lower_left() const
Definition: layer.h:229
virtual void clear_vector_cache_() const =0
Clear the cache for global position information.
double double_t
Double precision floating point numbers.
Definition: nest.h:93
void dump_nodes(std::ostream &os) const
Write layer data to stream.
Definition: layer_impl.h:244
void dump_connections(std::ostream &out, const Token &syn_model)
Dumps information about all connections of the given type having their source in the given layer to t...
Definition: layer_impl.h:255
int_t depth_
number of neurons at each position
Definition: layer.h:168
static index cached_vector_layer_
GID for the single layer for which we cache global position information.
Definition: layer.h:173
virtual ~AbstractLayer()
Virtual destructor.
Definition: layer.cpp:37
virtual double_t compute_distance(const std::vector< double_t > &from_pos, const index to) const =0
Returns distance to node from given position.
AbstractLayer()
Constructor.
Definition: layer.h:50
const Name mask("mask")
Definition: topology_names.h:57
Default types used by the NEST kernel.
This template is the standard safe-pointer implementation of SYNOD.
Definition: lockptr.h:84
MaskDatum mask_
Definition: layer.h:468
std::vector< double_t > get_position_vector(const index sind) const
Definition: layer.h:590
vector< Node * >::iterator local_begin()
Return iterator to the first local child node.
Definition: subnet.h:240
void set_status(const DictionaryDatum &)
Change properties of the layer according to the entries in the dictionary.
Definition: layer_impl.h:58
std::bitset< D > get_periodic_mask() const
Definition: layer.h:247
A type-independent container for C++-types.
Definition: token.h:68
std::vector< std::pair< Position< D >, index > > * get_global_positions_vector(Selector filter=Selector())
Definition: layer_impl.h:184
lockPTR< Ntree< D, index > > get_global_positions_ntree(Selector filter=Selector())
Get positions for all nodes in layer, including nodes on other MPI processes.
Definition: layer_impl.h:119
virtual std::vector< double_t > get_position_vector(const index sind) const =0
Get position of node.
virtual std::vector< double_t > compute_displacement(const std::vector< double_t > &from_pos, const index to) const =0
Returns displacement of node from given position.
virtual void clear_ntree_cache_() const =0
Clear the cache for global position information.
static index cached_ntree_layer_
GID for the single layer for which we cache global position information.
Definition: layer.h:163
double_t compute_distance(const Position< D > &from_pos, const index to) const
Returns distance to node from given position.
Definition: layer.h:574
const double e
Definition: numerics.cpp:62
virtual std::vector< index > get_global_nodes(const MaskDatum &mask, const std::vector< double_t > &anchor, bool allow_oversized)=0
Return a vector with the GIDs of the nodes inside the mask.
virtual void insert_local_positions_ntree_(Ntree< D, index > &tree, const Selector &filter)=0
Insert local position info into ntree.
void check_mask_(Layer< D > &layer, bool allow_oversized)
Will check that the mask can be applied to the layer.
Definition: layer_impl.h:318
std::vector< index > get_global_nodes(const MaskDatum &mask, const std::vector< double_t > &anchor, bool allow_oversized)
Return a vector with the GIDs of the nodes inside the mask.
Definition: layer_impl.h:233