Package com.singularsys.extensions.matrix.dictionary


package com.singularsys.extensions.matrix.dictionary
Provides a set of components for using dictionaries compatible with the com.singularsys.extensions.matrix package. See DictionaryComponents for the main documentation.

The MatrixDictKeys and MatrixDictValues functions return results as a VectorI. The MatrixDictEntries functions return results as a MatrixI.

When set with the MatrixDictComponents.Type.MATRIX_NO_NULL option dictionaries are represent as N by 2 MatrixI. As matrices have fixed sizes, methods that modify the size, clear(mat), remove(mat,'x') will throw exceptions, as will put(mat,'unknown',5).

The functions in this package will also work with MatrixI and VectorI values created by the parser or other matrix operations.

mat = [['x',2], ['y',3], ['z',4]];
set = [['x'], ['y'], ['z']];
vec = ['x', 'y', 'z'];
get(mat,'y');
keys(set);
numEntries(vec);
As matrices have fixed sizes, methods that modify the size, clear(mat), remove(mat,'x') will throw exceptions, as will put(mat,'unknown',5).

To set up use:

var mfact = new ObjectMatrixFactory();
var mfield = new SimpleMatrixField(mfact);
var mot = new MatrixOperatorTable(mfact, mfield);
var mft = new MatrixFunctionTable(mfact, mfield);
var mdc = new MatrixDictComponents(
	    MatrixDictComponents.Type.MAP_NULL_VALUES,
	    mfact, mfield);
jep = new Jep(new StandardConfigurableParser(), mot, mft, mdc);
Since:
Jep 4.1 extensions 2.2
See Also: