GAMS Alias. More...

Inherits handle.

GAMS Alias.

This class represents a GAMS Alias, which is a link to another GAMS Set.

Example:

c = Container();
s = Set(c, 's');
a = Alias(c, 'a', s);
See also
Set, Container

Public Member Functions

function Alias (in container, in name, in alias_with)
 Constructs a GAMS Alias. More...
 
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 alias. 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 dim, 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 the UELs with updating UEL codes in records. More...
 
function addUELs (in obj, in uels, in dim)
 Adds UELs to the symbol. More...
 
function removeUELs (in obj, in varargin)
 Removes UELs from the symbol. More...
 
function renameUELs (in obj, in uels, in dim)
 Renames UELs in the symbol. More...
 

Public Attributes

Property name
 Alias name.
 
Property alias_with
 Aliased GAMS Set.
 
Property modified
 Flag to indicate modification. More...
 
Property description
 Aliased GAMS Set description.
 
Property is_singleton
 Indicator if aliased GAMS Set is singleton.
 
Property dimension
 Aliased GAMS Set dimension (in [0,20])
 
Property size
 Aliased GAMS Set Shape (length == dimension)
 
Property domain
 Aliased GAMS Set domain (length == dimension)
 
Property domain_names
 Aliased GAMS Set domain names.
 
Property domain_labels
 Expected domain labels in records.
 
Property domain_type
 Specifies if domains are stored 'relaxed' or 'regular'.
 
Property records
 Storage of aliased Set records.
 
Property format
 Records format. More...
 

Constructor & Destructor Documentation

◆ Alias()

function Alias ( in  container,
in  name,
in  alias_with 
)

Constructs a GAMS Alias.

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 alias
  3. alias_with (Set or Alias): GAMS Set to be linked to

Example:

c = Container();
s = Set(c, 's');
a = Alias(c, 'a', s);
See also
Set, Container

Member Function Documentation

◆ addUELs()

function addUELs ( in  obj,
in  uels,
in  dim 
)

Adds UELs to the symbol.

See also
Symbol.addUELs

◆ copy()

function copy ( in  obj,
in  varargin 
)

Copies symbol to destination container.

If destination container does not have a symbol equal to the aliased symbol, an error is raised.

Required Arguments:

  1. destination (Container): Destination container

Optional Arguments:

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

◆ countEps()

function countEps ( in  obj,
in  varargin 
)

Returns the number of GAMS EPS values in records.

See also
Symbol.countEps

◆ countNA()

function countNA ( in  obj,
in  varargin 
)

Returns the number of GAMS NA values in records.

See also
Symbol.countNA

◆ countNegInf()

function countNegInf ( in  obj,
in  varargin 
)

Returns the number of GAMS MINF (negative infinity) values in records.

See also
Symbol.countNegInf

◆ countPosInf()

function countPosInf ( in  obj,
in  varargin 
)

Returns the number of GAMS PINF (positive infinity) values in records.

See also
Symbol.countPosInf

◆ countUndef()

function countUndef ( in  obj,
in  varargin 
)

Returns the number of GAMS UNDEF values in records.

See also
Symbol.countUndef

◆ 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

◆ getCardenality()

function getCardenality ( in  obj)

Returns the cardenality of symbol records.

See also
Symbol.getCardenality

◆ getDomainViolations()

function getDomainViolations ( in  obj)

Get domain violations.

See also
Symbol.getDomainViolations

◆ getMaxAbsValue()

function getMaxAbsValue ( in  obj,
in  varargin 
)

Returns the largest absolute value in records.

See also
Symbol.getMaxAbsValue

◆ getMaxValue()

function getMaxValue ( in  obj,
in  varargin 
)

Returns the largest value in records.

See also
Symbol.getMaxValue

◆ getMeanValue()

function getMeanValue ( in  obj,
in  varargin 
)

Returns the mean value over all values in records.

See also
Symbol.getMeanValue

◆ getMinValue()

function getMinValue ( in  obj,
in  varargin 
)

Returns the smallest value in records.

See also
Symbol.getMinValue

◆ getNumberRecords()

function getNumberRecords ( in  obj)

Returns the number of GDX records (not available for matrix formats)

See also
Symbol.getNumberRecords

◆ getNumberValues()

function getNumberValues ( in  obj,
in  varargin 
)

Returns the number of values stored for this symbol.

See also
Symbol.getNumberValues

◆ getSparsity()

function getSparsity ( in  obj)

Returns the sparsity of symbol records.

See also
Symbol.getSparsity

◆ getUELLabels()

function getUELLabels ( in  obj,
in  dim,
in  codes 
)

Returns the UELs labels for the given UEL codes.

See also
Symbol.getUELLabels

◆ getUELs()

function getUELs ( in  obj,
in  dim,
in  varargin 
)

Returns the UELs used in this symbol.

See also
Symbol.getUELs

◆ initUELs()

function initUELs ( in  obj,
in  dim,
in  uels 
)

Sets the UELs without modifying UEL codes in records.

See also
Symbol.initUELs

◆ isValid()

function isValid ( in  obj,
in  varargin 
)

Checks correctness of alias.

Optional Arguments:

  1. verbose (logical): If true, the reason for an invalid symbol is printed
  2. force (logical): If true, forces reevaluation of validity (resets cache)

◆ removeUELs()

function removeUELs ( in  obj,
in  varargin 
)

Removes UELs from the symbol.

See also
Symbol.removeUELs

◆ renameUELs()

function renameUELs ( in  obj,
in  uels,
in  dim 
)

Renames UELs in the symbol.

See also
Symbol.renameUELs

◆ resolveDomainViolations()

function resolveDomainViolations ( in  obj)

Extends domain sets in order to resolve domain violations.

See also
Symbol.resolveDomainViolations

◆ setRecords()

function setRecords ( in  obj,
in  varargin 
)

Sets symbol records in supported format.

See also
Symbol.setRecords

◆ setUELs()

function setUELs ( in  obj,
in  uels,
in  dim,
in  varargin 
)

Sets the UELs with updating UEL codes in records.

See also
Symbol.setUELs

◆ transformRecords()

function transformRecords ( in  obj,
in  target_format 
)

Transforms symbol records into given format.

See also
Symbol.transformRecords

Member Data Documentation

◆ format

Property format

Records format.

If records are changed, this gets reset to RecordsFormat.UNKNOWN. Calling Alias.isValid will detect the format again.

◆ modified

Property modified

Flag to indicate modification.

If the symbol has been modified since last reset of flag (false), this flag will be true.

function Alias(in container, in name, in alias_with)
Constructs a GAMS Alias.