Gadget
Public Member Functions | Protected Attributes | List of all members
PopInfoIndexVector Class Reference

This class implements a dynamic vector of PopInfo values, indexed from minpos not 0. More...

#include <popinfoindexvector.h>

Collaboration diagram for PopInfoIndexVector:
Collaboration graph

Public Member Functions

 PopInfoIndexVector ()
 This is the default PopInfoIndexVector constructor. More...
 
 PopInfoIndexVector (int sz, int minpos)
 This is the PopInfoIndexVector constructor for a specified size. More...
 
 PopInfoIndexVector (int sz, int minpos, PopInfo initial)
 This is the PopInfoIndexVector constructor for a specified size with an initial value. More...
 
 PopInfoIndexVector (const PopInfoIndexVector &initial)
 This is the PopInfoIndexVector constructor that creates a copy of an existing PopInfoIndexVector. More...
 
 ~PopInfoIndexVector ()
 This is the PopInfoIndexVector destructor. More...
 
void resize (int addsize, int newminpos, PopInfo value)
 This will add new entries to the vector. More...
 
PopInfooperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const PopInfooperator[] (int pos) const
 This will return the value of an element of the vector. More...
 
int minCol () const
 This will return the index of the vector. More...
 
int maxCol () const
 This will return the length of the vector. More...
 
int Size () const
 This will return the size of the vector. More...
 
void Add (const PopInfoIndexVector &Addition, const ConversionIndex &CI, double ratio=1.0)
 This function will add a PopInfoIndexVector to the current vector. More...
 
void Add (const PopInfoIndexVector &Addition, const ConversionIndex &CI, const DoubleVector &Ratio, double ratio=1.0)
 This function will add a PopInfoIndexVector to the current vector. More...
 

Protected Attributes

int minpos
 This is the index for the vector. More...
 
int size
 This is the size of the vector. More...
 
PopInfov
 This is the indexed vector of PopInfo values. More...
 

Detailed Description

This class implements a dynamic vector of PopInfo values, indexed from minpos not 0.

Constructor & Destructor Documentation

◆ PopInfoIndexVector() [1/4]

PopInfoIndexVector::PopInfoIndexVector ( )
inline

This is the default PopInfoIndexVector constructor.

◆ PopInfoIndexVector() [2/4]

PopInfoIndexVector::PopInfoIndexVector ( int  sz,
int  minpos 
)

This is the PopInfoIndexVector constructor for a specified size.

Parameters
szis the size of the vector to be created
minposis the index for the vector to be created
Note
The elements of the vector will all be created, and set to zero

◆ PopInfoIndexVector() [3/4]

PopInfoIndexVector::PopInfoIndexVector ( int  sz,
int  minpos,
PopInfo  initial 
)

This is the PopInfoIndexVector constructor for a specified size with an initial value.

Parameters
szis the size of the vector to be created
minposis the index for the vector to be created
initialis the initial value for all the entries of the vector

◆ PopInfoIndexVector() [4/4]

PopInfoIndexVector::PopInfoIndexVector ( const PopInfoIndexVector initial)

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

Parameters
initialis the PopInfoIndexVector to copy

◆ ~PopInfoIndexVector()

PopInfoIndexVector::~PopInfoIndexVector ( )

This is the PopInfoIndexVector destructor.

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

Member Function Documentation

◆ Add() [1/2]

void PopInfoIndexVector::Add ( const PopInfoIndexVector Addition,
const ConversionIndex CI,
const DoubleVector Ratio,
double  ratio = 1.0 
)

This function will add a PopInfoIndexVector to the current vector.

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

◆ Add() [2/2]

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

This function will add a PopInfoIndexVector to the current vector.

Parameters
Additionis the PopInfoIndexVector 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)

◆ maxCol()

int PopInfoIndexVector::maxCol ( ) const
inline

This will return the length of the vector.

Returns
the length of the vector

◆ minCol()

int PopInfoIndexVector::minCol ( ) const
inline

This will return the index of the vector.

Returns
the index of the vector

◆ operator[]() [1/2]

PopInfo& PopInfoIndexVector::operator[] ( int  pos)
inline

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

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

◆ operator[]() [2/2]

const PopInfo& PopInfoIndexVector::operator[] ( int  pos) const
inline

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

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

◆ resize()

void PopInfoIndexVector::resize ( int  addsize,
int  newminpos,
PopInfo  value 
)

This will add new entries to the vector.

Parameters
addsizeis the number of new entries to the vector
newminposis the index for the vector to be created
valueis the value that will be entered for the new entries

◆ Size()

int PopInfoIndexVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

Member Data Documentation

◆ minpos

int PopInfoIndexVector::minpos
protected

This is the index for the vector.

◆ size

int PopInfoIndexVector::size
protected

This is the size of the vector.

◆ v

PopInfo* PopInfoIndexVector::v
protected

This is the indexed vector of PopInfo values.


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