Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
options.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008 Peter Carbonetto. All Rights Reserved.
2 // This code is published under the Eclipse Public License.
3 //
4 // Author: Peter Carbonetto
5 // Dept. of Computer Science
6 // University of British Columbia
7 // September 25, 2008
8
9 #ifndef INCLUDE_OPTIONS
10 #define INCLUDE_OPTIONS
11
12 #include "mex.h"
13 #include "iterate.hpp"
14 #include "ipoptoptions.hpp"
15
16 // Class Options.
17 // -----------------------------------------------------------------
18 // This class processes the options input from MATLAB.
19 class Options {
20 public:
21
22 // The constructor expects as input a point to a MATLAB array, in
23 // particular a structure array with the appropriate fields. Note
24 // that the Options object does *not* possess an independent copy of
25 // some of the MATLAB data (such as the auxiliary data).
26 Options (const Iterate& x, Ipopt::IpoptApplication& app,
27 const mxArray* ptr);
28
29 // The destructor.
30 ~Options();
31
32 // Get the number of variables and the number of constraints.
33 friend int numvars (const Options& options) { return options.n; };
34 friend int numconstraints (const Options& options) { return options.m; };
35
36 // Access the lower and upper bounds on the variables and constraints.
37 const double* lowerbounds () const { return lb; };
38 const double* upperbounds () const { return ub; };
39 const double* constraintlb() const { return cl; };
40 const double* constraintub() const { return cu; };
41
42 // Access the IPOPT options object.
43 const IpoptOptions ipoptOptions() const { return ipopt; };
44
45 // Access the Lagrange multpliers.
46 const double* multlb () const { return zl; };
47 const double* multub () const { return zu; };
48 const double* multconstr() const { return lambda; };
49
50 protected:
51 int n; // The number of optimization variables.
52 int m; // The number of constraints.
53 double* lb; // Lower bounds on the variables.
54 double* ub; // Upper bounds on the variables.
55 double* cl; // Lower bounds on constraints.
56 double* cu; // Upper bounds on constraints.
57 double* zl; // Lagrange multipliers for lower bounds.
58 double* zu; // Lagrange multipliers for upper bounds.
59 double* lambda; // Lagrange multipliers for constraints.
60 IpoptOptions ipopt; // The IPOPT options.
61
62 // These are helper functions used by the class constructor.
63 static double* loadLowerBounds (int n, const mxArray* ptr,
64 double neginfty);
65 static double* loadUpperBounds (int n, const mxArray* ptr,
66 double posinfty);
67 static int loadConstraintBounds (const mxArray* ptr, double*& cl,
68 double*& cu, double neginfty,
69 double posinfty);
70 static void loadMultipliers (int n, int m, const mxArray* ptr,
71 double*& zl, double*& zu,
72 double*& lambda);
73 };
74
75 #endif
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
iterate.hpp
Options::cl
double * cl
Definition: options.hpp:55
Options::m
int m
Definition: options.hpp:52
Options::lambda
double * lambda
Definition: options.hpp:59
Options::~Options
~Options()
Options::constraintub
const double * constraintub() const
Definition: options.hpp:40
ipoptoptions.hpp
Options::zu
double * zu
Definition: options.hpp:58
Options::upperbounds
const double * upperbounds() const
Definition: options.hpp:38
Options::ipoptOptions
const IpoptOptions ipoptOptions() const
Definition: options.hpp:43
Options::multlb
const double * multlb() const
Definition: options.hpp:46
Options::numvars
friend int numvars(const Options &options)
Definition: options.hpp:33
Options::multub
const double * multub() const
Definition: options.hpp:47
Options::loadMultipliers
static void loadMultipliers(int n, int m, const mxArray *ptr, double *&zl, double *&zu, double *&lambda)
Options::loadLowerBounds
static double * loadLowerBounds(int n, const mxArray *ptr, double neginfty)
IpoptOptions
Definition: ipoptoptions.hpp:19
Options::constraintlb
const double * constraintlb() const
Definition: options.hpp:39
Options::n
int n
Definition: options.hpp:48
Options
Definition: options.hpp:19
Options::ipopt
IpoptOptions ipopt
Definition: options.hpp:60
Options::loadUpperBounds
static double * loadUpperBounds(int n, const mxArray *ptr, double posinfty)
Options::lb
double * lb
Definition: options.hpp:53
Options::numconstraints
friend int numconstraints(const Options &options)
Definition: options.hpp:34
Iterate
Definition: iterate.hpp:31
Options::lowerbounds
const double * lowerbounds() const
Definition: options.hpp:37
Ipopt::IpoptApplication
This is the main application class for making calls to Ipopt.
Definition: IpIpoptApplication.hpp:47
Options::ub
double * ub
Definition: options.hpp:54
Options::Options
Options(const Iterate &x, Ipopt::IpoptApplication &app, const mxArray *ptr)
Options::cu
double * cu
Definition: options.hpp:56
Options::multconstr
const double * multconstr() const
Definition: options.hpp:48
Options::zl
double * zl
Definition: options.hpp:57
Options::loadConstraintBounds
static int loadConstraintBounds(const mxArray *ptr, double *&cl, double *&cu, double neginfty, double posinfty)