public final class FloatMatrixUtil 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 AbstractFloatMatrix<U,S>> |
instantiate(float[][] value,
U unit,
StorageType storageType)
Instantiate the FloatMatrix based on its unit.
|
static <S extends AbstractFloatMatrix<?,S>> |
instantiateAnonymous(float[][] value,
Unit<?> unit,
StorageType storageType)
Instantiate the FloatMatrix based on its unit.
|
static <S extends AbstractFloatMatrix<?,S>> |
instantiateAnonymousSI(float[][] si,
Unit<?> displayUnit,
StorageType storageType)
Instantiate the FloatMatrix based on its unit.
|
static <U extends Unit<U>,S extends AbstractFloatMatrix<U,S>> |
instantiateSI(float[][] si,
U displayUnit,
StorageType storageType)
Instantiate the FloatMatrix based on its unit.
|
public static <U extends Unit<U>,S extends AbstractFloatMatrix<U,S>> S instantiate(float[][] value, U unit, StorageType storageType) throws ValueException
U
- the unitS
- the return typevalue
- the valueunit
- the unit in which the value is expressedstorageType
- whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <S extends AbstractFloatMatrix<?,S>> S instantiateAnonymous(float[][] value, Unit<?> unit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = FloatMatrixUtil.instantiateAnonymous(10.0, mlu);
S
- the return typevalue
- the valueunit
- the unit in which the value is expressedstorageType
- whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <U extends Unit<U>,S extends AbstractFloatMatrix<U,S>> S instantiateSI(float[][] si, U displayUnit, StorageType storageType) throws ValueException
U
- the unitS
- the return typesi
- the value in SI unitsdisplayUnit
- the unit in which the value is expressedstorageType
- whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <S extends AbstractFloatMatrix<?,S>> S instantiateAnonymousSI(float[][] si, Unit<?> displayUnit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = FloatMatrixUtil.instantiateAnonymousSI(10.0, mlu);
S
- the return typesi
- the value in SI unitsdisplayUnit
- the unit in which the value is expressedstorageType
- whether the vector is SPARSE or DENSEValueException
- on vector init errorCopyright © 2015–2018 Delft University of Technology. All rights reserved.