|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.math.AbstractVector
org.apache.mahout.math.PermutedVectorView
public class PermutedVectorView
Provides a permuted view of a vector.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mahout.math.AbstractVector |
---|
AbstractVector.LocalElement |
Nested classes/interfaces inherited from interface org.apache.mahout.math.Vector |
---|
Vector.Element |
Field Summary |
---|
Fields inherited from class org.apache.mahout.math.AbstractVector |
---|
lengthSquared |
Constructor Summary | |
---|---|
PermutedVectorView(Vector vector,
int[] pivot)
|
|
PermutedVectorView(Vector vector,
int[] pivot,
int[] unpivot)
|
Method Summary | |
---|---|
double |
getIteratorAdvanceCost()
Gets an estimate of the cost (in number of operations) it takes to advance an iterator through the nonzero elements of this vector. |
double |
getLookupCost()
Gets an estimate of the cost (in number of operations) it takes to lookup a random element in this vector. |
int |
getNumNondefaultElements()
Return the number of values in the recipient |
double |
getQuick(int index)
Return the value at the given index, without checking bounds |
boolean |
isAddConstantTime()
Return true iff adding a new (nonzero) element takes constant time for this vector. |
boolean |
isDense()
|
boolean |
isSequentialAccess()
If the view is permuted, the elements cannot be accessed in the same order. |
Iterator<Vector.Element> |
iterateNonZero()
Iterates over all non-zero elements. |
Iterator<Vector.Element> |
iterator()
Iterates over all elements * NOTE: Implementations may choose to reuse the Element returned for performance reasons, so if you need a copy of it, you should call AbstractVector.getElement(int) for the given index |
Vector |
like()
Return an empty vector of the same underlying class as the receiver |
protected Matrix |
matrixLike(int rows,
int columns)
Subclasses must override to return an appropriately sparse or dense result |
void |
mergeUpdates(OrderedIntDoubleMapping updates)
Used internally by assign() to update multiple indices and values at once. |
void |
setQuick(int index,
double value)
Set the value at the given index, without checking bounds |
Methods inherited from class org.apache.mahout.math.AbstractVector |
---|
aggregate, aggregate, all, asFormatString, assign, assign, assign, assign, assign, assign, clone, createOptimizedCopy, cross, divide, dot, dotSelf, equals, get, getDistanceSquared, getElement, getLengthSquared, getNumNonZeroElements, hashCode, incrementQuick, invalidateCachedLength, logNormalize, logNormalize, logNormalize, maxValue, maxValueIndex, minus, minValue, minValueIndex, nonZeroes, norm, normalize, normalize, plus, plus, set, size, sparseVectorToString, times, times, toString, toString, viewPart, zSum |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PermutedVectorView(Vector vector, int[] pivot, int[] unpivot)
public PermutedVectorView(Vector vector, int[] pivot)
Method Detail |
---|
protected Matrix matrixLike(int rows, int columns)
matrixLike
in class AbstractVector
rows
- the row cardinalitycolumns
- the column cardinality
public void mergeUpdates(OrderedIntDoubleMapping updates)
updates
- a mapping of indices to values to merge in the vector.public boolean isDense()
public boolean isSequentialAccess()
iterator()
and iterateNonZero()
return elements in ascending order by index.public Iterator<Vector.Element> iterator()
AbstractVector.getElement(int)
for the given index
iterator
in class AbstractVector
Iterator
over all elementspublic Iterator<Vector.Element> iterateNonZero()
AbstractVector.getElement(int)
for the given index
iterateNonZero
in class AbstractVector
Iterator
over all non-zero elementspublic double getQuick(int index)
index
- an int index
public Vector like()
public void setQuick(int index, double value)
index
- an int index into the receivervalue
- a double value to setpublic int getNumNondefaultElements()
public double getLookupCost()
Vector
public double getIteratorAdvanceCost()
Vector
public boolean isAddConstantTime()
Vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |