source: branches/sandbox/Cbc/src/CbcGenParam.cpp @ 1389

Last change on this file since 1389 was 1374, checked in by bjarni, 10 years ago

Renamed all CbcGenXXXX.cpp_lou back to CbcGenXXXX.cpp (same for .hpp) after reorganizing the CbcParam? and CbcSolver? files

File size: 3.2 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
23namespace {
24
25char svnid[] = "$Id: CbcGenParam.cpp 1173 2009-06-04 09:44:10Z forrest $" ;
26
27}
28
29/*
30  Constructors and destructors
31
32  There's a generic constructor and one for integer, double, keyword, string,
33  and action parameters.
34*/
35
36/*
37  Default constructor.
38*/
39CbcGenParam::CbcGenParam ()
40        : CoinParam(),
41        paramCode_(CbcGenParamCode(0)),
42        obj_(0)
43{
44    /* Nothing to be done here */
45}
46
47
48/*
49  Constructor for double parameter
50*/
51CbcGenParam::CbcGenParam (CbcGenParamCode code,
52                          std::string name, std::string help,
53                          double lower, double upper, double dflt,
54                          bool display)
55        : CoinParam(name, help, lower, upper, dflt, display),
56        paramCode_(code),
57        obj_(0)
58{
59    /* Nothing to be done here */
60}
61
62/*
63  Constructor for integer parameter
64*/
65CbcGenParam::CbcGenParam (CbcGenParamCode code,
66                          std::string name, std::string help,
67                          int lower, int upper, int dflt,
68                          bool display)
69        : CoinParam(name, help, lower, upper, dflt, display),
70        paramCode_(code),
71        obj_(0)
72{
73    /* Nothing to be done here */
74}
75
76/*
77  Constructor for keyword parameter.
78*/
79CbcGenParam::CbcGenParam (CbcGenParamCode code,
80                          std::string name, std::string help,
81                          std::string firstValue, int dflt,
82                          bool display)
83        : CoinParam(name, help, firstValue, dflt, display),
84        paramCode_(code),
85        obj_(0)
86{
87    /* Nothing to be done here */
88}
89
90/*
91  Constructor for string parameter.
92*/
93CbcGenParam::CbcGenParam (CbcGenParamCode code,
94                          std::string name, std::string help,
95                          std::string dflt,
96                          bool display)
97        : CoinParam(name, help, dflt, display),
98        paramCode_(code),
99        obj_(0)
100{
101    /* Nothing to be done here */
102}
103
104/*
105  Constructor for action parameter.
106*/
107CbcGenParam::CbcGenParam (CbcGenParamCode code,
108                          std::string name, std::string help,
109                          bool display)
110        : CoinParam(name, help, display),
111        paramCode_(code),
112        obj_(0)
113{
114    /* Nothing to be done here */
115}
116
117
118/*
119  Copy constructor.
120*/
121CbcGenParam::CbcGenParam (const CbcGenParam &orig)
122        : CoinParam(orig),
123        paramCode_(orig.paramCode_),
124        obj_(orig.obj_)
125{
126    /* Nothing to be done here */
127}
128
129/*
130  Clone
131*/
132
133CbcGenParam *CbcGenParam::clone ()
134{
135    return (new CbcGenParam(*this)) ;
136}
137
138CbcGenParam &CbcGenParam::operator= (const CbcGenParam & rhs)
139{
140    if (this != &rhs) {
141        CoinParam::operator=(rhs) ;
142
143        paramCode_ = rhs.paramCode_ ;
144        obj_ = rhs.obj_ ;
145    }
146
147    return *this ;
148}
149
150/*
151  Destructor
152*/
153CbcGenParam::~CbcGenParam ()
154{ /* Nothing more to do */ }
155
Note: See TracBrowser for help on using the repository browser.