public class MoneyMatrix extends AbstractDoubleMatrixRel<MoneyUnit,MoneyMatrix,MutableMoneyMatrix,Money>
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
data
Constructor and Description |
---|
MoneyMatrix(double[][] values,
MoneyUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double MoneyMatrix.
|
MoneyMatrix(DoubleMatrixData data,
MoneyUnit unit) |
MoneyMatrix(Money[][] values,
StorageType storageType)
Construct a new Relative Immutable Double MoneyMatrix.
|
Modifier and Type | Method and Description |
---|---|
protected MutableMoneyMatrix |
instantiateMutableType(DoubleMatrixData dmd,
MoneyUnit unit)
Construct a new Relative Mutable DoubleMatrix of the right type.
|
protected Money |
instantiateScalar(double value,
MoneyUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected MoneyMatrix |
instantiateType(DoubleMatrixData dmd,
MoneyUnit unit)
Construct a new Relative Immutable DoubleMatrix of the right type.
|
MoneyMatrix |
toDense()
Create a dense version of this DoubleMatrix.
|
MoneyMatrix |
toSparse()
Create a sparse version of this DoubleMatrix.
|
checkUnit, divide, ensureRectangularAndNonEmpty, get, minus, mutable, plus, times
cardinality, checkIndex, checkSize, checkSize, columns, determinant, ensureRectangularAndNonEmpty, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, rows, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
public MoneyMatrix(double[][] values, MoneyUnit unit, StorageType storageType) throws ValueException
values
- double[][]; the values of the entries in the new Relative Immutable Double MoneyMatrixunit
- U; the unit of the new Relative Immutable Double MoneyMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MoneyMatrix(Money[][] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[][]; the values of the entries in the new Relative Immutable Double MoneyMatrixstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesMoneyMatrix(DoubleMatrixData data, MoneyUnit unit)
data
- an internal data objectunit
- the unitpublic final MoneyMatrix toDense()
public final MoneyMatrix toSparse()
protected final MoneyMatrix instantiateType(DoubleMatrixData dmd, MoneyUnit unit)
instantiateType
in class AbstractDoubleMatrixRel<MoneyUnit,MoneyMatrix,MutableMoneyMatrix,Money>
dmd
- an internal data objectunit
- the unitprotected final MutableMoneyMatrix instantiateMutableType(DoubleMatrixData dmd, MoneyUnit unit)
instantiateMutableType
in class AbstractDoubleMatrixRel<MoneyUnit,MoneyMatrix,MutableMoneyMatrix,Money>
dmd
- an internal data objectunit
- the unitprotected final Money instantiateScalar(double value, MoneyUnit unit)
instantiateScalar
in class AbstractDoubleMatrixRel<MoneyUnit,MoneyMatrix,MutableMoneyMatrix,Money>
value
- the valueunit
- the unitCopyright © 2015–2018 Delft University of Technology. All rights reserved.