Loading...
Searching...
No Matches
gamsequation.h
1/*
2 * GAMS - General Algebraic Modeling System C++ API
3 *
4 * Copyright (c) 2017-2023 GAMS Software GmbH <support@gams.com>
5 * Copyright (c) 2017-2023 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 GAMSEQUATION_H
27#define GAMSEQUATION_H
28
29#include "gamssymbol.h"
30#include "gamsequationrecord.h"
31
32namespace gams {
33
36class LIBSPEC GAMSEquation : public GAMSSymbol
37{
38public:
39
41
44
47 GAMSEquation(const GAMSSymbol &other);
48
51
55
59
64
68 GAMSEquationRecord firstRecord(const std::vector<std::string>& slice);
69
73
77 GAMSEquationRecord firstRecord(const std::string& key1);
78
83 GAMSEquationRecord firstRecord(const std::string& key1, const std::string& key2);
84
90 GAMSEquationRecord firstRecord(const std::string& key1, const std::string& key2, const std::string& key3);
91
95 GAMSEquationRecord lastRecord(const std::vector<std::string>& slice);
96
100
104 GAMSEquationRecord lastRecord(const std::string& key1);
105
110 GAMSEquationRecord lastRecord(const std::string& key1, const std::string& key2);
111
117 GAMSEquationRecord lastRecord(const std::string& key1, const std::string& key2, const std::string& key3);
118
122 GAMSEquationRecord addRecord(const std::vector<std::string>& keys);
123
127
131 GAMSEquationRecord addRecord(const std::string& key1);
132
137 GAMSEquationRecord addRecord(const std::string& key1, const std::string& key2);
138
144 GAMSEquationRecord addRecord(const std::string& key1, const std::string& key2, const std::string& key3);
145
149 GAMSEquationRecord findRecord(const std::vector<std::string>& keys);
150
154
158 GAMSEquationRecord findRecord(const std::string& key1);
159
164 GAMSEquationRecord findRecord(const std::string& key1, const std::string& key2);
165
171 GAMSEquationRecord findRecord(const std::string& key1, const std::string& key2, const std::string& key3);
172
176 GAMSEquationRecord mergeRecord(const std::vector<std::string>& keys);
177
181
185 GAMSEquationRecord mergeRecord(const std::string& key1);
186
191 GAMSEquationRecord mergeRecord(const std::string& key1, const std::string& key2);
192
198 GAMSEquationRecord mergeRecord(const std::string& key1, const std::string& key2, const std::string& key3);
199
202
203private:
204 friend class GAMSDatabaseImpl;
205 friend class GAMSSymbolIter<GAMSEquation>;
206
207 GAMSEquation(GAMSDatabase& database, void *symPtr, int dim, std::string name, std::string text
208 , GAMSEnum::EquType eqType);
209
210 GAMSEquation(GAMSDatabase& database, const std::string& name, const int dim, const std::string& text
211 , GAMSEnum::EquType equType);
212
213 GAMSEquation(GAMSDatabase& database, const std::string& name, const std::string& text
214 , const std::vector<GAMSDomain>& domains, GAMSEnum::EquType equType);
215};
216
217} // namespace gams
218
219#endif // GAMSEQUATION_H
EquType
Equation subtype.
Definition: gamsenum.h:58
This class represents a single record of a GAMSEquation.
GAMSEquationRecord mergeRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSEquationRecord findRecord(const std::string &key1, const std::string &key2)
GAMSEquationRecord addRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSymbolIter< GAMSEquation > begin()
GAMSEquationRecord lastRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSEquation(const GAMSSymbol &other)
GAMSEquationRecord lastRecord(const std::string &key1, const std::string &key2)
GAMSEquationRecord findRecord(const std::vector< std::string > &keys)
GAMSEquationRecord firstRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSEquationRecord mergeRecord(const std::string &key1)
GAMSEquation()
Standard constructor.
Definition: gamsequation.h:43
GAMSEquationRecord lastRecord(const std::vector< std::string > &slice)
~GAMSEquation()
Destructor.
GAMSSymbolIter< GAMSEquation > end()
GAMSEquationRecord findRecord()
GAMSEquationRecord addRecord(const std::string &key1)
GAMSEnum::EquType equType()
Retrieve subtype of Equation (E: Equal, G: Greater, L: Less, N: No specification, X: External defined...
GAMSEquationRecord lastRecord()
GAMSEquationRecord findRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSEquationRecord addRecord(const std::string &key1, const std::string &key2)
GAMSEquationRecord mergeRecord()
GAMSEquationRecord lastRecord(const std::string &key1)
GAMSEquationRecord firstRecord(const std::string &key1, const std::string &key2)
GAMSEquationRecord mergeRecord(const std::vector< std::string > &keys)
GAMSEquationRecord firstRecord(const std::string &key1)
GAMSEquationRecord addRecord()
GAMSEquationRecord findRecord(const std::string &key1)
GAMSEquationRecord firstRecord()
GAMSEquation & operator=(const GAMSEquation &other)
GAMSEquationRecord mergeRecord(const std::string &key1, const std::string &key2)
GAMSEquationRecord addRecord(const std::vector< std::string > &keys)
GAMSEquationRecord firstRecord(const std::vector< std::string > &slice)
Definition: gams.h:91