protected static class AbstractMatrix.TransposeViewVector extends AbstractVector
AbstractVector.LocalElementVector.ElementlengthSquared| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMatrix.TransposeViewVector(Matrix m,
int offset) |
protected |
AbstractMatrix.TransposeViewVector(Matrix m,
int offset,
boolean rowToColumn) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
clone()
Return a copy of the recipient
|
Vector.Element |
getElement(int i)
Return an object of Vector.Element representing an element of this Vector.
|
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()
TODO: currently I don't know of an efficient way to getVector this value correctly.
|
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() |
Iterator<Vector.Element> |
iterateNonZero()
Currently delegates to
iterator(). |
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
|
Vector |
like(int cardinality)
Return a new empty vector of the same underlying class as the receiver with given cardinality
|
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.
|
protected Vector |
newVector(int cardinality) |
void |
setQuick(int index,
double value)
Set the value at the given index, without checking bounds
|
aggregate, aggregate, all, asFormatString, assign, assign, assign, assign, assign, assign, createOptimizedCopy, cross, divide, dot, dotSelf, equals, get, getDistanceSquared, 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, zSumprotected AbstractMatrix.TransposeViewVector(Matrix m, int offset)
protected AbstractMatrix.TransposeViewVector(Matrix m, int offset, boolean rowToColumn)
public Vector clone()
Vectorclone in interface Vectorclone in class AbstractVectorpublic boolean isDense()
public boolean isSequentialAccess()
Vector.all() and Vector.nonZeroes() ()} return elements
in ascending order by index.protected Matrix matrixLike(int rows, int columns)
AbstractVectormatrixLike in class AbstractVectorrows - the row cardinalitycolumns - the column cardinalitypublic Iterator<Vector.Element> iterator()
AbstractVectorAbstractVector.getElement(int) for the given indexiterator in class AbstractVectorIterator over all elementspublic Iterator<Vector.Element> iterateNonZero()
iterator().
TODO: This could be optimized to at least skip empty rows if there are many of them.iterateNonZero in class AbstractVectorpublic Vector.Element getElement(int i)
VectorgetElement in interface VectorgetElement in class AbstractVectori - Index of the Vector.Element requiredpublic void mergeUpdates(OrderedIntDoubleMapping updates)
updates - a mapping of indices to values to merge in the vector.public double getQuick(int index)
Vectorindex - an int indexpublic void setQuick(int index,
double value)
Vectorindex - an int index into the receivervalue - a double value to setprotected Vector newVector(int cardinality)
public Vector like()
Vectorpublic Vector like(int cardinality)
Vectorpublic int getNumNondefaultElements()
public double getLookupCost()
Vectorpublic double getIteratorAdvanceCost()
Vectorpublic boolean isAddConstantTime()
VectorCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.