public final class DoubleMatrixUtil extends Object
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Method and Description |
|---|---|
static <U extends Unit<U>,S extends AbstractDoubleMatrix<U,S>> |
instantiate(double[][] value,
U unit,
StorageType storageType)
Instantiate the DoubleMatrix based on its unit.
|
static <S extends AbstractDoubleMatrix<?,S>> |
instantiateAnonymous(double[][] value,
Unit<?> unit,
StorageType storageType)
Instantiate the DoubleMatrix based on its unit.
|
static <S extends AbstractDoubleMatrix<?,S>> |
instantiateAnonymousSI(double[][] si,
Unit<?> displayUnit,
StorageType storageType)
Instantiate the DoubleMatrix based on its unit.
|
static <U extends Unit<U>,S extends AbstractDoubleMatrix<U,S>> |
instantiateSI(double[][] si,
U displayUnit,
StorageType storageType)
Instantiate the DoubleMatrix based on its unit.
|
public static <U extends Unit<U>,S extends AbstractDoubleMatrix<U,S>> S instantiate(double[][] value, U unit, StorageType storageType) throws ValueException
U - the unitS - the return typevalue - double[][]; the valueunit - U; the unit in which the value is expressedstorageType - StorageType; whether the vector is SPARSE or DENSEValueException - on vector init errorpublic static <S extends AbstractDoubleMatrix<?,S>> S instantiateAnonymous(double[][] value, Unit<?> unit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleMatrixUtil.instantiateAnonymous(10.0, mlu);
S - the return typevalue - double[][]; the valueunit - Unit<?>; the unit in which the value is expressedstorageType - StorageType; whether the vector is SPARSE or DENSEValueException - on vector init errorpublic static <U extends Unit<U>,S extends AbstractDoubleMatrix<U,S>> S instantiateSI(double[][] si, U displayUnit, StorageType storageType) throws ValueException
U - the unitS - the return typesi - double[][]; the value in SI unitsdisplayUnit - U; the unit in which the value is expressedstorageType - StorageType; whether the vector is SPARSE or DENSEValueException - on vector init errorpublic static <S extends AbstractDoubleMatrix<?,S>> S instantiateAnonymousSI(double[][] si, Unit<?> displayUnit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleMatrixUtil.instantiateAnonymousSI(10.0, mlu);
S - the return typesi - double[][]; the value in SI unitsdisplayUnit - Unit<?>; the unit in which the value is expressedstorageType - StorageType; whether the vector is SPARSE or DENSEValueException - on vector init errorCopyright © 2015–2019 Delft University of Technology. All rights reserved.