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
vectorimplementation for 64 bits floating point elements.- Version:
- 3.3, January 2, 2007
- Author:
- Jean-Marie Dautelle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Float64Vectorcopy()Returns a copy of this vectorallocatedby the calling thread (possibly on the stack).Float64Vectorcross(Vector<Float64> that)Returns the cross product of two 3-dimensional vectors.Float64get(int i)Returns a single element from this vector.intgetDimension()Returns the number of elements held by this vector.doublegetValue(int i)Returns the value of a floating point number from this vector (fast).Float64Vectorminus(Vector<Float64> that)Returns the difference between this vector and the one specified.Float64norm()Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).doublenormValue()Returns thenorm()value of this vector.Float64Vectoropposite()Returns the negation of this vector.Float64Vectorplus(Vector<Float64> that)Returns the sum of this vector with the one specified.Float64Vectortimes(double k)Equivalent tothis.times(Float64.valueOf(k))Float64Vectortimes(Float64 k)Returns the product of this vector with the specified coefficient.Float64times(Vector<Float64> that)Returns the dot product of this vector with the one specified.static Float64VectorvalueOf(double... values)Returns a new vector holding the specifieddoublevalues.static Float64VectorvalueOf(java.util.List<Float64> elements)Returns a new vector holding the elements from the specified collection.static Float64VectorvalueOf(Vector<Float64> that)Returns aFloat64Vectorinstance equivalent to the specified vector.
-
-
-
Method Detail
-
valueOf
public static Float64Vector valueOf(double... values)
Returns a new vector holding the specifieddoublevalues.- 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 aFloat64Vectorinstance equivalent to the specified vector.- Parameters:
that- the vector to convert.- Returns:
thator 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:
normin 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:VectorReturns the number of elements held by this vector.- Specified by:
getDimensionin classVector<Float64>- Returns:
- this vector dimension.
-
get
public Float64 get(int i)
Description copied from class:VectorReturns a single element from this vector.
-
opposite
public Float64Vector opposite()
Description copied from class:VectorReturns the negation of this vector.
-
plus
public Float64Vector plus(Vector<Float64> that)
Description copied from class:VectorReturns the sum of this vector with the one specified.
-
minus
public Float64Vector minus(Vector<Float64> that)
Description copied from class:VectorReturns the difference between this vector and the one specified.
-
times
public Float64Vector times(Float64 k)
Description copied from class:VectorReturns 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:VectorReturns the dot product of this vector with the one specified.- Specified by:
timesin 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:VectorReturns the cross product of two 3-dimensional vectors.
-
copy
public Float64Vector copy()
Description copied from class:VectorReturns a copy of this vectorallocatedby the calling thread (possibly on the stack).
-
-