- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.5.1/Ipopt/src/Interfaces/IpNLP.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2006 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Common Public License.
    00004 //
    00005 // $Id: IpNLP.hpp 949 2007-03-27 00:41:26Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPNLP_HPP__
    00010 #define __IPNLP_HPP__
    00011
    00012 #include "IpUtils.hpp"
    00013 #include "IpVector.hpp"
    00014 #include "IpSmartPtr.hpp"
    00015 #include "IpMatrix.hpp"
    00016 #include "IpSymMatrix.hpp"
    00017 #include "IpOptionsList.hpp"
    00018 #include "IpAlgTypes.hpp"
    00019 #include "IpReturnCodes.hpp"
    00020
    00021 namespace Ipopt
    00022 {
    00023   // forward declarations
    00024   class IpoptData;
    00025   class IpoptCalculatedQuantities;
    00026   class IteratesVector;
    00027
    00031   class NLP : public ReferencedObject
    00032   {
    00033   public:
    00037     NLP()
    00038     {}
    00039
    00041     virtual ~NLP()
    00042     {}
    00044
    00047     DECLARE_STD_EXCEPTION(USER_SCALING_NOT_IMPLEMENTED);
    00049
    00055     virtual bool ProcessOptions(const OptionsList& options,
    00056                                 const std::string& prefix)
    00057     {
    00058       return true;
    00059     }
    00060
    00064     virtual bool GetSpaces(SmartPtr<const VectorSpace>& x_space,
    00065                            SmartPtr<const VectorSpace>& c_space,
    00066                            SmartPtr<const VectorSpace>& d_space,
    00067                            SmartPtr<const VectorSpace>& x_l_space,
    00068                            SmartPtr<const MatrixSpace>& px_l_space,
    00069                            SmartPtr<const VectorSpace>& x_u_space,
    00070                            SmartPtr<const MatrixSpace>& px_u_space,
    00071                            SmartPtr<const VectorSpace>& d_l_space,
    00072                            SmartPtr<const MatrixSpace>& pd_l_space,
    00073                            SmartPtr<const VectorSpace>& d_u_space,
    00074                            SmartPtr<const MatrixSpace>& pd_u_space,
    00075                            SmartPtr<const MatrixSpace>& Jac_c_space,
    00076                            SmartPtr<const MatrixSpace>& Jac_d_space,
    00077                            SmartPtr<const SymMatrixSpace>& Hess_lagrangian_space)=0;
    00078
    00080     virtual bool GetBoundsInformation(const Matrix& Px_L,
    00081                                       Vector& x_L,
    00082                                       const Matrix& Px_U,
    00083                                       Vector& x_U,
    00084                                       const Matrix& Pd_L,
    00085                                       Vector& d_L,
    00086                                       const Matrix& Pd_U,
    00087                                       Vector& d_U)=0;
    00088
    00092     virtual bool GetStartingPoint(
    00093       SmartPtr<Vector> x,
    00094       bool need_x,
    00095       SmartPtr<Vector> y_c,
    00096       bool need_y_c,
    00097       SmartPtr<Vector> y_d,
    00098       bool need_y_d,
    00099       SmartPtr<Vector> z_L,
    00100       bool need_z_L,
    00101       SmartPtr<Vector> z_U,
    00102       bool need_z_U
    00103     )=0;
    00104
    00108     virtual bool GetWarmStartIterate(IteratesVector& warm_start_iterate)
    00109     {
    00110       return false;
    00111     }
    00113
    00117     virtual bool Eval_f(const Vector& x, Number& f) = 0;
    00118
    00119     virtual bool Eval_grad_f(const Vector& x, Vector& g_f) = 0;
    00120
    00121     virtual bool Eval_c(const Vector& x, Vector& c) = 0;
    00122
    00123     virtual bool Eval_jac_c(const Vector& x, Matrix& jac_c) = 0;
    00124
    00125     virtual bool Eval_d(const Vector& x, Vector& d) = 0;
    00126
    00127     virtual bool Eval_jac_d(const Vector& x, Matrix& jac_d) = 0;
    00128
    00129     virtual bool Eval_h(const Vector& x,
    00130                         Number obj_factor,
    00131                         const Vector& yc,
    00132                         const Vector& yd,
    00133                         SymMatrix& h) = 0;
    00135
    00144     virtual void FinalizeSolution(SolverReturn status,
    00145                                   const Vector& x, const Vector& z_L,
    00146                                   const Vector& z_U,
    00147                                   const Vector& c, const Vector& d,
    00148                                   const Vector& y_c, const Vector& y_d,
    00149                                   Number obj_value,
    00150                                   const IpoptData* ip_data,
    00151                                   IpoptCalculatedQuantities* ip_cq)
    00152     {}
    00153
    00169     virtual bool IntermediateCallBack(AlgorithmMode mode,
    00170                                       Index iter, Number obj_value,
    00171                                       Number inf_pr, Number inf_du,
    00172                                       Number mu, Number d_norm,
    00173                                       Number regularization_size,
    00174                                       Number alpha_du, Number alpha_pr,
    00175                                       Index ls_trials,
    00176                                       const IpoptData* ip_data,
    00177                                       IpoptCalculatedQuantities* ip_cq)
    00178     {
    00179       return true;
    00180     }
    00182
    00187     virtual void GetScalingParameters(
    00188       const SmartPtr<const VectorSpace> x_space,
    00189       const SmartPtr<const VectorSpace> c_space,
    00190       const SmartPtr<const VectorSpace> d_space,
    00191       Number& obj_scaling,
    00192       SmartPtr<Vector>& x_scaling,
    00193       SmartPtr<Vector>& c_scaling,
    00194       SmartPtr<Vector>& d_scaling) const
    00195     {
    00196       THROW_EXCEPTION(USER_SCALING_NOT_IMPLEMENTED,
    00197                       "You have set options for user provided scaling, but have"
    00198                       " not implemented GetScalingParameters in the NLP interface");
    00199     }
    00201
    00215     virtual void
    00216     GetQuasiNewtonApproximationSpaces(SmartPtr<VectorSpace>& approx_space,
    00217                                       SmartPtr<Matrix>& P_approx)
    00218     {
    00219       approx_space = NULL;
    00220       P_approx = NULL;
    00221     }
    00222
    00223   private:
    00233     NLP(const NLP&);
    00234
    00236     void operator=(const NLP&);
    00238   };
    00239
    00240 } // namespace Ipopt
    00241
    00242 #endif