Skip to content

Commit 09b69dd

Browse files
committed
Expands reference docs.
1 parent c8a7329 commit 09b69dd

22 files changed

+95
-70
lines changed

src/configf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class Configf : public std::ifstream { // derived class
4646
/// Find the next "Check", then returns the next input entry as string
4747
std::string find( const std::string& Check );
4848

49-
/// points to next delim, and verify it is "check"+"delim"
49+
/// Points to next delim, and verify it is "check"+"delim"
5050
bool next( const std::string& Check, int delim=':' );
5151

52-
/// searches and points to next keyword
52+
/// Searches and points to next keyword
5353
void go2( const std::string& keyword );
5454

5555
std::streamsize tell() {

src/coupling.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/** @file coupling.cpp
2-
@brief A brief, one sentence description.
2+
@brief Definition of the main class handling synaptic connections.
33
4-
A more detailed multiline description...
4+
This class assumes that the synaptic strengths are constant over space and
5+
time. The classes: CouplingRamp; CouplingDiffArctan; LongCoupling; and CaDP,
6+
which are derived from Coupling, implement temporally varying synaptic
7+
strengths or modulation by pre- or postsynaptic activity.
58
69
@author Peter Drysdale, Felix Fung,
710
*/
@@ -24,6 +27,7 @@ using std::endl;
2427
using std::string;
2528
using std::vector;
2629

30+
/// Read `.conf` file and initialise synaptic coupling strengths and weighted presynaptic inputs.
2731
void Coupling::init( Configf& configf ) {
2832
configf.next("nu");
2933
vector<double> temp = configf.numbers();
@@ -54,12 +58,14 @@ Coupling::Coupling( size_type nodes, double deltat, size_type index,
5458

5559
Coupling::~Coupling() = default;
5660

61+
/// Calculate next value for synaptic-coupling-strength-weighted-presynaptic-inputs.
5762
void Coupling::step() {
5863
for( size_type i=0; i<nodes; i++ ) {
5964
P[i] = nu[i]*prepropag[i];
6065
}
6166
}
6267

68+
/// Read synaptic coupling strength from `.conf` file.
6369
double Coupling::nuinit( Configf& configf ) const {
6470
string buffer = configf.find( label("Coupling ",index+1)+"*nu:");
6571
return atof(buffer.c_str());

src/coupling.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file coupling.h
2-
@brief A brief, one sentence description.
2+
@brief Declaration of the main class handling synaptic connections.
33
44
A more detailed multiline description...
55
@@ -30,12 +30,12 @@ class Coupling : public NF {
3030

3131
const Propagator& prepropag;
3232
const Population& postpop;
33-
std::vector<double> nu; ///< \f$\nu\f$
34-
std::vector<double> P; ///< \f$\nu\phi\f$
33+
std::vector<double> nu; ///< Synaptic coupling strength (\f$\nu\f$).
34+
std::vector<double> P; ///< Presynaptic inputs weighted by synaptic coupling strength (\f$\nu\phi\f$).
3535
int pos = 0;
3636
public:
37-
Coupling() = delete; // No default constructor allowed.
38-
Coupling(const Coupling&) = delete; // No copy constructor allowed.
37+
Coupling() = delete; ///< No default constructor allowed.
38+
Coupling(const Coupling&) = delete; ///< No copy constructor allowed.
3939

4040
Coupling( size_type nodes, double deltat, size_type index,
4141
const Propagator& prepropag, const Population& postpop );

src/de.h

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/** @file de.h
2-
@brief A brief, one sentence description.
2+
@brief A collection of classes for differential equations and their integrators.
33
4-
A more detailed multiline description...
4+
The base differential equation class (DE) requires specific differential
5+
equation classes, derived from DE, to specify their equations in DE::rhs.
6+
There are currently two integrators derived from the base Integrator class,
7+
namely Euler and RK4.
58
69
@author Peter Drysdale, Felix Fung,
710
*/
@@ -14,9 +17,10 @@
1417

1518
using vvd_size_type = std::vector<std::vector<double>>::size_type;
1619

20+
/// Base class for differential equations.
1721
class DE {
1822
protected:
19-
// if the number of field variables need to be extended, use this function
23+
/// if the number of field variables need to be extended, use this function.
2024
void extend( vvd_size_type extension ) {
2125
ndim += extension;
2226
variables.resize(ndim);
@@ -25,12 +29,12 @@ class DE {
2529
}
2630
}
2731
public:
28-
DE() = delete; // No default constructor allowed.
29-
DE(const DE&) = delete; // No copy constructor allowed.
30-
void operator=(const DE&) = delete;
32+
DE() = delete; ///< No default constructor allowed.
33+
DE(const DE&) = delete; ///< No copy constructor allowed.
34+
void operator=(const DE&) = delete; ///< No copy assignment allowed.
3135

3236
vvd_size_type nodes; ///< number of nodes in the system.
33-
double deltat; ///< integration timestep size.
37+
double deltat; ///< integration timestep size [s].
3438
vvd_size_type ndim; ///< dimension of system == y.size()
3539
std::vector<std::vector<double> > variables;
3640

@@ -48,30 +52,32 @@ class DE {
4852
virtual const std::vector<double>& operator[] ( vvd_size_type index ) const {
4953
return variables[index];
5054
}
51-
// define dydt here
55+
/// Classes derived from DE, define their specific differential equations here.
5256
virtual void rhs( const std::vector<double>& y, std::vector<double>& dydt, std::vector<double>::size_type n ) = 0;
5357
};
5458

59+
/// Base class for bringing together differential equations (DE) and integration schemes Integrator::step().
5560
class Integrator {
5661
protected:
5762
DE& de;
5863
public:
59-
Integrator() = delete; // No default constructor allowed.
60-
Integrator(const Integrator&) = delete; // No copy constructor allowed.
61-
void operator=(const Integrator&) = delete;
64+
Integrator() = delete; ///< No default constructor allowed.
65+
Integrator(const Integrator&) = delete; ///< No copy constructor allowed.
66+
void operator=(const Integrator&) = delete; ///< No copy assignment allowed.
6267

6368
explicit Integrator( DE& de ) : de(de) {}
6469
virtual ~Integrator() = default;
65-
virtual void step() = 0;
70+
virtual void step() = 0; ///< Scheme for advancing de one step forward in time. Pure virtual, must be overridden.
6671
};
6772

73+
/// Implements the Euler integration scheme.
6874
class Euler : public Integrator {
6975
protected:
7076
std::vector<double> dydt;
7177
public:
72-
Euler() = delete; // No default constructor allowed.
73-
Euler(const Euler&) = delete; // No copy constructor allowed.
74-
void operator=(const Euler&) = delete;
78+
Euler() = delete; ///< No default constructor allowed.
79+
Euler(const Euler&) = delete; ///< No copy constructor allowed.
80+
void operator=(const Euler&) = delete; ///< No copy assignment allowed.
7581

7682
explicit Euler( DE& de ) : Integrator(de), dydt(de.ndim) {}
7783
~Euler() override = default;
@@ -85,6 +91,7 @@ class Euler : public Integrator {
8591
}
8692
};
8793

94+
/// Implements the fourth order Runge-Kutta integration scheme.
8895
class RK4 : public Integrator {
8996
protected:
9097
double h6; ///< == deltat/6
@@ -96,14 +103,15 @@ class RK4 : public Integrator {
96103
std::vector<double> k4;
97104
std::vector<double> temp;
98105
public:
99-
RK4() = delete; // No default constructor allowed.
100-
RK4(const RK4&) = delete; // No copy constructor allowed.
101-
void operator=(const RK4&) = delete;
106+
RK4() = delete; ///< No default constructor allowed.
107+
RK4(const RK4&) = delete; ///< No copy constructor allowed.
108+
void operator=(const RK4&) = delete; ///< No copy assignment allowed.
102109

103110
explicit RK4( DE& de ) : Integrator(de), h6(de.deltat/6.0), deltat5(de.deltat*0.5),
104111
k1(de.ndim), k2(de.ndim), k3(de.ndim), k4(de.ndim), temp(de.ndim) {}
105112
~RK4() override = default;
106113

114+
/// Implements the 4th order Runge-Kutta scheme for advancing Integrator::de one step forward in time.
107115
void step() override {
108116
for( vvd_size_type j=0; j<de.nodes; j++ ) {
109117
for( vvd_size_type i=0; i<de.ndim; i++ ) {

src/dendrite.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/** @file dendrite.cpp
2-
@brief Dendrite handles the dendritic response of the postsynaptic population.
2+
@brief Defines the Dendrite class, which handles dendritic dynamics.
33
4-
A more detailed multiline description...
4+
Dendrite dynamics are applied to incoming activity to postsynaptic Population
5+
objects. The differential equation defining the dendritic dynamics are in the
6+
member function Dendrite::DendriteDE::rhs.
57
68
@author Peter Drysdale, Felix Fung,
79
*/

src/dendrite.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/** @file dendrite.h
2-
@brief Defines the Dendrite class, which handles the response of the postsynaptic population.
2+
@brief Declares the Dendrite class, which handles dendritic dynamics.
33
4-
A more detailed multiline description...
4+
Dendrite dynamics are applied to incoming activity to postsynaptic Population
5+
objects.
56
67
@author Peter Drysdale, Felix Fung,
78
*/

src/dendrite_integral.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/** @file dendrite_integral.cpp
22
@brief DendriteIntegral handles the dendritic response of the postsynaptic
3-
population using the integral form for the step() member-function.
3+
population using the integral form for the DendriteIntegral::step()
4+
member-function.
45
56
A more detailed multiline description...
67

src/dendrite_integral.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @file dendrite_integral.h
2-
@brief Defines the DendriteIntegral class, which handles the response of the
3-
postsynaptic population using the integral form for the step()
2+
@brief Declares the DendriteIntegral class, which handles the response of the
3+
postsynaptic population using the integral form for the DendriteIntegral::step()
44
member-function.
55
66
A more detailed multiline description...

src/firing_response.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
Each neural population is associated with a FiringResponse object which produces
55
the soma response governed by a specified equation, for example Sigmoid:
66
\f[
7-
Insert equation 9 from draft nftsim paper here.
7+
S_{a}[V_a(\mathbf{r}, t), \theta_{a}(\mathbf{r},t)] = \frac{Q_{a}^{\text{max}}}
8+
{1 + \exp[-\{ V_a(\mathbf{r}, t) - \theta_a(\mathbf{r}, t)\}/\sigma'_a(\mathbf{r}, t)]}
89
\f]
910
1011
@author Peter Drysdale, Felix Fung,
@@ -31,6 +32,7 @@ using std::exp;
3132
using std::string;
3233
using std::vector;
3334

35+
/// Initialise FiringResponse, reading function and parameters to use from file.
3436
void FiringResponse::init( Configf& configf ) {
3537
configf.param("Function", mode);
3638
if( mode == "Sigmoid" ) {
@@ -62,8 +64,8 @@ FiringResponse::FiringResponse( size_type nodes, double deltat, size_type index
6264

6365
FiringResponse::~FiringResponse() = default;
6466

67+
/// Step through dendrites, then sum up soma potentials.
6568
void FiringResponse::step() {
66-
// step through dendrites, then sum up soma potential
6769
dendrites.step();
6870
for( size_type i=0; i<nodes; i++ ) {
6971
v[i] = 0;

src/firing_response.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file firing_response.h
2-
@brief Defines the FiringResponse class, for the soma response of neural populations.
2+
@brief Declares the FiringResponse class, for the soma response of neural populations.
33
44
Each neural population is associated with a FiringResponse object, which produces
55
the soma response.
@@ -43,8 +43,8 @@ class FiringResponse : public NF {
4343
std::vector<double> v; ///< soma potential for the population
4444

4545
public:
46-
FiringResponse(const FiringResponse& ) = delete; // No copy constructor allowed.
47-
FiringResponse() = delete; // No default constructor allowed.
46+
FiringResponse(const FiringResponse& ) = delete; ///< No copy constructor allowed.
47+
FiringResponse() = delete; ///< No default constructor allowed.
4848

4949
FiringResponse( size_type nodes, double deltat, size_type index );
5050
~FiringResponse() override;

src/glutamate_response.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file glutamate_response.h
2-
@brief Defines the GlutamateResponse class, for the soma response of neural populations.
2+
@brief Declares the GlutamateResponse class, for the soma response of neural populations.
33
44
@author Peter Drysdale, Felix Fung,
55
*/

src/harmonic.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/** @file harmonic.cpp
2-
@brief A brief, one sentence description.
2+
@brief Definition of the Harmonic Propagator class.
33
4-
A more detailed multiline description...
4+
The Harmonic Propgator is used for spatially homogeneous models, where the
5+
Laplacian Operator term is zero and one finds a damped oscillator response.
56
67
@author Peter Drysdale, Felix Fung,
78
*/

src/harmonic.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/** @file harmonic.h
2-
@brief A brief, one sentence description.
2+
@brief Declaration of the Harmonic Propagator class.
33
4-
A more detailed multiline description...
4+
The Harmonic Propgator is used for spatially homogeneous models, where the
5+
Laplacian Operator term is zero and one finds a damped oscillator response.
56
67
@author Peter Drysdale, Felix Fung,
78
*/

src/random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Random::Random(uint_fast64_t seed, double mean, double std) {
2424
}
2525

2626
void Random::init(uint_fast64_t seed, double mean, double std) {
27-
gen = std::mt19937_64(seed); ///< Generator
27+
gen = std::mt19937_64(seed); ///< Generator: Mersenne Twister, 64-bit.
2828
dist = std::normal_distribution<double>(mean,std); ///< Distribution
2929
}
3030

src/solver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class Solver : public NF {
9090
//virtual void restart( Restartf& restartf );
9191
//virtual void dump( Dumpf& dumpf ) const;
9292
public:
93-
Solver() = delete; // No default constructor allowed.
94-
Solver(const Solver&) = delete; // No copy constructor allowed.
93+
Solver() = delete; ///< No default constructor allowed.
94+
Solver(const Solver&) = delete; ///< No copy constructor allowed.
9595

9696
explicit Solver( Dumpf& dumpf );
9797
~Solver() override;

src/stencil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file stencil.cpp
2-
@brief A brief, one sentence description.
2+
@brief Stencil definition -- spatial neighbourhood used to evaluate \f[{\Delta}x\f].
33
44
A more detailed multiline description...
55

src/stencil.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file stencil.h
2-
@brief Stencil declaration -- spatial neighbourhood use to evaluate \f[{\Delta}x\f].
2+
@brief Stencil declaration -- spatial neighbourhood used to evaluate \f[{\Delta}x\f].
33
44
This file contains the Stencil declaration, including a definition of Stencil's
55
grid increment operator (ie, ++), and the parentheses operator (ie, ()). The
@@ -27,17 +27,17 @@
2727

2828
class Stencil {
2929
protected:
30-
int nodes;
31-
int longside;
32-
int shortside;
33-
std::string boundary;
30+
int nodes; ///< Number of nodes covering the spatial domain.
31+
int longside; ///< Length of the long-side of the spatial domain (in number of nodes).
32+
int shortside; ///< Length of the short-side of the spatial domain (in number of nodes).
33+
std::string boundary; ///< Type of boundary conditions.
3434
double* m;
3535

3636
mutable int ptr;
3737
public:
38-
Stencil() = delete; // No default constructor allowed.
39-
Stencil(const Stencil&) = delete; // No copy constructor allowed.
40-
Stencil& operator=(const Stencil&) = delete; // No copy assignment operator allowed.
38+
Stencil() = delete; ///< No default constructor allowed.
39+
Stencil(const Stencil&) = delete; ///< No copy constructor allowed.
40+
Stencil& operator=(const Stencil&) = delete; ///< No copy assignment operator allowed.
4141

4242
enum Neighbours {
4343
n=-2,
@@ -49,9 +49,9 @@ class Stencil {
4949
virtual ~Stencil();
5050

5151
const std::vector<double>& operator= ( const std::vector<double>& field );
52-
inline void operator++ (int) const; // increment Neighbours grid
53-
void set( int node ) const; // point to node
54-
int get() const; // get ptr
52+
inline void operator++ (int) const; ///< increment Neighbours grid
53+
void set( int node ) const; ///< point to node
54+
int get() const; ///< get ptr
5555

5656
inline double operator() ( Neighbours neighbour=c ) const {
5757
int arr[5] = { ptr-longside-2,

src/stencil_legacy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@brief StencilLegacy, square nine-point stencil definition.
33
44
As well as a constructor and destructor, this file defines the set() and
5-
get() member functions and a custom equals (=) operator.
5+
get() member functions and a custom copy assignment operator(=).
66
77
@author Peter Drysdale, Felix Fung.
88
*/

src/tau.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/** @file tau.cpp
2-
@brief A brief, one sentence description.
2+
@brief Definition of Tau, which handles the activity history.
33
4-
A more detailed multiline description...
4+
Tau objects are used to retrieve the appropriate delayed activity when the
5+
discrete time delay \f$\tau_{ab}\f$ is nonzero.
56
67
@author Peter Drysdale, Felix Fung,
78
*/
@@ -25,6 +26,7 @@ using std::scientific;
2526
using std::setprecision;
2627
using std::vector;
2728

29+
/// Initialises Tau::m by reading from a `.conf` file, setting Tau::max accordingly.
2830
void Tau::init( Configf& configf ) {
2931
vector<double> temp = configf.numbers();
3032
if( temp.size() == 1 ) {

0 commit comments

Comments
 (0)