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, wait
newInstance
public AbstractVector()
public abstract void set(int i, double v)
Vector
public void add(Vector that)
Vector
public void multAdd(double factor, ImmutableVector that)
Vector
public void scale(double factor)
Vector
public void normalize()
Vector
public abstract double get(int i)
ImmutableVector
get
in interface ImmutableVector
i
- indexpublic abstract int size()
ImmutableVector
size
in interface ImmutableVector
public double dot(Vector that)
ImmutableVector
dot
in interface ImmutableVector
public double sum()
ImmutableVector
sum
in interface ImmutableVector
public double norm2()
ImmutableVector
norm2
in interface ImmutableVector
public double norm2Sqr()
ImmutableVector
norm2Sqr
in interface ImmutableVector
public Tuple<Integer,Double> min()
ImmutableVector
min
in interface ImmutableVector
Copyright © 2015 The Apache Software Foundation. All rights reserved.