Documentation of 'mikera.arrayz.impl.AbstractArray' Java class
AbstractArray
mikera.arrayz.impl

Class AbstractArray<T>

  • Type Parameters:
    T - The type of array slices
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<T>, INDArray
    Direct Known Subclasses:
    AMatrix, AScalar, AVector, BaseShapedArray


    public abstract class AbstractArray<T>
    extends java.lang.Object
    implements INDArray, java.lang.Iterable<T>
    Abstract base class for INDArray implementations Contains generic implementations for most INDArray operations, enabling new INDArray implementations to inherit these (at least until more optimised implementations can be written). Default implementations assume dimensionality of 1 or above Most INDArray instances should ultimately inherit from AbstractArray
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractArray() 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      void abs()
      Replaces all elements of this array with their absolute values, according to Math.abs(double)
      INDArray absCopy()
      Returns a copy of the array with the abs operator applied to each element
      void absDiff(INDArray a)
      Sets this array to the absolute values of the difference between this array and another
      INDArray absDiffCopy(INDArray a)
      Returns an array containing the absolute values of the difference between this array and another
      void add(AScalar a)
      Subtracts a scalar from every element of this array
      void add(double a)
      Adds a double value to all elements in this array.
      void add(INDArray a)
      Adds all the elements of another array to this array, in an elementwise order.
      void addApplyOp(Op op, INDArray a)
      Adds the result of applying an Op to another array to this array.
      void addAt(long i, double v)
      Adds to a mutable array, indexed by element position in row major order.
      INDArray addCopy(AScalar a) 
      INDArray addCopy(double d)
      Creates a new array equal to this array with a constant value added to every element
      INDArray addCopy(INDArray a)
      Creates a new array equal to the sum of this array with another array.
      void addInnerProduct(AMatrix a, INDArray b)
      Adds the inner product of a matrix and an array to this array
      void addInnerProduct(AVector a, INDArray b)
      Adds the inner product of a vector and an array to this array
      void addInnerProduct(INDArray a, INDArray b)
      Adds the inner product of two arrays to this array.
      void addInnerProduct(INDArray a, INDArray b, double d)
      Adds a scalar multiple of the inner product of two arrays to this array.
      void addMultiple(INDArray src, double factor)
      Adds a scaled multiple of another array to this array
      void addMultipleSparse(INDArray src, double factor)
      Adds a multiple of the source array to the non-sparse elements of this array
      void addOuterProduct(INDArray a, INDArray b)
      Adds the outer product of two arrays to this array.
      void addOuterProductSparse(INDArray a, INDArray b)
      Adds the outer product of two arrays to this array.
      void addPower(INDArray src, double exponent)
      Adds an array with all elements of the source array raised to the specified power
      void addPower(INDArray src, double exponent, double factor)
      Adds an array with all elements raised to the specified power and scaled by the given factor
      void addSparse(double c)
      Adds to the non-sparse elements of this array
      void addSparse(INDArray a)
      Adds the corresponding elements of the source array the non-sparse elements of this array
      void addToArray(double[] data, int offset)
      Adds all the elements of this array to a double array at the specified offset, in row-major order
      void applyOp(IOperator op)
      Applies a unary operator to all elements of the array (in-place)
      void applyOp(Op op)
      Applies a unary operator to all elements of the array (in-place)
      void applyOp(Op2 op, double b)
      Applies a binary operator to this array and a double value.
      void applyOp(Op2 op, INDArray b)
      Applies a binary operator to this array and a second array.
      INDArray applyOpCopy(Op op)
      Applies a unary operator to all elements of the array (creating a new array)
      double[] asDoubleArray()
      Returns the underlying double array representing the densely packed elements of this array.
      java.util.List<java.lang.Double> asElementList()
      Returns a List containing all elements of this array
      AVector asVector()
      Constructs a view of all elements in the array as a single vector in row-major order.
      INDArray broadcast(int... targetShape)
      Returns a view of this array broadcasted up to a larger shape
      INDArray broadcastCloneLike(INDArray target)
      Creates a mutable clone of the array, broadcasted upwards if necessary to match the shape of the target.
      INDArray broadcastCopyLike(INDArray target)
      Creates a copy of the array, broadcasted upwards if necessary to match the shape of the target Like broadCastCloneLike, but does not guarantee a fully mutable clone - hence may be faster when used with immutable or specialized arrays
      AMatrix broadcastLike(AMatrix target)
      Broadcasts an array to match the shape of the target matrix
      AVector broadcastLike(AVector target)
      Broadcasts an array to match the shape of the target vector
      INDArray broadcastLike(INDArray target)
      Broadcasts an array to match the shape of the target
      void clamp(double min, double max)
      Clamps all the elements of this array within the specified [min,max] range
      INDArray clone()
      Returns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original.
      int compareTo(INDArray a) 
      int componentCount()
      Returns the number of components of this array.
      INDArray copy()
      Returns a defensive copy of the array data.
      INDArray dense()
      Coerces this INDArray to a dense format, without changing its element values.
      INDArray denseClone()
      Creates a fully mutable dense clone of this array.
      double density() 
      void divide(double factor)
      Divides all elements by a given factor
      void divide(INDArray a)
      Divides all elements in place by the equivalent elements in a second array
      INDArray divideCopy(double d)
      Returns a copy of the array with all elements divided by a single constant value
      INDArray divideCopy(INDArray a)
      Divides all elements by the equivalent elements in a second array.
      double elementAbsPowSum(double p)
      Returns the sum of the absolute values of all the elements raised to a specified power
      java.util.Iterator<java.lang.Double> elementIterator()
      Returns an iterator over all elements in this array, in row-major order
      double elementMax()
      Returns the maximum element value in this array.
      double elementMaxAbs()
      Returns the maximum absolute element value in this array.
      double elementMin()
      Returns the maximum element value in this array.
      double elementPowSum(double p)
      Returns the sum of all the elements raised to a specified power
      double elementProduct()
      Returns the product of all elements in the array.
      boolean elementsEqual(double value)
      Returns true if all elements are equal to a specific value
      double elementSquaredSum()
      Returns the sum of squared elements in this array.
      double elementSum()
      Returns the sum of all elements in this array.
      INDArray ensureMutable()
      Ensures the array is a fully mutable representation.
      boolean epsilonEquals(INDArray a)
      Tests if this array is approximately equal to another array.
      boolean epsilonEquals(INDArray a, double epsilon)
      Tests is this array is approximately equal to another array, up to a given tolerance (epsilon) The arrays must have the same shape
      boolean equals(AVector a)
      Returns true if this array is exactly equal to a vector.
      boolean equals(INDArray a)
      Checks if two arrays are equal exactly in terms of both value and shape Element equality checks are consistent with compareTo
      boolean equals(java.lang.Object o) 
      boolean equalsArray(double[] data)
      Returns true if the elements in this array exactly match the elements in the given array, in row-major order.
      boolean equalsArray(double[] data, int offset)
      Returns true if the elements in this array exactly match the elements in the given array, in row-major order
      void exp()
      Computes the function e^x (in-place) for all array elements
      void fill(double value)
      Fills this array with a single double value.
      abstract double get()
      Returns the double value of a scalar array
      double get(AIndex ix)
      Returns the double value at the specified position in the array
      double get(Index ix)
      Returns the double value at the specified position in the array
      abstract double get(int i)
      Returns the double value at the specified position in a 1D vector
      abstract double get(int i, int j)
      Returns the double value at the specified position in a 2D matrix
      double get(long i)
      Returns the double value at the specified position in a 1D vector
      double get(long[] xs)
      Returns the double value at the specified index position in an array
      double get(long x, long y)
      Returns the double value at the specified position in a 2D matrix
      INDArray getComponent(int k)
      Gets a component from the array at the specified index Will throw an error if components are not supported, or if the component is out of bounds as defined by 0 <= k
      INDArray[] getComponents()
      Gets all components in a new array, with length componentCount();
      double[] getElements()
      Gets all elements of the array as a Java double[] array
      void getElements(double[] arr)
      Copies all elements of this INDArray to the specified double array
      void getElements(double[] dest, int offset)
      Copies all elements of this array a double array at the specified offset
      void getElements(java.lang.Object[] dest, int offset)
      Copies all elements of this array into an object array at the specified offset
      long[] getLongShape()
      Returns the shape of the array as an array of longs.
      int getShape(int dim)
      Returns the dimension size for a specific dimension in the array's shape
      int[] getShapeClone()
      Returns the shape of the array as an array of ints, guaranteed to be a new array i.e.
      java.util.List<?> getSlices()
      Returns a list of all major slices of this array.
      java.util.List<?> getSlices(int dimension)
      Returns a list of all slices of this array along a given dimension.
      java.util.List<INDArray> getSliceViews()
      Returns a list of slices as mutable INDArray views.
      INDArray getTranspose()
      Returns the transpose of this array.
      INDArray getTransposeCopy()
      Returns a transposed copy of the array.
      INDArray getTransposeView()
      Returns a transposed view of the array.
      int hashCode() 
      boolean hasUncountable()
      Returns true if any element is this array is NaN or infinite
      INDArray immutable()
      Returns an immutable version of this array.
      INDArray innerProduct(AScalar s)
      Calculates the inner product of this array with a scalar
      INDArray innerProduct(AVector a)
      Computes the inner product of this array with a vector
      INDArray innerProduct(double a)
      Calculates the inner product of this array with a double value
      INDArray innerProduct(INDArray a)
      Calculates the inner product of this array with another array.
      boolean isBoolean()
      Returns true if the array is boolean (contains only 0.0 or 1.0 values)
      boolean isDense()
      Returns true if the array is in a dense format.
      boolean isElementConstrained()
      Returns true if this array has some constraints on element values
      boolean isFullyMutable()
      If this method returns true, the INDArray is guaranteed to be fully mutable in all positions i.e.
      boolean isMutable()
      Returns true if the INDArray is mutable (at least partially)
      boolean isSameShape(INDArray a)
      Returns true if this array is the same shape as another array
      boolean isSparse()
      Returns true if the array is in a sparse format
      boolean isZero()
      Returns true if the array is zero (all elements equal to zero)
      java.util.Iterator<T> iterator() 
      INDArray join(INDArray a)
      Joins an array with another array along the major dimension Guarantees a view that combines the two joined arrays.
      INDArray join(INDArray a, int dimension)
      Joins an array with another array along a specified dimension.
      void log()
      Computes the natural logarithm (in-place) for all array elements
      void multiply(double d)
      Multiplies all elements of the array in place by a given double value
      void multiply(INDArray a)
      Multiplies all elements by the equivalent elements in a second array, i.e.
      INDArray multiplyCopy(double d)
      Returns a copy of the array with all elements multiplied by a single constant value
      INDArray multiplyCopy(INDArray a)
      Multiplies all elements by the equivalent elements in a second array, i.e.
      INDArray mutable()
      Coerces this INDArray to a fully mutable format.
      void negate()
      Negates all elements in the array in place
      INDArray negateCopy()
      Negates all elements in the array, returning a new array
      long nonZeroCount()
      Returns the number of non-zero elements in the array.
      INDArray outerProduct(INDArray a)
      Calculates the outer product of this array with another array.
      void pow(double exponent)
      Raises all elements of the array to a specified power in place
      void reciprocal()
      Replaces all elements in the array with their reciprocal
      INDArray reciprocalCopy()
      Returns a new array where every element is the reciprocal of the corresponding element in this array
      double reduce(Op2 op)
      Reduces over all elements of the array in row-major order.
      double reduce(Op2 op, double init)
      Reduces over all elements of the array in row-major order.
      AVector reduceSlices(Op2 op)
      Reduces each vector slice of the array by the given binary operator Reduces down to a single vector
      AVector reduceSlices(Op2 op, double init)
      Reduces each slice of the array by the given binary operator.
      INDArray reorder(int[] order)
      Returns a re-ordered array by taking the specified order of slices along dimension 0
      INDArray reorder(int dim, int[] order)
      Returns a re-ordered array by taking the specified order of slices along a given dimension May or may not use views of underlying slices (i.e.
      INDArray reshape(int... targetShape)
      Returns a new array by rearranging the elements of this array into the desired shape Truncates or zero-pads the elements as required to fill the new shape
      INDArray rotateView(int dimension, int shift)
      Returns rotated view of this array
      void scale(double d)
      Scales all elements of the array in place by a given double value
      void scaleAdd(double factor, double constant)
      Scales all elements of the array by a given double value and adds a constant value
      void scaleAdd(double factor, INDArray b, double bfactor, double constant)
      Scales all elements of the array by a given double value, adds a scaled second array and adds a constant value
      INDArray scaleCopy(double d)
      Scales all elements of the array by a given double value, returning a new array
      void set(double value)
      Sets all elements of an array to a specific double value
      void set(INDArray a)
      Sets this array to the element values contained in another array.
      void set(int x, double value)
      Sets a value at a given position in a mutable 1D array
      void set(int x, int y, double value)
      Sets a value at a given position in a mutable 2D array
      void set(long[] xs, double value)
      Sets the element at the given indexed position in a mutable array
      void set(java.lang.Object o)
      Sets this array to the element values contained in the given object.
      void setApplyOp(Op op, INDArray a)
      Sets this array to the result of applying an operation to a source array
      void setElements(double... values)
      Sets all elements in an array using the given double values
      void setElements(double[] values, int offset)
      Sets all elements in an array using the given double values
      void setElements(int pos, double[] values, int offset, int length)
      Sets elements in an array using the given double values.
      void setInnerProduct(INDArray a, INDArray b)
      Sets this array to the inner product of two arrays.
      void setMultiple(INDArray a, double b)
      Sets this array to be the multiple of another array.
      void setMultiple(INDArray a, INDArray b)
      Sets this array to the element-wise multiple of two arrays.
      void setSparse(double value)
      Sets the non-sparse elements of this array to the specified value May throw an exception if non-sparse elements are not mutable
      void setSparse(INDArray a)
      Sets the non-sparse elements of this array to the corresponding elements of the source array
      void signum()
      Calculates the signum of all elements of this mutable array Sets each component of the array to its sign value (-1, 0 or 1)
      INDArray signumCopy()
      Returns a copy of the array with the signum operator applied to each element
      java.lang.Object sliceValue(int i)
      Returns the value of a major slice of this array (slice along dimension 0) Like 'slice', except returns a Double value for slices of 1D vectors
      INDArray sparse()
      Coerces this INDArray to a sparse format, without changing its element values.
      INDArray sparseClone()
      Creates a fully mutable clone of this array.
      void sqrt()
      Computes the square root of all elements in the array
      void square()
      Squares all elements of the array in place
      INDArray squareCopy()
      Squares all elements of the array, returning a new array
      void sub(AScalar a)
      Subtracts a scalar from every element of this array
      void sub(double a)
      Subtracts a double value from all elements in this array
      void sub(INDArray a)
      Subtracts all the elements of another array from this array, in an elementwise order.
      INDArray subArray(int[] offsets, int[] shape)
      Returns a subarray view of a larger array
      INDArray subCopy(INDArray a)
      Creates a new array equal to the subtraction of another array from this array
      double[] toDoubleArray()
      Copies the elements of this array to a new double[] array.
      void toDoubleBuffer(java.nio.DoubleBuffer dest)
      Copies the elements of this INDArray to the specified double buffer.
      INDArray[] toSliceArray()
      Copies the slices of this array to a new INDArray[] Throws an error if the array has no slices (i.e.
      java.lang.String toString() 
      java.lang.String toStringFull() 
      Vector toVector()
      Coerces the array into a flattened dense Vector, in row-major order.
      void validate()
      Validates the internal data structure of the INDArray.
      INDArray withComponents(INDArray... cs)
      Returns a new array of the same shape/structure as the original but with the specified components.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • AbstractArray

        public AbstractArray()
    • Method Detail

      • get

        public abstract double get()
        Description copied from interface: INDArray
        Returns the double value of a scalar array
        Specified by:
        get in interface INDArray
      • get

        public abstract double get(int i)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 1D vector
        Specified by:
        get in interface INDArray
      • get

        public 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
      • get

        public abstract double get(int i,
                                   int j)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 2D matrix
        Specified by:
        get in interface INDArray
      • get

        public double get(long x,
                          long y)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 2D matrix
        Specified by:
        get in interface INDArray
      • get

        public double get(long[] xs)
        Description copied from interface: INDArray
        Returns the double value at the specified index position in an array
        Specified by:
        get in interface INDArray
      • get

        public double get(AIndex ix)
        Description copied from interface: INDArray
        Returns the double value at the specified position in the array
        Specified by:
        get in interface INDArray
      • get

        public double get(Index ix)
        Description copied from interface: INDArray
        Returns the double value at the specified position in the array
        Specified by:
        get in interface INDArray
      • getShape

        public int getShape(int dim)
        Description copied from interface: INDArray
        Returns the dimension size for a specific dimension in the array's shape
        Specified by:
        getShape in interface INDArray
      • getShapeClone

        public 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
      • getLongShape

        public long[] getLongShape()
        Description copied from interface: INDArray
        Returns the shape of the array as an array of longs.
        Specified by:
        getLongShape in interface INDArray
      • epsilonEquals

        public final boolean epsilonEquals(INDArray a)
        Description copied from interface: INDArray
        Tests if this array is approximately equal to another array. The arrays must have the same shape.
        Specified by:
        epsilonEquals in interface INDArray
      • epsilonEquals

        public boolean epsilonEquals(INDArray a,
                                     double epsilon)
        Description copied from interface: INDArray
        Tests is this array is approximately equal to another array, up to a given tolerance (epsilon) The arrays must have the same shape
        Specified by:
        epsilonEquals in interface INDArray
      • isBoolean

        public boolean isBoolean()
        Description copied from interface: INDArray
        Returns true if the array is boolean (contains only 0.0 or 1.0 values)
        Specified by:
        isBoolean in interface INDArray
      • isSparse

        public boolean isSparse()
        Description copied from interface: INDArray
        Returns true if the array is in a sparse format
        Specified by:
        isSparse in interface INDArray
      • isDense

        public boolean isDense()
        Description copied from interface: INDArray
        Returns true if the array is in a dense format. A dense format uses efficient storage proportional to the number of elements
        Specified by:
        isDense in interface INDArray
      • 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
      • 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
      • applyOp

        public void applyOp(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (in-place)
        Specified by:
        applyOp in interface INDArray
      • applyOp

        public void applyOp(IOperator op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (in-place)
        Specified by:
        applyOp in interface INDArray
        Parameters:
        op - The operator to apply to the array
      • applyOp

        public void applyOp(Op2 op,
                            INDArray b)
        Description copied from interface: INDArray
        Applies a binary operator to this array and a second array. Broadcasts the second array to the shape of this array if required.
        Specified by:
        applyOp in interface INDArray
      • applyOp

        public void applyOp(Op2 op,
                            double b)
        Description copied from interface: INDArray
        Applies a binary operator to this array and a double value. Works as if the double value was broadcast to the shape of this array.
        Specified by:
        applyOp in interface INDArray
      • multiply

        public void multiply(double d)
        Description copied from interface: INDArray
        Multiplies all elements of the array in place by a given double value
        Specified by:
        multiply in interface INDArray
      • multiplyCopy

        public INDArray 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
        Parameters:
        d - A scalar factor
        Returns:
        A new array, with all element values scaled by the given factor
      • divideCopy

        public INDArray divideCopy(double d)
        Description copied from interface: INDArray
        Returns a copy of the array with all elements divided by a single constant value
        Specified by:
        divideCopy in interface INDArray
        Returns:
        A new array, with all element values scaled by the given factor
      • applyOpCopy

        public INDArray applyOpCopy(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (creating a new array)
        Specified by:
        applyOpCopy in interface INDArray
      • reduce

        public double reduce(Op2 op,
                             double init)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the initial/previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
      • reduce

        public double reduce(Op2 op)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
      • isElementConstrained

        public boolean isElementConstrained()
        Description copied from interface: INDArray
        Returns true if this array has some constraints on element values
        Specified by:
        isElementConstrained in interface INDArray
      • isSameShape

        public boolean isSameShape(INDArray a)
        Description copied from interface: INDArray
        Returns true if this array is the same shape as another array
        Specified by:
        isSameShape in interface INDArray
      • asVector

        public AVector asVector()
        Description copied from interface: INDArray
        Constructs a view of all elements in the array as a single vector in row-major order.
        Specified by:
        asVector in interface INDArray
      • setElements

        public void setElements(double[] values,
                                int offset)
        Description copied from interface: INDArray
        Sets all elements in an array using the given double values
        Specified by:
        setElements in interface INDArray
        Parameters:
        values - Element values in a double[] array. There must be at least as many element values as elements in this array.
        offset - Position in the values array from which to start taking values.
      • setElements

        public void setElements(int pos,
                                double[] values,
                                int offset,
                                int length)
        Description copied from interface: INDArray
        Sets elements in an array using the given double values. The source array must contain at least the specified length in terms of number of elements
        Specified by:
        setElements in interface INDArray
        Parameters:
        pos - Offset into this array, expressed in terms of number of elements in row major order
        values - Element values in a double[] array. There must be at least as many element values as elements in this array.
        offset - Position in the values array from which to start taking values.
        length - Number of elements to set.
      • isZero

        public boolean isZero()
        Description copied from interface: INDArray
        Returns true if the array is zero (all elements equal to zero)
        Specified by:
        isZero in interface INDArray
      • ensureMutable

        public INDArray ensureMutable()
        Description copied from interface: INDArray
        Ensures the array is a fully mutable representation. Returns either the same array or a new clone.
        Specified by:
        ensureMutable in interface INDArray
      • fill

        public void fill(double value)
        Description copied from interface: INDArray
        Fills this array with a single double value. Requires the array to be mutable.
        Specified by:
        fill in interface INDArray
      • innerProduct

        public INDArray innerProduct(double a)
        Description copied from interface: INDArray
        Calculates the inner product of this array with a double value
        Specified by:
        innerProduct in interface INDArray
      • innerProduct

        public INDArray innerProduct(AVector a)
        Description copied from interface: INDArray
        Computes the inner product of this array with a vector
        Specified by:
        innerProduct in interface INDArray
        Parameters:
        a - A vector
        Returns:
        A new array representing the inner product
      • getTranspose

        public INDArray getTranspose()
        Description copied from interface: INDArray
        Returns the transpose of this array. A transpose of an array is equivalent to reversing the order of dimensions. May or may not return a view depending on the array type.
        Specified by:
        getTranspose in interface INDArray
      • getTransposeView

        public INDArray getTransposeView()
        Description copied from interface: INDArray
        Returns a transposed view of the array. May throw UnsupportedOperationException if the array type does not support this capability
        Specified by:
        getTransposeView in interface INDArray
      • getTransposeCopy

        public INDArray getTransposeCopy()
        Description copied from interface: INDArray
        Returns a transposed copy of the array. Guarantees a new defensive copy.
        Specified by:
        getTransposeCopy in interface INDArray
      • scale

        public final void scale(double d)
        Description copied from interface: INDArray
        Scales all elements of the array in place by a given double value
        Specified by:
        scale in interface INDArray
      • scaleAdd

        public void scaleAdd(double factor,
                             double constant)
        Description copied from interface: INDArray
        Scales all elements of the array by a given double value and adds a constant value
        Specified by:
        scaleAdd in interface INDArray
      • scaleAdd

        public void scaleAdd(double factor,
                             INDArray b,
                             double bfactor,
                             double constant)
        Description copied from interface: INDArray
        Scales all elements of the array by a given double value, adds a scaled second array and adds a constant value
        Specified by:
        scaleAdd in interface INDArray
      • addMultiple

        public void addMultiple(INDArray src,
                                double factor)
        Description copied from interface: INDArray
        Adds a scaled multiple of another array to this array
        Specified by:
        addMultiple in interface INDArray
      • addMultipleSparse

        public void addMultipleSparse(INDArray src,
                                      double factor)
        Description copied from interface: INDArray
        Adds a multiple of the source array to the non-sparse elements of this array
        Specified by:
        addMultipleSparse in interface INDArray
      • addPower

        public void addPower(INDArray src,
                             double exponent)
        Description copied from interface: INDArray
        Adds an array with all elements of the source array raised to the specified power
        Specified by:
        addPower in interface INDArray
      • addPower

        public void addPower(INDArray src,
                             double exponent,
                             double factor)
        Description copied from interface: INDArray
        Adds an array with all elements raised to the specified power and scaled by the given factor
        Specified by:
        addPower in interface INDArray
      • addInnerProduct

        public void addInnerProduct(INDArray a,
                                    INDArray b,
                                    double d)
        Description copied from interface: INDArray
        Adds a scalar multiple of the inner product of two arrays to this array.
        Specified by:
        addInnerProduct in interface INDArray
      • addInnerProduct

        public void addInnerProduct(AMatrix a,
                                    INDArray b)
        Adds the inner product of a matrix and an array to this array
        Parameters:
        a -
        b -
      • addInnerProduct

        public void addInnerProduct(AVector a,
                                    INDArray b)
        Adds the inner product of a vector and an array to this array
        Parameters:
        a -
        b -
      • addOuterProductSparse

        public void addOuterProductSparse(INDArray a,
                                          INDArray b)
        Description copied from interface: INDArray
        Adds the outer product of two arrays to this array. Only affects the mutable, non-sparse elements of this array.
        Specified by:
        addOuterProductSparse in interface INDArray
      • addSparse

        public void addSparse(double c)
        Description copied from interface: INDArray
        Adds to the non-sparse elements of this array
        Specified by:
        addSparse in interface INDArray
      • addSparse

        public void addSparse(INDArray a)
        Description copied from interface: INDArray
        Adds the corresponding elements of the source array the non-sparse elements of this array
        Specified by:
        addSparse in interface INDArray
      • setInnerProduct

        public void setInnerProduct(INDArray a,
                                    INDArray b)
        Description copied from interface: INDArray
        Sets this array to the inner product of two arrays. Must be the correct shape.
        Specified by:
        setInnerProduct in interface INDArray
      • setMultiple

        public void setMultiple(INDArray a,
                                INDArray b)
        Description copied from interface: INDArray
        Sets this array to the element-wise multiple of two arrays. Must have compatible shapes.
        Specified by:
        setMultiple in interface INDArray
      • setMultiple

        public void setMultiple(INDArray a,
                                double b)
        Description copied from interface: INDArray
        Sets this array to be the multiple of another array. Must have compatible shapes.
        Specified by:
        setMultiple in interface INDArray
      • setSparse

        public void setSparse(INDArray a)
        Description copied from interface: INDArray
        Sets the non-sparse elements of this array to the corresponding elements of the source array
        Specified by:
        setSparse in interface INDArray
      • setSparse

        public void setSparse(double value)
        Description copied from interface: INDArray
        Sets the non-sparse elements of this array to the specified value May throw an exception if non-sparse elements are not mutable
        Specified by:
        setSparse in interface INDArray
      • addCopy

        public INDArray addCopy(double d)
        Description copied from interface: INDArray
        Creates a new array equal to this array with a constant value added to every element
        Specified by:
        addCopy in interface INDArray
        Returns:
      • set

        public void set(double value)
        Description copied from interface: INDArray
        Sets all elements of an array to a specific double value
        Specified by:
        set in interface INDArray
      • set

        public void set(int x,
                        double value)
        Description copied from interface: INDArray
        Sets a value at a given position in a mutable 1D array
        Specified by:
        set in interface INDArray
      • set

        public void set(int x,
                        int y,
                        double value)
        Description copied from interface: INDArray
        Sets a value at a given position in a mutable 2D array
        Specified by:
        set in interface INDArray
      • set

        public void set(long[] xs,
                        double value)
        Description copied from interface: INDArray
        Sets the element at the given indexed position in a mutable array
        Specified by:
        set in interface INDArray
      • set

        public void set(INDArray a)
        Description copied from interface: INDArray
        Sets this array to the element values contained in another array. Broadcasts the source array if necessary to the shape of this array. Throws an exception if the shapes are incompatible.
        Specified by:
        set in interface INDArray
      • setApplyOp

        public void setApplyOp(Op op,
                               INDArray a)
        Description copied from interface: INDArray
        Sets this array to the result of applying an operation to a source array
        Specified by:
        setApplyOp in interface INDArray
      • addApplyOp

        public void addApplyOp(Op op,
                               INDArray a)
        Description copied from interface: INDArray
        Adds the result of applying an Op to another array to this array.
        Specified by:
        addApplyOp in interface INDArray
        Parameters:
        op - A Vectorz Op
      • clamp

        public void clamp(double min,
                          double max)
        Description copied from interface: INDArray
        Clamps all the elements of this array within the specified [min,max] range
        Specified by:
        clamp in interface INDArray
      • set

        public void set(java.lang.Object o)
        Description copied from interface: INDArray
        Sets this array to the element values contained in the given object. Attempts to interpret the object as an array, and broadcasts the object to the shape of this array if required.
        Specified by:
        set in interface INDArray
      • setElements

        public void setElements(double... values)
        Description copied from interface: INDArray
        Sets all elements in an array using the given double values
        Specified by:
        setElements in interface INDArray
        Parameters:
        values - Element values in a double[] array. There must be at least as many element values as elements in this array.
      • square

        public void square()
        Description copied from interface: INDArray
        Squares all elements of the array in place
        Specified by:
        square in interface INDArray
      • squareCopy

        public INDArray squareCopy()
        Description copied from interface: INDArray
        Squares all elements of the array, returning a new array
        Specified by:
        squareCopy in interface INDArray
      • absCopy

        public INDArray absCopy()
        Description copied from interface: INDArray
        Returns a copy of the array with the abs operator applied to each element
        Specified by:
        absCopy in interface INDArray
        Returns:
        A new array containing the absolute element values
      • reciprocalCopy

        public INDArray reciprocalCopy()
        Description copied from interface: INDArray
        Returns a new array where every element is the reciprocal of the corresponding element in this array
        Specified by:
        reciprocalCopy in interface INDArray
      • signumCopy

        public INDArray signumCopy()
        Description copied from interface: INDArray
        Returns a copy of the array with the signum operator applied to each element
        Specified by:
        signumCopy in interface INDArray
        Returns:
        A new array containing the signums of element values
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • elementIterator

        public java.util.Iterator<java.lang.Double> elementIterator()
        Description copied from interface: INDArray
        Returns an iterator over all elements in this array, in row-major order
        Specified by:
        elementIterator in interface INDArray
      • equals

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • equalsArray

        public boolean equalsArray(double[] data)
        Description copied from interface: INDArray
        Returns true if the elements in this array exactly match the elements in the given array, in row-major order. Returns false otherwise.
        Specified by:
        equalsArray in interface INDArray
        Parameters:
        data - Array of double element values to check for equality
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringFull

        public java.lang.String toStringFull()
      • clone

        public INDArray clone()
        Description copied from interface: INDArray
        Returns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original. Clone should attempt to return the most efficient possible array type. Clone should preserve sparsity property where possible, but this is not guaranteed.
        Specified by:
        clone in interface INDArray
        Overrides:
        clone in class java.lang.Object
      • copy

        public INDArray copy()
        Description copied from interface: INDArray
        Returns a defensive copy of the array data. Use this if the original array might change and you need a defensive copy. May return the same array if the original was immutable, otherwise will return a defensive copy.
        Specified by:
        copy in interface INDArray
      • scaleCopy

        public INDArray scaleCopy(double d)
        Description copied from interface: INDArray
        Scales all elements of the array by a given double value, returning a new array
        Specified by:
        scaleCopy in interface INDArray
      • negateCopy

        public INDArray negateCopy()
        Description copied from interface: INDArray
        Negates all elements in the array, returning a new array
        Specified by:
        negateCopy in interface INDArray
      • equals

        public boolean equals(INDArray a)
        Description copied from interface: INDArray
        Checks if two arrays are equal exactly in terms of both value and shape Element equality checks are consistent with compareTo
        Specified by:
        equals in interface INDArray
      • equals

        public boolean equals(AVector a)
        Returns true if this array is exactly equal to a vector.
        Parameters:
        a -
        Returns:
      • equalsArray

        public boolean equalsArray(double[] data,
                                   int offset)
        Description copied from interface: INDArray
        Returns true if the elements in this array exactly match the elements in the given array, in row-major order
        Specified by:
        equalsArray in interface INDArray
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • add

        public void add(INDArray a)
        Description copied from interface: INDArray
        Adds all the elements of another array to this array, in an elementwise order.
        Specified by:
        add in interface INDArray
      • sub

        public final void sub(AScalar a)
        Subtracts a scalar from every element of this array
        Parameters:
        a -
      • add

        public final void add(AScalar a)
        Subtracts a scalar from every element of this array
        Parameters:
        a -
      • add

        public void add(double a)
        Description copied from interface: INDArray
        Adds a double value to all elements in this array. Implementations may optimize the case of 0.0
        Specified by:
        add in interface INDArray
      • addAt

        public void addAt(long i,
                          double v)
        Description copied from interface: INDArray
        Adds to a mutable array, indexed by element position in row major order. This is an unsafe operation: bounds are not checked
        Specified by:
        addAt in interface INDArray
      • addCopy

        public INDArray addCopy(INDArray a)
        Description copied from interface: INDArray
        Creates a new array equal to the sum of this array with another array.
        Specified by:
        addCopy in interface INDArray
        Returns:
      • subCopy

        public INDArray subCopy(INDArray a)
        Description copied from interface: INDArray
        Creates a new array equal to the subtraction of another array from this array
        Specified by:
        subCopy in interface INDArray
        Returns:
      • multiplyCopy

        public INDArray multiplyCopy(INDArray a)
        Description copied from interface: INDArray
        Multiplies all elements by the equivalent elements in a second array, i.e. performs elementwise multiplication. Returns a new array. If matrix-style multiplication is required, use innerProduct instead.
        Specified by:
        multiplyCopy in interface INDArray
      • divideCopy

        public INDArray divideCopy(INDArray a)
        Description copied from interface: INDArray
        Divides all elements by the equivalent elements in a second array. Returns a new array.
        Specified by:
        divideCopy in interface INDArray
      • addToArray

        public void addToArray(double[] data,
                               int offset)
        Description copied from interface: INDArray
        Adds all the elements of this array to a double array at the specified offset, in row-major order
        Specified by:
        addToArray in interface INDArray
      • pow

        public void pow(double exponent)
        Description copied from interface: INDArray
        Raises all elements of the array to a specified power in place
        Specified by:
        pow in interface INDArray
      • sub

        public void sub(double a)
        Description copied from interface: INDArray
        Subtracts a double value from all elements in this array
        Specified by:
        sub in interface INDArray
      • multiply

        public void multiply(INDArray a)
        Description copied from interface: INDArray
        Multiplies all elements by the equivalent elements in a second array, i.e. performs elementwise multiplication. If matrix-style multiplication is required, use innerProduct instead.
        Specified by:
        multiply in interface INDArray
      • divide

        public void divide(INDArray a)
        Description copied from interface: INDArray
        Divides all elements in place by the equivalent elements in a second array
        Specified by:
        divide in interface INDArray
      • divide

        public void divide(double factor)
        Description copied from interface: INDArray
        Divides all elements by a given factor
        Specified by:
        divide in interface INDArray
      • nonZeroCount

        public long nonZeroCount()
        Description copied from interface: INDArray
        Returns the number of non-zero elements in the array.
        Specified by:
        nonZeroCount in interface INDArray
      • density

        public double density()
      • elementSum

        public double elementSum()
        Description copied from interface: INDArray
        Returns the sum of all elements in this array.
        Specified by:
        elementSum in interface INDArray
      • elementProduct

        public double elementProduct()
        Description copied from interface: INDArray
        Returns the product of all elements in the array.
        Specified by:
        elementProduct in interface INDArray
        Returns:
      • elementMax

        public double elementMax()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMax in interface INDArray
      • elementsEqual

        public boolean elementsEqual(double value)
        Description copied from interface: INDArray
        Returns true if all elements are equal to a specific value
        Specified by:
        elementsEqual in interface INDArray
      • elementMin

        public double elementMin()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMin in interface INDArray
      • elementSquaredSum

        public double elementSquaredSum()
        Description copied from interface: INDArray
        Returns the sum of squared elements in this array.
        Specified by:
        elementSquaredSum in interface INDArray
      • sub

        public void sub(INDArray a)
        Description copied from interface: INDArray
        Subtracts all the elements of another array from this array, in an elementwise order.
        Specified by:
        sub in interface INDArray
      • negate

        public void negate()
        Description copied from interface: INDArray
        Negates all elements in the array in place
        Specified by:
        negate in interface INDArray
      • reciprocal

        public void reciprocal()
        Description copied from interface: INDArray
        Replaces all elements in the array with their reciprocal
        Specified by:
        reciprocal in interface INDArray
      • abs

        public void abs()
        Description copied from interface: INDArray
        Replaces all elements of this array with their absolute values, according to Math.abs(double)
        Specified by:
        abs in interface INDArray
      • absDiff

        public void absDiff(INDArray a)
        Description copied from interface: INDArray
        Sets this array to the absolute values of the difference between this array and another
        Specified by:
        absDiff in interface INDArray
      • absDiffCopy

        public INDArray absDiffCopy(INDArray a)
        Description copied from interface: INDArray
        Returns an array containing the absolute values of the difference between this array and another
        Specified by:
        absDiffCopy in interface INDArray
        Returns:
        A new array containing the absolute element values
      • sqrt

        public void sqrt()
        Description copied from interface: INDArray
        Computes the square root of all elements in the array
        Specified by:
        sqrt in interface INDArray
      • log

        public void log()
        Description copied from interface: INDArray
        Computes the natural logarithm (in-place) for all array elements
        Specified by:
        log in interface INDArray
      • exp

        public void exp()
        Description copied from interface: INDArray
        Computes the function e^x (in-place) for all array elements
        Specified by:
        exp in interface INDArray
      • signum

        public void signum()
        Description copied from interface: INDArray
        Calculates the signum of all elements of this mutable array Sets each component of the array to its sign value (-1, 0 or 1)
        Specified by:
        signum in interface INDArray
      • reshape

        public INDArray reshape(int... targetShape)
        Description copied from interface: INDArray
        Returns a new array by rearranging the elements of this array into the desired shape Truncates or zero-pads the elements as required to fill the new shape
        Specified by:
        reshape in interface INDArray
      • reorder

        public INDArray reorder(int dim,
                                int[] order)
        Description copied from interface: INDArray
        Returns a re-ordered array by taking the specified order of slices along a given dimension May or may not use views of underlying slices (i.e. may be a reordered view)
        Specified by:
        reorder in interface INDArray
      • reorder

        public INDArray reorder(int[] order)
        Description copied from interface: INDArray
        Returns a re-ordered array by taking the specified order of slices along dimension 0
        Specified by:
        reorder in interface INDArray
      • getSlices

        public java.util.List<?> getSlices(int dimension)
        Description copied from interface: INDArray
        Returns a list of all slices of this array along a given dimension. Returns a list of Double values if a 1-dimensional array is sliced, otherwise a list of INDArray instances
        Specified by:
        getSlices in interface INDArray
      • getSlices

        public java.util.List<?> getSlices()
        Description copied from interface: INDArray
        Returns a list of all major slices of this array. Returns a list of Double values if a 1-dimensional array is sliced, otherwise a list of INDArray instances
        Specified by:
        getSlices in interface INDArray
      • getSliceViews

        public java.util.List<INDArray> getSliceViews()
        Description copied from interface: INDArray
        Returns a list of slices as mutable INDArray views. Note: will return a list of AScalar values when this array is a 1D vector
        Specified by:
        getSliceViews in interface INDArray
      • componentCount

        public int componentCount()
        Description copied from interface: INDArray
        Returns the number of components of this array. May return 0 if components are not supported
        Specified by:
        componentCount in interface INDArray
        Returns:
      • getComponent

        public INDArray getComponent(int k)
        Description copied from interface: INDArray
        Gets a component from the array at the specified index Will throw an error if components are not supported, or if the component is out of bounds as defined by 0 <= k
        Specified by:
        getComponent in interface INDArray
        Returns:
      • getComponents

        public INDArray[] getComponents()
        Description copied from interface: INDArray
        Gets all components in a new array, with length componentCount();
        Specified by:
        getComponents in interface INDArray
        Returns:
      • withComponents

        public INDArray withComponents(INDArray... cs)
        Description copied from interface: INDArray
        Returns a new array of the same shape/structure as the original but with the specified components. Components must be of a compatible type and identical shape to the original components.
        Specified by:
        withComponents in interface INDArray
      • subArray

        public INDArray subArray(int[] offsets,
                                 int[] shape)
        Description copied from interface: INDArray
        Returns a subarray view of a larger array
        Specified by:
        subArray in interface INDArray
      • join

        public INDArray join(INDArray a,
                             int dimension)
        Description copied from interface: INDArray
        Joins an array with another array along a specified dimension. Guarantees a view that combines the two joined arrays.
        Specified by:
        join in interface INDArray
      • join

        public INDArray join(INDArray a)
        Description copied from interface: INDArray
        Joins an array with another array along the major dimension Guarantees a view that combines the two joined arrays.
        Specified by:
        join in interface INDArray
      • rotateView

        public INDArray rotateView(int dimension,
                                   int shift)
        Description copied from interface: INDArray
        Returns rotated view of this array
        Specified by:
        rotateView in interface INDArray
      • toVector

        public Vector toVector()
        Description copied from interface: INDArray
        Coerces the array into a flattened dense Vector, in row-major order. May return the same array if it is already a Vector instance.
        Specified by:
        toVector in interface INDArray
      • asElementList

        public java.util.List<java.lang.Double> asElementList()
        Description copied from interface: INDArray
        Returns a List containing all elements of this array
        Specified by:
        asElementList in interface INDArray
      • getElements

        public final double[] getElements()
        Description copied from interface: INDArray
        Gets all elements of the array as a Java double[] array
        Specified by:
        getElements in interface INDArray
        Returns:
        A Java double[] array containing all elements in row-major order
      • getElements

        public void getElements(double[] dest,
                                int offset)
        Description copied from interface: INDArray
        Copies all elements of this array a double array at the specified offset
        Specified by:
        getElements in interface INDArray
      • getElements

        public void getElements(java.lang.Object[] dest,
                                int offset)
        Description copied from interface: INDArray
        Copies all elements of this array into an object array at the specified offset
        Specified by:
        getElements in interface INDArray
      • getElements

        public void getElements(double[] arr)
        Description copied from interface: INDArray
        Copies all elements of this INDArray to the specified double array
        Specified by:
        getElements in interface INDArray
      • toDoubleBuffer

        public void toDoubleBuffer(java.nio.DoubleBuffer dest)
        Description copied from interface: INDArray
        Copies the elements of this INDArray to the specified double buffer.
        Specified by:
        toDoubleBuffer in interface INDArray
      • toDoubleArray

        public double[] toDoubleArray()
        Description copied from interface: INDArray
        Copies the elements of this array to a new double[] array.
        Specified by:
        toDoubleArray in interface INDArray
      • asDoubleArray

        public double[] asDoubleArray()
        Description copied from interface: INDArray
        Returns the underlying double array representing the densely packed elements of this array. Modifications to this double array will change the original array. Returns null if there is no such array.
        Specified by:
        asDoubleArray in interface INDArray
      • toSliceArray

        public INDArray[] toSliceArray()
        Description copied from interface: INDArray
        Copies the slices of this array to a new INDArray[] Throws an error if the array has no slices (i.e. is zero-dimensional)
        Specified by:
        toSliceArray in interface INDArray
      • sliceValue

        public java.lang.Object sliceValue(int i)
        Description copied from interface: INDArray
        Returns the value of a major slice of this array (slice along dimension 0) Like 'slice', except returns a Double value for slices of 1D vectors
        Specified by:
        sliceValue in interface INDArray
      • broadcast

        public INDArray broadcast(int... targetShape)
        Description copied from interface: INDArray
        Returns a view of this array broadcasted up to a larger shape
        Specified by:
        broadcast in interface INDArray
      • immutable

        public INDArray immutable()
        Description copied from interface: INDArray
        Returns an immutable version of this array. May return the same array if already immutable. Guarantees a defensive copy if the array is mutable.
        Specified by:
        immutable in interface INDArray
      • mutable

        public INDArray mutable()
        Description copied from interface: INDArray
        Coerces this INDArray to a fully mutable format. May return the same INDArray if already fully mutable
        Specified by:
        mutable in interface INDArray
      • sparse

        public INDArray sparse()
        Description copied from interface: INDArray
        Coerces this INDArray to a sparse format, without changing its element values. May return the same INDArray if already sparse. May also mutate the internal structure of the original NDArray, or create a view over parts of the original INDArray. You should take a defensive copy of the original NDArray if any of this concerns you. The returned sparse array may not be fully mutable in all elements.
        Specified by:
        sparse in interface INDArray
      • sparseClone

        public INDArray sparseClone()
        Description copied from interface: INDArray
        Creates a fully mutable clone of this array. Will use a sparse format if possible.
        Specified by:
        sparseClone in interface INDArray
      • dense

        public INDArray dense()
        Description copied from interface: INDArray
        Coerces this INDArray to a dense format, without changing its element values. May return the same INDArray if already dense. May also mutate the internal structure of the original NDArray, or create a view over parts of the original INDArray. You should take a defensive copy of the original NDArray if any of this concerns you. The returned dense array may not be fully mutable in all elements.
        Specified by:
        dense in interface INDArray
      • denseClone

        public INDArray denseClone()
        Description copied from interface: INDArray
        Creates a fully mutable dense clone of this array. Will always use a dense format, even if the array data is sparse.
        Specified by:
        denseClone in interface INDArray
      • broadcastLike

        public INDArray broadcastLike(INDArray target)
        Description copied from interface: INDArray
        Broadcasts an array to match the shape of the target
        Specified by:
        broadcastLike in interface INDArray
        Parameters:
        target - The target array
      • broadcastLike

        public AMatrix broadcastLike(AMatrix target)
        Description copied from interface: INDArray
        Broadcasts an array to match the shape of the target matrix
        Specified by:
        broadcastLike in interface INDArray
        Parameters:
        target - The target matrix
      • broadcastLike

        public AVector broadcastLike(AVector target)
        Description copied from interface: INDArray
        Broadcasts an array to match the shape of the target vector
        Specified by:
        broadcastLike in interface INDArray
        Parameters:
        target - The target vector
      • broadcastCloneLike

        public INDArray broadcastCloneLike(INDArray target)
        Description copied from interface: INDArray
        Creates a mutable clone of the array, broadcasted upwards if necessary to match the shape of the target. If no upwards broadcasting is required, returns a regular clone() of this array.
        Specified by:
        broadcastCloneLike in interface INDArray
        Parameters:
        target - The target array
      • broadcastCopyLike

        public INDArray broadcastCopyLike(INDArray target)
        Description copied from interface: INDArray
        Creates a copy of the array, broadcasted upwards if necessary to match the shape of the target Like broadCastCloneLike, but does not guarantee a fully mutable clone - hence may be faster when used with immutable or specialized arrays
        Specified by:
        broadcastCopyLike in interface INDArray
        Parameters:
        target - The target array
      • validate

        public void validate()
        Description copied from interface: INDArray
        Validates the internal data structure of the INDArray. Throws an exception on failure. Failure indicates a serious bug and/or data corruption.
        Specified by:
        validate in interface INDArray
      • hasUncountable

        public boolean hasUncountable()
        Returns true if any element is this array is NaN or infinite
        Specified by:
        hasUncountable in interface INDArray
        Returns:
      • elementPowSum

        public double elementPowSum(double p)
        Returns the sum of all the elements raised to a specified power
        Specified by:
        elementPowSum in interface INDArray
        Returns:
      • elementAbsPowSum

        public double elementAbsPowSum(double p)
        Returns the sum of the absolute values of all the elements raised to a specified power
        Specified by:
        elementAbsPowSum in interface INDArray
        Returns:
      • reduceSlices

        public AVector reduceSlices(Op2 op)
        Description copied from interface: INDArray
        Reduces each vector slice of the array by the given binary operator Reduces down to a single vector
        Specified by:
        reduceSlices in interface INDArray
      • compareTo

        public int compareTo(INDArray a)
        Specified by:
        compareTo in interface java.lang.Comparable<INDArray>
      • reduceSlices

        public AVector reduceSlices(Op2 op,
                                    double init)
        Description copied from interface: INDArray
        Reduces each slice of the array by the given binary operator. Results are returned in a vector with one element for each slice. Uses the specified initial value for reduction of each slice.
        Specified by:
        reduceSlices in interface INDArray
      • elementMaxAbs

        public double elementMaxAbs()
        Description copied from interface: INDArray
        Returns the maximum absolute element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMaxAbs in interface INDArray

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.