Documentation of 'mikera.vectorz.Vector4' Java class
Vector4
mikera.vectorz

Class Vector4

    • Field Detail

      • x

        public double x
      • y

        public double y
      • z

        public double z
      • t

        public double t
    • Constructor Detail

      • Vector4

        public Vector4()
      • Vector4

        public Vector4(Vector4 source)
      • Vector4

        public Vector4(double x,
                       double y,
                       double z,
                       double t)
      • Vector4

        public Vector4(double... values)
    • Method Detail

      • of

        public static Vector4 of(double x,
                                 double y,
                                 double z,
                                 double t)
      • of

        public static Vector4 of(double... values)
      • 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
      • 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
        Overrides:
        reduce in class AVector
      • 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
        Overrides:
        reduce 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 AVector
      • add

        public void add(double dx,
                        double dy,
                        double dz,
                        double dt)
      • add

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

        public void add(Vector4 a)
      • set

        public void set(Vector4 a)
      • 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
      • multiply

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

        public void addMultiple(double dx,
                                double dy,
                                double dz,
                                double dt,
                                double factor)
      • 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 AVector
      • addMultiple

        public void addMultiple(Vector4 v,
                                double factor)
      • addProduct

        public void addProduct(Vector4 a,
                               Vector4 b,
                               double factor)
      • dotProduct

        public double dotProduct(Vector4 a)
      • dotProduct

        public double dotProduct(double[] as,
                                 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
        Specified by:
        dotProduct 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:
      • length

        public int length()
        Description copied from interface: IVector
        Returns the length of a vector, in terms of the number of elements. For Euclidean length, use magnitude() instead
        Specified by:
        length in interface IVector
        Specified by:
        length in class AVector
        Returns:
      • elementSum

        public double elementSum()
        Description copied from class: AVector
        Returns the sum of all elements in a vector
        Specified by:
        elementSum in interface INDArray
        Overrides:
        elementSum 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(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
      • addAt

        public void addAt(int i,
                          double value)
        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
      • setValues

        public void setValues(double x,
                              double y,
                              double z,
                              double t)
      • 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
      • 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
      • 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
      • clone

        public Vector4 clone()
        Description copied from class: AVector
        Clones the vector, creating a new mutable copy of all data. The clone is: - not guaranteed to be of the same type. - guaranteed to be fully mutable - guaranteed not to contain a reference (i.e. is a full deep copy)
        Specified by:
        clone in interface INDArray
        Specified by:
        clone in interface IVector
        Specified by:
        clone in class APrimitiveVector
      • 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 AVector
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.