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

Class ArraySubVector

    • Constructor Detail

      • ArraySubVector

        public ArraySubVector(ADenseArrayVector source,
                              int offset,
                              int length)
        Constructs a vector directly referencing a sub-vector of an existing array-based Vector
        Parameters:
        source -
        offset -
        length -
    • Method Detail

      • wrap

        public static ArraySubVector wrap(double[] values)
        Wraps a double array as a dense ArraySubVector
      • wrap

        public static ArraySubVector wrap(double[] data,
                                          int offset,
                                          int length)
        Wraps a segment of a double array as a dense ArraySubVector
        Parameters:
        data -
        offset -
        length -
        Returns:
      • get

        public 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
        Specified by:
        get in interface IVector
        Specified by:
        get in class ADenseArrayVector
      • set

        public void set(int i,
                        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
        Specified by:
        set in interface IVector
        Specified by:
        set in class ADenseArrayVector
      • fill

        public void fill(double value)
        Description copied from class: AVector
        Fills the entire vector with a given value
        Specified by:
        fill in interface INDArray
        Overrides:
        fill in class ADenseArrayVector
      • unsafeGet

        public double unsafeGet(int i)
        Description copied from class: AVector
        Like get, but performs no bounds checking. Results are undefined if the index is out of range
        Specified by:
        unsafeGet in class ADenseArrayVector
      • unsafeSet

        public void unsafeSet(int i,
                              double value)
        Description copied from class: AVector
        Like set, but performs no bounds checking. Results are undefined if the index is out of range
        Specified by:
        unsafeSet in class ADenseArrayVector
      • addMultiple

        public void addMultiple(AVector v,
                                double factor)
        Description copied from class: AVector
        Adds a scaled multiple of another vector to this vector
        Overrides:
        addMultiple in class ADenseArrayVector
      • addAt

        public void addAt(int i,
                          double v)
        Description copied from class: AVector
        Adds a value to a specific element of the vector This function does not perform bounds checking, i.e. is an unsafe operation
        Specified by:
        addAt in class AStridedVector
      • 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
        Specified by:
        applyOp in class AStridedVector
      • 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
        Overrides:
        abs in class AVector
      • hashCode

        public int hashCode()
        Vector hashcode, designed to match hashcode of Java double array
        Overrides:
        hashCode in class AVector
      • isView

        public boolean isView()
        Description copied from class: AVector
        Returns true if this vector is of a view type that references other vectors / data.
        Specified by:
        isView in interface INDArray
        Overrides:
        isView in class ADenseArrayVector
      • subVector

        public AVector subVector(int start,
                                 int length)
        Description copied from class: AVector
        Obtains a sub-vector view that refers to this vector. Changes to the sub-vector will be reflected in this vector
        Overrides:
        subVector in class ADenseArrayVector
      • setElements

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

        public ArraySubVector exactClone()
        Description copied from class: AVector
        Returns an exact clone of this vector, i.e. of the same type
        Specified by:
        exactClone in interface INDArray
        Specified by:
        exactClone in class AVector
        Returns:
        A clone of the original array

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.