public final class SingleElementVector extends ASparseVector
length
Constructor and Description |
---|
SingleElementVector(int componentIndex,
int dimensions) |
SingleElementVector(int componentIndex,
int dimensions,
double value) |
Modifier and Type | Method and Description |
---|---|
void |
add(ASparseVector v) |
static AVector |
create(double val,
int i,
int len) |
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
SingleElementVector |
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 |
isElementConstrained()
Returns true if this array has some constraints on element values
|
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isMutable()
Returns true if this vector is mutable.
|
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared() |
int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
Index |
nonSparseIndexes()
Returns the non-sparse indexes
|
AVector |
nonSparseValues()
Returns the non-sparse values as a compacted vector view
|
void |
set(int i,
double value)
Set a specified element in a vector
|
AScalar |
slice(int i)
Returns the specified major slice of this array as a view (slice along dimension 0)
|
AVector |
subVector(int offset,
int length)
Obtains a sub-vector that refers to this vector.
|
double |
unsafeGet(int i) |
dotProduct, equals, equals
elementCount, getShape, getShape, getShapeClone, length, sliceCount
abs, add, add, add, add, add, add, addAt, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleToArray, addProduct, addProduct, addProduct, addProductToArray, addProductToArray, addToArray, addToArray, addWeighted, angle, applyOp, applyOp, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, clamp, clampMax, clampMin, clone, compareTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, crossProduct, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideTo, dotProduct, dotProduct, dotProduct, elementIterator, elementSquaredSum, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equalsArray, equalsArray, fill, fillRange, get, get, get, get, getElements, getLongShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, interpolate, isSameShape, isSameShape, isUnitLengthVector, isView, isZero, iterator, join, join, log, logistic, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiplyTo, mutable, negate, nonZeroCount, normalise, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reshape, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleToMagnitude, set, set, set, set, set, set, set, set, set, setElements, setElements, setRange, setValues, signum, slice, sparse, sparseClone, square, sub, sub, sub, subArray, subMultiple, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toString, toVector, unsafeGetInteger, unsafeSet, unsafeSetInteger, validate, zeroCount
broadcastCloneLike, ensureMutable, exp, getSlices, getSliceViews, isBoolean, reciprocal, scale, set, set, sqrt, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
broadcastCloneLike, ensureMutable, exp, getSlices, getSliceViews, isBoolean, reciprocal, scale, set, set, sqrt, toArray
public SingleElementVector(int componentIndex, int dimensions)
public SingleElementVector(int componentIndex, int dimensions, double value)
public static AVector create(double val, int i, int len)
public double magnitude()
AVector
public double elementSum()
AVector
elementSum
in interface INDArray
elementSum
in class AVector
public double elementMax()
INDArray
elementMax
in interface INDArray
elementMax
in class AVector
public double elementMin()
INDArray
elementMin
in interface INDArray
elementMin
in class AVector
public double magnitudeSquared()
magnitudeSquared
in class AVector
public boolean isFullyMutable()
AVector
isFullyMutable
in interface INDArray
isFullyMutable
in class AVector
public boolean isMutable()
AVector
public boolean isElementConstrained()
INDArray
isElementConstrained
in interface INDArray
isElementConstrained
in class AVector
public double density()
ISparse
density
in interface ISparse
density
in class ASparseVector
public double get(int i)
INDArray
public void set(int i, double value)
IVector
public final AScalar slice(int i)
INDArray
public AVector subVector(int offset, int length)
AVector
public SingleElementVector exactClone()
AVector
exactClone
in interface INDArray
exactClone
in class AVector
public int nonSparseElementCount()
ASparseVector
nonSparseElementCount
in class ASparseVector
public AVector nonSparseValues()
ASparseVector
nonSparseValues
in class ASparseVector
public Index nonSparseIndexes()
ASparseVector
nonSparseIndexes
in class ASparseVector
public boolean includesIndex(int i)
ASparseVector
includesIndex
in class ASparseVector
public void add(ASparseVector v)
add
in class ASparseVector
Copyright © 2014. All Rights Reserved.