Gadget
src
include
formulavector.h
Go to the documentation of this file.
1
#ifndef formulavector_h
2
#define formulavector_h
3
4
#include "
formula.h
"
5
10
class
FormulaVector
{
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);
37
~FormulaVector
();
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
;
82
Formula
*
v
;
83
};
84
85
#endif
FormulaVector
This class implements a dynamic vector of Formula values.
Definition:
formulavector.h:10
FormulaVector::FormulaVector
FormulaVector()
This is the default FormulaVector constructor.
Definition:
formulavector.h:15
FormulaVector::v
Formula * v
This is the vector of Formula values.
Definition:
formulavector.h:82
FormulaVector::Size
int Size() const
This will return the size of the vector.
Definition:
formulavector.h:56
FormulaVector::~FormulaVector
~FormulaVector()
This is the FormulaVector destructor.
Definition:
formulavector.cc:36
FormulaVector::Inform
void Inform(Keeper *keeper)
This function will inform Keeper of the values of the stored Formula.
Definition:
formulavector.cc:61
FormulaVector::operator[]
Formula & operator[](int pos)
This will return the value of an element of the vector.
Definition:
formulavector.h:62
FormulaVector::size
int size
This is the size of the vector.
Definition:
formulavector.h:78
FormulaVector::resize
void resize(int addsize, Keeper *keeper)
This will add new blank (ie. NULL) entries to the vector.
Definition:
formulavector.cc:43
FormulaVector::Delete
void Delete(int pos, Keeper *keeper)
This will delete an entry from the vector.
Definition:
formulavector.cc:67
Formula
This is the class used to calculate the value of the variables used in the model simulation.
Definition:
formula.h:18
Keeper
This is the class used to store information about the variables that are used in model simulation.
Definition:
keeper.h:17
formula.h
Generated by
1.9.1