Loading...
Searching...
No Matches
gams Namespace Reference

Classes

class  GAMSCheckpoint
 
class  GAMSDatabase
 
class  GAMSDatabaseDomainViolation
 This class describes a domain violation of a GAMSDatabase. More...
 
class  GAMSDatabaseIter
 
class  GAMSDomain
 This class represents a abstraction of GAMSSet objects and relaxed sets, i.e. strings. More...
 
class  GAMSEnum
 The collection of all common GAMS enumerations. More...
 
class  GAMSEquation
 
class  GAMSEquationRecord
 This class represents a single record of a GAMSEquation. More...
 
class  GAMSException
 Exception class thrown for GAMS exceptions. More...
 
class  GAMSExceptionExecution
 Exception class thrown for GAMS execution exceptions. More...
 
class  GAMSJob
 
class  GAMSModelInstance
 
class  GAMSModelInstanceOpt
 The GAMSModelInstanceOpt can be used to customize the GAMSModelInstance.solve() routine. More...
 
class  GAMSModifier
 
class  GAMSOptions
 
class  GAMSParameter
 
class  GAMSParameterRecord
 This is the representation of a single record of a GAMSParameter. More...
 
class  GAMSPath
 Represents the GAMS path to a specific file. More...
 
struct  GAMSPlatform
 Encapsulates all platform specific calls of the API. More...
 
class  GAMSSet
 
class  GAMSSetRecord
 This is the representation of a single record of a GAMSSet. More...
 
class  GAMSSymbol
 
class  GAMSSymbolDomainViolation
 This class describes a domain violation of a GAMSSymbol. More...
 
class  GAMSSymbolIter
 
class  GAMSSymbolRecord
 
class  GAMSVariable
 
class  GAMSVariableRecord
 This is the representation of a single record of a GAMSVariable. More...
 
class  GAMSVersion
 Represents the GAMS version information. More...
 
class  GAMSWorkspace
 
class  GAMSWorkspaceInfo
 The GAMSWorkspaceInfo can be used to input parameters for the GAMSWorkspace constructor. More...
 
class  GAMSWorkspacePool
 Manages a collection of all GAMS workspaces. More...
 
class  Logger
 Logging class used to get feedback about the API actions. More...
 
class  LoggerPool
 The class to manage all loggers used in an API instance. More...
 
class  SolverOptions
 Represents the solver options. More...
 

Detailed Description

GAMS C++ API

Copyright (c) 2017-2024 GAMS Software GmbH support@gams.com Copyright (c) 2017-2024 GAMS Development Corp. support@gams.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The GAMS namespace provides objects to interact with the General Algebraic Modeling System (GAMS). Objects in this namespace allow convenient exchange of input data and model results (GAMSDatabase), help to create and run GAMS models (GAMSJob), that can be customized by GAMS options (GAMSOptions). Furthermore, it introduces a way to solve a sequence of closely related model instances in the most efficient way (GAMSModelInstance).

The underlying GAMS engine relies to some extent on file based communication (e.g. the listing file) and other low-level resources. A GAMS program can include other source files (e.g. $include), load data from GDX files (e.g. $GDXIN or execute_load), and create PUT files. All these files can be specified with a (relative) path and therefore an anchor into the file system is required. The base class GAMSWorkspace manages the anchor to the file system. If external file communication is not an issue in a particular application, temporary directories and files will be managed by objects within the library.

With the exception of GAMSWorkspace the objects in the GAMS namespace cannot be accessed across different threads unless the instance is locked. The classes themself are thread safe and multiple objects of the class can be used from different threads (see below for restrictions on solvers that are not thread safe within the GAMSModelInstance class).

Note: If you use multiple instances of the GAMSWorkspace in parallel, you should avoid using the same WorkingDirectory. Otherwise you may end up with conflicting file names.

This version of the GAMS namespace lacks support for the following GAMS components:

Acronyms, support for GAMS compilation/execution errors (GAMSJob.Run just throws an exception), structured access to listing file, and proper support for solver options.

Currently only Cplex, Gurobi, ODHCplex, and SoPlex fully utilize the power of solving GAMSModelInstances, i.e. only communicate the changes from the previous model instance to the solver (model instance update versus complete new setup inside the solver) and perform a hot start. For quadratic model instances and instances with "exotic" features like indicator constraints, the instance update and hot start are not available. The solver will indicate this with the log message *** Hotstart failed! Falling back to cold start....

Some solvers will not work in a multi-threaded application using GAMSModelInstances. For some solvers this is unavoidable because the solver library is not thread safe (e.g. MINOS), other solvers are in principle thread safe but the GAMS link is not (e.g. LINDO). A table in the chapter "The Grid and Multi-Threading Solve Facility" provides an overview which solvers work in a multi-threaded application.

There are examples in C++ using this API in [GAMS system]\apifiles.

GAMS C++ API

Copyright (c) 2017-2024 GAMS Software GmbH support@gams.com Copyright (c) 2017-2024 GAMS Development Corp. support@gams.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.