Gadget
popinfoindexvector.h
Go to the documentation of this file.
1 #ifndef popinfoindexvector_h
2 #define popinfoindexvector_h
3 
4 #include "popinfo.h"
5 #include "conversionindex.h"
6 
12 public:
16  PopInfoIndexVector() { minpos = 0; size = 0; v = 0; };
23  PopInfoIndexVector(int sz, int minpos);
30  PopInfoIndexVector(int sz, int minpos, PopInfo initial);
35  PopInfoIndexVector(const PopInfoIndexVector& initial);
47  void resize(int addsize, int newminpos, PopInfo value);
53  PopInfo& operator [] (int pos) { return v[pos - minpos]; };
59  const PopInfo& operator [] (int pos) const { return v[pos - minpos]; };
64  int minCol() const { return minpos; };
69  int maxCol() const { return minpos + size; };
74  int Size() const { return size; };
81  void Add(const PopInfoIndexVector& Addition, const ConversionIndex& CI, double ratio = 1.0);
89  void Add(const PopInfoIndexVector& Addition, const ConversionIndex& CI, const DoubleVector& Ratio, double ratio = 1.0);
90 protected:
94  int minpos;
98  int size;
103 };
104 
105 #endif
This is the class used to convert information from one LengthGroupDivision length structure to a seco...
Definition: conversionindex.h:12
This class implements a dynamic vector of double values.
Definition: doublevector.h:11
This class implements a dynamic vector of PopInfo values, indexed from minpos not 0.
Definition: popinfoindexvector.h:11
void Add(const PopInfoIndexVector &Addition, const ConversionIndex &CI, double ratio=1.0)
This function will add a PopInfoIndexVector to the current vector.
Definition: popinfomemberfunctions.cc:18
PopInfo * v
This is the indexed vector of PopInfo values.
Definition: popinfoindexvector.h:102
int size
This is the size of the vector.
Definition: popinfoindexvector.h:98
int minpos
This is the index for the vector.
Definition: popinfoindexvector.h:94
int minCol() const
This will return the index of the vector.
Definition: popinfoindexvector.h:64
PopInfo & operator[](int pos)
This will return the value of an element of the vector.
Definition: popinfoindexvector.h:53
PopInfoIndexVector()
This is the default PopInfoIndexVector constructor.
Definition: popinfoindexvector.h:16
void resize(int addsize, int newminpos, PopInfo value)
This will add new entries to the vector.
Definition: popinfoindexvector.cc:44
int maxCol() const
This will return the length of the vector.
Definition: popinfoindexvector.h:69
~PopInfoIndexVector()
This is the PopInfoIndexVector destructor.
Definition: popinfoindexvector.cc:37
int Size() const
This will return the size of the vector.
Definition: popinfoindexvector.h:74
This is the class used to store information about the number, and mean weight, of a population cell o...
Definition: popinfo.h:10