Gadget
lengthgroup.h
Go to the documentation of this file.
1 #ifndef lengthgroup_h
2 #define lengthgroup_h
3 
4 #include "doublevector.h"
5 
11 public:
18  LengthGroupDivision(double minlength, double maxlength, double dl);
38  double meanLength(int i) const;
44  double minLength(int i) const;
50  double maxLength(int i) const;
55  double minLength() const { return minlen; };
60  double maxLength() const { return maxlen; };
65  double dl() const { return Dl; };
70  int numLengthGroups() const { return size; };
76  int numLengthGroup(double len) const;
81  int Combine(const LengthGroupDivision* const addition);
86  int Error() const { return error; }
90  void printError() const;
95  void Print(ofstream& outfile) const;
96 protected:
100  int error;
104  int size;
108  double Dl;
112  double minlen;
116  double maxlen;
125 };
126 
133 extern int checkLengthGroupStructure(const LengthGroupDivision* finer,
134  const LengthGroupDivision* coarser);
135 
136 #endif
This class implements a dynamic vector of double values.
Definition: doublevector.h:11
This is the class used to store information about the length groups of the modelled stock population.
Definition: lengthgroup.h:10
double minLength() const
This function will return the minimum length of the smallest length group.
Definition: lengthgroup.h:55
int error
This is the flag to denote whether an error has occured or not.
Definition: lengthgroup.h:100
void printError() const
This function will print an error message about the LengthGroupDivision.
Definition: lengthgroup.cc:200
void Print(ofstream &outfile) const
This function will print the LengthGroupDivision information.
Definition: lengthgroup.cc:191
DoubleVector meanlength
This is the DoubleVector of the mean lengths for each length group.
Definition: lengthgroup.h:120
double meanLength(int i) const
This function will return the mean length of a specified length group.
Definition: lengthgroup.cc:93
int numLengthGroups() const
This function will return the total number of the length groups.
Definition: lengthgroup.h:70
double dl() const
This function will return the step length of the length groups.
Definition: lengthgroup.h:65
LengthGroupDivision(double minlength, double maxlength, double dl)
This is the LengthGroupDivision constructor with evenly spaced length groups.
Definition: lengthgroup.cc:6
int Combine(const LengthGroupDivision *const addition)
This function will combine a second LengthGroupDivision with the current LengthGroupDivision.
Definition: lengthgroup.cc:111
double maxLength() const
This function will return the maximum length of the biggest length group.
Definition: lengthgroup.h:60
DoubleVector minlength
This is the DoubleVector of the minimum lengths for each length group.
Definition: lengthgroup.h:124
int numLengthGroup(double len) const
This function will return the identifier of a length group containing a specified length.
Definition: lengthgroup.cc:75
double maxlen
This is the maximum length of the biggest length group.
Definition: lengthgroup.h:116
~LengthGroupDivision()
This is the default LengthGroupDivision destructor.
Definition: lengthgroup.h:32
int size
This is the size of the length group.
Definition: lengthgroup.h:104
int Error() const
This function will return the flag denoting whether an error has occured or not.
Definition: lengthgroup.h:86
double Dl
This is the step length for each length group.
Definition: lengthgroup.h:108
double minlen
This is the minimum length of the smallest length group.
Definition: lengthgroup.h:112
int checkLengthGroupStructure(const LengthGroupDivision *finer, const LengthGroupDivision *coarser)
This is the function that will check whether one LengthGroupDivision has length groups that are finer...
Definition: lengthgroup.cc:205