AbstractDoubleVector
jsci.maths.vectors

Class AbstractDoubleVector

    • Method Detail

      • equals

        public final boolean equals(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 Object
        Parameters:
        obj - a double vector
      • equals

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

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

        public int hashCode()
        Returns a hashcode for this vector.
        Overrides:
        hashCode in class 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.
      • 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.
      • 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.

SCaVis 1.7 © jWork.org