Loading...
Searching...
No Matches
gamsset.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 GAMSSET_H
27#define GAMSSET_H
28
29#include "gamssymbol.h"
30#include "gamssetrecord.h"
31
32namespace gams {
33
36class LIBSPEC GAMSSet : public GAMSSymbol
37{
38public:
40
43
46 GAMSSet(const GAMSSymbol& other);
47
50
55
59
63
67 GAMSSet& operator=(const GAMSSet& other);
68
72 GAMSSetRecord firstRecord(const std::vector<std::string>& slice);
73
77
81 GAMSSetRecord firstRecord(const std::string& key1);
82
87 GAMSSetRecord firstRecord(const std::string& key1, const std::string& key2);
88
94 GAMSSetRecord firstRecord(const std::string& key1, const std::string& key2, const std::string& key3);
95
99 GAMSSetRecord lastRecord(const std::vector<std::string>& slice);
100
104
108 GAMSSetRecord lastRecord(const std::string& key1);
109
114 GAMSSetRecord lastRecord(const std::string& key1, const std::string& key2);
115
121 GAMSSetRecord lastRecord(const std::string& key1, const std::string& key2, const std::string& key3);
122
126 GAMSSetRecord findRecord(const std::vector<std::string>& keys);
127
131
135 GAMSSetRecord findRecord(const std::string& key1);
136
141 GAMSSetRecord findRecord(const std::string& key1, const std::string& key2);
142
148 GAMSSetRecord findRecord(const std::string& key1, const std::string& key2, const std::string& key3);
149
153 GAMSSetRecord mergeRecord(const std::vector<std::string>& keys);
154
158
162 GAMSSetRecord mergeRecord(const std::string& key1);
163
168 GAMSSetRecord mergeRecord(const std::string& key1, const std::string& key2);
169
175 GAMSSetRecord mergeRecord(const std::string& key1, const std::string& key2, const std::string& key3);
176
180 GAMSSetRecord addRecord(const std::vector<std::string>& keys);
181
185
189 GAMSSetRecord addRecord(const std::string& key1);
190
195 GAMSSetRecord addRecord(const std::string& key1, const std::string& key2);
196
202 GAMSSetRecord addRecord(const std::string& key1, const std::string& key2, const std::string& key3);
203
204private:
205 friend class GAMSDatabaseImpl;
206 friend class GAMSSymbolImpl;
207 friend class GAMSSymbolIter<GAMSSet>;
208 GAMSSet(GAMSDatabase& database, void* symPtr);
209 GAMSSet(GAMSDatabase& database, void* symPtr, int dim, std::string name, std::string text);
210 GAMSSet(GAMSDatabase& database, const std::string& name, const int dim, const std::string& text,
211 GAMSEnum::SetType setType = GAMSEnum::SetType::Multi);
212 GAMSSet(GAMSDatabase& database, const std::string& name, const std::string& text,
213 const std::vector<GAMSDomain>& domains, GAMSEnum::SetType setType = GAMSEnum::SetType::Multi);
214};
215
216} // namespace gams
217
218#endif // GAMSSET_H
SetType
Set subtype.
Definition: gamsenum.h:73
This is the representation of a single record of a GAMSSet.
Definition: gamssetrecord.h:37
GAMSSetRecord mergeRecord(const std::string &key1, const std::string &key2)
GAMSSetRecord lastRecord(const std::string &key1, const std::string &key2)
GAMSSetRecord mergeRecord()
GAMSSet(const GAMSSymbol &other)
GAMSSetRecord mergeRecord(const std::string &key1)
GAMSSetRecord findRecord()
GAMSSetRecord firstRecord()
GAMSSetRecord lastRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSetRecord firstRecord(const std::string &key1, const std::string &key2)
GAMSSetRecord addRecord(const std::string &key1)
GAMSSetRecord addRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSetRecord lastRecord(const std::vector< std::string > &slice)
GAMSSetRecord addRecord()
GAMSSetRecord lastRecord()
GAMSSymbolIter< GAMSSet > end()
GAMSSetRecord addRecord(const std::string &key1, const std::string &key2)
GAMSSetRecord findRecord(const std::vector< std::string > &keys)
GAMSSymbolIter< GAMSSet > begin()
GAMSSetRecord mergeRecord(const std::vector< std::string > &keys)
GAMSSetRecord mergeRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSetRecord firstRecord(const std::vector< std::string > &slice)
GAMSSet()
Standard constructor.
GAMSSetRecord lastRecord(const std::string &key1)
GAMSSetRecord firstRecord(const std::string &key1)
GAMSSetRecord firstRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSetRecord findRecord(const std::string &key1, const std::string &key2, const std::string &key3)
GAMSSetRecord findRecord(const std::string &key1)
GAMSEnum::SetType setType()
~GAMSSet()
Destructor.
GAMSSetRecord findRecord(const std::string &key1, const std::string &key2)
GAMSSet & operator=(const GAMSSet &other)
GAMSSetRecord addRecord(const std::vector< std::string > &keys)
Definition: gams.h:91