public abstract class Vec extends Object implements Serializable
size()).| Modifier and Type | Method and Description |
|---|---|
double |
dot(Vec other)
Compute the dot product of this vector with another.
|
boolean |
equals(Object o) |
double |
get(int i)
Get the value from the vector at the specified position.
|
int |
hashCode() |
ImmutableVec |
immutable()
Get an immutable vector with this vector's contents.
|
double |
mean()
Get the mean of this vector.
|
MutableVec |
mutableCopy()
Get a mutable copy of this vector.
|
double |
norm()
Get the L2 (Euclidean) norm of this vector.
|
int |
size()
Get the dimension of this vector (the number of elements).
|
double |
sum()
Get the sum of this vector.
|
public final double get(int i)
i - The index into the vector.i.IllegalArgumentException - if i is not in the range [0,size()).public final int size()
public double norm()
public double sum()
public double mean()
Double.NaN if the vector is
empty).public final double dot(Vec other)
other - The other vector.other.IllegalArgumentException - if other.size() != this.size().public ImmutableVec immutable()
public MutableVec mutableCopy()
Copyright © 2013 GroupLens Research. All Rights Reserved.