Minotaur 0.4.1
Docs for developers
AMPLNonlinearFunction.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
15#ifndef MINOTAURAMPLNONLINEARFUNCTION_H
16#define MINOTAURAMPLNONLINEARFUNCTION_H
17
18#include "asl.h"
19
20#include "NonlinearFunction.h"
21
22namespace MINOTAUR_AMPL {
23
32public:
33
36
47 bool is_in_obj);
48
49 // Not available.
51 cloneWithVars(Minotaur::VariableConstIterator vbeg,
52 int *err) const;
53
54 // Evaluate at a point. Base class function.
55 double eval(const double *x, int *error);
56
57 // Evaluate gradient at a point. Base class function.
58 void evalGradient(const double *x, double *grad_f,
59 int *error);
60
61 void evalHessian(const double mult, const double *x,
62 const Minotaur::LTHessStor *stor, double *values,
63 int *error);
64
65 // Not available.
67
68 // Not available.
70
71 // Not available.
72 void fillJac(const double *, double *, int *);
73
74 // Get variables used in this function. Base class method.
75 void getVars(Minotaur::VariableSet *);
76
77 // Multiply by a constant. Base class method.
78 void multiply(double c);
79
80 // Not available.
81 void prepJac(Minotaur::VarSetConstIter, Minotaur::VarSetConstIter);
82
92 void setVars(Minotaur::VarSetConstIterator vb,
93 Minotaur::VarSetConstIterator ve);
94
95 // Display the function. Base class method.
96 void write(std::ostream &out) const;
97
98private:
100 Minotaur::UInt nVars_;
101
103 Minotaur::UInt amplIndex_;
104
105 // pointer to ampl's asl.
106 ASL *myAsl_;
107
112 bool neg_;
113
115 bool isInObj_;
116}; // AMPLNonlinearFunction
117
119} // namespace
120
121#endif
122
Declare abstract base class NonlinearFunction.
Declare the AMPLNonlinearFunction class for setting up evaluation and derivatives of nonlinear Functi...
Definition: AMPLNonlinearFunction.h:31
void getVars(Minotaur::VariableSet *)
Get variables used in this function.
Definition: AMPLNonlinearFunction.cpp:120
void write(std::ostream &out) const
Display the nonlinear function.
Definition: AMPLNonlinearFunction.cpp:151
void finalHessStor(const Minotaur::LTHessStor *)
Finalize hessian preparation.
Definition: AMPLNonlinearFunction.cpp:108
void fillHessStor(Minotaur::LTHessStor *)
Fill sparsity of hessian into hessian storage.
Definition: AMPLNonlinearFunction.cpp:102
void evalGradient(const double *x, double *grad_f, int *error)
Evaluate and add gradient at a given point.
Definition: AMPLNonlinearFunction.cpp:73
void fillJac(const double *, double *, int *)
Evaluate and add gradient at a given point to the jacobian.
Definition: AMPLNonlinearFunction.cpp:114
void evalHessian(const double mult, const double *x, const Minotaur::LTHessStor *stor, double *values, int *error)
Evaluate and add hessian at a given point.
Definition: AMPLNonlinearFunction.cpp:94
void setVars(Minotaur::VarSetConstIterator vb, Minotaur::VarSetConstIterator ve)
Tell what variables are in this function.
Definition: AMPLNonlinearFunction.cpp:144
double eval(const double *x, int *error)
Evaluate the function at a given point x.
Definition: AMPLNonlinearFunction.cpp:53
void prepJac(Minotaur::VarSetConstIter, Minotaur::VarSetConstIter)
Prepare for evaluating sparse jacobian.
Definition: AMPLNonlinearFunction.cpp:137
Minotaur::NonlinearFunctionPtr cloneWithVars(Minotaur::VariableConstIterator vbeg, int *err) const
Make a clone using new variables.
Definition: AMPLNonlinearFunction.cpp:45
AMPLNonlinearFunction()
Default constructor.
Definition: AMPLNonlinearFunction.cpp:21
void multiply(double c)
Multiply by a constant.
Definition: AMPLNonlinearFunction.cpp:129
Base class for nonlinear functions.
Definition: NonlinearFunction.h:31
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
Definition: HessianOfLag.h:21

Minotaur source code documented by Doxygen 1.9.4 on Fri Apr 25 2025