Gadget
Public Member Functions | List of all members
InitialInputFile Class Reference

This is the class used to get and store initial values for the variables used in the model simulation from an input file. More...

#include <initialinputfile.h>

Collaboration diagram for InitialInputFile:
Collaboration graph

Public Member Functions

 InitialInputFile (const char *const filename)
 This is the default InitialInputFile constructor. More...
 
 ~InitialInputFile ()
 This is the default InitialInputFile destructor. More...
 
void getVectors (ParameterVector &sw, DoubleVector &val, DoubleVector &low, DoubleVector &upp, IntVector &opt)
 This function will return a copy of the data read from the input file. More...
 
void getValues (DoubleVector &val)
 This function will return a copy of the value of the variables. More...
 
void getSwitches (ParameterVector &sw)
 This function will return a copy of the names of the variables. More...
 
void readNextLine ()
 This is the function that will read the next line of the data from the input file. More...
 
void readFromFile ()
 This is the function that will read the data from the input file. More...
 
int isDataLeft ()
 This function will check to see if there is more data to read in the input file. More...
 
int numSwitches () const
 This function will return the number of switches read from the input file. More...
 
int numVariables () const
 This function will return the number of variables read from the input file. More...
 
int isRepeatedValues ()
 This function will return the value of the flag used to denote that the 'repeated values' format is used in the input file. More...
 
int getOptimise (int i) const
 This function will return the optimising flag for a switch in the input file. More...
 
double getValue (int i) const
 This function will return the value of a switch in the input file. More...
 
double getLower (int i) const
 This function will return the lower bound for a switch in the input file. More...
 
double getUpper (int i) const
 This function will return the upper bound for a switch in the input file. More...
 
Parameter getSwitch (int i) const
 This function will return the paramter name for a switch in the input file. More...
 

Detailed Description

This is the class used to get and store initial values for the variables used in the model simulation from an input file.

Constructor & Destructor Documentation

◆ InitialInputFile()

InitialInputFile::InitialInputFile ( const char *const  filename)

This is the default InitialInputFile constructor.

Parameters
filenameis the name of the file to read the initial parameter values from

◆ ~InitialInputFile()

InitialInputFile::~InitialInputFile ( )

This is the default InitialInputFile destructor.

Member Function Documentation

◆ getLower()

double InitialInputFile::getLower ( int  i) const
inline

This function will return the lower bound for a switch in the input file.

Parameters
iis the index for the switch
Returns
lower bound for the switch

◆ getOptimise()

int InitialInputFile::getOptimise ( int  i) const
inline

This function will return the optimising flag for a switch in the input file.

Parameters
iis the index for the switch
Returns
optimise flag for the switch

◆ getSwitch()

Parameter InitialInputFile::getSwitch ( int  i) const
inline

This function will return the paramter name for a switch in the input file.

Parameters
iis the index for the switch
Returns
parameter name for the switch

◆ getSwitches()

void InitialInputFile::getSwitches ( ParameterVector sw)

This function will return a copy of the names of the variables.

Parameters
swis the ParameterVector that will contain a copy of the names

◆ getUpper()

double InitialInputFile::getUpper ( int  i) const
inline

This function will return the upper bound for a switch in the input file.

Parameters
iis the index for the switch
Returns
upper bound for the switch

◆ getValue()

double InitialInputFile::getValue ( int  i) const
inline

This function will return the value of a switch in the input file.

Parameters
iis the index for the switch
Returns
value of the switch

◆ getValues()

void InitialInputFile::getValues ( DoubleVector val)

This function will return a copy of the value of the variables.

Parameters
valis the DoubleVector that will contain a copy of the values

◆ getVectors()

void InitialInputFile::getVectors ( ParameterVector sw,
DoubleVector val,
DoubleVector low,
DoubleVector upp,
IntVector opt 
)

This function will return a copy of the data read from the input file.

Parameters
swis the ParameterVector that will contain a copy of the names
valis the DoubleVector that will contain a copy of the values
lowis the DoubleVector that will contain a copy of the lower bounds
uppis the DoubleVector that will contain a copy of the upper bounds
optis the IntVector that will contain a copy of the optimise flags

◆ isDataLeft()

int InitialInputFile::isDataLeft ( )

This function will check to see if there is more data to read in the input file.

Returns
1 if there is more data to read from the input file, 0 otherwise

◆ isRepeatedValues()

int InitialInputFile::isRepeatedValues ( )
inline

This function will return the value of the flag used to denote that the 'repeated values' format is used in the input file.

Returns
repeatedValues

◆ numSwitches()

int InitialInputFile::numSwitches ( ) const
inline

This function will return the number of switches read from the input file.

Returns
number of switches

◆ numVariables()

int InitialInputFile::numVariables ( ) const
inline

This function will return the number of variables read from the input file.

Returns
number of variables

◆ readFromFile()

void InitialInputFile::readFromFile ( )

This is the function that will read the data from the input file.

◆ readNextLine()

void InitialInputFile::readNextLine ( )

This is the function that will read the next line of the data from the input file.

Note
This function is only used when the data is in the 'repeated values' format

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