Gadget
popinfomatrix.h
Go to the documentation of this file.
1 #ifndef popinfomatrix_h
2 #define popinfomatrix_h
3 
4 #include "intvector.h"
5 #include "popinfovector.h"
6 
12 public:
16  PopInfoMatrix() { nrow = 0; v = 0; };
23  PopInfoMatrix(int nr, int nc, PopInfo initial);
28  PopInfoMatrix(const PopInfoMatrix& initial);
40  int Ncol(int i = 0) const { return v[i]->Size(); };
45  int Nrow() const { return nrow; };
51  PopInfoVector& operator [] (int pos) { return *v[pos]; };
57  const PopInfoVector& operator [] (int pos) const { return *v[pos]; };
64  void AddRows(int add, int length, PopInfo value);
70  void Delete(int pos);
71 protected:
75  int nrow;
80 };
81 
82 #endif
This class implements a dynamic vector of PopInfoVector values.
Definition: popinfomatrix.h:11
PopInfoVector ** v
This is the vector of PopInfoVector values.
Definition: popinfomatrix.h:79
PopInfoMatrix()
This is the default PopInfoMatrix constructor.
Definition: popinfomatrix.h:16
void AddRows(int add, int length, PopInfo value)
This will add new entries to the vector.
Definition: popinfomatrix.cc:34
PopInfoVector & operator[](int pos)
This will return the value of an element of the vector.
Definition: popinfomatrix.h:51
void Delete(int pos)
This will delete an entry from the vector.
Definition: popinfomatrix.cc:57
int nrow
This is number of rows of the vector.
Definition: popinfomatrix.h:75
int Ncol(int i=0) const
This will return the number of columns in row i of the vector.
Definition: popinfomatrix.h:40
int Nrow() const
This will return the number of rows of the vector.
Definition: popinfomatrix.h:45
~PopInfoMatrix()
This is the PopInfoMatrix destructor.
Definition: popinfomatrix.cc:24
This class implements a dynamic vector of PopInfo values.
Definition: popinfovector.h:11
int Size() const
This will return the size of the vector.
Definition: popinfovector.h:53
This is the class used to store information about the number, and mean weight, of a population cell o...
Definition: popinfo.h:10