Package org.djunits.value.vfloat.vector
Class FLOATVECTOR
java.lang.Object
org.djunits.value.vfloat.vector.FLOATVECTOR
DOUBLEVECTOR for creating different test vectors.
Copyright (c) 2019-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck
-
Method Summary
Modifier and TypeMethodDescriptionstatic float[]
denseArray
(int size) Return an array with all values !static <U extends Unit<U>,
S extends FloatScalar<U, S>>
S[]denseScalarArray
(int size, Class<S> scalarClass) Return a scalar array with all values !static float[]
sparseArray
(int size) Return an array with nonzero values in every 10th place.static <U extends Unit<U>,
S extends FloatScalar<U, S>>
S[]sparseScalarArray
(int size, Class<S> scalarClass) Return a scalar array with nonzero values in every 10th place.
-
Method Details
-
denseArray
public static float[] denseArray(int size) Return an array with all values != 0.- Parameters:
size
- the number of cells- Returns:
- an array with all nonzero values
-
sparseArray
public static float[] sparseArray(int size) Return an array with nonzero values in every 10th place.- Parameters:
size
- the number of cells- Returns:
- an array with only nonzero values on the diagonal
-
denseScalarArray
public static <U extends Unit<U>,S extends FloatScalar<U, S[] denseScalarArrayS>> (int size, Class<S> scalarClass) Return a scalar array with all values != 0.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
size
- the number of cellsscalarClass
- the class of scalars to use- Returns:
- an array with all nonzero values
-
sparseScalarArray
public static <U extends Unit<U>,S extends FloatScalar<U, S[] sparseScalarArrayS>> (int size, Class<S> scalarClass) Return a scalar array with nonzero values in every 10th place.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
size
- the number of cellsscalarClass
- the class of scalars to use- Returns:
- an array with only nonzero values on the diagonal
-