Gadget
formulavector.h
Go to the documentation of this file.
1 #ifndef formulavector_h
2 #define formulavector_h
3 
4 #include "formula.h"
5 
11 public:
15  FormulaVector() { size = 0; v = 0; };
21  FormulaVector(int sz, Formula initial);
27  FormulaVector(int sz, double initial);
32  FormulaVector(const FormulaVector& initial);
44  void resize(int addsize, Keeper* keeper);
51  void Delete(int pos, Keeper* keeper);
56  int Size() const { return size; };
62  Formula& operator [] (int pos) { return v[pos]; };
68  const Formula& operator [] (int pos) const { return v[pos]; };
73  void Inform(Keeper* keeper);
74 protected:
78  int size;
83 };
84 
85 #endif
This class implements a dynamic vector of Formula values.
Definition: formulavector.h:10
FormulaVector()
This is the default FormulaVector constructor.
Definition: formulavector.h:15
Formula * v
This is the vector of Formula values.
Definition: formulavector.h:82
int Size() const
This will return the size of the vector.
Definition: formulavector.h:56
~FormulaVector()
This is the FormulaVector destructor.
Definition: formulavector.cc:36
void Inform(Keeper *keeper)
This function will inform Keeper of the values of the stored Formula.
Definition: formulavector.cc:61
Formula & operator[](int pos)
This will return the value of an element of the vector.
Definition: formulavector.h:62
int size
This is the size of the vector.
Definition: formulavector.h:78
void resize(int addsize, Keeper *keeper)
This will add new blank (ie. NULL) entries to the vector.
Definition: formulavector.cc:43
void Delete(int pos, Keeper *keeper)
This will delete an entry from the vector.
Definition: formulavector.cc:67
This is the class used to calculate the value of the variables used in the model simulation.
Definition: formula.h:18
This is the class used to store information about the variables that are used in model simulation.
Definition: keeper.h:17