Class FloatMatrix
java.lang.Object
org.djunits.value.vfloat.matrix.base.FloatMatrix
public final class FloatMatrix extends Object
FloatMatrix utility methods, e.g., for creating FloatMatrixs from different types of data.
Copyright (c) 2015-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Method Summary
Modifier and Type Method Description static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(float[][] valuesInUnit, U unit, StorageType storageType)
Instantiate the FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(float[][] valuesInUnit, U unit, StorageType storageType, Class<M> matrixClass)
Instantiate the FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(Collection<FloatSparseValue<U,S>> values, int rows, int cols, U displayUnit, StorageType storageType)
Construct a new Relative Immutable Float Matrix.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(Collection<FloatSparseValue<U,S>> values, int rows, int cols, U displayUnit, StorageType storageType, Class<M> matrixClass)
Construct a new Relative Immutable Float Matrix.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(FloatMatrixData values, U unit)
Instantiate the Mutable FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(FloatMatrixData values, U unit, Class<M> matrixClass)
Instantiate the Mutable FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(S[][] values, U displayUnit, StorageType storageType)
Construct a new Relative Immutable Float Matrix.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
Minstantiate(S[][] values, U displayUnit, StorageType storageType, Class<M> matrixClass)
Construct a new Relative Immutable Float Matrix.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
MinstantiateAnonymous(FloatMatrixData values, Unit<?> unit)
Instantiate the Immutable FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
MinstantiateAnonymous(FloatMatrixData values, Unit<?> unit, Class<M> matrixClass)
Instantiate the Immutable FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
MinstantiateSI(float[][] valuesSI, U displayUnit, StorageType storageType)
Instantiate the FloatMatrix based on its unit.static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>>
MinstantiateSI(float[][] valuesSI, U displayUnit, StorageType storageType, Class<M> matrixClass)
Instantiate the FloatMatrix based on its unit.
-
Method Details
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(float[][] valuesInUnit, U unit, StorageType storageType)Instantiate the FloatMatrix based on its unit. Rigid check on types for the compiler. The float array is of the form f[rows][columns] so each value can be found with f[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
valuesInUnit
- float[][]; the values in the given unitunit
- U; the unit in which the values are expressed and displayedstorageType
- StorageType; whether the matrix is SPARSE or DENSE- Returns:
- M; an instantiated FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(float[][] valuesInUnit, U unit, StorageType storageType, Class<M> matrixClass)Instantiate the FloatMatrix based on its unit. Rigid check on types for the compiler. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes. The float array is of the form f[rows][columns] so each value can be found with f[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
valuesInUnit
- float[][]; the values in the given unitunit
- U; the unit in which the values are expressed and displayedstorageType
- StorageType; whether the matrix is SPARSE or DENSEmatrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated FloatMatrix with the values expressed in their unit
-
instantiateSI
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiateSI(float[][] valuesSI, U displayUnit, StorageType storageType)Instantiate the FloatMatrix based on its unit. Rigid check on types for the compiler. The float array is of the form f[rows][columns] so each value can be found with f[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
valuesSI
- float[][]; the values in the SI unitdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; whether the matrix is SPARSE or DENSE- Returns:
- M; an instantiated FloatMatrix with the SI values and display unit
-
instantiateSI
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiateSI(float[][] valuesSI, U displayUnit, StorageType storageType, Class<M> matrixClass)Instantiate the FloatMatrix based on its unit. Rigid check on types for the compiler. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes. The float array is of the form f[rows][columns] so each value can be found with f[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
valuesSI
- float[][]; the values in the SI unitdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; whether the matrix is SPARSE or DENSEmatrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated FloatMatrix with the SI values and display unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(FloatMatrixData values, U unit)Instantiate the Mutable FloatMatrix based on its unit. Rigid check on types for the compiler.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- FloatMatrixData; the valuesunit
- U; the unit in which the values are expressed- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(FloatMatrixData values, U unit, Class<M> matrixClass)Instantiate the Mutable FloatMatrix based on its unit. Rigid check on types for the compiler. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- FloatMatrixData; the valuesunit
- U; the unit in which the values are expressedmatrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(S[][] values, U displayUnit, StorageType storageType)Construct a new Relative Immutable Float Matrix. Rigid check on types for the compiler. The FloatScalar array is of the form fs[rows][columns] so each value can be found with fs[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- S[][]; the values of the entries in the new Relative Immutable Float MatrixdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(S[][] values, U displayUnit, StorageType storageType, Class<M> matrixClass)Construct a new Relative Immutable Float Matrix. Rigid check on types for the compiler. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes. The FloatScalar array is of the form fs[rows][columns] so each value can be found with fs[row][column].- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- S[][]; the values of the entries in the new Relative Immutable Float MatrixdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)matrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(Collection<FloatSparseValue<U,S>> values, int rows, int cols, U displayUnit, StorageType storageType)Construct a new Relative Immutable Float Matrix. Rigid check on types for the compiler.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- Collection<FloatSparseValue<U, S>>; the (sparse [X, Y, SI]) values to storerows
- int; the number of rows of the matrixcols
- int; the number of columns of the matrixdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiate
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiate(Collection<FloatSparseValue<U,S>> values, int rows, int cols, U displayUnit, StorageType storageType, Class<M> matrixClass)Construct a new Relative Immutable Float Matrix. Rigid check on types for the compiler. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- Collection<FloatSparseValue<U, S>>; the (sparse [X, Y, SI]) values to storerows
- int; the number of rows of the matrixcols
- int; the number of columns of the matrixdisplayUnit
- U; the unit in which the values will be displayedstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)matrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated mutable FloatMatrix with the values expressed in their unit
-
instantiateAnonymous
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiateAnonymous(FloatMatrixData values, Unit<?> unit)Instantiate the Immutable FloatMatrix based on its unit. Loose check for types on the compiler. This allows the unit to be specified as a Unit<?> type.
Note that it is possible to make mistakes with anonymous units.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- FloatMatrixData; the valuesunit
- Unit<?>; the unit in which the values are expressed- Returns:
- M; an instantiated FloatMatrix with the values expressed in their unit
-
instantiateAnonymous
public static <U extends Unit<U>, S extends FloatScalarInterface<U, S>, V extends FloatVectorInterface<U, S, V>, M extends FloatMatrixInterface<U, S, V, M>> M instantiateAnonymous(FloatMatrixData values, Unit<?> unit, Class<M> matrixClass)Instantiate the Immutable FloatMatrix based on its unit. Loose check for types on the compiler. This allows the unit to be specified as a Unit<?> type. The class for the matrix is explicitly provided, e.g., for user-defined matrix classes.
Note that it is possible to make mistakes with anonymous units.- Type Parameters:
U
- the unit typeS
- the corresponding scalar typeV
- the corresponding vector typeM
- the corresponding matrix type- Parameters:
values
- FloatMatrixData; the valuesunit
- Unit<?>; the unit in which the values are expressedmatrixClass
- Class<M>; the class of the matrix to instantiate- Returns:
- M; an instantiated FloatMatrix with the values expressed in their unit
-