public final class DenseVector<F extends Field<F>> extends Vector<F>
This class represents a dense vector.
| Modifier and Type | Method and Description |
|---|---|
DenseVector<F> |
copy()
Returns a copy of this vector
allocated
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>> |
valueOf(F... elements)
Returns a dense vector holding the specified elements.
|
static <F extends Field<F>> |
valueOf(List<F> elements)
Returns a dense vector holding the elements from the specified
collection.
|
static <F extends Field<F>> |
valueOf(Vector<F> that)
Returns a dense vector equivalent to the specified vector.
|
public static <F extends Field<F>> DenseVector<F> valueOf(F... elements)
elements - the vector elements.public static <F extends Field<F>> DenseVector<F> valueOf(List<F> elements)
elements - the collection of vector elements.public static <F extends Field<F>> DenseVector<F> valueOf(Vector<F> that)
that - the vector to convert.that or a dense vector holding the same elements
as the specified vector.public int getDimension()
VectorgetDimension in class Vector<F extends Field<F>>public F get(int i)
Vectorpublic DenseVector<F> opposite()
Vectorpublic DenseVector<F> plus(Vector<F> that)
Vectorpublic DenseVector<F> minus(Vector<F> that)
Vectorpublic DenseVector<F> times(F k)
Vectorpublic F times(Vector<F> that)
Vectorpublic DenseVector<F> copy()
Vectorallocated
by the calling thread (possibly on the stack).