public class MatrixVectorView extends AbstractVector
AbstractVector.LocalElementVector.ElementlengthSquared| Constructor and Description |
|---|
MatrixVectorView(Matrix matrix,
int row,
int column,
int rowStride,
int columnStride) |
MatrixVectorView(Matrix matrix,
int row,
int column,
int rowStride,
int columnStride,
boolean isDense) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
clone()
Return a copy of the recipient
|
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()
true if this implementation should be considered dense -- that it explicitly
represents every value
|
boolean |
isSequentialAccess()
true if this implementation should be considered to be iterable in index order in an efficient way.
|
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
|
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.
|
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, 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, zSumpublic MatrixVectorView(Matrix matrix, int row, int column, int rowStride, int columnStride, boolean isDense)
public MatrixVectorView(Matrix matrix, int row, int column, int rowStride, int columnStride)
public boolean isDense()
VectorVector implementation should be considered
dense -- that it explicitly represents every valuepublic boolean isSequentialAccess()
VectorVector.all() and Vector.nonZeroes() ()} return elements
in ascending order by index.Vector should be considered to be iterable in
index order in an efficient way. In particular this implies that iterator() and
iterateNonZero() return elements in ascending order by index.public Iterator<Vector.Element> iterator()
AbstractVector.getElement(int) for
the given indexiterator in class AbstractVectorIterator over all elementspublic Iterator<Vector.Element> iterateNonZero()
AbstractVector.getElement(int) for the given indexiterateNonZero in class AbstractVectorIterator over all non-zero elementspublic double getQuick(int index)
index - an int indexpublic Vector like()
public Vector like(int cardinality)
Vectorcardinality - - size of vectorVectorpublic void setQuick(int index,
double value)
index - an int index into the receivervalue - a double value to setpublic int getNumNondefaultElements()
public double getLookupCost()
Vectorpublic double getIteratorAdvanceCost()
Vectorpublic boolean isAddConstantTime()
Vectorprotected Matrix matrixLike(int rows, int columns)
AbstractVectormatrixLike in class AbstractVectorrows - the row cardinalitycolumns - the column cardinalitypublic Vector clone()
Vectorclone in interface Vectorclone in class AbstractVectorpublic void mergeUpdates(OrderedIntDoubleMapping updates)
updates - a mapping of indices to values to merge in the vector.Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.