Package org.jscience.mathematics.vector
Class Float64Vector
- java.lang.Object
-
- org.jscience.mathematics.vector.Vector<Float64>
-
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected static javolution.xml.XMLFormat<Float64Vector>
XML
Holds the default XML representation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Float64Vector
copy()
Returns a copy of this vectorallocated
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 thenorm()
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 tothis.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 specifieddouble
values.static Float64Vector
valueOf(List<Float64> elements)
Returns a new vector holding the elements from the specified collection.static Float64Vector
valueOf(Vector<Float64> that)
Returns aFloat64Vector
instance equivalent to the specified vector.
-
-
-
Field Detail
-
XML
protected static final javolution.xml.XMLFormat<Float64Vector> XML
Holds the default XML representation. For example: [code]
-
-
Method Detail
-
valueOf
public static Float64Vector valueOf(double... values)
Returns a new vector holding the specifieddouble
values.- Parameters:
values
- the vector values.- Returns:
- the vector having the specified values.
-
valueOf
public static Float64Vector valueOf(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 aFloat64Vector
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:
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 interfaceVectorSpaceNormed<Vector<Float64>,Float64>
- Returns:
sqrt(this · this)
.- See Also:
- Wikipedia: Vector Norm
-
normValue
public double normValue()
Returns thenorm()
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 classVector<Float64>
- Returns:
- this vector dimension.
-
get
public Float64 get(int i)
Description copied from class:Vector
Returns a single element from this vector.
-
opposite
public Float64Vector opposite()
Description copied from class:Vector
Returns the negation of this vector.
-
plus
public Float64Vector plus(Vector<Float64> that)
Description copied from class:Vector
Returns the sum of this vector with the one specified.
-
minus
public Float64Vector minus(Vector<Float64> that)
Description copied from class:Vector
Returns the difference between this vector and the one specified.
-
times
public Float64Vector times(Float64 k)
Description copied from class:Vector
Returns the product of this vector with the specified coefficient.
-
times
public Float64Vector times(double k)
Equivalent tothis.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 classVector<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.
-
copy
public Float64Vector copy()
Description copied from class:Vector
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).
-
-