Loading...
Searching...
No Matches
gamsvariable.h
1/*
2 * GAMS - General Algebraic Modeling System C++ API
3 *
4 * Copyright (c) 2017-2024 GAMS Software GmbH <support@gams.com>
5 * Copyright (c) 2017-2024 GAMS Development Corp. <support@gams.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26#ifndef GAMSVARIABLE_H
27#define GAMSVARIABLE_H
28
29#include "gamssymbol.h"
30#include "gamsvariablerecord.h"
31
32namespace gams {
33
36class LIBSPEC GAMSVariable : public GAMSSymbol
37{
38public:
40
43
46 GAMSVariable(const GAMSSymbol& other);
47
50
54
58
63
67 GAMSVariableRecord firstRecord(const std::vector<std::string>& slice);
68
72
76 GAMSVariableRecord firstRecord(const std::string& key1);
77
82 GAMSVariableRecord firstRecord(const std::string& key1, const std::string& key2);
83
89 GAMSVariableRecord firstRecord(const std::string& key1, const std::string& key2, const std::string& key3);
90
94 GAMSVariableRecord lastRecord(const std::vector<std::string>& slice);
95
99
103 GAMSVariableRecord lastRecord(const std::string& key1);
104
109 GAMSVariableRecord lastRecord(const std::string& key1, const std::string& key2);
110
116 GAMSVariableRecord lastRecord(const std::string& key1, const std::string& key2, const std::string& key3);
117
121 GAMSVariableRecord findRecord(const std::vector<std::string>& keys);
122
126
130 GAMSVariableRecord findRecord(const std::string& key1);
131
136 GAMSVariableRecord findRecord(const std::string& key1, const std::string& key2);
137
143 GAMSVariableRecord findRecord(const std::string& key1, const std::string& key2, const std::string& key3);
144
148 GAMSVariableRecord mergeRecord(const std::vector<std::string>& keys);
149
153
157 GAMSVariableRecord mergeRecord(const std::string& key1);
158
163 GAMSVariableRecord mergeRecord(const std::string& key1, const std::string& key2);
164
170 GAMSVariableRecord mergeRecord(const std::string& key1, const std::string& key2, const std::string& key3);
171
175 GAMSVariableRecord addRecord(const std::vector<std::string>& keys);
176
180
184 GAMSVariableRecord addRecord(const std::string& key1);
185
190 GAMSVariableRecord addRecord(const std::string& key1, const std::string& key2);
191
197 GAMSVariableRecord addRecord(const std::string& key1, const std::string& key2, const std::string& key3);
198
201
202private:
203 friend class GAMSDatabaseImpl;
204 friend class GAMSSymbolIter<GAMSVariable>;
205 GAMSVariable(GAMSDatabase& database, void* symPtr, int dim, std::string name, std::string text, GAMSEnum::VarType varType);
206 GAMSVariable(GAMSDatabase& database, const std::string& name, const int dim, const std::string& text, GAMSEnum::VarType varType);
207 GAMSVariable(GAMSDatabase& database, const std::string& name, const std::string& text, const std::vector<GAMSDomain>& domains, GAMSEnum::VarType varType);
208};
209
210} // namespace gams
211
212#endif // GAMSVARIABLE_H
VarType
Variable subtype.
Definition: gamsenum.h:83
This is the representation of a single record of a GAMSVariable.
GAMSVariableRecord lastRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSVariableRecord firstRecord(const std::string &key1, const std::string &key2)
GAMSVariableRecord firstRecord()
GAMSVariableRecord lastRecord()
GAMSVariableRecord mergeRecord(const std::string &key1, const std::string &key2)
GAMSVariableRecord addRecord(const std::string &key1, const std::string &key2)
GAMSVariableRecord findRecord()
GAMSVariableRecord findRecord(const std::vector< std::string > &keys)
~GAMSVariable()
Destructor.
GAMSVariableRecord addRecord(const std::vector< std::string > &keys)
GAMSVariableRecord addRecord()
GAMSVariableRecord lastRecord(const std::string &key1)
GAMSVariableRecord findRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSVariableRecord addRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSVariableRecord mergeRecord(const std::string &key1)
GAMSVariableRecord mergeRecord(const std::vector< std::string > &keys)
GAMSVariable & operator=(const GAMSVariable &other)
GAMSVariableRecord firstRecord(const std::vector< std::string > &slice)
GAMSVariableRecord firstRecord(const std::string &key1)
GAMSSymbolIter< GAMSVariable > end()
GAMSVariableRecord lastRecord(const std::vector< std::string > &slice)
GAMSVariable(const GAMSSymbol &other)
GAMSEnum::VarType varType()
Retrieve subtype of variable (Binary, Integer, Positive, Negative, Free, SOS1, SOS2,...
GAMSSymbolIter< GAMSVariable > begin()
GAMSVariableRecord addRecord(const std::string &key1)
GAMSVariableRecord findRecord(const std::string &key1, const std::string &key2)
GAMSVariableRecord mergeRecord()
GAMSVariableRecord findRecord(const std::string &key1)
GAMSVariableRecord lastRecord(const std::string &key1, const std::string &key2)
GAMSVariableRecord mergeRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSVariable()
Standard constructor.
GAMSVariableRecord firstRecord(const std::string &key1, const std::string &key2, const std::string &key3)
Definition: gams.h:91