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.
-
-
Field Summary
Fields Modifier and Type Field Description protected static javolution.xml.XMLFormat<DenseVector>
XML
Holds the default XML representation for dense vectors.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DenseVector<F>
copy()
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).F
get(int i)
Returns a single element from this vector.int
getDimension()
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.F
times(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(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.
-
-
-
Field Detail
-
XML
protected static final javolution.xml.XMLFormat<DenseVector> XML
Holds the default XML representation for dense vectors. For example: [code]
-
-
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(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:
that
or a dense vector holding the same elements as the specified vector.
-
getDimension
public int getDimension()
Description copied from class:Vector
Returns the number of elements held by this vector.- Specified by:
getDimension
in classVector<F extends Field<F>>
- Returns:
- this vector dimension.
-
get
public F get(int i)
Description copied from class:Vector
Returns a single element from this vector.
-
opposite
public DenseVector<F> opposite()
Description copied from class:Vector
Returns the negation of this vector.
-
plus
public DenseVector<F> plus(Vector<F> that)
Description copied from class:Vector
Returns the sum of this vector with the one specified.
-
minus
public DenseVector<F> minus(Vector<F> that)
Description copied from class:Vector
Returns the difference between this vector and the one specified.
-
times
public DenseVector<F> times(F k)
Description copied from class:Vector
Returns the product of this vector with the specified coefficient.
-
times
public F times(Vector<F> that)
Description copied from class:Vector
Returns the dot product of this vector with the one specified.
-
copy
public DenseVector<F> copy()
Description copied from class:Vector
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).
-
-