source: trunk/Cbc/src/CbcGenOsiParam.cpp @ 1464

Last change on this file since 1464 was 1464, checked in by stefan, 9 years ago

merge split branch into trunk; fix some examples

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