MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HSolveUtils.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-2007 Upinder S. Bhalla, Niraj Dudani 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 
10 #ifndef _HSOLVE_UTILS_H
11 #define _HSOLVE_UTILS_H
12 
13 #include "../basecode/header.h"
14 #include "../basecode/global.h"
15 #include "../utility/print_function.hpp"
16 #include "../utility/simple_test.hpp"
17 
18 #include "../biophysics/HHGate.h"
19 #include "../biophysics/ChanBase.h"
20 #include "../biophysics/ChanCommon.h"
21 #include "../biophysics/HHChannelBase.h"
22 #include "../biophysics/HHChannel.h"
23 #include "../basecode/OpFunc.h"
24 
25 
27 {
28 public:
29  static void initialize( Id object );
30  static int adjacent( Id compartment, vector< Id >& ret );
31  static int adjacent( Id compartment, Id exclude, vector< Id >& ret );
32  static int children( Id compartment, vector< Id >& ret );
33  static int channels( Id compartment, vector< Id >& ret );
34  static int hhchannels( Id compartment, vector< Id >& ret );
35  static int gates( Id channel, vector< Id >& ret, bool getOriginals = true );
36  static int spikegens( Id compartment, vector< Id >& ret );
37  static int synchans( Id compartment, vector< Id >& ret );
38  static int leakageChannels( Id compartment, vector< Id >& ret );
39  static int caTarget( Id channel, vector< Id >& ret );
40  static int caDepend( Id channel, vector< Id >& ret );
41 
42  class Grid
43  {
44  public:
45  Grid( double min, double max, unsigned int divs )
46  :
47  min_( min ),
48  max_( max ),
49  divs_( divs )
50  {
51  dx_ = ( max_ - min_ ) / divs_;
52  }
53 
54  unsigned int size();
55  double entry( unsigned int i );
56 
57  bool operator ==( const Grid& other )
58  {
59  return
60  min_ == other.min_ &&
61  max_ == other.max_ &&
62  divs_ == other.divs_;
63  }
64 
65  double min_;
66  double max_;
67  unsigned int divs_;
68  double dx_;
69  };
70 
71  // Functions for accessing gates' lookup tables.
72  //~ static int domain(
73  //~ Id gate,
74  //~ double& min,
75  //~ double& max );
76  static void rates(
77  Id gate,
78  Grid grid,
79  vector< double >& A,
80  vector< double >& B );
81  //~ static int modes(
82  //~ Id gate,
83  //~ int& AMode,
84  //~ int& BMode );
85 
86  static int targets(
87  Id object,
88  string msg,
89  vector< Id >& target,
90  string filter = "",
91  bool include = true );
92 
93  static int targets(
94  Id object,
95  string msg,
96  vector< Id >& target,
97  const vector< string >& filter,
98  bool include = true );
99 };
100 
101 #endif // _HSOLVE_UTILS_H
unsigned int divs_
Definition: HSolveUtils.h:67
static int children(Id compartment, vector< Id > &ret)
Definition: HSolveUtils.cpp:47
static int caDepend(Id channel, vector< Id > &ret)
static int leakageChannels(Id compartment, vector< Id > &ret)
static int spikegens(Id compartment, vector< Id > &ret)
static int caTarget(Id channel, vector< Id > &ret)
static int adjacent(Id compartment, vector< Id > &ret)
Definition: HSolveUtils.cpp:36
bool operator==(const Grid &other)
Definition: HSolveUtils.h:57
static int gates(Id channel, vector< Id > &ret, bool getOriginals=true)
Definition: HSolveUtils.cpp:75
unsigned int size()
static int targets(Id object, string msg, vector< Id > &target, string filter="", bool include=true)
static int channels(Id compartment, vector< Id > &ret)
Definition: HSolveUtils.cpp:59
static void initialize(Id object)
Definition: HSolveUtils.cpp:12
static void rates(Id gate, Grid grid, vector< double > &A, vector< double > &B)
static int synchans(Id compartment, vector< Id > &ret)
static int hhchannels(Id compartment, vector< Id > &ret)
Definition: HSolveUtils.cpp:64
Definition: Id.h:17
double entry(unsigned int i)
Grid(double min, double max, unsigned int divs)
Definition: HSolveUtils.h:45