Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_warmstart_basis.hpp
Go to the documentation of this file.
1// Copyright (C) 2000, International Business Machines
2// Corporation and others. All Rights Reserved.
3#ifndef _BCP_WARMSTART_BASIS_H
4#define _BCP_WARMSTART_BASIS_H
5
6#include "BCP_warmstart.hpp"
8
9/* NOTE:
10 Doxygen gracefully generates description for all inherited methods if they
11 are not documented here. So the virtual methods are documented ONLY if they
12 have something additional to say.
13*/
14
15//#############################################################################
16
23
24class BCP_warmstart_basis : public BCP_warmstart {
25private:
27 BCP_warmstart_basis& operator=(const BCP_warmstart_basis&);
28
32 BCP_warmstart_basis() :
33 _var_stat(BCP_Storage_WrtParent), _cut_stat(BCP_Storage_WrtParent) {}
34
35private:
37 BCP_vec_change<char> _var_stat;
39 BCP_vec_change<char> _cut_stat;
40
41public:
45 BCP_warmstart_basis(BCP_buffer& buf) : _var_stat(buf), _cut_stat(buf) {}
50 BCP_warmstart_basis(const char* vfirst, const char* vlast,
51 const char* cfirst, const char* clast) :
52 _var_stat(vfirst, vlast), _cut_stat(cfirst, clast) {}
53
54 BCP_warmstart_basis(const BCP_warmstart_basis& ws) :
55 _var_stat(ws._var_stat), _cut_stat(ws._cut_stat) {}
56
59
60 // Inherited methods --------------------------------------------------------
61
66
67 virtual BCP_storage_t storage() const;
68
69 virtual BCP_warmstart* clone() const {
70 return new BCP_warmstart_basis(*this);
71 }
72
73 virtual BCP_warmstart* empty_wrt_this() const {
74 // The default constructor creates an empty WrtParent warmstart info
75 // (i.e., no change wrt the parent)
76 return new BCP_warmstart_basis();
77 }
78
79 virtual int storage_size() const {
80 return _var_stat.storage_size() + _cut_stat.storage_size();
81 }
82
83 virtual void update(const BCP_warmstart* const change);
84
85 virtual BCP_warmstart* as_change(const BCP_warmstart* const old_ws,
86 const BCP_vec<int>& del_vars,
87 const BCP_vec<int>& del_cuts,
88 const double petol,
89 const double detol) const;
90
91 // Not inherited methods ----------------------------------------------------
92
94 void pack(BCP_buffer& buf) const {
95 _var_stat.pack(buf);
96 _cut_stat.pack(buf);
97 }
98};
99
100#endif
BCP_storage_t
This enumerative constant describes how to store certain data for a search tree node.
Definition BCP_enum.hpp:84
@ BCP_Storage_WrtParent
The data stored is with respect to the same kind of data in the parent of the search tree node.
Definition BCP_enum.hpp:91
This class describes the message buffer used for all processes of BCP.
This class stores a vector explicitly or relatively to another vector.
The class BCP_vec serves the same purpose as the vector class in the standard template library.
virtual BCP_warmstart * clone() const
Make a replica of the current warmstart information.
virtual BCP_storage_t storage() const
Return how the warmstarting info is stored.
BCP_warmstart_basis(const char *vfirst, const char *vlast, const char *cfirst, const char *clast)
Create an explicitly stored warmstart info by considering the two character arrays ([vfirst,...
virtual CoinWarmStart * convert_to_CoinWarmStart() const
Return an CoinwarmStart object that can be fed to the LP engine.
BCP_warmstart_basis(const BCP_warmstart_basis &ws)
Copy constructor.
BCP_warmstart_basis(BCP_buffer &buf)
Create the object by unpacking it from a buffer.
void pack(BCP_buffer &buf) const
Pack the warmstart info into a buffer.
virtual void update(const BCP_warmstart *const change)
Update the current data with the one in the argument.
virtual BCP_warmstart * as_change(const BCP_warmstart *const old_ws, const BCP_vec< int > &del_vars, const BCP_vec< int > &del_cuts, const double petol, const double detol) const
Return a pointer to a warmstart info describing the currently stored data as a change with respect to...
virtual int storage_size() const
Return how much memory it'll take to pack this warmstart info.
virtual BCP_warmstart * empty_wrt_this() const
Create a warmstart info describing that no change should be done.
Warmstarting information for the LP solver.