- Main Page
- Classes
- Files

- File List
- File Members

# src/Algorithm/IpIpoptNLP.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 Eclipse Public License.
    00004 //
    00005 // $Id: IpIpoptNLP.hpp 2594 2015-08-09 14:31:05Z stefan $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPIPOPTNLP_HPP__
    00010 #define __IPIPOPTNLP_HPP__
    00011
    00012 #include "IpNLP.hpp"
    00013 #include "IpJournalist.hpp"
    00014 #include "IpNLPScaling.hpp"
    00015
    00016 namespace Ipopt
    00017 {
    00018   // forward declarations
    00019   class IteratesVector;
    00020
    00028   class IpoptNLP : public ReferencedObject
    00029   {
    00030   public:
    00033     IpoptNLP(const SmartPtr<NLPScalingObject> nlp_scaling)
    00034         :
    00035         nlp_scaling_(nlp_scaling)
    00036     {}
    00037
    00039     virtual ~IpoptNLP()
    00040     {}
    00042
    00045     virtual bool Initialize(const Journalist& jnlst,
    00046                             const OptionsList& options,
    00047                             const std::string& prefix)
    00048     {
    00049       bool ret = true;
    00050       if (IsValid(nlp_scaling_)) {
    00051         ret = nlp_scaling_->Initialize(jnlst, options, prefix);
    00052       }
    00053       return ret;
    00054     }
    00055
    00059     DECLARE_STD_EXCEPTION(Eval_Error);
    00061
    00063     virtual bool InitializeStructures(SmartPtr<Vector>& x,
    00064                                       bool init_x,
    00065                                       SmartPtr<Vector>& y_c,
    00066                                       bool init_y_c,
    00067                                       SmartPtr<Vector>& y_d,
    00068                                       bool init_y_d,
    00069                                       SmartPtr<Vector>& z_L,
    00070                                       bool init_z_L,
    00071                                       SmartPtr<Vector>& z_U,
    00072                                       bool init_z_U,
    00073                                       SmartPtr<Vector>& v_L,
    00074                                       SmartPtr<Vector>& v_U
    00075                                      ) = 0;
    00076
    00078     virtual bool GetWarmStartIterate(IteratesVector& warm_start_iterate)=0;
    00079
    00083     virtual Number f(const Vector& x) = 0;
    00084
    00086     virtual SmartPtr<const Vector> grad_f(const Vector& x) = 0;
    00087
    00089     virtual SmartPtr<const Vector> c(const Vector& x) = 0;
    00090
    00092     virtual SmartPtr<const Matrix> jac_c(const Vector& x) = 0;
    00093
    00096     virtual SmartPtr<const Vector> d(const Vector& x) = 0;
    00097
    00099     virtual SmartPtr<const Matrix> jac_d(const Vector& x) = 0;
    00100
    00102     virtual SmartPtr<const SymMatrix> h(const Vector& x,
    00103                                         Number obj_factor,
    00104                                         const Vector& yc,
    00105                                         const Vector& yd
    00106                                        ) = 0;
    00107
    00109     virtual SmartPtr<const Vector> x_L() const = 0;
    00110
    00112     virtual SmartPtr<const Matrix> Px_L() const = 0;
    00113
    00115     virtual SmartPtr<const Vector> x_U() const = 0;
    00116
    00118     virtual SmartPtr<const Matrix> Px_U() const = 0;
    00119
    00121     virtual SmartPtr<const Vector> d_L() const = 0;
    00122
    00124     virtual SmartPtr<const Matrix> Pd_L() const = 0;
    00125
    00127     virtual SmartPtr<const Vector> d_U() const = 0;
    00128
    00130     virtual SmartPtr<const Matrix> Pd_U() const = 0;
    00131
    00133     virtual SmartPtr<const VectorSpace> x_space() const = 0;
    00134
    00137     virtual SmartPtr<const SymMatrixSpace> HessianMatrixSpace() const = 0;
    00139
    00141     virtual void GetSpaces(SmartPtr<const VectorSpace>& x_space,
    00142                            SmartPtr<const VectorSpace>& c_space,
    00143                            SmartPtr<const VectorSpace>& d_space,
    00144                            SmartPtr<const VectorSpace>& x_l_space,
    00145                            SmartPtr<const MatrixSpace>& px_l_space,
    00146                            SmartPtr<const VectorSpace>& x_u_space,
    00147                            SmartPtr<const MatrixSpace>& px_u_space,
    00148                            SmartPtr<const VectorSpace>& d_l_space,
    00149                            SmartPtr<const MatrixSpace>& pd_l_space,
    00150                            SmartPtr<const VectorSpace>& d_u_space,
    00151                            SmartPtr<const MatrixSpace>& pd_u_space,
    00152                            SmartPtr<const MatrixSpace>& Jac_c_space,
    00153                            SmartPtr<const MatrixSpace>& Jac_d_space,
    00154                            SmartPtr<const SymMatrixSpace>& Hess_lagrangian_space) = 0;
    00155
    00158     virtual void AdjustVariableBounds(const Vector& new_x_L,
    00159                                       const Vector& new_x_U,
    00160                                       const Vector& new_d_L,
    00161                                       const Vector& new_d_U)=0;
    00162
    00165     virtual Index f_evals() const = 0;
    00166     virtual Index grad_f_evals() const = 0;
    00167     virtual Index c_evals() const = 0;
    00168     virtual Index jac_c_evals() const = 0;
    00169     virtual Index d_evals() const = 0;
    00170     virtual Index jac_d_evals() const = 0;
    00171     virtual Index h_evals() const = 0;
    00173
    00183     virtual bool objective_depends_on_mu() const
    00184     {
    00185       return false;
    00186     }
    00187
    00190     virtual Number f(const Vector& x, Number mu) = 0;
    00191
    00194     virtual SmartPtr<const Vector> grad_f(const Vector& x, Number mu) = 0;
    00195
    00198     virtual SmartPtr<const SymMatrix> h(const Vector& x,
    00199                                         Number obj_factor,
    00200                                         const Vector& yc,
    00201                                         const Vector& yd,
    00202                                         Number mu) = 0;
    00203
    00207     virtual SmartPtr<const SymMatrix> uninitialized_h() = 0;
    00209
    00212     virtual void FinalizeSolution(SolverReturn status,
    00213                                   const Vector& x, const Vector& z_L, const Vector& z_U,
    00214                                   const Vector& c, const Vector& d,
    00215                                   const Vector& y_c, const Vector& y_d,
    00216                                   Number obj_value,
    00217                                   const IpoptData* ip_data,
    00218                                   IpoptCalculatedQuantities* ip_cq)=0;
    00219
    00220     virtual bool IntermediateCallBack(AlgorithmMode mode,
    00221                                       Index iter, Number obj_value,
    00222                                       Number inf_pr, Number inf_du,
    00223                                       Number mu, Number d_norm,
    00224                                       Number regularization_size,
    00225                                       Number alpha_du, Number alpha_pr,
    00226                                       Index ls_trials,
    00227                                       SmartPtr<const IpoptData> ip_data,
    00228                                       SmartPtr<IpoptCalculatedQuantities> ip_cq)=0;
    00230
    00232     SmartPtr<NLPScalingObject> NLP_scaling() const
    00233     {
    00234       DBG_ASSERT(IsValid(nlp_scaling_));
    00235       return nlp_scaling_;
    00236     }
    00237
    00238   private:
    00239
    00248
    00250     IpoptNLP(const IpoptNLP&);
    00251
    00253     void operator=(const IpoptNLP&);
    00255
    00256     SmartPtr<NLPScalingObject> nlp_scaling_;
    00257   };
    00258
    00259 } // namespace Ipopt
    00260
    00261 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines