This class implements a vector of PopInfoIndexVector values, indexed from minage not 0. More...
#include <agebandmatrix.h>
Public Member Functions | |
AgeBandMatrix () | |
This is the default AgeBandMatrix constructor. More... | |
AgeBandMatrix (int age, const IntVector &minl, const IntVector &size) | |
This is the AgeBandMatrix constructor for a specified minimum age and size. More... | |
AgeBandMatrix (int age, const PopInfoMatrix &initial, int minl) | |
This is the AgeBandMatrix constructor for a specified minimum age and initial value. More... | |
AgeBandMatrix (int age, const PopInfoIndexVector &initial) | |
This is the AgeBandMatrix constructor for a specified minimum age and initial value. More... | |
AgeBandMatrix (const AgeBandMatrix &initial) | |
This is the AgeBandMatrix constructor that creates a copy of an existing AgeBandMatrix. More... | |
~AgeBandMatrix () | |
This is the AgeBandMatrix destructor. More... | |
int | minAge () const |
This will return the minimum age of the population stored in the vector. More... | |
int | maxAge () const |
This will return the maximum age of the population stored in the vector. More... | |
int | Nrow () const |
This will return the number of rows of the vector. More... | |
PopInfoIndexVector & | operator[] (int age) |
This will return the value of an element of the vector. More... | |
const PopInfoIndexVector & | operator[] (int age) const |
This will return the value of an element of the vector. More... | |
int | minLength (int age) const |
This will return the minimum length of an age group stored in the vector. More... | |
int | maxLength (int age) const |
This will return the maximum length of an age group stored in the vector. More... | |
void | sumColumns (PopInfoVector &Result) const |
This function will sum the columns of each element stored in the vector (ie sum over all ages for each length group of the population) More... | |
void | Subtract (const DoubleVector &Ratio, const ConversionIndex &CI) |
This function will subtract a multiplicative ratio from each element stored in the vector. More... | |
void | Multiply (const DoubleVector &Ratio) |
This function will multiply each element stored in the vector by a constant. More... | |
void | setToZero () |
This function will set the population stored in the vector to zero. More... | |
void | IncrementAge () |
This function will increase the age of the population stored in the vector to zero. More... | |
void | printNumbers (ofstream &outfile) const |
This function will print the numbers of the population stored in the vector. More... | |
void | printWeights (ofstream &outfile) const |
This function will print the mean weights of the population stored in the vector. More... | |
void | Grow (const DoubleMatrix &Lgrowth, const DoubleMatrix &Wgrowth) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc calculations for the population. More... | |
void | Grow (const DoubleMatrix &Lgrowth, const DoubleMatrix &Wgrowth, Maturity *const Mat, int area) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc and Maturity calculations for the population. More... | |
void | Grow (const DoubleMatrix &Lgrowth, const DoubleVector &Weight) |
This function will increase the length of the population stored in the vector, according to values calculated by the GrowthCalc calculations for the population. More... | |
void | Grow (const DoubleMatrix &Lgrowth, const DoubleVector &Weight, Maturity *const Mat, int area) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc and Maturity calculations for the population. More... | |
void | Add (const AgeBandMatrix &Addition, const ConversionIndex &CI, double ratio=1.0) |
This function will add a AgeBandMatrix to the current vector. More... | |
Protected Attributes | |
int | minage |
This is the index for the vector. More... | |
int | nrow |
This is number of rows of the vector. More... | |
PopInfoIndexVector ** | v |
This is the indexed vector of PopInfoIndexVector values. More... | |
This class implements a vector of PopInfoIndexVector values, indexed from minage not 0.
|
inline |
This is the default AgeBandMatrix constructor.
This is the AgeBandMatrix constructor for a specified minimum age and size.
AgeBandMatrix::AgeBandMatrix | ( | int | age, |
const PopInfoMatrix & | initial, | ||
int | minl | ||
) |
This is the AgeBandMatrix constructor for a specified minimum age and initial value.
age | is the minimum index of the vector to be created |
initial | is the initial value for all the entries of the vector |
minl | is the minimum length used when constructing the entries of the vector |
AgeBandMatrix::AgeBandMatrix | ( | int | age, |
const PopInfoIndexVector & | initial | ||
) |
This is the AgeBandMatrix constructor for a specified minimum age and initial value.
age | is the minimum index of the vector to be created |
initial | is the initial value for the entry of the vector |
AgeBandMatrix::AgeBandMatrix | ( | const AgeBandMatrix & | initial | ) |
This is the AgeBandMatrix constructor that creates a copy of an existing AgeBandMatrix.
initial | is the AgeBandMatrix to copy |
AgeBandMatrix::~AgeBandMatrix | ( | ) |
This is the AgeBandMatrix destructor.
void AgeBandMatrix::Add | ( | const AgeBandMatrix & | Addition, |
const ConversionIndex & | CI, | ||
double | ratio = 1.0 |
||
) |
This function will add a AgeBandMatrix to the current vector.
Addition | is the AgeBandMatrix that will be added to the current vector |
CI | is the ConversionIndex that will convert between the length groups of the 2 vectors |
ratio | is a multiplicative constant applied to each entry (default value 1.0) |
void AgeBandMatrix::Grow | ( | const DoubleMatrix & | Lgrowth, |
const DoubleMatrix & | Wgrowth | ||
) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc calculations for the population.
Lgrowth | is the DoubleMatrix of the calculated change in length due to the growth |
Wgrowth | is the DoubleMatrix of the calculated change in mean weight due to the growth |
void AgeBandMatrix::Grow | ( | const DoubleMatrix & | Lgrowth, |
const DoubleMatrix & | Wgrowth, | ||
Maturity *const | Mat, | ||
int | area | ||
) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc and Maturity calculations for the population.
Lgrowth | is the DoubleMatrix of the calculated change in length due to the growth |
Wgrowth | is the DoubleMatrix of the calculated change in mean weight due to the growth |
Mat | is the Maturity used to calculate (and store) the proportion that population that will mature |
area | is the identifier for the are used for the maturation process |
void AgeBandMatrix::Grow | ( | const DoubleMatrix & | Lgrowth, |
const DoubleVector & | Weight | ||
) |
This function will increase the length of the population stored in the vector, according to values calculated by the GrowthCalc calculations for the population.
Lgrowth | is the DoubleMatrix of the calculated change in length due to the growth |
Weight | is the DoubleVector of the specified mean weight of the population |
void AgeBandMatrix::Grow | ( | const DoubleMatrix & | Lgrowth, |
const DoubleVector & | Weight, | ||
Maturity *const | Mat, | ||
int | area | ||
) |
This function will increase the length and mean weight of the population stored in the vector, according to values calculated by the GrowthCalc and Maturity calculations for the population.
Lgrowth | is the DoubleMatrix of the calculated change in length due to the growth |
Weight | is the DoubleVector of the specified mean weight of the population |
Mat | is the Maturity used to calculate (and store) the proportion that population that will mature |
area | is the identifier for the are used for the maturation process |
void AgeBandMatrix::IncrementAge | ( | ) |
This function will increase the age of the population stored in the vector to zero.
|
inline |
This will return the maximum age of the population stored in the vector.
|
inline |
This will return the maximum length of an age group stored in the vector.
age | is identifier for the age group |
|
inline |
This will return the minimum age of the population stored in the vector.
|
inline |
This will return the minimum length of an age group stored in the vector.
age | is identifier for the age group |
void AgeBandMatrix::Multiply | ( | const DoubleVector & | Ratio | ) |
This function will multiply each element stored in the vector by a constant.
Ratio | is the DoubleVector of multiplicative constants |
|
inline |
This will return the number of rows of the vector.
|
inline |
This will return the value of an element of the vector.
age | is the element of the vector to be returned |
|
inline |
This will return the value of an element of the vector.
age | is the element of the vector to be returned |
void AgeBandMatrix::printNumbers | ( | ofstream & | outfile | ) | const |
This function will print the numbers of the population stored in the vector.
outfile | is the ofstream that all the model information gets sent to |
void AgeBandMatrix::printWeights | ( | ofstream & | outfile | ) | const |
This function will print the mean weights of the population stored in the vector.
outfile | is the ofstream that all the model information gets sent to |
void AgeBandMatrix::setToZero | ( | ) |
This function will set the population stored in the vector to zero.
void AgeBandMatrix::Subtract | ( | const DoubleVector & | Ratio, |
const ConversionIndex & | CI | ||
) |
This function will subtract a multiplicative ratio from each element stored in the vector.
Ratio | is the DoubleVector of multiplicative constants |
CI | is the ConversionIndex that will convert between the length groups of the 2 vectors |
void AgeBandMatrix::sumColumns | ( | PopInfoVector & | Result | ) | const |
This function will sum the columns of each element stored in the vector (ie sum over all ages for each length group of the population)
Result | is the PopInfoVector containing the sum over all ages for each length |
|
protected |
This is the index for the vector.
|
protected |
This is number of rows of the vector.
|
protected |
This is the indexed vector of PopInfoIndexVector values.