MOOSE - Multiscale Object Oriented Simulation Environment
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TableBase.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE',
3 ** the Multi Object Oriented Simulation Environment.
4 **
5 ** Copyright (C) 2003-2016 Upinder S. Bhalla. and NCBS
6 **
7 ** It is made available under the terms of the
8 ** GNU Lesser General Public License version 3
9 **********************************************************************/
10 
11 #ifndef _TABLE_BASE_H
12 #define _TABLE_BASE_H
13 
19 class TableBase
20 {
21 public:
22  TableBase();
23 
24  /*-----------------------------------------------------------------------------
25  * Functions related to field assignment.
26  *-----------------------------------------------------------------------------*/
27  vector< double > getVec() const;
28  const vector< double >& data( );
29 
30  void setVec( vector< double > val );
31 
32  double getOutputValue() const;
33  void setOutputValue( double val );
34 
35  string getPlotDump() const;
36  void setPlotDump( string v );
37 
38  double getY( unsigned int index ) const;
39 
41  // Dest funcs
43  void linearTransform( double scale, double offset );
44  void xplot( string file, string plotname );
45  void plainPlot( string file );
46  void loadXplot( string fname, string plotname );
47 
48  void loadXplotRange(
49  string fname, string plotname,
50  unsigned int start, unsigned int end
51  );
52 
53  void loadCSV( string fname, int startLine, int colNum, char separator );
54  void compareXplot( string fname, string plotname, string op );
55  void compareVec( vector< double > other, string op );
56  void clearVec();
57 
59  // Lookup funcs for table
61  double* lookupVec( unsigned int index );
62  void setVecSize( unsigned int num );
63  unsigned int getVecSize( ) const;
64  double interpolate( double x, double xmin, double xmax ) const;
65 
66  static const Cinfo* initCinfo();
67 
68 protected:
69  vector< double >& vec();
70 
71 private:
72  double output_;
73  vector< double > vec_;
74 };
75 
76 #endif // _TABLE_BASE_H
void xplot(string file, string plotname)
Definition: TableBase.cpp:182
double getOutputValue() const
Definition: TableBase.cpp:423
vector< double > & vec()
Definition: TableBase.cpp:492
static double op(double x)
void linearTransform(double scale, double offset)
Definition: TableBase.cpp:166
void setVec(vector< double > val)
Definition: TableBase.cpp:487
vector< double > vec_
Definition: TableBase.h:73
vector< double > getVec() const
Definition: TableBase.cpp:482
double interpolate(double x, double xmin, double xmax) const
Definition: TableBase.cpp:440
void setPlotDump(string v)
Definition: TableBase.cpp:509
void clearVec()
Definition: TableBase.cpp:414
void setOutputValue(double val)
Definition: TableBase.cpp:428
const vector< double > & data()
Definition: TableBase.cpp:498
unsigned int getVecSize() const
Definition: TableBase.cpp:477
static const Cinfo * initCinfo()
Definition: TableBase.cpp:15
void loadCSV(string fname, int startLine, int colNum, char separator)
Definition: TableBase.cpp:320
void loadXplotRange(string fname, string plotname, unsigned int start, unsigned int end)
Definition: TableBase.cpp:302
void compareXplot(string fname, string plotname, string op)
Definition: TableBase.cpp:374
void plainPlot(string file)
Definition: TableBase.cpp:172
double * lookupVec(unsigned int index)
double getY(unsigned int index) const
Definition: TableBase.cpp:433
void setVecSize(unsigned int num)
Definition: TableBase.cpp:472
Definition: Cinfo.h:18
void loadXplot(string fname, string plotname)
Definition: TableBase.cpp:294
void compareVec(vector< double > other, string op)
Definition: TableBase.cpp:395
string getPlotDump() const
Definition: TableBase.cpp:503
double output_
Definition: TableBase.h:72