|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcommon.ImplicitVector
common.DenseVector
public class DenseVector
Implementation of ImplicitVector in which the explicit entries form a prefix of the implicit infinite vector. In other words, this is an ordinary vector in which entries beyond the end of the explicitly represented vector are treated as zeroes. Entries between the explicitly set entries that have not been set themselves are also treated as zeroes.
Constructor Summary | |
---|---|
DenseVector()
Creates a new vector with no explicit entries. |
|
DenseVector(int initialCapacity)
Creates a new vector with no explicit entries, but with memory allocated for the given number of entries. |
Method Summary | |
---|---|
void |
add(double value)
Adds the given value at the next index after the last explicitly set index. |
double |
get(int i)
Returns the value at the given index. |
int |
ithExplicitIndex(int i)
Returns the ith explicitly represented index in this vector. |
double |
ithExplicitValue(int i)
Returns the value at the ith explicitly represented index. |
int |
numExplicit()
Returns the number of explicitly represented entries in this vector. |
void |
set(int i,
double value)
Sets the value at the given index, filling in any gap between this index and the previous highest explicit index with explicit zeroes. |
java.lang.String |
toString()
|
Methods inherited from class common.ImplicitVector |
---|
dotProduct, dotProduct, maxExplicitIndex, sampleIndex, sum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DenseVector()
public DenseVector(int initialCapacity)
Method Detail |
---|
public double get(int i)
ImplicitVector
get
in class ImplicitVector
public void set(int i, double value)
set
in class ImplicitVector
public void add(double value)
public int numExplicit()
ImplicitVector
numExplicit
in class ImplicitVector
public int ithExplicitIndex(int i)
ImplicitVector
ithExplicitIndex
in class ImplicitVector
public double ithExplicitValue(int i)
ImplicitVector
ithExplicitValue
in class ImplicitVector
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |