OS  2.10.1
Public Member Functions | Public Attributes | List of all members
OSnl2OS Class Reference

The OSnl2OS Class. More...

#include <OSnl2OS.h>

+ Collaboration diagram for OSnl2OS:

Public Member Functions

 OSnl2OS ()
 the OSnl2OS class constructor More...
 
 OSnl2OS (ASL *cw, ASL *rw, ASL *asl)
 alternate constructor which does not allocate the ASL structs More...
 
 ~OSnl2OS ()
 the OSnl2OS class destructor More...
 
ASL * getASL (std::string name)
 return a pointer to an ASL object More...
 
bool readNl (std::string stub)
 read the nl file More...
 
void setOsol (std::string osol)
 set the osol string More...
 
void setJobID (std::string jobID)
 set the job ID More...
 
bool setASL (ASL *asl, ASL *rw, ASL *cw)
 set the pointers to the three ASL objects More...
 
bool createOSObjects ()
 create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in the nl file — such as initial values, basis information, branching priorities, etc. More...
 
void setVar (OSInstance *osinstance, int lower, int upper, char vartype)
 store a number of variables into an OSInstance object More...
 
void setIBVar (OSInstance *osinstance, int lower, int upper)
 special version of the previous method because AMPL makes no distinction between integer and binary variables that occur in nonlinear expressions. More...
 
OSnLNodewalkTree (expr *e)
 parse an nl tree structure holding a nonlinear expression More...
 

Public Attributes

OSoLReaderosolreader
 we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content More...
 
OSInstanceosinstance
 osinstance is a pointer to the OSInstance object that gets created from the information in the nl file More...
 
OSOptionosoption
 osoption is a pointer to the OSOption object that gets created from the information in the nl file (and the OSoL string if present) More...
 
std::string osol
 osol is a string containing the content of the OS option file (it may be empty if no option file was provided). More...
 
std::string jobID
 jobID is a string containing a jobID that may have been supplied on the command line (it may be empty). More...
 
std::vector< std::string > op_type
 
std::vector< double > operand
 
int numkount
 

Detailed Description

The OSnl2OS Class.

Author
Horand Gassmann, Jun Ma, Kipp Martin
Remarks
The OSnl2OS class is used for reading an AMPL nl file, extracting from it the instance along with any options indexed over variables, constraints, objectives. The latter may, if needed, be merged with the contents of an OSoL file. The processed information is stored into an OSInstance object and either an OSOption object (if not NULL) or an OSoL string.

Definition at line 78 of file OSnl2OS.h.

Constructor & Destructor Documentation

◆ OSnl2OS() [1/2]

OSnl2OS::OSnl2OS ( )

the OSnl2OS class constructor

◆ OSnl2OS() [2/2]

OSnl2OS::OSnl2OS ( ASL *  cw,
ASL *  rw,
ASL *  asl 
)

alternate constructor which does not allocate the ASL structs

&param cw a pointer to a (previously allocated) struct used for column-wise representation &param rw a pointer to a (previously allocated) struct used for row-wise representation &param asl an extra pointer that can be used to switch between rw and cw

◆ ~OSnl2OS()

OSnl2OS::~OSnl2OS ( )

the OSnl2OS class destructor

Member Function Documentation

◆ getASL()

ASL* OSnl2OS::getASL ( std::string  name)

return a pointer to an ASL object

Parameters
namecarries the name of the ASL object (there are three of them: asl, rw, cw)
Returns
the pointer to the object named

◆ readNl()

bool OSnl2OS::readNl ( std::string  stub)

read the nl file

Parameters
stubis the (relevant part of the) file name
Returns
whether the read was successful

◆ setOsol()

void OSnl2OS::setOsol ( std::string  osol)

set the osol string

◆ setJobID()

void OSnl2OS::setJobID ( std::string  jobID)

set the job ID

◆ setASL()

bool OSnl2OS::setASL ( ASL *  asl,
ASL *  rw,
ASL *  cw 
)

set the pointers to the three ASL objects

Parameters
aslcarries a pointer to the object named "asl"
rwcarries a pointer to the object named "rw"
cwcarries a pointer to the object named "cw" (asl should point to the same location as either rw or cw)
Returns
whether the operation was successful

◆ createOSObjects()

bool OSnl2OS::createOSObjects ( )

create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in the nl file — such as initial values, basis information, branching priorities, etc.

— cannot be stored into an OSInstance and must be stored in an OSOption object instead.)

Returns
whether the objects were created successfully.

◆ setVar()

void OSnl2OS::setVar ( OSInstance osinstance,
int  lower,
int  upper,
char  vartype 
)

store a number of variables into an OSInstance object

Parameters
osinstancea pointer to the OSInstance object
lowerindex of the first variable to be set in this call
upperset all variables from lower...upper-1
vartypethe type of the variable (in AMPL this is 'C', 'B' or 'I')

◆ setIBVar()

void OSnl2OS::setIBVar ( OSInstance osinstance,
int  lower,
int  upper 
)

special version of the previous method because AMPL makes no distinction between integer and binary variables that occur in nonlinear expressions.

The actual type ('B' or 'I') must be inferred from the variable bounds.

Parameters
osinstancea pointer to the OSInstance object
lowerindex of the first variable to be set in this call
upperset all variables from lower...upper-1

◆ walkTree()

OSnLNode* OSnl2OS::walkTree ( expr *  e)

parse an nl tree structure holding a nonlinear expression

Returns
the AMPL nonlinear structure as an OSnLNode.

Member Data Documentation

◆ osolreader

OSoLReader* OSnl2OS::osolreader

we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content

Definition at line 160 of file OSnl2OS.h.

◆ osinstance

OSInstance* OSnl2OS::osinstance

osinstance is a pointer to the OSInstance object that gets created from the information in the nl file

Definition at line 172 of file OSnl2OS.h.

◆ osoption

OSOption* OSnl2OS::osoption

osoption is a pointer to the OSOption object that gets created from the information in the nl file (and the OSoL string if present)

Definition at line 177 of file OSnl2OS.h.

◆ osol

std::string OSnl2OS::osol

osol is a string containing the content of the OS option file (it may be empty if no option file was provided).

If osoption is NULL, the option information is found in osol.

Definition at line 183 of file OSnl2OS.h.

◆ jobID

std::string OSnl2OS::jobID

jobID is a string containing a jobID that may have been supplied on the command line (it may be empty).

If osoption is not NULL, the jobID has been duplicated to osoption.

Definition at line 189 of file OSnl2OS.h.

◆ op_type

std::vector<std::string> OSnl2OS::op_type

Definition at line 191 of file OSnl2OS.h.

◆ operand

std::vector<double> OSnl2OS::operand

Definition at line 192 of file OSnl2OS.h.

◆ numkount

int OSnl2OS::numkount

Definition at line 193 of file OSnl2OS.h.


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