Package org.jscience.mathematics.vector
Class DenseVector<F extends Field<F>>
- java.lang.Object
-
- org.jscience.mathematics.vector.Vector<F>
-
- org.jscience.mathematics.vector.DenseVector<F>
-
- All Implemented Interfaces:
javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,GroupAdditive<Vector<F>>,Structure<Vector<F>>,VectorSpace<Vector<F>,F>
public final class DenseVector<F extends Field<F>> extends Vector<F>
This class represents a dense vector.
- 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 DenseVector<F>copy()Returns a copy of this vectorallocatedby the calling thread (possibly on the stack).Fget(int i)Returns a single element from this vector.intgetDimension()Returns the number of elements held by this vector.DenseVector<F>minus(Vector<F> that)Returns the difference between this vector and the one specified.DenseVector<F>opposite()Returns the negation of this vector.DenseVector<F>plus(Vector<F> that)Returns the sum of this vector with the one specified.DenseVector<F>times(F k)Returns the product of this vector with the specified coefficient.Ftimes(Vector<F> that)Returns the dot product of this vector with the one specified.static <F extends Field<F>>
DenseVector<F>valueOf(F... elements)Returns a dense vector holding the specified elements.static <F extends Field<F>>
DenseVector<F>valueOf(java.util.List<F> elements)Returns a dense vector holding the elements from the specified collection.static <F extends Field<F>>
DenseVector<F>valueOf(Vector<F> that)Returns a dense vector equivalent to the specified vector.
-
-
-
Method Detail
-
valueOf
public static <F extends Field<F>> DenseVector<F> valueOf(F... elements)
Returns a dense vector holding the specified elements.- Parameters:
elements- the vector elements.- Returns:
- the vector having the specified elements.
-
valueOf
public static <F extends Field<F>> DenseVector<F> valueOf(java.util.List<F> elements)
Returns a dense vector holding the elements from the specified collection.- Parameters:
elements- the collection of vector elements.- Returns:
- the vector having the specified elements.
-
valueOf
public static <F extends Field<F>> DenseVector<F> valueOf(Vector<F> that)
Returns a dense vector equivalent to the specified vector.- Parameters:
that- the vector to convert.- Returns:
thator a dense vector holding the same elements as the specified vector.
-
getDimension
public int getDimension()
Description copied from class:VectorReturns the number of elements held by this vector.- Specified by:
getDimensionin classVector<F extends Field<F>>- Returns:
- this vector dimension.
-
get
public F get(int i)
Description copied from class:VectorReturns a single element from this vector.
-
opposite
public DenseVector<F> opposite()
Description copied from class:VectorReturns the negation of this vector.
-
plus
public DenseVector<F> plus(Vector<F> that)
Description copied from class:VectorReturns the sum of this vector with the one specified.
-
minus
public DenseVector<F> minus(Vector<F> that)
Description copied from class:VectorReturns the difference between this vector and the one specified.
-
times
public DenseVector<F> times(F k)
Description copied from class:VectorReturns the product of this vector with the specified coefficient.
-
times
public F times(Vector<F> that)
Description copied from class:VectorReturns the dot product of this vector with the one specified.
-
copy
public DenseVector<F> copy()
Description copied from class:VectorReturns a copy of this vectorallocatedby the calling thread (possibly on the stack).
-
-