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

This class implements a dynamic vector of PopInfoVector values. More...

#include <popinfomatrix.h>

Collaboration diagram for PopInfoMatrix:
Collaboration graph

Public Member Functions

 PopInfoMatrix ()
 This is the default PopInfoMatrix constructor. More...
 
 PopInfoMatrix (int nr, int nc, PopInfo initial)
 This is the PopInfoMatrix constructor for a specified size. More...
 
 PopInfoMatrix (const PopInfoMatrix &initial)
 This is the PopInfoMatrix constructor that creates a copy of an existing PopInfoMatrix. More...
 
 ~PopInfoMatrix ()
 This is the PopInfoMatrix destructor. More...
 
int Ncol (int i=0) const
 This will return the number of columns in row i of the vector. More...
 
int Nrow () const
 This will return the number of rows of the vector. More...
 
PopInfoVectoroperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const PopInfoVectoroperator[] (int pos) const
 This will return the value of an element of the vector. More...
 
void AddRows (int add, int length, PopInfo value)
 This will add new entries to the vector. More...
 
void Delete (int pos)
 This will delete an entry from the vector. More...
 

Protected Attributes

int nrow
 This is number of rows of the vector. More...
 
PopInfoVector ** v
 This is the vector of PopInfoVector values. More...
 

Detailed Description

This class implements a dynamic vector of PopInfoVector values.

Constructor & Destructor Documentation

◆ PopInfoMatrix() [1/3]

PopInfoMatrix::PopInfoMatrix ( )
inline

This is the default PopInfoMatrix constructor.

◆ PopInfoMatrix() [2/3]

PopInfoMatrix::PopInfoMatrix ( int  nr,
int  nc,
PopInfo  initial 
)

This is the PopInfoMatrix constructor for a specified size.

Parameters
nris the size of the vector to be created
ncis the length of each row to be created (ie. the size of the PopInfoVector to be created for each row)
initialis the initial value for all the entries of the vector

◆ PopInfoMatrix() [3/3]

PopInfoMatrix::PopInfoMatrix ( const PopInfoMatrix initial)

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

Parameters
initialis the PopInfoMatrix to copy

◆ ~PopInfoMatrix()

PopInfoMatrix::~PopInfoMatrix ( )

This is the PopInfoMatrix destructor.

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

Member Function Documentation

◆ AddRows()

void PopInfoMatrix::AddRows ( int  add,
int  length,
PopInfo  value 
)

This will add new entries to the vector.

Parameters
addis the number of new entries to the vector
lengthis the number of entries to the PopInfoVector that is created
valueis the value that will be entered for the new entries

◆ Delete()

void PopInfoMatrix::Delete ( int  pos)

This will delete an entry from the vector.

Parameters
posis the element of the vector to be deleted
Note
This will free the memory allocated to the deleted element of the vector

◆ Ncol()

int PopInfoMatrix::Ncol ( int  i = 0) const
inline

This will return the number of columns in row i of the vector.

Parameters
iis the row of the vector to have the number of columns counted
Returns
the number of columns in row i of the vector
Note
This is the number of entries in the PopInfoVector that is entry i of the PopInfoMatrix

◆ Nrow()

int PopInfoMatrix::Nrow ( ) const
inline

This will return the number of rows of the vector.

Returns
the number of rows of the vector

◆ operator[]() [1/2]

PopInfoVector& PopInfoMatrix::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 PopInfoVector& PopInfoMatrix::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

Member Data Documentation

◆ nrow

int PopInfoMatrix::nrow
protected

This is number of rows of the vector.

◆ v

PopInfoVector** PopInfoMatrix::v
protected

This is the vector of PopInfoVector values.


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