Release Notes


Changes for GAMSSymboland GAMSSymbolRecord: Both classes got the IEquatable<T> Interface. As a result the behavior of the Equals function as well as the == and != operators were modified. For both classes Equals and == returns now true, if the internal data reference is the same. Here is an example:

GAMSVariable x1 = t1.OutDB.GetVariable("x");
GAMSVariable x2 = t1.OutDB.GetVariable("x");
if(x1 == x2)
if (x1.Equals(x2))
Console.WriteLine("x1 equals x2");
Console.WriteLine("x1 does not equal x2");

In previous versions we got this output:

x1 does not equal x2

Now we get:

x1 equals x2


  • New functions GAMSWorkspace.AddJobFromApiLib, GAMSWorkspace.AddJobFromNoaLib to create GAMSJob from models from the GAMS API Library and the Nonlinear Optimization Applications Library


  • New option GAMSOptions.ErrorLog: Max error message lines written to the log for each error


  • GAMSModelInstance.Instantiate: Skip creation of GDX file, which was unreachable from within the API anyway


  • GAMSWorkspace.AddJobFromFile: Throw an exception if given file does not exist


  • Fixed a bug with the property GAMSOptions.IDir


  • Fixed a bug that lead to a crash on Linux (using Mono) when the GAMS system directory is a symbolic link


  • New functions GAMSWorkspace.ApiLib and GAMSWorkspace.NoaLib that can be used to retrieve models from the GAMS API Library and the Nonlinear Optimization Applications Library


  • New property GAMSSymbol.DomainsAsStrings: Domains of Symbol, each element is a string
    Note: If the domain is an alias in GAMS, this call will return the name of the Alias, not the name of the aliased Set
  • Disable unwanted debug output from Couenne when running with GAMSModelInstance


  • Modified handling of GAMS Aliases:
    • If we ask for the number of GAMSSymbols in a GAMSDatabase, the Aliases will be excluded
    • If we iterate over all GAMSSymbols in a GAMSDatabase, Aliases will be skipped
    • If we ask explicitly for an Alias in a GAMSDatabase (GAMSDatabase.GetSet("a") with a being an Alias) we will get a reference to the GAMSSet referenced by the Alias, not the Alias itself
    • Note: Aliases can appear in a GAMSDatabase only, if it was initialized by a GDX file containing an Alias.


  • Make more GAMS options available through the GAMSOptions class:
    • GAMSOptions.AppendExpand: Expand file append option
    • GAMSOptions.AppendOut: Output file append option
    • GAMSOptions.DumpOpt: Writes preprocessed input to the file input.dmp
    • GAMSOptions.DumpParms: GAMS parameter logging
    • GAMSOptions.ErrMsg: Placing of compilation error messages
    • GAMSOptions.Expand: Expanded (include) input file name
    • GAMSOptions.FErr: Alternative error message file
    • GAMSOptions.JobTrace: Job trace string to be written to the trace file at the end of a Gams job
    • GAMSOptions.LimCol: Maximum number of columns listed in one variable block
    • GAMSOptions.LimRow: Maximum number of rows listed in one equation block
    • GAMSOptions.LogLine: Amount of line tracing to the log file
    • GAMSOptions.On115: Generate errors for unknown unique element in an equation
    • GAMSOptions.Output: Output file
    • GAMSOptions.PageContr: Output file page control option
    • GAMSOptions.PageSize: Output file page size (=0 no paging)
    • GAMSOptions.PageWidth: Output file page width
    • GAMSOptions.Reference: Symbol reference file
    • GAMSOptions.ScriptExit: Program or script to be executed at the end of a GAMS run
    • GAMSOptions.Suppress: Compiler listing option
    • GAMSOptions.Symbol: Symbol table file
    • GAMSOptions.TraceLevel: Solvestat threshold used in conjunction with a=GT


  • GAMSJob.Run creates OutDB now even if it throws a GAMSExceptionExecution
  • New function GAMSSymbolRecord.Key(int index): Retrieve key of GAMSSymbolRecord on position index
  • GAMSModelInstance.Solve also works now for solvers which require a subsolver, e.g. Dicopt
  • GAMSDatabase.Export registers real domains in GDX file now if possible, before relaxed domains were registered always
  • GAMSSymbol.CopySymbol works for the Universe of a GAMSDatabase (GAMSDatabase.GetSet("*")) now, when copying into the Universe, a merge will be performed
  • Fix default value for systemDirectory argument in GAMSWorkspace constructor when using MONO: If no value is given, first the PATH and then the (DY)LD_LIBRARY_PATH is checked for a valid GAMS system directory


  • Fix memory leak in GAMSDatabase


  • Fixed a bug regarding the subtype of equations and their default records, when the equation was added to a GamsDatabase from the API
  • Fix GAMSEnum.GAMSExitCode
  • Make sure that GAMSModelInstance.Instantiate() does not solve the model, but only prepares everything required for the following Solve()


  • New version of function GAMSWorkspace.AddOptions creating an instance of GAMSOptions initialized by an existing option file
  • New properties: GAMSWorkspace.APIVersion, GAMSWorkspace.APIMajorRelNumber, GAMSWorkspace.APIMinorRelNumber and GAMSWorkspace.APIGOLDRelNumber
  • New property GAMSWorkspace.MyEPS: Reset value to be stored in and read from GAMSDatabase for Epsilon, default is double.Epsilon
  • New function GAMSOptions.Export: Write GAMSOptions into a parameter file
  • Switching type of property GAMSOptions.NoNewVarEqu from Integer to Enum (ENoNewVarEqu)
  • Renaming of GAMSEnum.ModelStat.NonOptimalIntermed to GAMSEnum.ModelStat.Feasible


  • GAMSDatabase:
    • New function CheckDomains: Check for all symbols if all records are within the specified domain of the symbol
    • New function GetDatabaseDVs: Return all GAMSDatabaseDomainViolations
    • New property SuppressAutoDomainChecking: Controls whether domain checking is called in GAMSDatabase export
    • New variants of the functions AddEquation, AddParameter, AddSet, AddVariable: Allow to specify domain information
    • Function Compact becomes obsolete and will be dropped in future
  • GAMSModelInstance:
    • New function CopyModelInstance: Copies a ModelInstance to a new ModelInstance which gets constructed at this call
    • New function Interrupt: Sends interrupt signal to running GAMSModelInstance
  • GAMSModifier:
    • Allow to define SymbolUpdateType for each GAMSModifier separately
  • GAMSSymbol (GAMSEquation, GAMSParameter, GAMSSet, GAMSVariable):
    • New function CheckDomains: Check if all records are within the specified domain of the symbol
    • New function CopyToArray: Copies values of a dense symbol into a dense array
    • New function CopyToSqzdArray: Copies values of a sparse symbol into a squeezed array
    • New function CopySparseToDenseArray: Copies values of a sparse symbol into a dense array
    • New function CopyFromDenseArray: Copies values from dense array into a symbol
    • New function CopySliceFromDenseArray: Copies values from slice of dense array into a symbol
    • New function GetSymbolDVs: Return all GAMSSymbolDomainViolations
    • New function MergeRecord: Finds record in GAMSSymbol if it exists, adds it if not
    • New property Domains: Domains of Symbol, each element is either a GAMSSet (real domain) or a string (relaxed domain)
  • GAMSWorkspace:
    • Change the Debug parameter from a Boolean flag to an enum type called DebugLevel
    • The Debug parameter can be overwritten by the system environment variable "GAMSOOAPIDEBUG" if set to one of the following: Off, KeepFiles, ShowLog, Verbose
    • Improve performance significantly for function AddDatabase(GAMSDatabase)
    • New functions: AddJobFromGamsLib, AddJobFromTestLib, AddJobFromEmpLib, AddJobFromDataLib and AddJobFromFinLib
    • New properties: Version, MajorRelNumber, MinorRelNumber and GOLDRelNumber
    • New optional parameter inModelName for functions AddDatabaseFromGDX/AddDatabase: GAMS string constant that is used to access this database
  • Add new sub class of GAMSException: GAMSExceptionExecution. This provides additional info about the reason of the failed execution.


  • Add new function GAMSSymbol.CopySymbol which copys all records from one to another GAMSSymbol
  • Label and symbol lookup is now case insensitve
  • Fixed handling of infinite bounds for GAMSModifiers


  • Add function Interrupt to GAMSJob
  • Do not throw an exception when hitting an Alias with the GAMSDatabaseEnumerator or GetSymbol function but return the aliased GAMSSet


  • Constructor of GAMSWorkspace now appends conditionally the GAMS system directory to the PATH environment variable. This fixes a problem with applications that create and dispose many GAMSWorkspace instances.


  • GAMSModelInstance.Instantiate is now thread-safe
  • Additional flag createOutDB for method GAMSJob.Solve which allows to switch off automatic outDB creation
  • Fix a problem with parallel execution of GAMSModelInstances in Debug mode
  • Add new class GAMSException
  • Add tighter restriction on adding symbols to GAMSModelInstance.SyncDB
  • Add new class GAMSModelInstanceOpt to customize method GAMSModelInstance.Solve
    • GAMSModelInstanceOpt.Debug: produces a gams.gms, jacobian.gdx and dictmap.gdx allowing inspection of the model instance solved in the GAMSModelInstance.Solve method
    • GAMSModelInstanceOpt.NoMatchLimit: controls the maximum number of accepted unmatched scenario records before terminating the solve
    • GAMSModelInstanceOpt.OptFile: allows to choose solver option for GAMSModelInstance.Solve
    • GAMSModelInstanceOpt.Solver: allows to choose solver for GAMSModelInstance.Solve
  • Add GAMSWorkspace.ScratchFilePrefix to prefix all scratch files created by GAMS.Net
  • GAMSJob no longer implements IDisposable