MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RateLookup.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 _RATE_LOOKUP_H
11 #define _RATE_LOOKUP_H
12 
13 struct LookupRow
14 {
15  double* row;
16  double fraction;
17 };
19 
21 {
22  LookupColumn() { ; }
23  unsigned int column;
24  //~ bool interpolate;
25 };
26 
28 {
29 public:
30  LookupTable() { ; }
31 
33  double min,
34  double max,
35  unsigned int nDivs,
36  unsigned int nSpecies );
37 
39  void addColumns(
40  int species,
41  const vector< double >& C1,
42  const vector< double >& C2 );
43  //~ const vector< double >& C2,
44  //~ bool interpolate );
45 
46  void column(
47  unsigned int species,
49 
54  void row(
55  double x,
56  LookupRow& row );
57 
59  void lookup(
60  const LookupColumn& column,
61  const LookupRow& row,
62  double& C1,
63  double& C2 );
64 
65 private:
66  //~ vector< bool > interpolate_;
67  vector< double > table_;
68  double min_;
69  double max_;
70  unsigned int nPts_;
71  double dx_;
74  unsigned int nColumns_;
76 };
77 
78 #endif // _RATE_LOOKUP_H
unsigned int nColumns_
(# columns) = 2 * (# species)
Definition: RateLookup.h:75
double fraction
Definition: RateLookup.h:16
double dx_
Definition: RateLookup.h:73
void lookup(const LookupColumn &column, const LookupRow &row, double &C1, double &C2)
Actually performs the lookup and the linear interpolation.
Definition: RateLookup.cpp:76
unsigned int column
Definition: RateLookup.h:23
void row(double x, LookupRow &row)
Definition: RateLookup.cpp:62
double max_
max of the voltage / caConc range
Definition: RateLookup.h:69
unsigned int nPts_
Definition: RateLookup.h:70
void addColumns(int species, const vector< double > &C1, const vector< double > &C2)
Adds the columns for a given species. Columns supplied are C1 and C2.
Definition: RateLookup.cpp:31
void column(unsigned int species, LookupColumn &column)
Definition: RateLookup.cpp:56
vector< double > table_
Flattened table.
Definition: RateLookup.h:67
double min_
min of the voltage / caConc range
Definition: RateLookup.h:68
double * row
Pointer to the first column on a row.
Definition: RateLookup.h:15