public abstract class AbstractVector extends Object implements Vector
Vector implementations.
The only methods to be implemented by subclasses are get, set and size.
| Constructor and Description |
|---|
AbstractVector() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vector that)
Adds the Vector that to this one in place: this += that.
|
double |
dot(Vector that)
Computes the inner product with another Vector.
|
abstract double |
get(int i)
Access the value of the Vector at dimension i.
|
Tuple<Integer,Double> |
min()
Computes the min of all entries in the Vector.
|
void |
multAdd(double factor,
ImmutableVector that)
this += factor * that.
|
double |
norm2()
Computes the L2 norm of this Vector.
|
double |
norm2Sqr()
Computes the square of the L2 norm of this Vector.
|
void |
normalize()
Normalizes the Vector according to the L2 norm.
|
void |
scale(double factor)
Scales this Vector: this *= factor.
|
abstract void |
set(int i,
double v)
Set dimension i of the Vector to value v.
|
abstract int |
size()
The size (dimensionality) of the Vector.
|
double |
sum()
Computes the computeSum of all entries in the Vector.
|
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitnewInstancepublic AbstractVector()
public abstract void set(int i, double v)
Vectorpublic void add(Vector that)
Vectorpublic void multAdd(double factor, ImmutableVector that)
Vectorpublic void scale(double factor)
Vectorpublic void normalize()
Vectorpublic abstract double get(int i)
ImmutableVectorget in interface ImmutableVectori - indexpublic abstract int size()
ImmutableVectorsize in interface ImmutableVectorpublic double dot(Vector that)
ImmutableVectordot in interface ImmutableVectorpublic double sum()
ImmutableVectorsum in interface ImmutableVectorpublic double norm2()
ImmutableVectornorm2 in interface ImmutableVectorpublic double norm2Sqr()
ImmutableVectornorm2Sqr in interface ImmutableVectorpublic Tuple<Integer,Double> min()
ImmutableVectormin in interface ImmutableVectorCopyright © 2017 The Apache Software Foundation. All rights reserved.