• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/build/buildd/coinor-ipopt-3.8.3/Ipopt/contrib/MatlabInterface/src/matlabinfo.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2008 Peter Carbonetto. All Rights Reserved.
00002 // This code is published under the Common 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                    setCpuTime (double cpu);
00040 
00041   // Access and modify the Lagrange multipliers.
00042   const double* getmultlb     () const;
00043   const double* getmultub     () const;
00044   const double* getmultconstr () const;
00045   void          setmultlb     (int n, const double* zl);
00046   void          setmultub     (int n, const double* zu);
00047   void          setmultconstr (int m, const double* lambda);
00048 
00049 protected:
00050   mxArray* ptr;  // All the information is stored in a MATLAB array.
00051 };
00052 
00053 #endif

Generated on Sat Oct 16 2010 02:54:49 by  doxygen 1.7.1