Class AbstractParamVector<Q extends javax.measure.quantity.Quantity,​T extends AbstractParamVector<Q,​T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      Parameter<javax.measure.quantity.Angle> angle​(AbstractParamVector that)
      Returns the angle between this vector and the specified vector.
      int compareTo​(javax.measure.Measurable<Q> that)
      Compares the norm() of this measure with the specified measurable object.
      T divide​(double divisor)
      Returns this vector with each element divided by the specified divisor (dimensionless).
      Parameter<?> dot​(Vector that)
      Returns the dot product of this vector with the one specified.
      double doubleValue​(javax.measure.unit.Unit<Q> unit)
      Returns the value of this measurable stated in the specified unit as a double.
      abstract T fromVector3D​(Vector3D<Q> vector)
      Return the specified Vector3D object as a vector of a particular subtype of this class.
      abstract javax.measure.unit.Unit<Q> getUnit()
      Returns the unit in which the values in this vector are stated.
      double getValue​(int i)
      Returns the value of the Parameter in this vector as a double in the current units of the specified dimension of this vector.
      long longValue​(javax.measure.unit.Unit<Q> unit)
      Returns the estimated integral value of this measurable stated in the specified unit as a long.
      Parameter<Q> mag()
      Returns the Euclidian norm, magnitude, or length of this vector (square root of the dot product of this vector and itself).
      double magValue()
      Returns the norm(), magnitude, or length value of this vector.
      abstract T minus​(Parameter<Q> that)
      Subtracts the supplied Parameter from this vector.
      Parameter<Q> norm()
      Returns the Euclidian norm, magnitude, or length of this vector (square root of the dot product of this vector and itself).
      abstract double normValue()
      Returns the norm(), magnitude, or length value of this vector.
      abstract T plus​(Parameter<Q> that)
      Returns the sum of this vector with the parameter specified.
      abstract T times​(double k)
      Returns the product of this vector with the specified coefficient.
      abstract <R extends javax.measure.quantity.Quantity>
      AbstractParamVector<R,​? extends AbstractParamVector>
      to​(javax.measure.unit.Unit<R> unit)
      Returns the equivalent to this vector but stated in the specified unit.
      double[] toArray()
      Returns a new Java array that contains the values of the coordinates of this vector in the current units.
      double[] toArray​(double[] array)
      Fills the input Java array with the values of the coordinates of this vector in the current units.
      abstract Vector3D<Q> toVector3D()
      Returns a Vector3D representation of this vector if possible.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javolution.lang.Realtime

        toText
      • Methods inherited from interface javolution.lang.ValueType

        copy
      • Methods inherited from interface org.jscience.mathematics.structure.VectorSpace

        times
    • Method Detail

      • toVector3D

        public abstract Vector3D<QtoVector3D()
        Returns a Vector3D representation of this vector if possible.
        Returns:
        A Vector3D that is equivalent to this vector
        Throws:
        DimensionException - if this vector has any number of dimensions other than 3.
      • fromVector3D

        public abstract T fromVector3D​(Vector3D<Q> vector)
                                throws javax.measure.converter.ConversionException
        Return the specified Vector3D object as a vector of a particular subtype of this class.
        Parameters:
        vector - The Vector3D object to be converted to a specific subtype of this class.
        Returns:
        An instance of a specific subtype of this class that is equivalent to the supplied Vector3D object.
        Throws:
        javax.measure.converter.ConversionException - if the sub-type can not represent the units used in the supplied vector.
      • getValue

        public double getValue​(int i)
        Returns the value of the Parameter in this vector as a double in the current units of the specified dimension of this vector.
        Parameters:
        i - the dimension index.
        Returns:
        the value of the Parameter at i.
        Throws:
        java.lang.IndexOutOfBoundsException - (i < 0) || (i > dimension()-1)
      • normValue

        public abstract double normValue()
        Returns the norm(), magnitude, or length value of this vector.
        Returns:
        this.norm().getValue().
      • mag

        public Parameter<Qmag()
        Returns the Euclidian norm, magnitude, or length of this vector (square root of the dot product of this vector and itself).
        Returns:
        sqrt(this · this).
      • magValue

        public double magValue()
        Returns the norm(), magnitude, or length value of this vector.
        Returns:
        this.norm().doubleValue().
      • plus

        public abstract T plus​(Parameter<Q> that)
        Returns the sum of this vector with the parameter specified. The unit of the output vector will be the units of this vector.
        Parameters:
        that - the parameter to be added to this vector.
        Returns:
        this + that.
      • minus

        public abstract T minus​(Parameter<Q> that)
        Subtracts the supplied Parameter from this vector. The unit of the output vector will be the units of this vector.
        Parameters:
        that - the Parameter to be subtracted from this vector.
        Returns:
        this - that.
      • times

        public abstract T times​(double k)
        Returns the product of this vector with the specified coefficient.
        Parameters:
        k - the coefficient multiplier.
        Returns:
        this · k
      • divide

        public T divide​(double divisor)
        Returns this vector with each element divided by the specified divisor (dimensionless).
        Parameters:
        divisor - the divisor.
        Returns:
        this / divisor.
      • angle

        public Parameter<javax.measure.quantity.Angle> angle​(AbstractParamVector that)
        Returns the angle between this vector and the specified vector.
        Parameters:
        that - the vector to which the angle will be determined.
        Returns:
        acos(this · that)/(norm(this)*norm(that))
      • getUnit

        public abstract javax.measure.unit.Unit<QgetUnit()
        Returns the unit in which the values in this vector are stated.
        Returns:
        The unit in which the values in this vector are stated
      • to

        public abstract <R extends javax.measure.quantity.Quantity> AbstractParamVector<R,​? extends AbstractParamVectorto​(javax.measure.unit.Unit<R> unit)
        Returns the equivalent to this vector but stated in the specified unit.
        Type Parameters:
        R - The Quantity (unit type) of the vector being output.
        Parameters:
        unit - the unit of the vector to be returned.
        Returns:
        a vector equivalent to this vector but stated in the specified unit.
        Throws:
        javax.measure.converter.ConversionException - if the current model does not allows for conversion to the specified unit.
      • doubleValue

        public double doubleValue​(javax.measure.unit.Unit<Q> unit)
        Returns the value of this measurable stated in the specified unit as a double. This implementation returns the normValue() stated in the specified units.
        Specified by:
        doubleValue in interface javax.measure.Measurable<Q extends javax.measure.quantity.Quantity>
        Parameters:
        unit - the unit in which this measurable value is stated.
        Returns:
        the numeric value after conversion to type double.
      • longValue

        public final long longValue​(javax.measure.unit.Unit<Q> unit)
        Returns the estimated integral value of this measurable stated in the specified unit as a long. This implementation returns the normValue() stated in the specified units.

        Note: This method differs from the Number.longValue() in the sense that the closest integer value is returned and an ArithmeticException is raised instead of a bit truncation in case of overflow (safety critical).

        Specified by:
        longValue in interface javax.measure.Measurable<Q extends javax.measure.quantity.Quantity>
        Parameters:
        unit - the unit in which the measurable value is stated.
        Returns:
        the numeric value after conversion to type long.
        Throws:
        java.lang.ArithmeticException - if this quantity cannot be represented as a long number in the specified unit.
      • compareTo

        public int compareTo​(javax.measure.Measurable<Q> that)
        Compares the norm() of this measure with the specified measurable object.
        Specified by:
        compareTo in interface java.lang.Comparable<Q extends javax.measure.quantity.Quantity>
        Parameters:
        that - the measure to compare with.
        Returns:
        a negative integer, zero, or a positive integer as this measure is less than, equal to, or greater than that measurable.
        Throws:
        javax.measure.converter.ConversionException - if the current model does not allows for these measure to be compared.
      • toArray

        public double[] toArray​(double[] array)
        Fills the input Java array with the values of the coordinates of this vector in the current units.
        Parameters:
        array - An existing array of at least this.getDimension() size that will be filled with the values from this vector.
        Returns:
        The input Java array filled with the coordinate values from this vector.
      • toArray

        public double[] toArray()
        Returns a new Java array that contains the values of the coordinates of this vector in the current units.
        Returns:
        A new Java array of values from this vector.