public class SparseImmutableVector extends ASparseIndexedVector
length| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
void |
add(ASparseVector v) |
void |
addAt(int i,
double value)
Adds a value to a specific element of the vector
This function does not perform bounds checking, i.e.
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
SparseIndexedVector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
static AVector |
create(ASparseVector source) |
static AVector |
create(AVector source)
Creates a sparse immutable vector from the given vector, ignoring the zeros in the source.
|
static AVector |
create(int length,
Index sparseIndex,
AVector sparseValues)
Creates a SparseImmutableVector using the given sorted Index to identify the indexes of non-zero values,
and a dense vector to specify all the non-zero element values
|
static AVector |
create(int length,
Index sparseIndex,
double[] sparseValues)
Creates a SparseImmutableVector using the given sorted Index to identify the indexes of non-zero values,
and a double[] array to specify all the non-zero element values
|
static AVector |
createFromRow(AMatrix m,
int row)
Creates a SparseIndexedVector from a row of an existing matrix
|
Vector |
dense()
Coerces this INDArray to a dense format, without changing its element values.
|
SparseImmutableVector |
exactClone()
Returns an exact clone of this vector, i.e.
|
double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
boolean |
includesIndex(int i)
Returns true iff the sparse vector contains the index i
|
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isMutable()
Returns true if this vector is mutable.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
double |
maxAbsElement()
Returns the maximum absolute element value of a vector
|
int |
maxAbsElementIndex()
Returns the index of the maximum absolute element of a vector
|
int |
maxElementIndex()
Returns the index of the maximum element of a vector
|
int |
minElementIndex()
Returns the index of the minimum element of a vector
|
SparseIndexedVector |
mutable()
Coerces to a mutable version of a vector.
|
void |
negate()
Negates all emlements of this vector in place.
|
int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
Index |
nonSparseIndex()
Returns an Index indicating which elements of this vector are defined as non-sparse.
|
Vector |
nonSparseValues()
Returns the non-sparse elements as a compacted vector
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
int[] |
nonZeroIndices()
Return an int array specifying the positions in this vector which are non-zero
|
double[] |
nonZeroValues()
Return an double array specifying the values in this vector which are non-zero
|
void |
set(AVector v)
Sets the vector to equal the value of another vector
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
SparseIndexedVector |
sparseClone()
Clones the vector into a sparse mutable format
|
double |
unsafeGet(int i) |
void |
validate()
Validates the internal data structure of the INDArray.
|
static SparseImmutableVector |
wrap(int length,
Index index,
double[] nonSparseValues)
Creates a SparseImmutableVector with the specified index and data values.
|
addMultipleToArray, addProductToArray, addProductToArray, addToArray, addToArray, addToArray, cloneIncludingIndices, copySparseValuesTo, copyTo, dotProduct, dotProduct, dotProduct, dotProduct, elementSquaredSum, elementSum, equals, equalsArray, getElements, innerProduct, isRangeZero, multiplyadd, addMultiple, copyTo, copyTo, distanceL1, distanceLinf, distanceSquared, dotProduct, elementAbsPowSum, elementPowSum, elementProduct, equals, getSlices, hasUncountable, isSparse, isView, reduce, reduce, reduceSlices, roundToZero, sparse, toDoubleArray, toSparseIndexedVectorcheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabsCopy, add, add, add, add, add, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, checkDimension, checkSameLength, clamp, clampMax, clampMin, compareTo, copy, copyTo, copyTo, crossProduct, crossProduct, denseClone, dimensionality, distance, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, elementIterator, elementMax, elementMin, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fill, fillRange, get, get, get, get, getElements, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxElement, minElement, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, negateCopy, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, selectView, set, set, set, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, slice, sliceValue, softmax, softmaxCopy, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, unsafeSetadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitaddCopy, divideCopy, epsilonEquals, isSameShape, length, multiplyCopy, normalise, normaliseCopy, rotateCopy, rotateView, shiftCopy, sqrtCopy, subCopyabsCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, denseClone, dimensionality, divide, divide, divideCopy, elementCount, elementIterator, elementMax, elementMin, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isSameShape, join, join, log, multiply, multiplyCopy, multiplyCopy, negateCopy, outerProduct, pow, reciprocal, reciprocalCopy, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, withComponentsforEach, spliteratorpublic static SparseImmutableVector wrap(int length, Index index, double[] nonSparseValues)
public static AVector create(int length, Index sparseIndex, double[] sparseValues)
public static AVector create(int length, Index sparseIndex, AVector sparseValues)
public static AVector create(AVector source)
public static AVector create(ASparseVector source)
public static AVector createFromRow(AMatrix m, int row)
public int nonSparseElementCount()
ASparseVectornonSparseElementCount in class ASparseVectorpublic boolean isZero()
AVectorisZero in interface INDArrayisZero in class ASparseIndexedVectorpublic double maxAbsElement()
AVectormaxAbsElement in class AVectorpublic int maxElementIndex()
AVectormaxElementIndex in class AVectorpublic int maxAbsElementIndex()
AVectormaxAbsElementIndex in class AVectorpublic int minElementIndex()
AVectorminElementIndex in class AVectorpublic void negate()
AVectorpublic void applyOp(Op op)
INDArraypublic void abs()
INDArraypublic double get(int i)
INDArraypublic boolean isFullyMutable()
AVectorisFullyMutable in interface INDArrayisFullyMutable in class AVectorpublic boolean isMutable()
AVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class ASparseIndexedVectorpublic int[] nonZeroIndices()
AVectornonZeroIndices in class ASparseIndexedVectorpublic void add(ASparseVector v)
add in class ASparseVectorpublic void set(AVector v)
AVectorpublic void set(int i,
double value)
INDArraypublic void addAt(int i,
double value)
AVectorpublic Vector nonSparseValues()
ISparseVectornonSparseValues in interface ISparseVectornonSparseValues in class ASparseVectorpublic double[] nonZeroValues()
AVectornonZeroValues in class AVectorpublic Index nonSparseIndex()
AVectornonSparseIndex in interface ISparseVectornonSparseIndex in class ASparseVectorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseIndexedVectorpublic Vector dense()
INDArraypublic SparseIndexedVector mutable()
AVectorpublic SparseIndexedVector clone()
AVectorpublic SparseIndexedVector sparseClone()
AVectorsparseClone in interface INDArraysparseClone in class AVectorpublic SparseImmutableVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic void validate()
INDArrayCopyright © 2016. All rights reserved.