BCP_lp_convert_OsiWarmStart.cpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 
4 #include "CoinWarmStartDual.hpp"
5 #include "CoinWarmStartPrimalDual.hpp"
6 #include "CoinWarmStartBasis.hpp"
7 
8 #include "BCP_lp_functions.hpp"
9 #include "BCP_warmstart_dual.hpp"
11 
13 BCP_lp_convert_CoinWarmStart(BCP_lp_prob& p, CoinWarmStart*& warmstart)
14 {
15  if (warmstart == NULL)
16  return NULL;
17 
18  {
19  const CoinWarmStartDual* ws =
20  dynamic_cast<const CoinWarmStartDual*>(warmstart);
21  if (ws != NULL) {
22  const int size = ws->size();
23  const double* dual = ws->dual();
24  BCP_warmstart* bcp_ws = new BCP_warmstart_dual(dual, dual+size);
25  delete warmstart;
26  warmstart = NULL;
27  return bcp_ws;
28  }
29  }
30 
31  {
32  const CoinWarmStartPrimalDual* ws =
33  dynamic_cast<const CoinWarmStartPrimalDual*>(warmstart);
34  if (ws != NULL) {
35  const int psize = ws->primalSize();
36  const int dsize = ws->dualSize();
37  const double* primal = ws->primal();
38  const double* dual = ws->dual();
39  BCP_warmstart* bcp_ws =
40  new BCP_warmstart_primaldual(primal, primal+psize, dual, dual+dsize);
41  delete warmstart;
42  warmstart = NULL;
43  return bcp_ws;
44  }
45  }
46 
47  {
48  const CoinWarmStartBasis* ws =
49  dynamic_cast<const CoinWarmStartBasis*>(warmstart);
50  if (ws != NULL) {
51  // *FIXME* : want to convert it to BCP_warmstart_basis
52  delete warmstart;
53  warmstart = NULL;
54  return NULL;
55  }
56  }
57 
58 
59  return NULL;
60 }
This class describes a warmstart information that consists solely of the dual vector.
BCP_warmstart * BCP_lp_convert_CoinWarmStart(BCP_lp_prob &p, CoinWarmStart *&ws)
NO OLD DOC.
Definition: BCP_lp.hpp:102
Warmstarting information for the LP solver.
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real * ws
This class describes a warmstart information that consists solely of the dual vector.