BonBqpdWarmStart.cpp
Go to the documentation of this file.
1 // (C) Copyright International Business Machines Corporation 2007
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Andreas Waechter, International Business Machines Corporation
7 // based on BonFilterWarmStart.cpp
8 //
9 // Date : 2007-08-03
10 
11 #include "BonBqpdWarmStart.hpp"
12 
13 
14 namespace Bonmin{
15 
16  BqpdWarmStart:: BqpdWarmStart(const fint xSize /*= 0*/,
17  const real* xArray /*= NULL*/,
18  const fint lamSize /*= 0*/,
19  const real* lamArray /*= NULL*/,
20  const fint lwsSize /*= 0*/,
21  const fint *lwsArray /*= NULL*/,
22  const fint istat[14] /*= def_istat*/)
23  :
24  CoinWarmStartPrimalDual(xSize, lamSize, xArray, lamArray),
25  CoinWarmStartBasis(),
26  lwsSize_(lwsSize),
27  lwsArray_(NULL),
28  empty_(false)
29  {
30  DBG_ASSERT(lwsSize > 0 || !lwsArray);
31  if (lwsSize_ > 0){
32  lwsArray_ = new fint[lwsSize];
33  DBG_ASSERT(lwsArray);
34  CoinCopyN(lwsArray, lwsSize, lwsArray_);
35  }
36  for(int i = 0 ; i < 14 ; i ++) {
37  istat_[i] = istat[i];
38  }
39  }
40 
41  /* Copy constructor */
43  :
44  CoinWarmStartPrimalDual(other),
45  CoinWarmStartBasis(other),
46  lwsSize_(other.lwsSize_),
47  lwsArray_(NULL),
48  empty_(other.empty_)
49  {
50  DBG_ASSERT(lwsSize_ > 0 || !lwsArray_);
51  if (lwsSize_ > 0){
52  lwsArray_ = new fint[lwsSize_];
53  DBG_ASSERT(other.lwsArray_);
54  CoinCopyN(other.lwsArray_, lwsSize_, lwsArray_);
55  }
56  for(int i = 0 ; i < 14 ; i ++) {
57  istat_[i] = other.istat_[i];
58  }
59  }
60 
62  {
63  delete [] lwsArray_;
64  }
65 
66  CoinWarmStartDiff *
67  BqpdWarmStart::generateDiff(const CoinWarmStart * const oldOne) const
68  {
69  throw CoinError("Method not implemented",
70  "generateDiffs",
71  "BqpdWarmStart");
72  return NULL;
73  }
74 
75 
76  void
77  BqpdWarmStart::applyDiff(const CoinWarmStartDiff * diff){
78 
79  throw CoinError("Method not implemented",
80  "applyDiff",
81  "BqpdWarmStart");
82  }
83 
84 void
86 {
87  CoinWarmStartPrimalDual::clear();
88  delete [] lwsArray_;
89 
90  lwsArray_ = NULL;
91 }
92 
94 BqpdWarmStart::def_istat[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
95 
96 
97 } /* End namespace Bonmin */
fint istat_[14]
Filter&#39;s istat (AW: I think we only need first entry)
static Bigint * diff(Bigint *a, Bigint *b)
Definition: OSdtoa.cpp:1120
fint lwsSize_
Size of fint lws array store.
FilterSolver::fint fint
BqpdWarmStart(const fint xSize=0, const real *xArray=NULL, const fint lamSize=0, const real *lamArray=NULL, const fint lwsSize=0, const fint *lwsArray=NULL, const fint istat[14]=def_istat)
Constructor.
Warm start for filter interface.
virtual ~BqpdWarmStart()
Destructor.
virtual void applyDiff(const CoinWarmStartDiff *const cswDiff)
Apply differences.
FilterSolver::real real
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real real fint real fint real char real fint fint fint * istat
fint * lwsArray_
fint lws array to store
fint lwsSize() const
Access to lws size.
static fint def_istat[14]
Default values for istat.
virtual CoinWarmStartDiff * generateDiff(const CoinWarmStart *const other) const
Generate differences.
FilterTypes::fint fint
Fortran type for integer used in filter.