MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
VectorTable.h
Go to the documentation of this file.
1 #ifndef _VectorTable_H
2 #define _VectorTable_H
3 /**********************************************************************
4 ** This program is part of 'MOOSE', the
5 ** Messaging Object Oriented Simulation Environment.
6 ** Copyright (C) 2003-2011 Upinder S. Bhalla. and NCBS
7 ** It is made available under the terms of the
8 ** GNU Lesser General Public License version 2.1
9 ** See the file COPYING.LIB for the full notice.
10 **********************************************************************/
11 
12 //Class : VectorTable
13 //Author : Vishaka Datta S, 2011, NCBS
14 //Extreme barebones implementation of a vector lookup table.
15 //This is a minimal 1D equivalent of the Interpol2D class. Provides simple
16 //functions for getting and setting up the table, along with a lookup function.
17 //This class is to be used while supplying lookup tables to the MarkovChannel
18 //class, in cases where the transition rate varies with either membrane voltage
19 //or ligand concentration.
20 
22 {
23  public :
24  VectorTable();
25 
26  double lookupByValue( double ) const;
27  double lookupByIndex( unsigned int ) const;
28 
29  //All members except table_ are read-only. Avoids the hassle of recomputing the table when one of the terms are changed.
30  vector< double > getTable() const;
31 
32  //Setting up the lookup table.
33  void setTable( vector< double > );
34 
35  unsigned int getDiv() const;
36  void setDiv( unsigned int );
37  double getMin() const;
38  void setMin( double );
39  double getMax() const;
40  void setMax( double );
41  double getInvDx() const;
42 
43  bool tableIsEmpty() const;
44 
45  static const Cinfo* initCinfo();
46 
47  friend istream& operator>>( istream&, VectorTable& );
48 
49  private :
50  unsigned int xDivs_;
51  double xMin_;
52  double xMax_;
53  double invDx_;
54 
55  vector< double > table_;
56 };
57 
58 #endif
double lookupByValue(double) const
double getInvDx() const
double getMin() const
vector< double > getTable() const
bool tableIsEmpty() const
friend istream & operator>>(istream &, VectorTable &)
void setMin(double)
void setTable(vector< double >)
unsigned int xDivs_
Definition: VectorTable.h:50
vector< double > table_
Definition: VectorTable.h:55
double xMin_
Definition: VectorTable.h:51
void setMax(double)
unsigned int getDiv() const
double xMax_
Definition: VectorTable.h:52
double invDx_
Definition: VectorTable.h:53
static const Cinfo * initCinfo()
Definition: VectorTable.cpp:18
void setDiv(unsigned int)
Definition: Cinfo.h:18
double getMax() const
double lookupByIndex(unsigned int) const