- Fixed sparse write of format
sparse_matrix
.
- Fixed GDX setup.
- Fixed GDX setup.
- Removed property
Container.gams_dir
. GAMS Transfer Matlab is now compiled statically with GDX and is thus independent of the GAMS system. - Removed property
Container.indexed
. A container may now store indexed or standard symbols together. To read or write an indexed GDX file, pass the argumentindexed, true
toContainer.read
orContainer.write
. When writing an indexed GDX file, non-indexed symbols are ignored (symbols have a new propertyindexed
to show if the symbol can be used in indexed mode). Writing a standard GDX file is always possible for all symbols (however, the meaning of indexed symbols may be different compared to the indexed GDX file). An indexed symbol can be created by passing the size array instead of a domain cell for the domain (as before) or by settingsize
property of the symbol. - Restructured symbol classes:
- Added subpackages
gams.transfer.symbol
andgams.transfer.alias
(as well as internal subpackagesgams.transfer.incase_ordered_dict
,gams.transfer.unique_labels
,gams.transfer.symbol.data
,gams.transfer.symbol.definition
,gams.transfer.symbol.domain
,gams.transfer.symbol.value
andgams.transfer.symbol.unique_labels
). Note that internal and/ or hidden classes and packages may alter its API without notice, so use at own risk. Referring to subpackages withoutgams.transfer
in the following. - Changed symbol and alias classes to
symbol.Set
,symbol.Parameter
,symbol.Variable
,symbol.Equation
,alias.Set
andalias.Universe
. The previous (constructors of) classesSet
,Parameter
,Variable
,Equation
,Alias
andUniverseAlias
are now factory methods that forward the call toContainer.addSet
,Container.addParameter
,Container.addVariable
,Container.addEquation
,Container.addAlias
orContainer.addUniverseAlias
, respectively. Therefore, the factory methods now benefit from the overwrite feature of theContainer.add*
methods. - Changed abstract symbol class
Symbol
tosymbol.Abstract
and added abstract alias classalias.Abstract
.
- Added subpackages
- Changed behaviour of
symbol.Abstract.format
(previouslySymbol.format
):- Changed selection of
symbol.Abstract.format
: This was previously detected automatically fromsymbol.Abstract.records
. It is now chosen explicitly to be one of the four supported formatstable
,struct
,dense_matrix
orsparse_matrix
by settingsymbol.Abstract.format
.symbol.Abstract.isValid
will check the records towards the chosen format. Changing the format by settingsymbol.Abstract.format
does not changesymbol.Abstract.records
. - Changed
symbol.Abstract.format
when reading or creating symbol without records: Previously this wasempty
andsymbol.Abstract.records
was[]
. Now, the format is always one of the four supported formatstable
,struct
,dense_matrix
orsparse_matrix
(but without any records). - Changed
symbol.Abstract.format
when reading a scalar. In this case the formatsstruct
anddense_matrix
are identical andContainer.read
preferredstruct
, i.e.,dense_matrix
was changed tostruct
. This is not the case anymore.
- Changed selection of
- Changed enumeration-like classes
VariableType
andEquationType
:- Changed type of enumeration constants from
double
touint8
. - Added state (property
value
andselect
) to enumeration-like classesVariableType
andEquationType
. - Added methods
binary
,integer
,positive
,negative
,free
,sos1
,sos2
,semiCont
,semiInt
toVariableType
to create enumeration with corresponding value. - Added methods
eq
,leq
,geq
,nonBinding
,external
,cone
,boolean
toEquationType
to create enumeration with corresponding value. - Added methods
values
andselects
toVariableType
andEquationType
to convert input to (multiple) enumeration values or selections at once. - Removed methods
int2str
,str2int
andisValid
. Just use the constructor to create an enumeration and then use the propertiesvalue
orselect
instead.
- Changed type of enumeration constants from
- Changed handling of
symbol.Abstract.domain_labels
: Previously, if not set explicitly, these were extracted from the records. This is not the case anymore. They default tosymbol.Abstract.domain_names
(with possible unique added IDs). Changing the fields / columns in the records may require to updatesymbol.Abstract.domain_labels
accordingly. However, updatingsymbol.Abstract.domain_labels
will also update the corresponding fields / columns if available. - Changed
symbol.Abstract.setRecords
when passing astruct
. The domain fields are no longer taken by number of occurance, but bysymbol.Abstract.domain_labels
. - Changed behaviour when resetting
symbol.Abstact.domain
orsymbol.Abstract.size
: This may now reset all domain related properties such assymbol.Abstract.domain_labels
orsymbol.Abstract.domain_forwarding
. - Changed behaviour when removing a symbol or alias that is used as domain in another symbol:
Previously, the domain was set to the universe
*
. It is now relaxed keeping the symbol name such thatsymbol.Abstract.domain_names
stay the same. - Changed behaviour when passing
symbols, {}
toContainer.write
: Previously this wrote all symbols, now it is none. To write all symbols, use all symbols in thesymbols
argument (see alsoContainer.list*
) or don't specify thesymbols
argument in the call. - Changed behaviour of
Container.write
w.r.t.eps
values: Added argumenteps_to_zero
toContainer.write
to convert allSpecialValues.EPS
values in the records to zero in the write. This does not change the records in the Container. Default istrue
. - Changed signature of methods
symbol.Abstract.getMaxValue
,symbol.Abstract.getMinValue
,symbol.Abstract.getMeanValue
,symbol.Abstract.getMaxAbsValue
,symbol.Abstract.countNA
,symbol.Abstract.countUndef
,symbol.Abstract.countEps
,symbol.Abstract.countPosInf
,symbol.Abstract.countNegInf
andsymbol.Abstract.getNumberValues
: Previously the considered values could be filtered by passing individual strings (e.g.'level', 'marginal'
). Now use the parameter argumentvalues
(e.g. pass'values', {'level', 'marginal'}
). - Changed class
DomainViolation
: Moved tosymbol.domain.Violation
, hid constructor and removed propertydomain
. - Changed behaviour of
symbol.Set.getNumberValues
: This was constantly 0 before, now it considers theelement_text
column. - Changed name of subpackage
gams.transfer.cmex
togams.transfer.gdx
(internal). - Added (or unhided) property
symbol.Abstract.container
andalias.Abstract.container
referring to theContainer
the symbol or alias is stored in. - Added possibility for matrix formats
dense_matrix
andsparse_matrix
to maintain UELs. Previously UELs were used directly from the domain set for these formats and it was not allowed to change the UELs through thesymbol.Abstract.*UELs
methods. Now, if a symbol has a regular domain, UELs are initialized with the domain set as UELs. But it is further possible to edit those UELs per symbol without modifying the domain set. The size of the matrices insymbol.Abstract.records
is defined by the number of UELs per dimension (symbol.Abstract.size
stays the size defined mainly by the domain). This new feature therefore allows to use matrix formats when the symbol domain is relaxed and/or smaller matrices than actually defined by the regular domain. Note that the previous behaviour for regular symbols with matrix formats does not change. - Added methods
symbol.Abstract.dropDefaults
,symbol.Abstract.dropNA
,symbol.Abstract.dropUndef
,symbol.Abstract.dropMissing
,symbol.Abstract.dropEps
andsymbol.Parameter.dropZeros
to drop (table-like formats) or replace certain special values by defaults (matrix-like formats). - Added methods
symbol.Abstract.countDuplicateRecords
,symbol.Abstract.hasDuplicateRecords
,symbol.Abstract.findDuplicateRecords
,symbol.Abstract.dropDuplicateRecords
,Container.countDuplicateRecords
,Container.hasDuplicateRecords
andContainer.dropDuplicateRecords
to manage duplicates in table-like records formats. - Added methods
symbol.Abstract.countDomainViolations
,symbol.Abstract.hasDomainViolations
,symbol.Abstract.findDomainViolations
,symbol.Abstract.dropDomainViolations
,Container.countDomainViolations
,Container.hasDomainViolations
andContainer.dropDomainViolations
to manage domain violations in table-like records formats. - Added return of new symbol to
symbol.Abstract.copy
andalias.Abstract.copy
. - Added a silent call to
Container.reorderSymbols
inContainer.isValid
if symbols are out of order (symbols that use other symbols in the domain must appear after the domain symbols). Even though having unordered symbols is rather unlikely, this now makes it unnecessary to manually callContainer.reorderSymbols
. - Fixed read of GDX files with trailing whitespace in UELs or empty UELs. Since Matlab's
categorical
will trim category names and does not allow empty categories, GAMS Transfer Matlab will fall back to non-categorical mode for symbols with this kind of UELs. In this mode UELs will be stored insymbol.Abstract.unique_labels
and columns insymbol.Abstract.records
contain integer indices into the UELs instead ofcategoricals
. Maintain UELs with the usual UEL methods likegetUELs
andsetUELs
. - Fixed reading GDX files with records that use UELs without string representation. For matrix-like
record formats, these records will be ignored. For table-like record formats, these will result in
<undefined>
incategorical
domain columns.
- Breaking: Renamed package to
gams.transfer
(previously:GAMSTransfer
) and moved MEX interface togams.transfer.cmex
(internal use only). - Added MacOS Arm64 build.
- Added
gams.transfer.setup
and*.c
MEX source files of internal interface togams.transfer.cmex
. Callinggams.transfer.setup
allows to build GAMS Transfer Matlab from source. Check withmex -setup
which C compiler is enbaled in Matlab.
- Breaking: Renamed records field
text
of Sets toelement_text
. - Added symbol
UniverseAlias
to represent alises to the universe set. - Added possibility to change symbol name case with
Container.renameSymbol
. - Added possibility to reorder UELs by record order with
Symbol.reorderUELs
(passing no arguments). - Added
Container.getSets
,Container.getParameters
,Container.getVariables
,Container.getEquations
andContainer.getAliases
to get list of symbol objects of corresponding type. - Added possibility to get/remove all symbols with
Container.getSymbols
orContainer.removeSymbols
, respectively. - Added
Container.lowerUELs
,Container.upperUELs
,Symbol.lowerUELs
andSymbol.upperUELs
to convert (all) UELs to lower or upper case, respectively. - Added GDX library unload before each read/write operation.
- Added columns
where_min
andwhere_max
to output ofContainer.describeParameters
. - Changed used GDX library to
gdxcclib64
. - Changed column names in output of
Container.describe*
methods:dim
->dimension
,num_recs
->number_records
,num_vals
->number_values
,min_value
->min
,max_value
->max
,mean_value
->mean
. - Removed
*_marginal
,count_*
,where_max_abs_value
andis_alias
columns in output ofContainer.describe*
methods. - Removed
ConstContainer
. - Fixed bug that limited the number of used UELs in
Symbol.transformRecords
andSymbol.getUELs
. - Fixed
Container.eq
in case of containers with different number of symbols.
- Breaking:
Symbol.domain_labels
now mirrors the column or field names for domains inSymbol.records
. ChangingSymbol.domain_labels
will changeSymbol.records
and vice versa.Symbol.domain_labels
now exists instruct
andtable
format only. Domain fields in records are those fields that are not one of the following:- Variables and equations:
level
,marginal
,lower
,upper
,scale
. - Parameters:
value
. - Sets:
text
.
- Variables and equations:
- Breaking: Changed default
Symbol.domain_labels
: IfSymbol.domain_names
is a unqiue list of domain names, then those names are used as domain labels. Otherwise, the previous label strategy "_" is used. For example, a symbol with domain{i, j}
, now expects domain labelsi
andj
in records and with a domain{i, j, i}
it staysi_1
,j_2
,i_3
. - Added possibility to modify
Symbol.domain_labels
to any unqiue list of domain labels. IfSymbol.domain
is modified, domain labels are reset to default label strategy, described above. - Changed
Symbol.domain_forwarding
to be a vector of lengthSymbol.dimension
to enable/disable domain forwarding for each dimension independently. - Removed
Symbol.getCardinality
,Symbol.getUELLabels
,Symbol.initUELs
andContainer.getUniverseSet
. - Fixed possibly incorrect order of UELs of symbols in
dense_matrix
orsparse_matrix
format. - Fixed
Symbol.setRecords
for cell input and symbols of dimension >= 3.
- Improved performance of
Container.hasSymbols
. Among others, this has a significant effect when adding many symbols. - Added support of partial write.
- Added parameter
symbols
toContainer.write
,Container.getDomainViolations
,Container.resolveDomainViolations
andContainer.isValid
. - Added parameter
allow_merge
toContainer.renameUELs
andSymbol.renameUELs
in order support merging UELs while renaming (renaming a UEL to an already existing UEL).
- Breaking: Symbol name uniqueness is now checked case insensitively. For example, it is not
possible anymore to have two different symbols named
symbol
andSymbol
orSYMBOL
. - Breaking: Changed
Symbol.addUELs
signature fromaddUELs(dim, uels)
toaddUELs(uels, dim)
.dim
is now allowed to accept a vector of dimensions. - Breaking: Changed
Symbol.setUELs
signature fromsetUELs(dim, uels)
tosetUELs(uels, dim)
andsetUELS(_, 'rename', true/false)
. Settingrename
totrue
triggers the oldSymbol.initUELs
.dim
is now allowed to accept a vector of dimensions. - Breaking: Changed
Symbol.removeUELs
signature fromremoveUELs(dim, uels)
toremoveUELs()
,removeUELs(uels)
andremoveUELs(uels, dim)
.dim
is now allowed to accept a vector of dimensions. - Breaking: Changed
Symbol.renameUELs
signature fromrenameUELs(dim, olduels, newuels)
torenameUELs(uels)
andrenameUELs(uels, dim)
.uels
can now becellstr
,struct
orcontainers.Map
.dim
is now allowed to accept a vector of dimensions. - Added method
Container.getSymbolNames
to return the original symbol names for a list of symbol names of any case. - Added method
Container.hasSymbols
to check if symbol name (case insensitive) exists. - Added method
Container.getUELs
to get UELs from all symbols. - Added method
Container.removeUELs
to remove UELs from all symbols. - Added method
Container.renameUELs
to rename UELs in all symbols. - Added method
Symbol.reorderUELs
to reorder UELs without changing the meaning of records. - Added flags
Container.modified
andSymbol.modified
to indicate if a container and/or symbol has been modified since last reset. - Added possibility to filter UEL codes in
Symbol.getUELs
. - Added possibility to pass a vector of dimensions to
Symbol.getUELs
. - Added possibility to overwrite symbols with
Container.add*
if main symbol definition (e.g. type, domain) is equal. - Changed
Container.getSymbols
,Container.removeSymbol
,Container.renameSymbol
,Container.describe*
and others that useContainer.getSymbols
to accept symbol names case insensitively. - Changed behaviour of default records: Default records do not get written to GDX anymore if the
records format is
dense_matrix
and either the container is in indexed mode or if the symbol has a regular domain. - Changed behaviour of
getDomainViolations
: As in GDX different character case does not lead to a domain violation. - Categoricals for record domain labels are now created with
Ordinal
set totrue
, but ordinal categoricals are not enforced, i.e. users may pass categoricals withOrdinal
set tofalse
. - Changed symbol read order when reading a subset of symbols: Symbol order is defined by source
order (e.g. symbol order in GDX file) rather than user supplied order. To establish a custom order
after the read, use
reorderSymbols
. - Aliases are now removed if the aliased set is removed.
- Domains are now set to
*
(universe) if the domain set is removed. - Deprecated
Symbol.getUELLabels
. UseSymbol.getUELs
instead. - Deprecated
Symbol.initUELs
. UseSymbol.setUELs
instead. - Deprecated
Container.getUniverseSet
. UseContainer.getUELs
instead. - Fixed failing symbol constructors when using
domain_forwarding
, but none of the optional arguments. - Fixed
Symbol.transformRecords
(table-like to matrix-like formats) in case the domain set records and UELs differ. - Fixed write of sets defined over sets.
- Fixed read of equation with unknown subtype (recast as
=e=
). - Fixed partial read of symbols in indexed container.
- Fixed
equals
method in indexed container. - Fixed possible segfault when reading a subset of symbols as dense matrix with at least one scalar symbol.
- Fixed read of variable with unknown subtype (recast as free).
- Fixed check of variable type on variable creation.
- Fixed
isEps
,isNA
andisUndef
ofSpecialValues
for sparse matrix input. - Fixed default values of external, conic and boolean equations.
- Added documentation.
- Added "equals" method to Container and Symbol classes to compare containers or. symbols.
- Added "copy" method to Symbol classes to copy symbols to another container.
- Added support to read symbols directly from non-const container.
- First release