#include <OSnl2OS.h>
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. | |
OSnLNode * | walkTree (expr *e) |
parse an nl tree structure holding a nonlinear expression | |
Public Attributes | |
OSoLReader * | osolreader |
we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content | |
OSInstance * | osinstance |
osinstance is a pointer to the OSInstance object that gets created from the information in the nl file | |
OSOption * | 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) | |
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 |
The OSnl2OS Class.
Definition at line 93 of file OSnl2OS.h.
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.
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.
osol | is a string containing the option information (e.g., as read from an osol file). |
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
Definition at line 297 of file OSnl2OS.cpp.
osinstance is a pointer to the OSInstance object that gets created from the information in the nl file
std::string OSnl2OS::osol |
std::vector<std::string> OSnl2OS::op_type |
std::vector<double> OSnl2OS::operand |
ograd* OSnl2OS::og [private] |
ASL* OSnl2OS::asl [private] |
ASL * OSnl2OS::cw [private] |
ASL * OSnl2OS::rw [private] |
std::string OSnl2OS::stub [private] |