Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef INCLUDE_OPTIONS
00010 #define INCLUDE_OPTIONS
00011
00012 #include "mex.h"
00013 #include "iterate.hpp"
00014 #include "ipoptoptions.hpp"
00015
00016
00017
00018
00019 class Options {
00020 public:
00021
00022
00023
00024
00025
00026 Options (const Iterate& x, Ipopt::IpoptApplication& app,
00027 const mxArray* ptr);
00028
00029
00030 ~Options();
00031
00032
00033 friend int numvars (const Options& options) { return options.n; };
00034 friend int numconstraints (const Options& options) { return options.m; };
00035
00036
00037 const double* lowerbounds () const { return lb; };
00038 const double* upperbounds () const { return ub; };
00039 const double* constraintlb() const { return cl; };
00040 const double* constraintub() const { return cu; };
00041
00042
00043 const mxArray* getAuxData() const { return auxdata; };
00044
00045
00046 const IpoptOptions ipoptOptions() const { return ipopt; };
00047
00048
00049 const double* multlb () const { return zl; };
00050 const double* multub () const { return zu; };
00051 const double* multconstr() const { return lambda; };
00052
00053 protected:
00054 int n;
00055 int m;
00056 double* lb;
00057 double* ub;
00058 double* cl;
00059 double* cu;
00060 double* zl;
00061 double* zu;
00062 double* lambda;
00063 const mxArray* auxdata;
00064 IpoptOptions ipopt;
00065
00066
00067 static double* loadLowerBounds (int n, const mxArray* ptr,
00068 double neginfty);
00069 static double* loadUpperBounds (int n, const mxArray* ptr,
00070 double posinfty);
00071 static int loadConstraintBounds (const mxArray* ptr, double*& cl,
00072 double*& cu, double neginfty,
00073 double posinfty);
00074 static void loadMultipliers (int n, int m, const mxArray* ptr,
00075 double*& zl, double*& zu,
00076 double*& lambda);
00077 };
00078
00079 #endif