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>
This class represents a dense vector.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final javolution.xml.XMLFormat<DenseVector>
Holds the default XML representation for dense vectors. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).get
(int i) Returns a single element from this vector.int
Returns the number of elements held by this vector.Returns the difference between this vector and the one specified.opposite()
Returns the negation of this vector.Returns the sum of this vector with the one specified.Returns the product of this vector with the specified coefficient.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>Returns a dense vector holding the elements from the specified collection.static <F extends Field<F>>
DenseVector<F>Returns a dense vector equivalent to the specified vector.
-
Field Details
-
XML
Holds the default XML representation for dense vectors. For example: [code]
-
-
Method Details
-
valueOf
Returns a dense vector holding the specified elements.- Parameters:
elements
- the vector elements.- Returns:
- the vector having the specified elements.
-
valueOf
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
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
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
Description copied from class:Vector
Returns the dot product of this vector with the one specified. -
copy
Description copied from class:Vector
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).
-