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

Class ImmutableScalar

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Object>, IDense, INDArray, IScalar


    public final class ImmutableScalar
    extends AScalar
    Immutable scalar class Conceptually equivalent to a wrapped Double value, but supports all the Vectorz interfaces and functionality as a scalar object.
    See Also:
    Serialized Form
    • 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
        Overrides:
        isMutable in class AScalar
      • 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 AScalar
      • 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.
      • get

        public double get()
        Description copied from interface: INDArray
        Returns the double value of a scalar array
        Specified by:
        get in interface INDArray
        Specified by:
        get in interface IScalar
        Specified by:
        get in class AScalar
      • 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
        Overrides:
        getElements in class AScalar
      • 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
        Specified by:
        set in interface IScalar
        Specified by:
        set in class AScalar
      • exactClone

        public AScalar 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 AScalar
        Returns:
        A clone of the original array
      • mutable

        public Scalar 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
        Specified by:
        mutable in interface IScalar
        Overrides:
        mutable in class AScalar
      • sparse

        public AScalar 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
        Overrides:
        sparse in class AScalar
      • immutable

        public ImmutableScalar 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
        Specified by:
        immutable in interface IScalar
        Overrides:
        immutable in class AScalar

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.