Releases: GAMS-dev/transfer-matlab
Releases · GAMS-dev/transfer-matlab
GAMS Transfer Matlab v1.0.3
GAMS Transfer Matlab v1.0.2
- Fixed GDX setup.
GAMS Transfer Matlab v1.0.1
- Fixed GDX setup.
GAMS Transfer Matlab v1.0.0
- 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, trueto
Container.readorContainer.write. When writing an indexed GDX file, non-indexed symbols are
ignored (symbols have a new propertyindexedto 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.symbolandgams.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.valueandgams.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.transferin the following. - Changed symbol and alias classes to
symbol.Set,symbol.Parameter,symbol.Variable,
symbol.Equation,alias.Setandalias.Universe. The previous (constructors of) classes
Set,Parameter,Variable,Equation,AliasandUniverseAliasare now factory methods
that forward the call toContainer.addSet,Container.addParameter,Container.addVariable,
Container.addEquation,Container.addAliasorContainer.addUniverseAlias, respectively.
Therefore, the factory methods now benefit from the overwrite feature of theContainer.add*
methods. - Changed abstract symbol class
Symboltosymbol.Abstractand added abstract alias class
alias.Abstract.
- Added subpackages
- Changed behaviour of
symbol.Abstract.format(previouslySymbol.format):- Changed selection of
symbol.Abstract.format: This was previously detected automatically from
symbol.Abstract.records. It is now chosen explicitly to be one of the four supported formats
table,struct,dense_matrixorsparse_matrixby settingsymbol.Abstract.format.
symbol.Abstract.isValidwill check the records towards the chosen format. Changing the format
by settingsymbol.Abstract.formatdoes not changesymbol.Abstract.records. - Changed
symbol.Abstract.formatwhen reading or creating symbol without records: Previously
this wasemptyandsymbol.Abstract.recordswas[]. Now, the format is always one of the
four supported formatstable,struct,dense_matrixorsparse_matrix(but without any
records). - Changed
symbol.Abstract.formatwhen reading a scalar. In this case the formatsstructand
dense_matrixare identical andContainer.readpreferredstruct, i.e.,dense_matrixwas
changed tostruct. This is not the case anymore.
- Changed selection of
- Changed enumeration-like classes
VariableTypeandEquationType:- Changed type of enumeration constants from
doubletouint8. - Added state (property
valueandselect) to enumeration-like classesVariableTypeand
EquationType. - Added methods
binary,integer,positive,negative,free,sos1,sos2,semiCont,
semiInttoVariableTypeto create enumeration with corresponding value. - Added methods
eq,leq,geq,nonBinding,external,cone,booleantoEquationType
to create enumeration with corresponding value. - Added methods
valuesandselectstoVariableTypeandEquationTypeto convert input to
(multiple) enumeration values or selections at once. - Removed methods
int2str,str2intandisValid. Just use the constructor to create an
enumeration and then use the propertiesvalueorselectinstead.
- 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 to
symbol.Abstract.domain_names(with possible unique added IDs). Changing the fields / columns in
the records may require to updatesymbol.Abstract.domain_labelsaccordingly. However, updating
symbol.Abstract.domain_labelswill also update the corresponding fields / columns if available. - Changed
symbol.Abstract.setRecordswhen passing astruct. The domain fields are no longer
taken by number of occurance, but bysymbol.Abstract.domain_labels. - Changed behaviour when resetting
symbol.Abstact.domainorsymbol.Abstract.size: This may now
reset all domain related properties such assymbol.Abstract.domain_labelsor
symbol.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_namesstay 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 thesymbolsargument (see also
Container.list*) or don't specify thesymbolsargument in the call. - Changed behaviour of
Container.writew.r.t.epsvalues: Added argumenteps_to_zeroto
Container.writeto convert allSpecialValues.EPSvalues 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.countNegInfandsymbol.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_textcolumn. - Changed name of subpackage
gams.transfer.cmextogams.transfer.gdx(internal). - Added (or unhided) property
symbol.Abstract.containerandalias.Abstract.containerreferring
to theContainerthe symbol or alias is stored in. - Added possibility for matrix formats
dense_matrixandsparse_matrixto 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.*UELsmethods. 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 in
symbol.Abstract.recordsis 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.dropEpsand
symbol.Parameter.dropZerosto 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.hasDuplicateRecordsand
Container.dropDuplicateRecordsto manage duplicates in table-like records formats. - Added methods
symbol.Abstract.countDomainViolations,symbol.Abstract.hasDomainViolations,
symbol.Abstract.findDomainViolations,symbol.Abstract.dropDomainViolations,
Container.countDomainViolations,Container.hasDomainViolationsand
Container.dropDomainViolationsto manage domain violations in table-like records formats. - Added return of new symbol to
symbol.Abstract.copyandalias.Abstract.copy. - Added a silent call to
Container.reorderSymbolsinContainer.isValidif 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 call
Container.reorderSymbols. - Fixed read of GDX files with trailing whitespace in UELs or empty UELs. Since Matlab's
categoricalwill 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_labelsand columns insymbol.Abstract.recordscontain
integer indices into the UELs instead ofcategoricals. Maintain UELs with the usual UEL methods
likegetUELsandsetUELs. - 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>incategoricaldomain columns.
GAMS Transfer Matlab v0.8.0
- 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.setupand*.cMEX source files of internal interface to
gams.transfer.cmex. Callinggams.transfer.setupallows to build GAMS Transfer Matlab from
source. Check withmex -setupwhich C compiler is enbaled in Matlab.
GAMS Transfer Matlab v0.7.0
- Breaking: Renamed records field
textof Sets toelement_text. - Added symbol
UniverseAliasto 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.getEquationsandContainer.getAliasesto get list of symbol objects of corresponding
type. - Added possibility to get/remove all symbols with
Container.getSymbolsor
Container.removeSymbols, respectively. - Added
Container.lowerUELs,Container.upperUELs,Symbol.lowerUELsandSymbol.upperUELsto
convert (all) UELs to lower or upper case, respectively. - Added GDX library unload before each read/write operation.
- Added columns
where_minandwhere_maxto 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_valueandis_aliascolumns in output of
Container.describe*methods. - Removed
ConstContainer. - Fixed bug that limited the number of used UELs in
Symbol.transformRecordsandSymbol.getUELs. - Fixed
Container.eqin case of containers with different number of symbols.
GAMS Transfer Matlab v0.6.0
- Breaking:
Symbol.domain_labelsnow mirrors the column or field names for domains in
Symbol.records. ChangingSymbol.domain_labelswill changeSymbol.recordsand vice versa.
Symbol.domain_labelsnow exists instructandtableformat 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:
GAMS Transfer Matlab v0.5.0
- Breaking: Changed default
Symbol.domain_labels: IfSymbol.domain_namesis 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
andjin records and with a domain{i, j, i}it staysi_1,j_2,i_3. - Added possibility to modify
Symbol.domain_labelsto any unqiue list of domain labels. If
Symbol.domainis modified, domain labels are reset to default label strategy, described above. - Changed
Symbol.domain_forwardingto be a vector of lengthSymbol.dimensionto enable/disable
domain forwarding for each dimension independently. - Removed
Symbol.getCardinality,Symbol.getUELLabels,Symbol.initUELsand
Container.getUniverseSet. - Fixed possibly incorrect order of UELs of symbols in
dense_matrixorsparse_matrixformat. - Fixed
Symbol.setRecordsfor cell input and symbols of dimension >= 3.
GAMS Transfer Matlab v0.4.0
- Improved performance of
Container.hasSymbols. Among others, this has a significant effect when
adding many symbols. - Added support of partial write.
- Added parameter
symbolstoContainer.write,Container.getDomainViolations,
Container.resolveDomainViolationsandContainer.isValid. - Added parameter
allow_mergetoContainer.renameUELsandSymbol.renameUELsin order support
merging UELs while renaming (renaming a UEL to an already existing UEL).
GAMS Transfer Matlab v0.3.0
- Breaking: Symbol name uniqueness is now checked case insensitively. For example, it is not
possible anymore to have two different symbols namedsymbolandSymbolorSYMBOL. - Breaking: Changed
Symbol.addUELssignature fromaddUELs(dim, uels)toaddUELs(uels, dim).
dimis now allowed to accept a vector of dimensions. - Breaking: Changed
Symbol.setUELssignature fromsetUELs(dim, uels)tosetUELs(uels, dim)and
setUELS(_, 'rename', true/false). Settingrenametotruetriggers the oldSymbol.initUELs.
dimis now allowed to accept a vector of dimensions. - Breaking: Changed
Symbol.removeUELssignature fromremoveUELs(dim, uels)toremoveUELs(),
removeUELs(uels)andremoveUELs(uels, dim).dimis now allowed to accept a vector of
dimensions. - Breaking: Changed
Symbol.renameUELssignature fromrenameUELs(dim, olduels, newuels)to
renameUELs(uels)andrenameUELs(uels, dim).uelscan now becellstr,structor
containers.Map.dimis now allowed to accept a vector of dimensions. - Added method
Container.getSymbolNamesto return the original symbol names for a list of symbol
names of any case. - Added method
Container.hasSymbolsto check if symbol name (case insensitive) exists. - Added method
Container.getUELsto get UELs from all symbols. - Added method
Container.removeUELsto remove UELs from all symbols. - Added method
Container.renameUELsto rename UELs in all symbols. - Added method
Symbol.reorderUELsto reorder UELs without changing the meaning of records. - Added flags
Container.modifiedandSymbol.modifiedto 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.getSymbolsto accept symbol names case
insensitively. - Changed behaviour of default records: Default records do not get written to GDX anymore if the
records format isdense_matrixand 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
Ordinalset totrue, but ordinal
categoricals are not enforced, i.e. users may pass categoricals withOrdinalset 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, usereorderSymbols. - 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.getUELsinstead. - Deprecated
Symbol.initUELs. UseSymbol.setUELsinstead. - Deprecated
Container.getUniverseSet. UseContainer.getUELsinstead. - 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.