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

Class JoinedVector

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Double>, INDArray, IVector


    public final class JoinedVector
    extends AJoinedVector
    A vector that represents the concatenation of two vectors. Should only be used if the two vectors cannot otherwise be efficiently joined.
    See Also:
    Serialized Form
    • Method Detail

      • joinVectors

        public static AVector joinVectors(AVector left,
                                          AVector right)
        Returns a JoinedVector connecting the two vectors
        Parameters:
        left -
        right -
        Returns:
      • isFullyMutable

        public boolean isFullyMutable()
        Description copied from class: AVector
        Returns true if this vector is fully mutable, i.e. can contain any unconstrained double values
        Specified by:
        isFullyMutable in interface INDArray
        Overrides:
        isFullyMutable in class AVector
      • isZero

        public boolean isZero()
        Description copied from class: AVector
        Returns true if this vector is a zero vector (all components zero)
        Specified by:
        isZero in interface INDArray
        Overrides:
        isZero in class AJoinedVector
      • isRangeZero

        public boolean isRangeZero(int start,
                                   int length)
        Description copied from class: AVector
        Returns true if a sub-vector range is completely zero. Unsafe operation - does not perform bounds checking, results are undefined if sub-vector is out of range
        Overrides:
        isRangeZero in class AVector
        Returns:
      • copyTo

        public void copyTo(AVector dest,
                           int offset)
        Description copied from class: AVector
        Copies a the contents of a vector to a vector at the specified offset
        Overrides:
        copyTo in class AJoinedVector
      • 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
        Overrides:
        toDoubleBuffer in class AVector
      • addToArray

        public void addToArray(int offset,
                               double[] array,
                               int arrayOffset,
                               int length)
        Description copied from class: AVector
        Adds a subvector of this vector into a double array at the specified offset
        Overrides:
        addToArray in class AVector
      • addToArray

        public void addToArray(double[] dest,
                               int offset,
                               int stride)
        Description copied from class: AVector
        Adds this vector to a double[] array, using the specified offset and stride into the destination array
        Overrides:
        addToArray in class AVector
      • addMultipleToArray

        public void addMultipleToArray(double factor,
                                       int offset,
                                       double[] array,
                                       int arrayOffset,
                                       int length)
        Description copied from class: AVector
        Adds a multiple of a subvector of this vector into a double array at the specified offset
        Overrides:
        addMultipleToArray in class AVector
      • 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
        Overrides:
        addAt in class AVector
      • getElements

        public void getElements(double[] data,
                                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 AVector
      • multiplyTo

        public void multiplyTo(double[] data,
                               int offset)
        Description copied from class: AVector
        Multiplies the elements in the target array by corresponding elements in this vector
        Overrides:
        multiplyTo in class AVector
        offset - The offset into the target array
      • divideTo

        public void divideTo(double[] data,
                             int offset)
        Description copied from class: AVector
        Divides the elements in the target array by corresponding elements in this vector
        Overrides:
        divideTo in class AVector
        offset - The offset into the target array
      • copyTo

        public void copyTo(int start,
                           AVector dest,
                           int destOffset,
                           int length)
        Description copied from class: AVector
        Copies a subset of this vector to a vector at the specified offset
        Overrides:
        copyTo in class AJoinedVector
      • 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 AVector
      • tryEfficientJoin

        public AVector tryEfficientJoin(AVector a)
        Description copied from class: AVector
        Attempts to perform an efficient join with a second vector. An efficient join is guaranteed to be better than a simple JoinedVector(left,right) If possible, returns the joined vector. If not, returns null
        Overrides:
        tryEfficientJoin in class AVector
      • add

        public void add(AVector a)
        Description copied from class: AVector
        Adds another vector to this one
        Overrides:
        add in class AVector
      • addCopy

        public AVector addCopy(AVector a)
        Description copied from interface: IVector
        Adds a vector element-wise to this vector, returning a new vector.
        Specified by:
        addCopy in interface IVector
        Overrides:
        addCopy in class AVector
        Returns:
      • scaleAdd

        public void scaleAdd(double factor,
                             double constant)
        Description copied from class: AVector
        Scales this vector and adds a constant to every element
        Specified by:
        scaleAdd in interface INDArray
        Overrides:
        scaleAdd in class AVector
      • add

        public void add(double constant)
        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
        Overrides:
        add in class AVector
      • reciprocal

        public void reciprocal()
        Description copied from class: AVector
        Computes the reciprocal of all elements in this vector. Mutates this vector
        Specified by:
        reciprocal in interface INDArray
        Overrides:
        reciprocal in class AVector
      • clamp

        public void clamp(double min,
                          double max)
        Description copied from class: AVector
        Clamps all values in the vector to a given range
        Specified by:
        clamp in interface INDArray
        Overrides:
        clamp in class AVector
      • dotProduct

        public double dotProduct(AVector v)
        Description copied from class: AVector
        Returns the dot product of this vector with another vector The vectors must have the same length: if not the result is undefined
        Overrides:
        dotProduct in class AVector
        Returns:
      • dotProduct

        public double dotProduct(double[] data,
                                 int offset)
        Description copied from class: AVector
        Fast dot product with a double[] array. Performs no bounds checking. Likely to be faster than most other dot product operations
        Overrides:
        dotProduct in class AJoinedVector
      • add

        public void add(AVector a,
                        int aOffset)
        Description copied from class: AVector
        Adds part another vector to this one, starting at the specified offset in the source vector
        Overrides:
        add in class AVector
      • add

        public void add(double[] data,
                        int offset)
        Description copied from class: AVector
        Adds to this vector from a given double array.
        Overrides:
        add in class AVector
      • add

        public void add(int offset,
                        AVector a,
                        int aOffset,
                        int length)
        Description copied from class: AVector
        Adds a segment of another vector into this one, at the specified offset
        Overrides:
        add in class AVector
      • addMultiple

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

        public void addMultiple(JoinedVector a,
                                double factor)
      • addMultiple

        public void addMultiple(AVector a,
                                int aOffset,
                                double factor)
        Description copied from class: AVector
        Adds a multiple of a subvector of another vector to this vector. Useful as a specialised override for joined vectors etc.
        Overrides:
        addMultiple in class AVector
      • addProduct

        public void addProduct(AVector a,
                               AVector b,
                               double factor)
        Description copied from class: AVector
        Adds the element-wise product of two vectors and a constant factor to this vector. Mutates this vector.
        Overrides:
        addProduct in class AVector
      • addProduct

        public void addProduct(AVector a,
                               int aOffset,
                               AVector b,
                               int bOffset,
                               double factor)
        Description copied from class: AVector
        Adds the scaled elementwise product of two vectors to this vector
        Overrides:
        addProduct in class AVector
      • 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
        Overrides:
        signum in class AVector
      • 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
      • absCopy

        public AVector 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
        Overrides:
        absCopy in class AVector
        Returns:
        A new array containing the absolute element values
      • 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
        Overrides:
        exp in class AbstractArray<java.lang.Double>
      • 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
        Overrides:
        log in class AVector
      • negate

        public void negate()
        Description copied from class: AVector
        Negates all emlements of this vector in place.
        Specified by:
        negate in interface INDArray
        Overrides:
        negate in class AVector
      • 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
        Overrides:
        applyOp in class AVector
      • 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
        Overrides:
        elementMax in class AVector
      • 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
        Overrides:
        elementMin in class AVector
      • 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
        Overrides:
        nonZeroCount in class AVector
      • 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 AVector
      • set

        public void set(AVector src)
        Description copied from class: AVector
        Sets the vector to equal the value of another vector
        Overrides:
        set in class AVector
      • 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
        Overrides:
        unsafeGet in class AVector
      • set

        public void set(AVector src,
                        int srcOffset)
        Description copied from class: AVector
        Set the vector equal to an offset into another vector
        Overrides:
        set in class AVector
      • 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
        Overrides:
        setElements in class AVector
        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.
      • 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 AVector
      • 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
        Overrides:
        unsafeSet in class AVector
      • 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 AVector
      • square

        public void square()
        Description copied from interface: INDArray
        Squares all elements of the array in place
        Specified by:
        square in interface INDArray
        Overrides:
        square in class AVector
      • 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
        Overrides:
        sqrt in class AbstractArray<java.lang.Double>
      • tanh

        public void tanh()
        Description copied from class: AVector
        Computes the tanh of every element in this vector. Mutates this vector.
        Overrides:
        tanh in class AVector
      • logistic

        public void logistic()
        Description copied from class: AVector
        Computes the logistic function for every element in this vector. Mutates this vector.
        Overrides:
        logistic in class AVector
      • multiply

        public void multiply(double value)
        Description copied from class: AVector
        Multiplies the vector by a constant factor
        Specified by:
        multiply in interface INDArray
        Overrides:
        multiply in class AVector
        Parameters:
        value - Factor by which to multiply each component of the vector
      • depthCalc

        public static int depthCalc(AVector v)
      • depth

        public int depth()
      • 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
        Overrides:
        toDoubleArray in class AVector
      • equals

        public boolean equals(AVector v)
        Description copied from class: AbstractArray
        Returns true if this array is exactly equal to a vector.
        Overrides:
        equals in class AJoinedVector
        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 AJoinedVector
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • exactClone

        public JoinedVector 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
      • 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
        Overrides:
        validate in class AVector
      • 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
        Specified by:
        componentCount in class AJoinedVector
        Returns:
      • getComponent

        public AVector 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
        Specified by:
        getComponent in class AJoinedVector
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.