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

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

#include <formulamatrix.h>

Collaboration diagram for FormulaMatrix:
Collaboration graph

Public Member Functions

 FormulaMatrix ()
 This is the default FormulaMatrix constructor. More...
 
 FormulaMatrix (int nr, int nc, Formula initial)
 This is the FormulaMatrix constructor for a specified size. More...
 
 FormulaMatrix (int nr, int nc, double initial)
 This is the FormulaMatrix constructor for a specified size. More...
 
 ~FormulaMatrix ()
 This is the FormulaMatrix 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...
 
FormulaVectoroperator[] (int pos)
 This will return the value of an element of the vector. More...
 
const FormulaVectoroperator[] (int pos) const
 This will return the value of an element of the vector. More...
 
void AddRows (int add, int length, Formula value)
 This will add new entries to the vector. More...
 
void AddRows (int add, int length, double value)
 This will add new entries to the vector. More...
 
void Inform (Keeper *keeper)
 This function will inform Keeper of the values of the stored Formula. More...
 

Protected Attributes

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

Detailed Description

This class implements a dynamic vector of FormulaVector values.

Constructor & Destructor Documentation

◆ FormulaMatrix() [1/3]

FormulaMatrix::FormulaMatrix ( )
inline

This is the default FormulaMatrix constructor.

◆ FormulaMatrix() [2/3]

FormulaMatrix::FormulaMatrix ( int  nr,
int  nc,
Formula  initial 
)

This is the FormulaMatrix 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 FormulaVector to be created for each row)
initialis the initial value for all the entries of the vector

◆ FormulaMatrix() [3/3]

FormulaMatrix::FormulaMatrix ( int  nr,
int  nc,
double  initial 
)

This is the FormulaMatrix 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 FormulaVector to be created for each row)
initialis the initial value for all the entries of the vector

◆ ~FormulaMatrix()

FormulaMatrix::~FormulaMatrix ( )

This is the FormulaMatrix destructor.

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

Member Function Documentation

◆ AddRows() [1/2]

void FormulaMatrix::AddRows ( int  add,
int  length,
double  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 FormulaVector that is created
valueis the value that will be entered for the new entries

◆ AddRows() [2/2]

void FormulaMatrix::AddRows ( int  add,
int  length,
Formula  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 FormulaVector that is created
valueis the value that will be entered for the new entries

◆ Inform()

void FormulaMatrix::Inform ( Keeper keeper)

This function will inform Keeper of the values of the stored Formula.

Parameters
keeperis the Keeper for the current model

◆ Ncol()

int FormulaMatrix::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 FormulaVector that is entry i of the FormulaMatrix

◆ Nrow()

int FormulaMatrix::Nrow ( ) const
inline

This will return the number of rows of the vector.

Returns
the number of rows of the vector

◆ operator[]() [1/2]

FormulaVector& FormulaMatrix::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 FormulaVector& FormulaMatrix::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 FormulaMatrix::nrow
protected

This is number of rows of the vector.

◆ v

FormulaVector** FormulaMatrix::v
protected

This is the vector of FormulaVector values.


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