compartment

This document describes the "compartment" C++ class. This class describes objects that are compartments, and can be used to represent neurons and parts of neurons.

Abstract can contain contained in
no conductance, mechanism, synapse network

Methods¶

Function Signature

void addAxial(synapse *syn_)


Description

This method adds an axial synapse to this compartment. It updates the n_axial_syn property of this class so that every compartment can keep track of how many axial synapses are connected to it.

Code

Function Signature

void addConductance(conductance *cond_)


Description

This method adds a conductance object to this compartment. It does the following things:

1. Adds a pointer to the conductance to a vector of pointers called cond
2. Updates various attributes of the conductance like verbosity, etc.
3. Runs some initializaiton code (e.g. building look-up-tables in the conductance)
4. Calls the connect method of that conductance with a pointer to this compartment.

Code

Function Signature

void addMechanism(mechanism *mech_)


Description

This method adds a mechanism object to this compartment. It does the following things:

1. Adds a pointer to the conductance to a vector of pointers called cont
2. Updates various attributes of the conductance like verbosity, etc.
3. Tells the mechanism what its ordering in cont is by updating mechanism_idx in that mechanism object
4. Determines the data frame size of this object by calling getFullStateSize and storing this in mechanism_sizes

Code

Function Signature

void addSynapse(synapse *syn_)


Description

This method adds a synapse to this compartment. A pointer to this synapse is stored in the vector syn

Code

checkSolvers¶

Function Signature

void checkSolvers(int solver_order)


Description

This method is called when a non-default solver order is requested. The compartment checks that it can support this solver order, and then asks every component contained in it if they can support this solver order. This ensures that the solver order can actually be used, because if any component cannot support this solver order (because those integration routines have not been written), then they can throw an error, aborting the simulation.

Code

getBCDF¶

Function Signature

double getBCDF(int idx)


Description

This method is a helper function used in the Crank-Nicholson scheme and returns B, C, D and F values as defined in eq. 6.45 of "Theoretical Neuroscience" by Dayan and Abbott

Code

getConductancePointer¶

Function Signature

conductance* getConductancePointer(const char* cond_class)


Description

This method returns the pointer to a conductance stored in this compartment, identified by its class name.

Warning

Note that there is another method with the same name that can be called using a integer argument.

Code

getConductancePointer¶

Function Signature

conductance * getConductancePointer(int cond_idx)


Description

This method returns the pointer to a conductance contained in this compartment, identified by its numeric index.

Warning

Note that there is another method with the same name that can be called using a char argument.

Code

getConnectedCompartment¶

Function Signature

compartment* getConnectedCompartment(int idx)


Description

This method returns a pointer to a compartment that is linked via axial synapses to this compartment.

Code

getFullCurrentState¶

Function Signature

int getFullCurrentState(double *cond_state, int idx)


Description

This method is used to read out the full dynamical state of all channels, and to store it in a large array for output.

Since C++ doesn't support returning multiple values, this function works like this:

• it is first called with a pointer to the array, and an integer specifying where it should write values to
• it writes as many values as it wants to, to the array, and returns a new integer indicating the next empty location in the array

Code

getFullMechanismSize¶

Function Signature

int getFullMechanismSize(void)


Description

This method returns the full dimension size of all the mechanisms in this compartment. The full size is calculated on the fly by recursively asking all the mechanisms in this compartment what their data dimension is, and adding up all those numbers.

Code

getFullMechanismState¶

Function Signature

int getFullMechanismState(double *mech_state, int idx)


Description

This method is used to read out the full dynamical state of all mechanisms, and to store it in a large array for output.

Since C++ doesn't support returning multiple values, this function works like this:

• it is first called with a pointer to the array, and an integer specifying where it should write values to
• it writes as many values as it wants to, to the array, and returns a new integer indicating the next empty location in the array

Code

getFullSynapseSize¶

Function Signature

int getFullSynapseSize(void)


Description

This method returns the full dimension size of all the synapses in this compartment. The full size is calculated on the fly by recursively asking all the synapses in this compartment what their data dimension is, and adding up all those numbers.

Code

getFullSynapseState¶

Function Signature

int getFullSynapseState(double *syn_state, int idx)


Description

This method is used to read out the full dynamical state of all synapses, and to store it in a large array for output.

Since C++ doesn't support returning multiple values, this function works like this:

• it is first called with a pointer to the array, and an integer specifying where it should write values to
• it writes as many values as it wants to, to the array, and returns a new integer indicating the next empty location in the array

Code

getMechanismPointer¶

Function Signature

mechanism * getMechanismPointer(int mech_idx)


Description

This method returns a pointer to a mechanism stored in this compartment, identified by its numerical index.

Code

getMechanismPointer¶

Function Signature

mechanism* getMechanismPointer(const char* cond_class)


Description

This method returns a pointer to a mechanism that is contained by this compartment, that is linked to a conductance of a certain type, also in this compartment.

Code

getSynapsePointer¶

Function Signature

synapse * getSynapsePointer(int syn_idx)


Description

This method returns a pointer to a synapse contained by this compartment, where this synapse is identified by the numerical index it was added to this compartment.

Code

integrateChannels¶

Function Signature

void integrateChannels(void)


Description

This method integrates all the channels in the compartment. This method is only used when this compartment is not part of a multi-compartment model. It simply asks every conductance object in this compartment to integrate by calling their integrate methods.

Code

integrateCNFirstPass¶

Function Signature

void integrateCNFirstPass(void)


Description

This method is part of the Crank-Nicholson method to solve for the voltages in a multi-compartment neuron. This is the "first pass" down a cable. In simulations, this is called before integrateCNSecondPass.

Code

integrateCNSecondPass¶

Function Signature

void integrateCNSecondPass(void)


Description

This method is part of the Crank-Nicholson method to solve for the voltages in a multi-compartment neuron. This is the "second pass" up a cable. In simulations, this is called after integrateCNFirstPass.

Code

integrateMechanisms¶

Function Signature

void integrateMechanisms(void)


Description

This method integrates all mechanisms in this compartment. It simply calls the integrate method on every mechanism in the compartment.

Code

integrateMS¶

Function Signature

void integrateMS(int k)


Description

This method integrates the voltage in this compartment, and all components contained by this compartment, using the Runge-Kutta 4 solver. It iteratively calls the integrateMS method of all components contained within this compartment.

Code

integrateSynapses¶

Function Signature

void integrateSynapses(void)


Description

This method integrates all synapses in this compartment. All that this method does is "ask" every synapse to integrate (by calling their integrate method), and keep track of how they contribute to sigma_g and sigma_gE.

Code

integrateV_clamp¶

Function Signature

void integrateV_clamp(double V_clamp)


Description

This integration method is called when a compartment is voltage clamped. Here, the voltage is updated to the clamp voltage, and the current required to do so is computed and stored in I_clamp.

Code

computeClampingCurrent¶

Function Signature

void computeClampingCurrent(double V_clamp)


Description

This integration method is called when a multi-compartment neuron model is voltage clamped. This computes the clamping current needed for that compartment, and takes into account current flows between compartments

Code

integrateVoltage¶

Function Signature

void integrateVoltage(void)


Description

This method integrates the voltage in this compartment, assuming this compartment is not part of a multi-compartment neuron model, and default solver orders are being used.

This method implements the exponential Euler method to update the voltages in this compartment.

Code

resolveAxialConductances¶

Function Signature

void resolveAxialConductances(void)


Description

This method is used to "resolve" a multi-compartment model, i.e., to figure out which end is which in a cable. Compartments in a multi-compartment model are linked together using Axial synapses and the tree_idx property of the compartment is used to indicate its distance from the soma.

This method sets the downstream_g and upstream_g properties of this compartment based on the other compartments in the model.

Code