- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.53.1/Vol/examples/Volume-LP/lp.h

Go to the documentation of this file.

    00001 #ifndef __LP_H__
    00002 #define __LP_H__
    00003
    00004 #include <cfloat>
    00005 #include <string>
    00006 #include <fstream>
    00007
    00008 #include "VolVolume.hpp"
    00009 #include "lpc.h"
    00010
    00011 using std::string;
    00012
    00013 //#############################################################################
    00014
    00015 // parameters controlled by the user
    00016 class LP_parms {
    00017 public:
    00018   string fdata; // file with the data
    00019   string dualfile; // file with an initial dual solution
    00020   string dual_savefile; // file to save final dual solution
    00021   string primal_savefile; // file to save primal integer solution
    00022   int h_iter; // number of times that the primal heuristic will be run
    00023   // after termination of the volume algorithm
    00024   double var_ub; // upper bound for the variables
    00025
    00026   LP_parms(const char* filename);
    00027   ~LP_parms() {}
    00028 };
    00029
    00030 //#############################################################################
    00031
    00032 class LP_data_and_hook : public VOL_user_hooks { // original data for LP
    00033 public:
    00034   VOL_lp lp_pb; // lp data
    00035   VOL_dvector rhs; // right hand side
    00036   VOL_ivector ix;   // best integer feasible solution so far
    00037   double      icost;  // value of best integer feasible solution
    00038 public:
    00039   LP_data_and_hook() : icost(DBL_MAX) {}
    00040   virtual ~LP_data_and_hook() {}
    00041
    00042  public:
    00043    // for all hooks: return value of -1 means that volume should quit
    00044    // compute reduced costs
    00045    int compute_rc(const VOL_dvector& u, VOL_dvector& rc);
    00046    // solve relaxed problem
    00047    int solve_subproblem(const VOL_dvector& u, const VOL_dvector& rc,
    00048                         double& lcost, VOL_dvector& x, VOL_dvector&v,
    00049                         double& pcost);
    00050   // primal heuristic
    00051    // return DBL_MAX in heur_val if feas sol wasn't/was found
    00052    int heuristics(const VOL_problem& p,
    00053                   const VOL_dvector& x, double& heur_val);
    00054 };
    00055
    00056 //#############################################################################
    00057
    00058 #endif