Documentation of 'mikera.vectorz.impl.ASizedVector' Java class
ASizedVector
mikera.vectorz.impl

Class ASizedVector

    • Method Detail

      • length

        public final int length()
        Description copied from interface: IVector
        Returns the length of a vector, in terms of the number of elements. For Euclidean length, use magnitude() instead
        Specified by:
        length in interface IVector
        Specified by:
        length in class AVector
        Returns:
      • elementCount

        public final long elementCount()
        Description copied from interface: INDArray
        Returns the total number of elements in this array. Equivalent to the product of all dimension sizes.
        Specified by:
        elementCount in interface INDArray
        Overrides:
        elementCount in class AVector
      • sliceCount

        public final int sliceCount()
        Description copied from interface: INDArray
        Returns the number of major slices in this array (i.e. the size of dimension 0)
        Specified by:
        sliceCount in interface INDArray
        Overrides:
        sliceCount in class AVector
      • get

        public final double get(long i)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 1D vector
        Specified by:
        get in interface INDArray
        Overrides:
        get in class AVector
      • getShape

        public final int[] getShape()
        Description copied from interface: INDArray
        Returns the shape of the array as an array of ints. WARNING: May return the internal int[] array describing the shape. Modifying this may cause undefined behaviour. If you want to guarantee a new int[] array that can be safely modified, use getShapeClone() instead
        Specified by:
        getShape in interface INDArray
        Overrides:
        getShape in class AVector
      • isSameShape

        public final boolean isSameShape(AVector a)
        Description copied from interface: IVector
        Returns true if this vector is exactly the same shape as another vector.
        Specified by:
        isSameShape in interface IVector
        Overrides:
        isSameShape in class AVector
        Returns:
      • checkRange

        public final int checkRange(int offset,
                                    int length)
        Description copied from class: AVector
        Utility function to check vector range and throw an exception if not valid. Returns the length of this vector
        Overrides:
        checkRange in class AVector
      • checkIndex

        public final int checkIndex(int i)
        Description copied from class: AVector
        Utility function to check an index and throw an exception in not in bounds. Returns the vector length
        Overrides:
        checkIndex in class AVector
      • checkLength

        public final int checkLength(int length)
        Description copied from class: AVector
        Checks that a vector is the specified length, throws an exception if not.
        Overrides:
        checkLength in class AVector
        Returns:
        The length of the vector
      • getShapeClone

        public final int[] getShapeClone()
        Description copied from interface: INDArray
        Returns the shape of the array as an array of ints, guaranteed to be a new array i.e. will perform a defensive copy of any internal shape array if required.
        Specified by:
        getShapeClone in interface INDArray
        Overrides:
        getShapeClone in class AVector
      • equalsArray

        public final boolean equalsArray(double[] data)
        Description copied from class: AVector
        Returns true if this vector exactly matches a double[] array.
        Specified by:
        equalsArray in interface INDArray
        Overrides:
        equalsArray in class AVector
        Parameters:
        data - Array of double element values to check for equality
        Returns:
      • equalsArray

        public boolean equalsArray(double[] data,
                                   int offset)
        Description copied from class: AVector
        Returns true if this vector exactly matches the elements in double[] array, starting from the specified offset
        Specified by:
        equalsArray in interface INDArray
        Overrides:
        equalsArray in class AVector
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • visitNonZero

        public double visitNonZero(IndexedElementVisitor elementVisitor)
        Description copied from class: AVector
        Visits all non-zero elements of this vector. Visitor may return a non-zero value to terminate early, which will return the given value. Returns 0.0 otherwise.
        Specified by:
        visitNonZero in class AVector

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.