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

Class ImmutableArray

    • Method Detail

      • wrap

        public static INDArray wrap(double[] data,
                                    int[] shape)
      • dimensionality

        public int dimensionality()
        Description copied from interface: INDArray
        Returns the dimensionality of the array (i.e. the number of dimensions in the array shape) e.g. 0 for a scalar, 1 for a vector, 2 for a matrix etc.
        Specified by:
        dimensionality in interface INDArray
        Overrides:
        dimensionality in class BaseNDArray
      • 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 AbstractArray<INDArray>
      • getShape

        public 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 BaseShapedArray
      • 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
        Overrides:
        getShapeClone in class BaseShapedArray
      • get

        public double get(int... indexes)
        Description copied from interface: INDArray
        Returns the double value at the specified index position in an array
        Specified by:
        get in interface INDArray
        Overrides:
        get in class BaseNDArray
      • set

        public void set(int[] indexes,
                        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
      • slice

        public INDArray slice(int majorSlice)
        Description copied from interface: INDArray
        Returns the specified major slice of this array as a view (slice along dimension 0) 0 dimensional slice results are permitted, but attempting to slice a 0 dimensional array will result in an error.
        Specified by:
        slice in interface INDArray
      • slice

        public INDArray slice(int dimension,
                              int index)
        Description copied from interface: INDArray
        Returns a slice view of this array along the specified dimension
        Specified by:
        slice in interface INDArray
      • sliceCount

        public 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 BaseShapedArray
      • elementCount

        public 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 BaseNDArray
      • isView

        public boolean isView()
        Description copied from interface: INDArray
        Return true if this array is considered as a view type. This indicates (but does not guarantee): a) Data is *likely* to be shared with other arrays, so mutation of one may affect others b) It is *unlikely* to be in the most efficient general purpose format isView is intended to be used as for heuristics. It should *not* be used where the outcome might affect correctness.
        Specified by:
        isView in interface INDArray
      • exactClone

        public INDArray 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
        Returns:
        A clone of the original array
      • 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
        Overrides:
        equalsArray in class AbstractArray<INDArray>
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • getArray

        public double[] getArray()
        Description copied from interface: IStridedArray
        Gets the underlying data array for this strided array Unsafe operation - may allow modification of otherwise immutable arrays
        Specified by:
        getArray in interface IStridedArray
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.