Package org.jscience.mathematics.vector
Class 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
Modifier and TypeFieldDescriptionprotected static final javolution.xml.XMLFormat<Float64Vector>
Holds the default XML representation. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).Returns the cross product of two 3-dimensional vectors.get
(int i) Returns a single element from this vector.int
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).Returns the difference between this vector and the one specified.norm()
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).double
Returns thenorm()
value of this vector.opposite()
Returns the negation of this vector.Returns the sum of this vector with the one specified.times
(double k) Equivalent tothis.times(Float64.valueOf(k))
Returns the product of this vector with the specified coefficient.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
Returns a new vector holding the elements from the specified collection.static Float64Vector
Returns aFloat64Vector
instance equivalent to the specified vector.
-
Field Details
-
XML
Holds the default XML representation. For example: [code]
-
-
Method Details
-
valueOf
Returns a new vector holding the specifieddouble
values.- Parameters:
values
- the vector values.- Returns:
- the vector having the specified values.
-
valueOf
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
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
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:
-
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
Description copied from class:Vector
Returns a single element from this vector. -
opposite
Description copied from class:Vector
Returns the negation of this vector. -
plus
Description copied from class:Vector
Returns the sum of this vector with the one specified. -
minus
Description copied from class:Vector
Returns the difference between this vector and the one specified. -
times
Description copied from class:Vector
Returns the product of this vector with the specified coefficient. -
times
Equivalent tothis.times(Float64.valueOf(k))
- Parameters:
k
- the coefficient.- Returns:
this * k
-
times
Description copied from class:Vector
Returns the dot product of this vector with the one specified. -
cross
Description copied from class:Vector
Returns the cross product of two 3-dimensional vectors. -
copy
Description copied from class:Vector
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).
-