Package org.djunits.value.vdouble.matrix
Class DOUBLEMATRIX
java.lang.Object
org.djunits.value.vdouble.matrix.DOUBLEMATRIX
public final class DOUBLEMATRIX extends Object
DOUBLEMATRIX for creating different test matrices. Matrix values from a double array are stored as m[row][column].
Copyright (c) 2019-2020 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 Type Method Description static double[][]
denseRectArrays(int rows, int cols)
Return a rectangular array with all values != 0.static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>>
S[][]denseRectScalarArrays(int rows, int cols, Class<S> scalarClass)
Return a rectangular array with all values != 0.static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>>
Collection<org.djunits.value.vdouble.matrix.base.DoubleSparseValue<U,S>>denseRectTuples(int rows, int cols, Class<S> scalarClass)
Return a rectangular array with all values != 0.static double[][]
sparseRectArrays(int rows, int cols)
Return a rectangular array with only nonzero values on the diagonal.static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>>
S[][]sparseRectScalarArrays(int rows, int cols, Class<S> scalarClass)
Return a rectangular array with only nonzero values on the diagonal.static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>>
Collection<org.djunits.value.vdouble.matrix.base.DoubleSparseValue<U,S>>sparseRectTuples(int rows, int cols, Class<S> scalarClass)
Return a rectangular array with only nonzero values on the diagonal.
-
Method Details
-
denseRectArrays
public static double[][] denseRectArrays(int rows, int cols)Return a rectangular array with all values != 0.- Parameters:
rows
- the number of rowscols
- the number of columns- Returns:
- an array with all nonzero values
-
sparseRectArrays
public static double[][] sparseRectArrays(int rows, int cols)Return a rectangular array with only nonzero values on the diagonal.- Parameters:
rows
- the number of rowscols
- the number of columns- Returns:
- an array with only nonzero values on the diagonal
-
denseRectScalarArrays
public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>> S[][] denseRectScalarArrays(int rows, int cols, Class<S> scalarClass)Return a rectangular array with all values != 0.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
rows
- the number of rowscols
- the number of columnsscalarClass
- the class of scalars to use- Returns:
- an array with all nonzero values
-
sparseRectScalarArrays
public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>> S[][] sparseRectScalarArrays(int rows, int cols, Class<S> scalarClass)Return a rectangular array with only nonzero values on the diagonal.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
rows
- the number of rowscols
- the number of columnsscalarClass
- the class of scalars to use- Returns:
- an array with only nonzero values on the diagonal
-
denseRectTuples
public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>> Collection<org.djunits.value.vdouble.matrix.base.DoubleSparseValue<U,S>> denseRectTuples(int rows, int cols, Class<S> scalarClass)Return a rectangular array with all values != 0.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
rows
- the number of rowscols
- the number of columnsscalarClass
- the class of scalars to use- Returns:
- an array with all nonzero values
-
sparseRectTuples
public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vdouble.scalar.base.DoubleScalarInterface<U, S>> Collection<org.djunits.value.vdouble.matrix.base.DoubleSparseValue<U,S>> sparseRectTuples(int rows, int cols, Class<S> scalarClass)Return a rectangular array with only nonzero values on the diagonal.- Type Parameters:
U
- the unit typeS
- the scalar type- Parameters:
rows
- the number of rowscols
- the number of columnsscalarClass
- the class of scalars to use- Returns:
- an array with only nonzero values on the diagonal
-