MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MarkovSolver.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2011 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 #ifndef _MARKOVSOLVER_H
10 #define _MARKOVSOLVER_H
11 
13 //Class : MarkovSolver
14 //Author : Vishaka Datta S, 2011, NCBS
15 //Description : Candidate algorithm for solving the system of equations
16 //associated with the Markov model of multistate ion channels.
17 //
18 //This implementation computes the matrix exponential using the scaling and
19 //squaring approach described in
20 //"The Scaling and Squaring Method for the Matrix Exponential Revisited", by
21 //Nicholas J Higham, 2005, Society for Industrial and Applied Mathematics,
22 //26(4), pp. 1179-1193.
23 //
25 
27 //SrcFinfos
29 
31  public :
32  MarkovSolver();
33 
34  ~MarkovSolver();
35 
37 
38  //Scaling-and-squaring related function.
39  Matrix* computePadeApproximant( Matrix*, unsigned int );
40 
41  static const Cinfo* initCinfo();
43  //MsgDest functions.
45  void reinit( const Eref&, ProcPtr );
46  void process( const Eref&, ProcPtr );
47 
49  //Unit test
51  #ifdef DO_UNIT_TESTS
52  friend void testMarkovSolver();
53  #endif
54 
55  private :
56 };
57 //End of class definition.
58 
59 //Matrix exponential related constants.
60 //Coefficients of Pade approximants for degrees 3,5,7,9,13.
61 static double b13[14] =
62  {64764752532480000.0, 32382376266240000.0, 7771770303897600.0,
63  1187353796428800.0, 129060195264000.0, 10559470521600.0,
64  670442572800.0, 33522128640.0, 1323241920.0,
65  40840800.0, 960960.0, 16380.0, 182.0, 1.0};
66 
67 static double b9[10] =
68  {17643225600.0, 8821612800.0, 2075673600.0, 302702400.0,
69  30270240.0, 2162160.0, 110880.0, 3960.0, 90.0, 1 };
70 
71 static double b7[8] =
72  {17297280, 8648640, 1995840, 277200, 25200, 1512, 56, 1};
73 
74 static double b5[6] = {30240, 15120, 3360, 420, 30, 1};
75 
76 static double b3[4] = {120, 60, 12, 1};
77 
78 static double thetaM[5] = {1.495585217958292e-2, 2.539398330063230e-1,
79  9.504178996162932e-1, 2.097847961257068e0, 5.371920351148152e0};
80 
81 static unsigned int mCandidates[5] = {3, 5, 7, 9, 13};
82 
83 #endif
static double b3[4]
Definition: MarkovSolver.h:76
void process(const Eref &, ProcPtr)
void reinit(const Eref &, ProcPtr)
Matrix * computePadeApproximant(Matrix *, unsigned int)
Matrix * computeMatrixExponential()
static unsigned int mCandidates[5]
Definition: MarkovSolver.h:81
static double b9[10]
Definition: MarkovSolver.h:67
static double b13[14]
Definition: MarkovSolver.h:61
static double b5[6]
Definition: MarkovSolver.h:74
static double thetaM[5]
Definition: MarkovSolver.h:78
static const Cinfo * initCinfo()
Definition: Eref.h:26
vector< vector< double > > Matrix
Definition: MatrixOps.h:22
Definition: Cinfo.h:18
static double b7[8]
Definition: MarkovSolver.h:71