Documentation of 'jsci.maths.vectors.AbstractDoubleVector' Java class
AbstractDoubleVector
jsci.maths.vectors

Class AbstractDoubleVector

    • Method Detail

      • equals

        public final boolean equals(java.lang.Object obj)
        Compares two double vectors for equality. Two vectors are considered to be equal if the norm of their difference is within the zero tolerance.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - a double vector
      • equals

        public boolean equals(java.lang.Object obj,
                              double tol)
      • toString

        public java.lang.String toString()
        Returns a comma delimited string representing the value of this vector.
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a hashcode for this vector.
        Overrides:
        hashCode in class java.lang.Object
      • getComponent

        public abstract double getComponent(int n)
        Returns a component of this vector.
        Parameters:
        n - index of the vector component.
        Throws:
        VectorDimensionException - If attempting to access an invalid component.
      • setComponent

        public abstract void setComponent(int n,
                                          double x)
        Sets the value of a component of this vector.
        Parameters:
        n - index of the vector component.
        x - a number.
        Throws:
        VectorDimensionException - If attempting to access an invalid component.
      • getSet

        public java.lang.Object getSet()
        Specified by:
        getSet in interface Member
      • norm

        public double norm(int n)
        Returns the ln-norm.
      • infNorm

        public double infNorm()
        Returns the linfinity-norm.
      • mass

        public double mass()
        Returns the mass (l1-norm).
      • scalarMultiply

        public abstract AbstractDoubleVector scalarMultiply(double x)
        Returns the multiplication of this vector by a scalar.
        Parameters:
        x - a double.
      • scalarDivide

        public abstract AbstractDoubleVector scalarDivide(double x)
        Returns the division of this vector by a scalar.
        Parameters:
        x - a double.
        Throws:
        java.lang.ArithmeticException - If divide by zero.
      • normalize

        public AbstractDoubleVector normalize()
        Returns a normalised vector (a vector with norm equal to one).
      • scalarProduct

        public abstract double scalarProduct(AbstractDoubleVector v)
        Returns the scalar product of this vector and another.
        Parameters:
        v - a double vector.
        Throws:
        VectorDimensionException - If the vectors are different sizes.
      • mapComponents

        public abstract AbstractDoubleVector mapComponents(Mapping f)
        Applies a function on all the vector components.
        Parameters:
        f - a user-defined function.
        Returns:
        a double vector.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.