NEST main@f146f75
Loading...
Searching...
No Matches
nest::CompTree Class Reference

#include <cm_tree.h>

Collaboration diagram for nest::CompTree:
[legend]

Public Member Functions

 CompTree ()
 ~CompTree ()
void add_compartment (const long parent_index)
 add a compartment to the tree structure
void add_compartment (const long parent_index, const Dictionary &compartment_params)
void add_compartment (Compartment *compartment, const long parent_index)
void pre_run_hook ()
 initialize the tree for simulation
void init_pointers ()
 Initialize all tree structure pointers.
void set_syn_buffers (std::vector< RingBuffer > &syn_buffers)
 associate each receptor with a spike buffer
std::map< std::string, double * > get_recordables ()
 make all state variables accessible for recording
Compartment * get_compartment (const long compartment_index) const
 get a compartment pointer from the tree
Compartment * get_compartment (const long compartment_index, Compartment *compartment, const long raise_flag) const
Compartment * get_compartment_opt (const long compartment_indx) const
 Get the compartment corresponding to the provided index in the tree.
Compartment * get_root () const
long get_size () const
 get tree size (number of compartments)
std::vector< double > get_voltage () const
 get voltage values
double get_compartment_voltage (const long compartment_index)
 Return voltage of single compartment voltage, indicated by the compartment_index.
void construct_matrix (const long lag)
 construct the numerical integration matrix and vector
void solve_matrix ()
 solve the matrix equation for next timestep voltage
void print_tree () const
 print function

Private Member Functions

void solve_matrix_downsweep (Compartment *compartment_ptr, std::vector< Compartment * >::iterator leaf_it)
 recursion functions for matrix inversion
void solve_matrix_upsweep (Compartment *compartment, double vv)
void set_parents ()
 functions for pointer initialization
void set_compartments ()
 Creates a vector of compartment pointers, organized in the order in which they were added by add_compartment().
void set_leafs ()
 Creates a vector of compartment pointers of compartments that are also leafs of the tree.

Private Attributes

Compartment root_
 structural data containers for the compartment model
std::vector< long > compartment_indices_
std::vector< Compartment * > compartments_
std::vector< Compartment * > leafs_
long size_ = 0

Constructor & Destructor Documentation

◆ CompTree()

nest::CompTree::CompTree ( )

References compartments_, leafs_, root_, and size_.

◆ ~CompTree()

nest::CompTree::~CompTree ( )
inline

Member Function Documentation

◆ add_compartment() [1/3]

void nest::CompTree::add_compartment ( Compartment * compartment,
const long parent_index )

we do not raise an UnknownCompartment exception from within get_compartment(), because we want to print a more informative exception message

References nest::Compartment::children, nest::Compartment::comp_index, compartment_indices_, get_compartment(), get_root(), root_, set_compartments(), and size_.

Here is the call graph for this function:

◆ add_compartment() [2/3]

void nest::CompTree::add_compartment ( const long parent_index)

add a compartment to the tree structure

Add a compartment to the tree structure via the python interface root should have -1 as parent index.

Add root compartment first. Assumes parent of compartment is already added

References add_compartment(), and size_.

Referenced by add_compartment(), and add_compartment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_compartment() [3/3]

void nest::CompTree::add_compartment ( const long parent_index,
const Dictionary & compartment_params )

References add_compartment(), and size_.

Here is the call graph for this function:

◆ construct_matrix()

void nest::CompTree::construct_matrix ( const long lag)

construct the numerical integration matrix and vector

Construct the matrix equation to be solved to advance the model one timestep.

References compartments_.

◆ get_compartment() [1/2]

Compartment * nest::CompTree::get_compartment ( const long compartment_index) const

get a compartment pointer from the tree

Get the compartment corresponding to the provided index in the tree.

This function gets the compartments by a recursive search through the tree.

The overloaded functions looks only in the subtree of the provided compartment, and also has the option to throw an error if no compartment corresponding to compartment_index is found in the tree

References get_compartment(), and get_root().

Referenced by add_compartment(), get_compartment(), get_compartment(), set_compartments(), and set_parents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_compartment() [2/2]

Compartment * nest::CompTree::get_compartment ( const long compartment_index,
Compartment * compartment,
const long raise_flag ) const

References nest::Compartment::children, nest::Compartment::comp_index, and get_compartment().

Here is the call graph for this function:

◆ get_compartment_opt()

Compartment * nest::CompTree::get_compartment_opt ( const long compartment_idx) const

Get the compartment corresponding to the provided index in the tree.

Optimized trough the use of a pointer vector containing all compartments. Calling this function before CompTree::init_pointers() is called will result in a segmentation fault

References compartments_.

◆ get_compartment_voltage()

double nest::CompTree::get_compartment_voltage ( const long compartment_index)

Return voltage of single compartment voltage, indicated by the compartment_index.

References compartments_.

◆ get_recordables()

std::map< std::string, double * > nest::CompTree::get_recordables ( )

make all state variables accessible for recording

Returns a map of variable names and pointers to the recordables.

add recordables for all compartments, suffixed by compartment_idx, to "recordables"

References compartments_.

◆ get_root()

Compartment * nest::CompTree::get_root ( ) const
inline

References root_.

Referenced by add_compartment(), and get_compartment().

Here is the caller graph for this function:

◆ get_size()

long nest::CompTree::get_size ( ) const
inline

get tree size (number of compartments)

References size_.

◆ get_voltage()

std::vector< double > nest::CompTree::get_voltage ( ) const

get voltage values

Returns vector of voltage values, indices correspond to compartments in compartments_.

References compartments_.

◆ init_pointers()

void nest::CompTree::init_pointers ( )

Initialize all tree structure pointers.

fix all pointers in the tree, the tree structure should not be modified between calling this function and starting the simulation

References set_compartments(), set_leafs(), and set_parents().

Here is the call graph for this function:

◆ pre_run_hook()

void nest::CompTree::pre_run_hook ( )

initialize the tree for simulation

Initialize state variables.

References compartments_, and root_.

◆ print_tree()

void nest::CompTree::print_tree ( ) const

◆ set_compartments()

void nest::CompTree::set_compartments ( )
private

Creates a vector of compartment pointers, organized in the order in which they were added by add_compartment().

References compartment_indices_, compartments_, and get_compartment().

Referenced by add_compartment(), and init_pointers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_leafs()

void nest::CompTree::set_leafs ( )
private

Creates a vector of compartment pointers of compartments that are also leafs of the tree.

References compartments_, and leafs_.

Referenced by init_pointers().

Here is the caller graph for this function:

◆ set_parents()

void nest::CompTree::set_parents ( )
private

functions for pointer initialization

For each compartments, sets its pointer towards its parent compartment.

References compartment_indices_, get_compartment(), nest::Compartment::p_index, nest::Compartment::parent, and root_.

Referenced by init_pointers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_syn_buffers()

void nest::CompTree::set_syn_buffers ( std::vector< RingBuffer > & syn_buffers)

associate each receptor with a spike buffer

Initializes pointers for the spike buffers for all synapse receptors.

References compartments_.

◆ solve_matrix()

void nest::CompTree::solve_matrix ( )

solve the matrix equation for next timestep voltage

Solve matrix with O(n) algorithm.

References leafs_, root_, solve_matrix_downsweep(), and solve_matrix_upsweep().

Here is the call graph for this function:

◆ solve_matrix_downsweep()

void nest::CompTree::solve_matrix_downsweep ( Compartment * compartment_ptr,
std::vector< Compartment * >::iterator leaf_it )
private

recursion functions for matrix inversion

References nest::Compartment::children, nest::Compartment::gather_input(), nest::Compartment::io(), leafs_, nest::Compartment::n_passed, nest::Compartment::parent, and solve_matrix_downsweep().

Referenced by solve_matrix(), and solve_matrix_downsweep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve_matrix_upsweep()

void nest::CompTree::solve_matrix_upsweep ( Compartment * compartment,
double vv )
private

References nest::Compartment::calc_v(), nest::Compartment::children, and solve_matrix_upsweep().

Referenced by solve_matrix(), and solve_matrix_upsweep().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ compartment_indices_

std::vector< long > nest::CompTree::compartment_indices_
private

◆ compartments_

◆ leafs_

std::vector< Compartment* > nest::CompTree::leafs_
private

◆ root_

Compartment nest::CompTree::root_
mutableprivate

structural data containers for the compartment model

Referenced by add_compartment(), CompTree(), get_root(), pre_run_hook(), set_parents(), and solve_matrix().

◆ size_

long nest::CompTree::size_ = 0
private

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