JScience v4.3

org.jscience.mathematics.vector
Class Float64Vector

java.lang.Object
  extended by org.jscience.mathematics.vector.Vector<Float64>
      extended by org.jscience.mathematics.vector.Float64Vector
All Implemented Interfaces:
javolution.lang.Immutable, javolution.lang.Realtime, javolution.lang.ValueType, GroupAdditive<Vector<Float64>>, Structure<Vector<Float64>>, VectorSpace<Vector<Float64>,Float64>, VectorSpaceNormed<Vector<Float64>,Float64>

public final class Float64Vector
extends Vector<Float64>
implements VectorSpaceNormed<Vector<Float64>,Float64>

This class represents an optimized vector implementation for 64 bits floating point elements.

Version:
3.3, January 2, 2007
Author:
Jean-Marie Dautelle

Field Summary
protected static javolution.xml.XMLFormat<Float64Vector> XML
          Holds the default XML representation.
 
Method Summary
 Float64Vector copy()
          Returns a copy of this vector allocated by the calling thread (possibly on the stack).
 Float64Vector cross(Vector<Float64> that)
          Returns the cross product of two 3-dimensional vectors.
 Float64 get(int i)
          Returns a single element from this vector.
 int getDimension()
          Returns the number of elements held by this vector.
 double getValue(int i)
          Returns the value of a floating point number from this vector (fast).
 Float64Vector minus(Vector<Float64> that)
          Returns the difference between this vector and the one specified.
 Float64 norm()
          Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).
 double normValue()
          Returns the norm() value of this vector.
 Float64Vector opposite()
          Returns the negation of this vector.
 Float64Vector plus(Vector<Float64> that)
          Returns the sum of this vector with the one specified.
 Float64Vector times(double k)
          Equivalent to this.times(Float64.valueOf(k))
 Float64Vector times(Float64 k)
          Returns the product of this vector with the specified coefficient.
 Float64 times(Vector<Float64> that)
          Returns the dot product of this vector with the one specified.
static Float64Vector valueOf(double... values)
          Returns a new vector holding the specified double values.
static Float64Vector valueOf(java.util.List<Float64> elements)
          Returns a new vector holding the elements from the specified collection.
static Float64Vector valueOf(Vector<Float64> that)
          Returns a Float64Vector instance equivalent to the specified vector.
 
Methods inherited from class org.jscience.mathematics.vector.Vector
equals, equals, hashCode, toString, toText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XML

protected static final javolution.xml.XMLFormat<Float64Vector> XML
Holds the default XML representation. For example:
    <Float64Vector dimension="2">
        <Float64 value="1.0" />
        <Float64 value="0.0" />
    </Float64Vector>

Method Detail

valueOf

public static Float64Vector valueOf(double... values)
Returns a new vector holding the specified double values.

Parameters:
values - the vector values.
Returns:
the vector having the specified values.

valueOf

public static Float64Vector valueOf(java.util.List<Float64> elements)
Returns a new vector holding the elements from the specified collection.

Parameters:
elements - the collection of floating-points numbers.
Returns:
the vector having the specified elements.

valueOf

public static Float64Vector valueOf(Vector<Float64> that)
Returns a Float64Vector instance equivalent to the specified vector.

Parameters:
that - the vector to convert.
Returns:
that or new equivalent Float64Vector.

getValue

public double getValue(int i)
Returns the value of a floating point number from this vector (fast).

Parameters:
i - the floating point number index.
Returns:
the value of the floating point number at i.
Throws:
java.lang.IndexOutOfBoundsException - (i < 0) || (i >= dimension())

norm

public Float64 norm()
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).

Specified by:
norm in interface VectorSpaceNormed<Vector<Float64>,Float64>
Returns:
sqrt(this · this).
See Also:
Wikipedia: Vector Norm

normValue

public double normValue()
Returns the norm() value of this vector.

Returns:
this.norm().doubleValue().

getDimension

public int getDimension()
Description copied from class: Vector
Returns the number of elements held by this vector.

Specified by:
getDimension in class Vector<Float64>
Returns:
this vector dimension.

get

public Float64 get(int i)
Description copied from class: Vector
Returns a single element from this vector.

Specified by:
get in class Vector<Float64>
Parameters:
i - the element index (range [0..n[).
Returns:
the element at i.

opposite

public Float64Vector opposite()
Description copied from class: Vector
Returns the negation of this vector.

Specified by:
opposite in interface GroupAdditive<Vector<Float64>>
Specified by:
opposite in class Vector<Float64>
Returns:
-this.

plus

public Float64Vector plus(Vector<Float64> that)
Description copied from class: Vector
Returns the sum of this vector with the one specified.

Specified by:
plus in interface GroupAdditive<Vector<Float64>>
Specified by:
plus in class Vector<Float64>
Parameters:
that - the vector to be added.
Returns:
this + that.

minus

public Float64Vector minus(Vector<Float64> that)
Description copied from class: Vector
Returns the difference between this vector and the one specified.

Overrides:
minus in class Vector<Float64>
Parameters:
that - the vector to be subtracted.
Returns:
this - that.

times

public Float64Vector times(Float64 k)
Description copied from class: Vector
Returns the product of this vector with the specified coefficient.

Specified by:
times in interface VectorSpace<Vector<Float64>,Float64>
Specified by:
times in class Vector<Float64>
Parameters:
k - the coefficient multiplier.
Returns:
this · k

times

public Float64Vector times(double k)
Equivalent to this.times(Float64.valueOf(k))

Parameters:
k - the coefficient.
Returns:
this * k

times

public Float64 times(Vector<Float64> that)
Description copied from class: Vector
Returns the dot product of this vector with the one specified.

Specified by:
times in class Vector<Float64>
Parameters:
that - the vector multiplier.
Returns:
this · that
See Also:
Wikipedia: Dot Product

cross

public Float64Vector cross(Vector<Float64> that)
Description copied from class: Vector
Returns the cross product of two 3-dimensional vectors.

Overrides:
cross in class Vector<Float64>
Parameters:
that - the vector multiplier.
Returns:
this x that

copy

public Float64Vector copy()
Description copied from class: Vector
Returns a copy of this vector allocated by the calling thread (possibly on the stack).

Specified by:
copy in interface javolution.lang.ValueType
Specified by:
copy in class Vector<Float64>
Returns:
an identical and independant copy of this matrix.

JScience v4.3

Copyright © 2006 JScience.