OSnl2OS Class Reference

The OSnl2OS Class. More...

#include <OSnl2OS.h>

Collaboration diagram for OSnl2OS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OSnl2OS (std::string nlfilename, std::string osol)
 the OSnl2OS class constructor
 ~OSnl2OS ()
 the OSnl2OS class destructor
bool createOSObjects ()
 create an OSInstance and OS option representation from the AMPL nl content Since some of the information in the nl file (such as initial values, basis information, branching priorities) cannot be stored into an OSInstance and must be stored in an OSOption object instead, all other options must be provided to this method as well.
OSnLNodewalkTree (expr *e)
 parse an nl tree structure holding a nonlinear expression

Public Attributes

OSoLReaderosolreader
 we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content
OSInstanceosinstance
 osinstance is a pointer to the OSInstance object that gets created from the information in the nl file
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)
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).
std::vector< std::string > op_type
std::vector< double > operand
int numkount

Private Attributes

ograd * og
 og is a pointer to the AMPL data structure holding the objective function coefficients
ASL * asl
 Pointers to AMPL data structures.
ASL * cw
ASL * rw
std::string stub
 stub is the name of the file with the nl instance

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 93 of file OSnl2OS.h.


Constructor & Destructor Documentation

OSnl2OS::OSnl2OS ( std::string  nlfilename,
std::string  osol 
)

the OSnl2OS class constructor

Definition at line 74 of file OSnl2OS.cpp.

OSnl2OS::~OSnl2OS (  ) 

the OSnl2OS class destructor

Definition at line 271 of file OSnl2OS.cpp.


Member Function Documentation

bool OSnl2OS::createOSObjects (  ) 

create an OSInstance and OS option representation from the AMPL nl content Since some of the information in the nl file (such as initial values, basis information, branching priorities) cannot be stored into an OSInstance and must be stored in an OSOption object instead, all other options must be provided to this method as well.

Parameters:
osol is a string containing the option information (e.g., as read from an osol file).
Returns:
whether the OSOption object is created successfully.
Remarks:
The osol string must be prepared prior to calling createOSObjects!

Before we can process the rest of the instance, we check for QP This needs to be done here because of the possibility of expressions like (1 - x[0])^2 which may modify the A matrix as well as the right-hand sides. If the A-matrix is modified, the column-wise representation is out of date and must be rebuilt from the row-wise form.

The nl file may contain options that are indexed over model entities: variables, constraints, objectives, problems. An example would be initial primal and dual variables. AMPL stores these as suffixes, which are processed next. The code below is based on ideas expressed by David Gay.

Definition at line 602 of file OSnl2OS.cpp.

OSnLNode * OSnl2OS::walkTree ( expr *  e  ) 

parse an nl tree structure holding a nonlinear expression

Returns:
the AMPL nonlinear structure as an OSnLNode.

Definition at line 297 of file OSnl2OS.cpp.


Member Data Documentation

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

Definition at line 121 of file OSnl2OS.h.

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

Definition at line 133 of file OSnl2OS.h.

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 138 of file OSnl2OS.h.

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 144 of file OSnl2OS.h.

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

Definition at line 146 of file OSnl2OS.h.

std::vector<double> OSnl2OS::operand

Definition at line 147 of file OSnl2OS.h.

Definition at line 148 of file OSnl2OS.h.

ograd* OSnl2OS::og [private]

og is a pointer to the AMPL data structure holding the objective function coefficients

Definition at line 155 of file OSnl2OS.h.

ASL* OSnl2OS::asl [private]

Pointers to AMPL data structures.

cw is loaded in column-wise format. rw is loaded in row-wise format. asl is for conveniently switching.

Definition at line 162 of file OSnl2OS.h.

ASL * OSnl2OS::cw [private]

Definition at line 162 of file OSnl2OS.h.

ASL * OSnl2OS::rw [private]

Definition at line 162 of file OSnl2OS.h.

std::string OSnl2OS::stub [private]

stub is the name of the file with the nl instance

Definition at line 166 of file OSnl2OS.h.


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

Generated on 15 Jul 2012 by  doxygen 1.6.1