CSIM: algorithm.h Source File

algorithm.h

Go to the documentation of this file.
00001 
00005 #ifndef _ALGORITHM_H_
00006 #define _ALGORITHM_H_
00007 
00008 #include <string>
00009 #include <map>
00010 #include <list>
00011 #include "csimerror.h"
00012 #include "csimclass.h"
00013 #include "advanceable.h"
00014 
00015 using namespace std;
00016 
00019 class Algorithm : public Advancable {
00020 
00021  public:
00026   Algorithm(unsigned int in_rows=1, double lower_bound=0, double upper_bound=1);
00027 
00028   virtual ~Algorithm(void) {};
00029 
00031   virtual int advance(void) {
00032     return 1;
00033   }
00034 
00036   virtual int addIncoming(Advancable *Incoming) {
00037     return 0;
00038   }
00039 
00041   virtual int addOutgoing(Advancable *Outgoing) {
00042     return 0;
00043   }
00044 
00045 
00049   virtual void setParameter(string name, double value);
00050 
00051 
00055   virtual double getParameter(string name);
00056 
00059   virtual list<string> validParameters(void);
00060 
00061 
00066   virtual int apply(const double* S, double* X) = 0;
00067 
00069   virtual void reset() {};
00070 
00075   virtual int importRepresentation(const double* rep, int rep_length) = 0;
00076 
00081   virtual double* exportRepresentation(int *rep_length) = 0;
00082 
00084   int getInputRows() { return nInputRows; }
00085 
00089   void getRange(double* a, double *b);
00090   
00094   void setRange(double a, double b);
00095   
00096 
00097 
00099   virtual string getFormatDescription() = 0;
00100 
00102   virtual int updateInternal();
00103 
00105   double range_low;
00106 
00108   double range_high;
00109 
00110  protected:
00111 
00113   map<string, double *> params;
00114 
00116   int nInputRows;
00118   double dInputRows;
00119 };
00120 
00121 #endif

 
(C) 2003, Thomas Natschläger last modified 07/10/2006