build
coinor-vol-1.1.7
Vol
examples
Volume-LP
lp.h
Go to the documentation of this file.
1
#ifndef __LP_H__
2
#define __LP_H__
3
4
#include <cfloat>
5
#include <string>
6
#include <fstream>
7
8
#include "
VolVolume.hpp
"
9
#include "
lpc.h
"
10
11
using
std::string;
12
13
//#############################################################################
14
15
// parameters controlled by the user
16
class
LP_parms
{
17
public
:
18
string
fdata
;
// file with the data
19
string
dualfile
;
// file with an initial dual solution
20
string
dual_savefile
;
// file to save final dual solution
21
string
primal_savefile
;
// file to save primal integer solution
22
int
h_iter
;
// number of times that the primal heuristic will be run
23
// after termination of the volume algorithm
24
double
var_ub
;
// upper bound for the variables
25
26
LP_parms
(
const
char
* filename);
27
~LP_parms
() {}
28
};
29
30
//#############################################################################
31
32
class
LP_data_and_hook
:
public
VOL_user_hooks
{
// original data for LP
33
public
:
34
VOL_lp
lp_pb
;
// lp data
35
VOL_dvector
rhs
;
// right hand side
36
VOL_ivector
ix
;
// best integer feasible solution so far
37
double
icost
;
// value of best integer feasible solution
38
public
:
39
LP_data_and_hook
() : icost(DBL_MAX) {}
40
virtual
~LP_data_and_hook
() {}
41
42
public
:
43
// for all hooks: return value of -1 means that volume should quit
44
// compute reduced costs
45
int
compute_rc(
const
VOL_dvector
& u,
VOL_dvector
& rc);
46
// solve relaxed problem
47
int
solve_subproblem(
const
VOL_dvector
& u,
const
VOL_dvector
& rc,
48
double
& lcost,
VOL_dvector
& x,
VOL_dvector
&v,
49
double
& pcost);
50
// primal heuristic
51
// return DBL_MAX in heur_val if feas sol wasn't/was found
52
int
heuristics(
const
VOL_problem
& p,
53
const
VOL_dvector
& x,
double
& heur_val);
54
};
55
56
//#############################################################################
57
58
#endif
VOL_lp
Definition:
lpc.h:9
LP_data_and_hook::LP_data_and_hook
LP_data_and_hook()
Definition:
lp.h:39
VOL_ivector
vector of ints.
Definition:
VolVolume.hpp:237
LP_parms::fdata
string fdata
Definition:
lp.h:18
LP_data_and_hook::lp_pb
VOL_lp lp_pb
Definition:
lp.h:34
LP_parms::dual_savefile
string dual_savefile
Definition:
lp.h:20
LP_data_and_hook::rhs
VOL_dvector rhs
Definition:
lp.h:35
VOL_dvector
vector of doubles.
Definition:
VolVolume.hpp:143
LP_parms::~LP_parms
~LP_parms()
Definition:
lp.h:27
lpc.h
VOL_problem
This class holds every data for the Volume Algorithm and its solve method must be invoked to solve th...
Definition:
VolVolume.hpp:600
LP_parms::var_ub
double var_ub
Definition:
lp.h:24
LP_parms::LP_parms
LP_parms(const char *filename)
LP_parms::h_iter
int h_iter
Definition:
lp.h:22
VolVolume.hpp
LP_parms::dualfile
string dualfile
Definition:
lp.h:19
LP_data_and_hook::~LP_data_and_hook
virtual ~LP_data_and_hook()
Definition:
lp.h:40
LP_data_and_hook::icost
double icost
Definition:
lp.h:37
VOL_user_hooks
The user hooks should be overridden by the user to provide the problem specific routines for the volu...
Definition:
VolVolume.hpp:558
LP_parms::primal_savefile
string primal_savefile
Definition:
lp.h:21
LP_data_and_hook::ix
VOL_ivector ix
Definition:
lp.h:36
LP_data_and_hook
Definition:
lp.h:32
LP_parms
Definition:
lp.h:16
Generated by
1.8.13