Ipopt
3.11.4
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
contrib
MatlabInterface
src
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
Generated on Mon Oct 21 2013 19:08:14 for Ipopt by
1.8.4