13#ifndef MINOTAURAMPLINTERFACE_H
14#define MINOTAURAMPLINTERFACE_H
22typedef double efunc(expr*);
30class PolynomialFunction;
32class QuadraticFunction;
34typedef CGraph* CGraphPtr;
35typedef Environment* EnvironmentPtr;
36typedef LinearFunction* LinearFunctionPtr;
37typedef PolynomialFunction* PolyFunPtr;
38typedef QuadraticFunction* QuadraticFunctionPtr;
39typedef const Solution* ConstSolutionPtr;
42namespace MINOTAUR_AMPL {
44class AMPLNonlinearFunction;
45typedef AMPLNonlinearFunction* AMPLNlfPtr;
62typedef AMPLInterface * AMPLInterfacePtr;
104 void writeProblem(std::ostream &out)
const;
113 std::map <efunc*, int> functionMap_;
116 const double intTol_;
122 static const std::string me_;
157 std::vector<Minotaur::VariablePtr> vars_;
223 void createFunctionMap_();
229 void findVars_(expr *e_ptr, std::set<int> & vars);
263 std::vector<std::set<int> > &vids);
280 void getOptionsFromEnv_(std::string pre);
292 double & c, expr *e_ptr);
309 void readFile_(std::string *fname,
ReaderType readerType);
314 void saveNlVars_(std::vector<std::set<int> > &vars);
320 void unsupportedOp_(
int opcode);
327 void writeExpression_(expr *e_ptr, std::ostream &out)
const;
336 void writeExpression_(
int i,
bool is_obj, std::ostream &out)
const;
345 void writeLin_(
Minotaur::UInt i,
bool is_obj, std::ostream &out)
const;
ReaderType
What kind of ASL reader is used to read the .nl file.
Definition: AMPLInterface.h:48
@ PFGHReader
First derivatives and partially separable structure.
Definition: AMPLInterface.h:55
@ PFGReader
Definition: AMPLInterface.h:54
@ FGReader
No derivatives, linear objective and constraints only.
Definition: AMPLInterface.h:50
@ FGHReader
Definition: AMPLInterface.h:52
Declare important 'types' used in Minotaur.
Interface to read ampl models using AMPL Solver Library. AMPLInterface class provides methods to read...
Definition: AMPLInterface.h:74
Minotaur::ProblemPtr readInstance(std::string fname)
Read an instance from a .nl file 'fname'.
Definition: AMPLInterface.cpp:2029
AMPLInterface(Minotaur::EnvPtr env, std::string solver="minotaurampl")
Constructor.
Definition: AMPLInterface.cpp:67
const double * getInitialPoint() const
Get the initial point provided in the .nl file.
Definition: AMPLInterface.cpp:1299
ASL * getAsl()
Get pointer to the ASL structure myAsl_.
Definition: AMPLInterface.cpp:926
void freeASL()
Free the ASL data structure myAsl_;.
Definition: AMPLInterface.cpp:914
~AMPLInterface()
Destroy.
Definition: AMPLInterface.cpp:88
Minotaur::UInt getNumDefs() const
Get the number of defined variables.
Definition: AMPLInterface.cpp:1470
void writeSolution(Minotaur::ConstSolutionPtr sol, Minotaur::SolveStatus status)
Write the solution to the AMPL acceptable .sol file.
Definition: AMPLInterface.cpp:2609
ReaderType getReaderType()
What kind of reader from ASL was used to read the .nl file.
Definition: AMPLInterface.cpp:1920
CNode denotes a node in the computational graph. It stores the op-code, children, parents and other a...
Definition: CNode.h:48
Definition: Environment.h:28
The base class linear function is of the form c'x.
Definition: LinearFunction.h:31
PolynomialFunction represents functions of the form , where is a MonomialFunction.
Definition: PolynomialFunction.h:160
Definition: QuadraticFunction.h:38
Definition: Solution.h:30
Definition: ActiveNodeStore.h:20
ProblemType
The different classes of problems.
Definition: Types.h:44
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
FunctionType
Different types of functions in Minotaur.
Definition: Types.h:65
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158