source: trunk/Cbc/src/CbcGenParam.cpp

Last change on this file was 2465, checked in by unxusr, 7 months ago

script to format sources

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