Ipopt
trunk
|
00001 // Copyright (C) 2008 Peter Carbonetto. All Rights Reserved. 00002 // This code is published under the Eclipse Public License. 00003 // 00004 // Author: Peter Carbonetto 00005 // Dept. of Computer Science 00006 // University of British Columbia 00007 // September 25, 2008 00008 00009 #ifndef INCLUDE_MATLABINFO 00010 #define INCLUDE_MATLABINFO 00011 00012 #include "mex.h" 00013 #include "IpIpoptApplication.hpp" 00014 00015 using Ipopt::ApplicationReturnStatus; 00016 00017 // Class MatlabInfo. 00018 // ----------------------------------------------------------------- 00019 // An object of this class stores all the information we will pass 00020 // back to MATLAB upon termination of IPOPT. 00021 class MatlabInfo { 00022 public: 00023 00024 // Create a new info object and store the information in a MATLAB 00025 // array. The input pointer will point to the the newly created 00026 // MATLAB array. Since the user has an opportunity to modify the 00027 // MATLAB array pointed to by "ptr", we do not destroy the array 00028 // when the MatlabInfo object is destroyed. It is up to the user to 00029 // do that. 00030 explicit MatlabInfo (mxArray*& ptr); 00031 00032 // The destructor. 00033 ~MatlabInfo() { }; 00034 00035 // Access and modify the exit status and solution statistics. 00036 ApplicationReturnStatus getExitStatus () const; 00037 void setExitStatus (ApplicationReturnStatus status); 00038 void setIterationCount (int iter); 00039 void setFuncEvals(int obj, int con, int grad, int jac, int hess); 00040 void setCpuTime (double cpu); 00041 00042 // Access and modify the Lagrange multipliers. 00043 const double* getmultlb () const; 00044 const double* getmultub () const; 00045 const double* getmultconstr () const; 00046 void setmultlb (int n, const double* zl); 00047 void setmultub (int n, const double* zu); 00048 void setmultconstr (int m, const double* lambda); 00049 00050 protected: 00051 mxArray* ptr; // All the information is stored in a MATLAB array. 00052 }; 00053 00054 #endif