Gadget
popstatistics.h
Go to the documentation of this file.
1 #ifndef popstatistics_h
2 #define popstatistics_h
3 
4 #include "lengthgroup.h"
5 #include "popinfovector.h"
6 #include "popinfoindexvector.h"
8 
14 public:
18  PopStatistics() { meanlength = 0.0; meanweight = 0.0; totalnumber = 0.0; sdevlength = 0.0; };
29  void calcStatistics(const PopInfoIndexVector& pop, const LengthGroupDivision* const lgrpdiv, int calcweight = 1);
35  void calcStatistics(const AgeBandMatrix& agelenum, int lengr);
40  double meanLength() const { return meanlength; };
45  double meanWeight() const { return meanweight; };
50  double totalNumber() const { return totalnumber; };
55  double sdevLength() const { return sdevlength; };
56 private:
60  double meanlength;
64  double meanweight;
68  double totalnumber;
72  double sdevlength;
73 };
74 
75 #endif
This class implements a vector of PopInfoIndexVector values, indexed from minage not 0.
Definition: agebandmatrix.h:15
This is the class used to store information about the length groups of the modelled stock population.
Definition: lengthgroup.h:10
This class implements a dynamic vector of PopInfo values, indexed from minpos not 0.
Definition: popinfoindexvector.h:11
This is the class used to calculate some standard statistics about a given population.
Definition: popstatistics.h:13
~PopStatistics()
This is the default PopStatistics destructor.
Definition: popstatistics.h:22
PopStatistics()
This is the default PopStatistics constructor.
Definition: popstatistics.h:18
double meanWeight() const
This will return the mean weight of the population.
Definition: popstatistics.h:45
double sdevLength() const
This will return the standard deviation of the length of the population.
Definition: popstatistics.h:55
double totalNumber() const
This will return the total number in the population.
Definition: popstatistics.h:50
double meanLength() const
This will return the mean length of the population.
Definition: popstatistics.h:40
void calcStatistics(const PopInfoIndexVector &pop, const LengthGroupDivision *const lgrpdiv, int calcweight=1)
This function will calculate the standard statistics for a given population.
Definition: popstatistics.cc:8