MCF1.cpp
Go to the documentation of this file.
1 #include "MCF1_par.hpp"
2 #include "MCF1_init.hpp"
3 #include "MCF1_tm.hpp"
4 #include "MCF1_lp.hpp"
5 
6 using std::make_pair;
7 
8 //#############################################################################
9 
10 int main(int argc, char* argv[])
11 {
12  MCF1_init init;
13  return bcp_main(argc, argv, &init);
14 }
15 
16 //#############################################################################
17 
18 template <>
20 {
21  // Create the list of keywords for parameter file reading
22  keys.push_back(make_pair(BCP_string("MCF1_AddDummySourceSinkArcs"),
23  BCP_parameter(BCP_CharPar, AddDummySourceSinkArcs)));
24  keys.push_back(make_pair(BCP_string("MCF1_InputFilename"),
25  BCP_parameter(BCP_StringPar, InputFilename)));
26 }
27 
28 template <>
30 {
31  set_entry(InputFilename, "small");
32  set_entry(AddDummySourceSinkArcs, true);
33 }
34 
35 //#############################################################################
36 
38 {
39  return new MCF1_init;
40 }
41 
42 /*---------------------------------------------------------------------------*/
43 
46 {
47  return new MCF1_packer;
48 }
49 
50 /*---------------------------------------------------------------------------*/
51 
54  const int argnum, const char * const * arglist)
55 {
56  MCF1_tm* tm = new MCF1_tm;
57  tm->par.read_from_arglist(argnum, arglist);
58  std::ifstream ifs(tm->par.entry(MCF1_par::InputFilename).c_str());
59  tm->data.readDimacsFormat(ifs,
61  return tm;
62 }
63 
64 /*---------------------------------------------------------------------------*/
65 
68 {
69  return new MCF1_lp;
70 }
virtual BCP_user_pack * packer_init(BCP_user_class *p)
Definition: MCF1.cpp:45
BCP_parameter_set< MCF1_par > par
Definition: MCF1_tm.hpp:30
Character parameter.
void create_keyword_list()
Method for creating the list of keyword looked for in the parameter file.
int main(int argc, char *argv[])
Definition: BB_tm.cpp:32
char entry(const chr_params key) const
virtual BCP_lp_user * lp_init(BCP_lp_prob &p)
Definition: MCF1.cpp:67
NO OLD DOC.
Definition: BCP_lp.hpp:102
void set_default_entries()
Method for setting the default values for the parameters.
void read_from_arglist(const int argnum, const char *const *arglist)
Simply invoke reading from a stream.
BCP_vec< std::pair< BCP_string, BCP_parameter > > keys
The keyword, parameter pairs.
This class is a very simple impelementation of a constant length string.
Definition: BCP_string.hpp:13
String parameter.
void push_back(const_reference x)
Append x to the end of the vector.
The BCP_lp_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_lp_user.hpp:75
USER_initialize * BCP_user_init()
Definition: MC_init.cpp:15
int bcp_main(int argc, char *argv[], USER_initialize *user_init)
This is the function the user must invoke when (s)he is ready to turn contrl over to BCP...
Definition: BCP_tm_main.cpp:37
This class is an abstract base class for the initializer class the user has to provide.
Definition: BCP_USER.hpp:160
int readDimacsFormat(std::istream &s, bool addDummyArcs)
Definition: MCF1_data.cpp:63
void set_entry(const chr_params key, const char val)
MCF1_data data
Definition: MCF1_tm.hpp:31
NO OLD DOC.
Definition: BCP_tm.hpp:136
This parameter indeintifies a single parameter entry.
The BCP_tm_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_tm_user.hpp:58
virtual BCP_tm_user * tm_init(BCP_tm_prob &p, const int argnum, const char *const *arglist)
Definition: MCF1.cpp:53