Documentation of 'mikera.matrixx.impl.ScalarMatrix' Java class
ScalarMatrix
mikera.matrixx.impl

Class ScalarMatrix

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, ISparse, IMatrix, IFastBands


    public class ScalarMatrix
    extends ADiagonalMatrix
    Immutable scalar matrix class - a diagonal matrix with an identical value along the leading diagonal. When used to transform a vector, multiplies every component by a constant factor
    See Also:
    Serialized Form
    • Constructor Detail

      • ScalarMatrix

        public ScalarMatrix(int dimensions,
                            double scale)
    • Method Detail

      • isMutable

        public boolean isMutable()
        Description copied from interface: INDArray
        Returns true if the INDArray is mutable (at least partially)
        Specified by:
        isMutable in interface INDArray
        Specified by:
        isMutable in class ADiagonalMatrix
      • isFullyMutable

        public boolean isFullyMutable()
        Description copied from interface: INDArray
        If this method returns true, the INDArray is guaranteed to be fully mutable in all positions i.e. every position can store any valid double value
        Specified by:
        isFullyMutable in interface INDArray
        Overrides:
        isFullyMutable in class ADiagonalMatrix
      • get

        public double get(int row,
                          int column)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 2D matrix
        Specified by:
        get in interface INDArray
        Specified by:
        get in interface IMatrix
        Specified by:
        get in class AMatrix
      • unsafeGet

        public double unsafeGet(int row,
                                int column)
        Description copied from class: AMatrix
        Gets an element in the matrix in an unsafe fashion, without performing bound checks The result is undefined if the row and column are out of bounds.
        Overrides:
        unsafeGet in class AMatrix
        Returns:
      • create

        public static ScalarMatrix create(int dimensions,
                                          double scale)
      • trace

        public double trace()
        Description copied from interface: IMatrix
        Computes the trace of a matrix, i.e. the sum of all elements on the leading diagonal
        Specified by:
        trace in interface IMatrix
        Overrides:
        trace in class ADiagonalMatrix
        Returns:
      • multiplyCopy

        public AMatrix multiplyCopy(double d)
        Description copied from interface: INDArray
        Returns a copy of the array with all elements multiplied by a single constant value
        Specified by:
        multiplyCopy in interface INDArray
        Overrides:
        multiplyCopy in class AMatrix
        Parameters:
        d - A scalar factor
        Returns:
        A new array, with all element values scaled by the given factor
      • exactClone

        public ScalarMatrix exactClone()
        Description copied from interface: INDArray
        Creates a deep clone of an array, using the same class implementation as the original array
        Specified by:
        exactClone in interface INDArray
        Specified by:
        exactClone in class ADiagonalMatrix
        Returns:
        A clone of the original array

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.