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(java.util.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(java.util.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()
Vector
getDimension
in class Vector<F extends Field<F>>
public F get(int i)
Vector
public DenseVector<F> opposite()
Vector
public DenseVector<F> plus(Vector<F> that)
Vector
public DenseVector<F> minus(Vector<F> that)
Vector
public DenseVector<F> times(F k)
Vector
public F times(Vector<F> that)
Vector
public DenseVector<F> copy()
Vector
allocated
by the calling thread (possibly on the stack).