Bonmin  1.8.7
BonIpoptWarmStart.hpp
Go to the documentation of this file.
1 // (C) Copyright International Business Machines Corporation, Carnegie Mellon University 2006
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Pierre Bonami, Carnegie Mellon University,
7 // Andreas Waechter, International Business Machines Corporation
8 //
9 // Date : 02/15/2006
10 
11 
12 #ifndef IpoptWarmStart_HPP
13 #define IpoptWarmStart_HPP
14 #include "CoinWarmStartBasis.hpp"
17 
18 
19 namespace Bonmin
20 {
21  class TMINLP2TNLP;
22 
47  public virtual CoinWarmStartPrimalDual, public virtual CoinWarmStartBasis
48  {
49  public:
50 
52  IpoptWarmStart(bool empty = 1, int numvars = 0, int numcont = 0);
57  IpoptWarmStart(int primal_size, int dual_size,
58  const double * primal, const double * dual);
60  IpoptWarmStart( const IpoptWarmStart &other, bool ownValues = 1);
64  virtual ~IpoptWarmStart();
65 
67  virtual CoinWarmStart *clone() const
68  {
69  return new IpoptWarmStart(*this,1);
70  }
71 
73  virtual CoinWarmStartDiff*
74  generateDiff(const CoinWarmStart *const oldCWS) const;
78  virtual void
79  applyDiff (const CoinWarmStartDiff *const cwsdDiff);
80 
83  {
84  return warm_starter_;
85  }
86 
88  void flushPoint();
89 
91  bool empty() const
92  {
93  return empty_;
94  }
95  private:
97  mutable Ipopt::SmartPtr<IpoptInteriorWarmStarter> warm_starter_;
99  bool empty_;
100  };
101 
102  //###########################################################################
103 
110  {
111  public:
112  friend class IpoptWarmStart;
117  warm_starter_(NULL)//(warm_starter)
118  {
120  }
124  warm_starter_(NULL /*other.warm_starter_*/) {}
125 
127  virtual ~IpoptWarmStartDiff() {}
128 
130  virtual CoinWarmStartDiff *clone() const
131  {
132  return new IpoptWarmStartDiff(*this);
133  }
134 
137  {
138  return warm_starter_;
139  }
140  void flushPoint();
141  private:
142 
145  };
146 
147 }
148 #endif
virtual CoinWarmStartDiff * clone() const
‘Virtual constructor’
Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter() const
Accessor to warm start information obecjt.
(C) Copyright International Business Machines Corporation 2007
IpoptWarmStart(bool empty=1, int numvars=0, int numcont=0)
Default constructor.
virtual ~IpoptWarmStart()
Abstract destructor.
IpoptWarmStartDiff(CoinWarmStartPrimalDualDiff *diff, Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter)
Useful constructor; takes over the data in diff.
Diff class for IpoptWarmStart.
void swap(CoinWarmStartPrimalDualDiff &rhs)
virtual CoinWarmStartDiff * generateDiff(const CoinWarmStart *const oldCWS) const
Generate the "differences" between two IpoptWarmStart.
Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter() const
Accessor to warm start information obecjt.
const double * dual() const
bool empty() const
Is this an empty warm start?
virtual CoinWarmStart * clone() const
‘Virtual constructor’
const double * primal() const
virtual ~IpoptWarmStartDiff()
Abstract destructor.
IpoptWarmStartDiff(const IpoptWarmStartDiff &other)
Copy constructor.
Class for storing warm start informations for Ipopt.
void flushPoint()
flush the starting point
virtual void applyDiff(const CoinWarmStartDiff *const cwsdDiff)
Apply 'differences' to an Ipopt warm start.