source: branches/devel/Cbc/src/CbcGenParam.cpp @ 591

Last change on this file since 591 was 591, checked in by lou, 13 years ago

Initial commit of cbc-generic source.

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/*
2  Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
3  and others.  All Rights Reserved.
4
5  This file is part of cbc-generic.
6*/
7
8#if defined(_MSC_VER)
9// Turn off compiler warning about long names
10#  pragma warning(disable:4786)
11#endif
12
13#include <string>
14#include <cassert>
15
16#include "CoinParam.hpp"
17
18#include "CbcModel.hpp"
19
20#include "CbcGenCtlBlk.hpp"
21#include "CbcGenParam.hpp"
22
23/*
24  Constructors and destructors
25
26  There's a generic constructor and one for integer, double, keyword, string,
27  and action parameters.
28*/
29
30/*
31  Default constructor.
32*/
33CbcGenParam::CbcGenParam () 
34  : CoinParam(),
35    paramCode_(CbcGenParamCode(0)),
36    obj_(0)
37{
38  /* Nothing to be done here */
39}
40
41
42/*
43  Constructor for double parameter
44*/
45CbcGenParam::CbcGenParam (CbcGenParamCode code,
46                          std::string name, std::string help,
47                          double lower, double upper, double dflt,
48                          bool display)
49  : CoinParam(name,help,lower,upper,dflt,display),
50    paramCode_(code),
51    obj_(0)
52{
53  /* Nothing to be done here */
54}
55
56/*
57  Constructor for integer parameter
58*/
59CbcGenParam::CbcGenParam (CbcGenParamCode code,
60                          std::string name, std::string help,
61                          int lower, int upper, int dflt,
62                          bool display)
63  : CoinParam(name,help,lower,upper,dflt,display),
64    paramCode_(code),
65    obj_(0)
66{
67  /* Nothing to be done here */
68}
69
70/*
71  Constructor for keyword parameter.
72*/
73CbcGenParam::CbcGenParam (CbcGenParamCode code,
74                          std::string name, std::string help,
75                          std::string firstValue, int dflt,
76                          bool display)
77  : CoinParam(name,help,firstValue,dflt,display),
78    paramCode_(code),
79    obj_(0)
80{
81  /* Nothing to be done here */
82}
83
84/*
85  Constructor for string parameter.
86*/
87CbcGenParam::CbcGenParam (CbcGenParamCode code,
88                          std::string name, std::string help,
89                          std::string dflt,
90                          bool display)
91  : CoinParam(name,help,dflt,display),
92    paramCode_(code),
93    obj_(0)
94{
95  /* Nothing to be done here */
96}
97
98/*
99  Constructor for action parameter.
100*/
101CbcGenParam::CbcGenParam (CbcGenParamCode code,
102                          std::string name, std::string help,
103                          bool display)
104  : CoinParam(name,help,display),
105    paramCode_(code),
106    obj_(0)
107{
108  /* Nothing to be done here */
109}
110
111
112/*
113  Copy constructor.
114*/
115CbcGenParam::CbcGenParam (const CbcGenParam &orig)
116  : CoinParam(orig),
117    paramCode_(orig.paramCode_),
118    obj_(orig.obj_)
119{
120  /* Nothing to be done here */
121}
122
123/*
124  Clone
125*/
126
127CbcGenParam *CbcGenParam::clone ()
128{
129  return (new CbcGenParam(*this)) ;
130}
131
132CbcGenParam &CbcGenParam::operator= (const CbcGenParam &rhs)
133{
134  if (this != &rhs)
135  { CoinParam::operator=(rhs) ;
136 
137    paramCode_ = rhs.paramCode_ ;
138    obj_ = rhs.obj_ ; }
139
140  return *this ; }
141
142/*
143  Destructor
144*/
145CbcGenParam::~CbcGenParam ()
146{ /* Nothing more to do */ }
147
Note: See TracBrowser for help on using the repository browser.