Gadget
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
AgeBandMatrix Class Reference

This class implements a vector of PopInfoIndexVector values, indexed from minage not 0. More...

#include <agebandmatrix.h>

Collaboration diagram for AgeBandMatrix:
Collaboration graph

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...
 
PopInfoIndexVectoroperator[] (int age)
 This will return the value of an element of the vector. More...
 
const PopInfoIndexVectoroperator[] (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...
 

Detailed Description

This class implements a vector of PopInfoIndexVector values, indexed from minage not 0.

Constructor & Destructor Documentation

◆ AgeBandMatrix() [1/5]

AgeBandMatrix::AgeBandMatrix ( )
inline

This is the default AgeBandMatrix constructor.

◆ AgeBandMatrix() [2/5]

AgeBandMatrix::AgeBandMatrix ( int  age,
const IntVector minl,
const IntVector size 
)

This is the AgeBandMatrix constructor for a specified minimum age and size.

Parameters
ageis the minimum index of the vector to be created
minlis the IntVector of minimum lengths used when constructing the entries of the vector
sizeis the IntVector of sizes used when constructing the entries of the vector

◆ AgeBandMatrix() [3/5]

AgeBandMatrix::AgeBandMatrix ( int  age,
const PopInfoMatrix initial,
int  minl 
)

This is the AgeBandMatrix constructor for a specified minimum age and initial value.

Parameters
ageis the minimum index of the vector to be created
initialis the initial value for all the entries of the vector
minlis the minimum length used when constructing the entries of the vector

◆ AgeBandMatrix() [4/5]

AgeBandMatrix::AgeBandMatrix ( int  age,
const PopInfoIndexVector initial 
)

This is the AgeBandMatrix constructor for a specified minimum age and initial value.

Parameters
ageis the minimum index of the vector to be created
initialis the initial value for the entry of the vector
Note
There will only be one entry on the vector created with this constructor

◆ AgeBandMatrix() [5/5]

AgeBandMatrix::AgeBandMatrix ( const AgeBandMatrix initial)

This is the AgeBandMatrix constructor that creates a copy of an existing AgeBandMatrix.

Parameters
initialis the AgeBandMatrix to copy

◆ ~AgeBandMatrix()

AgeBandMatrix::~AgeBandMatrix ( )

This is the AgeBandMatrix destructor.

Note
This will free all the memory allocated to all the elements of the vector

Member Function Documentation

◆ Add()

void AgeBandMatrix::Add ( const AgeBandMatrix Addition,
const ConversionIndex CI,
double  ratio = 1.0 
)

This function will add a AgeBandMatrix to the current vector.

Parameters
Additionis the AgeBandMatrix that will be added to the current vector
CIis the ConversionIndex that will convert between the length groups of the 2 vectors
ratiois a multiplicative constant applied to each entry (default value 1.0)

◆ Grow() [1/4]

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.

Parameters
Lgrowthis the DoubleMatrix of the calculated change in length due to the growth
Wgrowthis the DoubleMatrix of the calculated change in mean weight due to the growth

◆ Grow() [2/4]

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.

Parameters
Lgrowthis the DoubleMatrix of the calculated change in length due to the growth
Wgrowthis the DoubleMatrix of the calculated change in mean weight due to the growth
Matis the Maturity used to calculate (and store) the proportion that population that will mature
areais the identifier for the are used for the maturation process

◆ Grow() [3/4]

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.

Parameters
Lgrowthis the DoubleMatrix of the calculated change in length due to the growth
Weightis the DoubleVector of the specified mean weight of the population
Note
The mean weight of the population is fixed to values specified in the input file for the population

◆ Grow() [4/4]

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.

Parameters
Lgrowthis the DoubleMatrix of the calculated change in length due to the growth
Weightis the DoubleVector of the specified mean weight of the population
Matis the Maturity used to calculate (and store) the proportion that population that will mature
areais the identifier for the are used for the maturation process
Note
The mean weight of the population is fixed to values specified in the input file for the population

◆ IncrementAge()

void AgeBandMatrix::IncrementAge ( )

This function will increase the age of the population stored in the vector to zero.

◆ maxAge()

int AgeBandMatrix::maxAge ( ) const
inline

This will return the maximum age of the population stored in the vector.

Returns
maximum age

◆ maxLength()

int AgeBandMatrix::maxLength ( int  age) const
inline

This will return the maximum length of an age group stored in the vector.

Parameters
ageis identifier for the age group
Returns
maximum length

◆ minAge()

int AgeBandMatrix::minAge ( ) const
inline

This will return the minimum age of the population stored in the vector.

Returns
minimum age

◆ minLength()

int AgeBandMatrix::minLength ( int  age) const
inline

This will return the minimum length of an age group stored in the vector.

Parameters
ageis identifier for the age group
Returns
minimum length

◆ Multiply()

void AgeBandMatrix::Multiply ( const DoubleVector Ratio)

This function will multiply each element stored in the vector by a constant.

Parameters
Ratiois the DoubleVector of multiplicative constants

◆ Nrow()

int AgeBandMatrix::Nrow ( ) const
inline

This will return the number of rows of the vector.

Returns
the number of rows of the vector

◆ operator[]() [1/2]

PopInfoIndexVector& AgeBandMatrix::operator[] ( int  age)
inline

This will return the value of an element of the vector.

Parameters
ageis the element of the vector to be returned
Returns
the value of the specified element

◆ operator[]() [2/2]

const PopInfoIndexVector& AgeBandMatrix::operator[] ( int  age) const
inline

This will return the value of an element of the vector.

Parameters
ageis the element of the vector to be returned
Returns
the value of the specified element

◆ printNumbers()

void AgeBandMatrix::printNumbers ( ofstream &  outfile) const

This function will print the numbers of the population stored in the vector.

Parameters
outfileis the ofstream that all the model information gets sent to

◆ printWeights()

void AgeBandMatrix::printWeights ( ofstream &  outfile) const

This function will print the mean weights of the population stored in the vector.

Parameters
outfileis the ofstream that all the model information gets sent to

◆ setToZero()

void AgeBandMatrix::setToZero ( )

This function will set the population stored in the vector to zero.

◆ Subtract()

void AgeBandMatrix::Subtract ( const DoubleVector Ratio,
const ConversionIndex CI 
)

This function will subtract a multiplicative ratio from each element stored in the vector.

Parameters
Ratiois the DoubleVector of multiplicative constants
CIis the ConversionIndex that will convert between the length groups of the 2 vectors

◆ sumColumns()

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)

Parameters
Resultis the PopInfoVector containing the sum over all ages for each length

Member Data Documentation

◆ minage

int AgeBandMatrix::minage
protected

This is the index for the vector.

◆ nrow

int AgeBandMatrix::nrow
protected

This is number of rows of the vector.

◆ v

PopInfoIndexVector** AgeBandMatrix::v
protected

This is the indexed vector of PopInfoIndexVector values.


The documentation for this class was generated from the following files: