GAMS Set. More...

Inheritance diagram for Set:
Symbol

GAMS Set.

Example:

c = Container();
s1 = Set(c, 's1');
s2 = Set(c, 's2', {s1, '*', '*'});
s3 = Set(c, 's3', '*', 'records', {'e1', 'e2', 'e3'}, 'description', 'set s3');
See also
Container

Public Member Functions

function Set (in container, in name, in varargin)
 Constructs a GAMS Set. More...
 
function equals (in obj, in symbol)
 Checks equivalence with other symbol. More...
 
function copy (in obj, in varargin)
 Copies symbol to destination container. More...
 
- Public Member Functions inherited from Symbol
function setRecords (in obj, in varargin)
 Sets symbol records in supported format. More...
 
function transformRecords (in obj, in target_format)
 Transforms symbol records into given format. More...
 
function equals (in obj, in symbol)
 Checks equivalence with other symbol. More...
 
function copy (in obj, in varargin)
 Copies symbol to destination container. More...
 
function isValid (in obj, in varargin)
 Checks correctness of symbol. More...
 
function getDomainViolations (in obj)
 Get domain violations. More...
 
function resolveDomainViolations (in obj)
 Extends domain sets in order to resolve domain violations. More...
 
function getSparsity (in obj)
 Returns the sparsity of symbol records. More...
 
function getCardenality (in obj)
 Returns the cardenality of symbol records. More...
 
function getMaxValue (in obj, in varargin)
 Returns the largest value in records. More...
 
function getMinValue (in obj, in varargin)
 Returns the smallest value in records. More...
 
function getMeanValue (in obj, in varargin)
 Returns the mean value over all values in records. More...
 
function getMaxAbsValue (in obj, in varargin)
 Returns the largest absolute value in records. More...
 
function countNA (in obj, in varargin)
 Returns the number of GAMS NA values in records. More...
 
function countUndef (in obj, in varargin)
 Returns the number of GAMS UNDEF values in records. More...
 
function countEps (in obj, in varargin)
 Returns the number of GAMS EPS values in records. More...
 
function countPosInf (in obj, in varargin)
 Returns the number of GAMS PINF (positive infinity) values in records. More...
 
function countNegInf (in obj, in varargin)
 Returns the number of GAMS MINF (negative infinity) values in records. More...
 
function getNumberRecords (in obj)
 Returns the number of GDX records (not available for matrix formats) More...
 
function getNumberValues (in obj, in varargin)
 Returns the number of values stored for this symbol. More...
 
function getUELs (in obj, in varargin)
 Returns the UELs used in this symbol. More...
 
function getUELLabels (in obj, in dim, in codes)
 Returns the UELs labels for the given UEL codes. More...
 
function initUELs (in obj, in dim, in uels)
 Sets the UELs without modifying UEL codes in records. More...
 
function setUELs (in obj, in uels, in dim, in varargin)
 Sets UELs. More...
 
function reorderUELs (in obj, in uels, in dim)
 Reorders UELs. More...
 
function addUELs (in obj, in uels, in dim)
 Adds UELs to the symbol. More...
 
function removeUELs (in obj, in uels, in dim)
 Removes UELs from the symbol. More...
 
function renameUELs (in obj, in uels, in dim)
 Renames UELs in the symbol. More...
 

Public Attributes

Property name
 Set name.
 
Property description
 Set description.
 
Property is_singleton
 indicator if Set is is_singleton
 
- Public Attributes inherited from Symbol
Property dimension
 Dimension of symbol (in [0,20])
 
Property size
 Shape of symbol (length == dimension) More...
 
Property domain
 Domain of symbol (length == dimension) More...
 
Property domain_forwarding
 Enables domain entries in records to be recursively added to the domains in case they are not present in the domains already. More...
 
Property records
 Storage of symbol records. More...
 
Property modified
 Flag to indicate modification. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Symbol
function Symbol (in container, in name, in description, in domain_size, in records, in domain_forwarding)
 Constructs a GAMS Symbol, see subclasses help.
 

Constructor & Destructor Documentation

◆ Set()

function Set ( in  container,
in  name,
in  varargin 
)

Constructs a GAMS Set.

See Creating a Symbol for more information.

Required Arguments:

  1. container (Container): Container object this symbol should be stored in
  2. name (string): Name of set

Optional Arguments:

  1. domain (cellstr or Set): List of domains given either as string or as reference to a Set object. Default is {"*"} (for 1-dim with universe domain).

Parameter Arguments:

  • records: Set records, e.g. a list of strings. Default is [].
  • description (string): Description of symbol. Default is "".
  • is_singleton (logical): Indicates if set is a is_singleton set (true) or not (false). Default is false.
  • domain_forwarding (logical): If true, domain entries in records will recursively be added to the domains in case they are not present in the domains already. Default: false.

Example:

c = Container();
s1 = Set(c, 's1');
s2 = Set(c, 's2', {s1, '*', '*'});
s3 = Set(c, 's3', '*', 'records', {'e1', 'e2', 'e3'}, 'description', 'set s3');
See also
Container

Member Function Documentation

◆ copy()

function copy ( in  obj,
in  varargin 
)

Copies symbol to destination container.

Symbol domains are downgraded to relaxed if the destination container does not have equivalent domain sets, see also Symbol Domain.

Required Arguments:

  1. destination (Container): Destination Container

Optional Arguments:

  1. overwrite (bool): Overwrites symbol with same name in destination if true. Default: false.

◆ equals()

function equals ( in  obj,
in  symbol 
)

Checks equivalence with other symbol.

Note
A symbol is always linked to a container. This method does not check equivalence of the linked containers.

Required Arguments:

  1. symbol (any): Other symbol
function Set(in container, in name, in varargin)
Constructs a GAMS Set.