Class Vector4Dd


  • public class Vector4Dd
    extends Serializable
    A N-Dimensional Vector
    • Constructor Detail

      • Vector4Dd

        public Vector4Dd​(long cPtr,
                         boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(Vector4Dd obj)
      • size

        public long size()
        The dimension of the VectorND (i.e. 3).
        This method is provided to help support generic algorithms using
        size() and operator[].
      • elemDivide

        public Vector4Dd elemDivide​(Vector4Dd rhs)
        element wise division.
        Parameters:
        rhs - [in] the vector being devided with
        Returns:
        the resulting Vector3D
      • elemMultiply

        public Vector4Dd elemMultiply​(Vector4Dd rhs)
        Elementweise multiplication.
        Parameters:
        rhs - [in] vector
        Returns:
        the element wise product
      • negate

        public Vector4Dd negate()
        Unary minus.
        negative version
      • divide

        public Vector4Dd divide​(double rhs)
        Scalar division.
        Parameters:
        rhs - [in] the scalar to devide with
        Returns:
        result of devision
      • multiply

        public Vector4Dd multiply​(double rhs)
        Scalar multiplication.
        Parameters:
        rhs - [in] the scalar to multiply with
        Returns:
        the product
      • elemSubtract

        public Vector4Dd elemSubtract​(double rhs)
        Scalar subtraction.
      • elemAdd

        public Vector4Dd elemAdd​(double rhs)
        Scalar addition.
      • norm2

        public double norm2()
        Returns the Euclidean norm (2-norm) of the VectorND
        Returns:
        the norm
      • norm1

        public double norm1()
        Returns the Manhatten norm (1-norm) of the VectorND
        Returns:
        the norm
      • normInf

        public double normInf()
        Returns the infinte norm ( \inf-norm) of the VectorND
        Returns:
        the norm
      • dot

        public double dot​(Vector4Dd vec)
        calculate the dot product
        Parameters:
        vec - [in] the vecor to be dotted
        Returns:
        the dot product
      • normalize

        public Vector4Dd normalize()
        normalize vector to get length 1
        Returns:
        the normalized Vector
      • get

        public double get​(long i)
      • set

        public void set​(long i,
                        double d)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStdVector

        public vector_d toStdVector()
        converts the vector to a std:vector
        Returns:
        a std::vector
      • multiplyAssign

        public Vector4Dd multiplyAssign​(double s)
        Scalar multiplication.
      • devideAssign

        public Vector4Dd devideAssign​(double s)
        Scalar division.
      • equals

        public boolean equals​(Vector4Dd rhs)
        Compare with rhs for equality.
        Parameters:
        rhs - [in] other vector.
        Returns:
        True if this equals rhs, false otherwise.
      • notEqual

        public boolean notEqual​(Vector4Dd rhs)
        Compare with rhs for inequality.
        Parameters:
        rhs - [in] other vector.
        Returns:
        True if this and rhs are different, false otherwise.
      • zero

        public static Vector4Dd zero()
        Get zero-initialized vector.
        Returns:
        vector.