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

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

#include <popratioindexvector.h>

Collaboration diagram for PopRatioIndexVector:
Collaboration graph

Public Member Functions

 PopRatioIndexVector ()
 This is the default PopRatioIndexVector constructor. More...
 
 PopRatioIndexVector (int sz, int minpos)
 This is the PopRatioIndexVector constructor for a specified size. More...
 
 PopRatioIndexVector (int sz, int minpos, const PopRatioVector &initial)
 This is the PopRatioIndexVector constructor for a specified size with an initial value. More...
 
 PopRatioIndexVector (const PopRatioIndexVector &initial)
 This is the PopRatioIndexVector constructor that creates a copy of an existing PopRatioIndexVector. More...
 
 ~PopRatioIndexVector ()
 This is the PopRatioIndexVector destructor. More...
 
void resize (int addsize, int newminpos, const PopRatioVector &initial)
 This will add new entries to the vector. More...
 
PopRatioVectoroperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const PopRatioVectoroperator[] (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...
 

Protected Attributes

int minpos
 This is the index for the vector. More...
 
int size
 This is the size of the vector. More...
 
PopRatioVector ** v
 This is the indexed vector of PopRatioVector values. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PopRatioIndexVector() [1/4]

PopRatioIndexVector::PopRatioIndexVector ( )
inline

This is the default PopRatioIndexVector constructor.

◆ PopRatioIndexVector() [2/4]

PopRatioIndexVector::PopRatioIndexVector ( int  sz,
int  minpos 
)

This is the PopRatioIndexVector 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

◆ PopRatioIndexVector() [3/4]

PopRatioIndexVector::PopRatioIndexVector ( int  sz,
int  minpos,
const PopRatioVector initial 
)

This is the PopRatioIndexVector 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

◆ PopRatioIndexVector() [4/4]

PopRatioIndexVector::PopRatioIndexVector ( const PopRatioIndexVector initial)

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

Parameters
initialis the PopRatioIndexVector to copy

◆ ~PopRatioIndexVector()

PopRatioIndexVector::~PopRatioIndexVector ( )

This is the PopRatioIndexVector destructor.

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

Member Function Documentation

◆ maxCol()

int PopRatioIndexVector::maxCol ( ) const
inline

This will return the length of the vector.

Returns
the length of the vector

◆ minCol()

int PopRatioIndexVector::minCol ( ) const
inline

This will return the index of the vector.

Returns
the index of the vector

◆ operator[]() [1/2]

PopRatioVector& PopRatioIndexVector::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 PopRatioVector& PopRatioIndexVector::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 PopRatioIndexVector::resize ( int  addsize,
int  newminpos,
const PopRatioVector initial 
)

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
initialis the value that will be entered for the new entries

◆ Size()

int PopRatioIndexVector::Size ( ) const
inline

This will return the size of the vector.

Returns
the size of the vector

Member Data Documentation

◆ minpos

int PopRatioIndexVector::minpos
protected

This is the index for the vector.

◆ size

int PopRatioIndexVector::size
protected

This is the size of the vector.

◆ v

PopRatioVector** PopRatioIndexVector::v
protected

This is the indexed vector of PopRatioVector values.


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