source: trunk/Cbc/src/CbcGenParam.cpp @ 1899

Last change on this file since 1899 was 1899, checked in by stefan, 5 years ago

fixup svn properties

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
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 code is licensed under the terms of the Eclipse Public License (EPL).
6
7  $Id: CbcGenParam.cpp 1899 2013-04-09 18:12:08Z stefan $
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 1899 2013-04-09 18:12:08Z stefan $" ;
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/*
54  Constructor for double parameter
55*/
56CbcGenParam::CbcGenParam (CbcGenParamCode 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*/
70CbcGenParam::CbcGenParam (CbcGenParamCode 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*/
84CbcGenParam::CbcGenParam (CbcGenParamCode 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*/
98CbcGenParam::CbcGenParam (CbcGenParamCode 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*/
112CbcGenParam::CbcGenParam (CbcGenParamCode 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/*
124  Copy constructor.
125*/
126CbcGenParam::CbcGenParam (const CbcGenParam &orig)
127        : CoinParam(orig),
128        paramCode_(orig.paramCode_),
129        obj_(orig.obj_)
130{
131    /* Nothing to be done here */
132}
133
134/*
135  Clone
136*/
137
138CbcGenParam *CbcGenParam::clone ()
139{
140    return (new CbcGenParam(*this)) ;
141}
142
143CbcGenParam &CbcGenParam::operator= (const CbcGenParam & rhs)
144{
145    if (this != &rhs) {
146        CoinParam::operator=(rhs) ;
147
148        paramCode_ = rhs.paramCode_ ;
149        obj_ = rhs.obj_ ;
150    }
151
152    return *this ;
153}
154
155/*
156  Destructor
157*/
158CbcGenParam::~CbcGenParam ()
159{ /* Nothing more to do */ }
160
Note: See TracBrowser for help on using the repository browser.