source: trunk/Cbc/src/CbcGenCbcParam.cpp @ 2464

Last change on this file since 2464 was 2464, checked in by unxusr, 10 months ago

.clang-format with proposal for formatting code

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