Class FLOATMATRIX

java.lang.Object
org.djunits.value.vfloat.matrix.FLOATMATRIX

public final class FLOATMATRIX extends Object
FLOATMATRIX for creating different test matrices. Matrix values from a float array are stored as m[row][column].

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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float[][]
    denseRectArrays(int rows, int cols, boolean random)
    Return a rectangular array with all values != 0.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    S[][]
    denseRectScalarArrays(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
    Return a rectangular array with all values != 0.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<U,S>>
    denseRectTuples(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
    Return a collection of tuples with all values != 0.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<?,?>>
    denseRectTuplesAnonymous(int rows, int cols, Class<?> scalarClass, org.djunits.unit.Unit<?> unit, boolean random)
    Return a collection of tuples with all values != 0.
    static float[][]
    sparseRectArrays(int rows, int cols, boolean random)
    Return a rectangular array with only nonzero values on the diagonal.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    S[][]
    sparseRectScalarArrays(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
    Return a rectangular array with only nonzero values on the diagonal.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<U,S>>
    sparseRectTuples(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
    Return a collection of tuples with only nonzero values on the diagonal.
    static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>>
    Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<?,?>>
    sparseRectTuplesAnonymous(int rows, int cols, Class<?> scalarClass, org.djunits.unit.Unit<?> unit, boolean random)
    Return a collection of tuples with only nonzero values on the diagonal.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • denseRectArrays

      public static float[][] denseRectArrays(int rows, int cols, boolean random)
      Return a rectangular array with all values != 0.
      Parameters:
      rows - the number of rows
      cols - the number of columns
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      an array with all nonzero values
    • sparseRectArrays

      public static float[][] sparseRectArrays(int rows, int cols, boolean random)
      Return a rectangular array with only nonzero values on the diagonal.
      Parameters:
      rows - the number of rows
      cols - the number of columns
      random - boolean; whether values will contain a random element or are fully predictable
      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.vfloat.scalar.base.FloatScalar<U, S>> S[][] denseRectScalarArrays(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
      Return a rectangular array with all values != 0.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U; the unit to use for construction
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      an array with all nonzero values
    • sparseRectScalarArrays

      public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>> S[][] sparseRectScalarArrays(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
      Return a rectangular array with only nonzero values on the diagonal.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U; the unit to use for construction
      random - boolean; whether values will contain a random element or are fully predictable
      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.vfloat.scalar.base.FloatScalar<U, S>> Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<U,S>> denseRectTuples(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
      Return a collection of tuples with all values != 0.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U the unit
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      a collection with all nonzero values
    • denseRectTuplesAnonymous

      public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>> Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<?,?>> denseRectTuplesAnonymous(int rows, int cols, Class<?> scalarClass, org.djunits.unit.Unit<?> unit, boolean random)
      Return a collection of tuples with all values != 0.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U the unit
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      a collection with only nonzero values on the diagonal
    • sparseRectTuples

      public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>> Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<U,S>> sparseRectTuples(int rows, int cols, Class<S> scalarClass, U unit, boolean random)
      Return a collection of tuples with only nonzero values on the diagonal.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U the unit
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      a collection with only nonzero values on the diagonal
    • sparseRectTuplesAnonymous

      public static <U extends org.djunits.unit.Unit<U>, S extends org.djunits.value.vfloat.scalar.base.FloatScalar<U, S>> Collection<org.djunits.value.vfloat.matrix.base.FloatSparseValue<?,?>> sparseRectTuplesAnonymous(int rows, int cols, Class<?> scalarClass, org.djunits.unit.Unit<?> unit, boolean random)
      Return a collection of tuples with only nonzero values on the diagonal.
      Type Parameters:
      U - the unit type
      S - the scalar type
      Parameters:
      rows - the number of rows
      cols - the number of columns
      scalarClass - the class of scalars to use
      unit - U the unit
      random - boolean; whether values will contain a random element or are fully predictable
      Returns:
      a collection with only nonzero values on the diagonal