public class SparseIndexedVector extends ASparseVector
| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Sets each component of the vector to its absolute value
|
void |
addAt(int i,
double value) |
void |
addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length) |
void |
addProductToArray(double factor,
int offset,
ArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length) |
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
Vector |
clone()
Clones the vector, creating a new copy of all data.
|
void |
copySparseValuesTo(double[] array,
int offset) |
void |
copyTo(AVector v,
int offset)
Copies a the contents of a vector to a vector at the specified offset
|
void |
copyTo(double[] array,
int offset)
Copies a the contents of a vector to a double array at the specified offset
|
static SparseIndexedVector |
create(AVector source)
Creates a SparseIndexedVector from the given vector, ignoring the zeros
|
static SparseIndexedVector |
create(int length,
Index index,
AVector data) |
static SparseIndexedVector |
create(int length,
Index index,
double[] data) |
static AVector |
createFromRow(AMatrix m,
int row)
Creates a SparseIndexedVector from a row of an existing matrix
|
double |
dotProduct(ArrayVector v) |
double |
dotProduct(AVector v) |
double |
elementSum()
Returns the sum of all elements in a vector
|
SparseIndexedVector |
exactClone()
Returns an exact clone of this vector, i.e.
|
double |
get(int i) |
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 |
isZeroVector()
Returns true if this vector is a zero vector (all components zero)
|
int |
length() |
double |
magnitudeSquared() |
double |
maxAbsElement()
Returns the maximum absolute element of a vector
|
void |
multiply(ArrayVector v) |
void |
multiply(AVector v) |
void |
multiply(double[] array,
int offset) |
void |
negate() |
int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
Index |
nonSparseIndexes()
Returns the non-sparse indexes
|
Vector |
nonSparseValues()
Returns the non-sparse values as a compacted vector view
|
void |
set(int i,
double value) |
static SparseIndexedVector |
wrap(int length,
Index index,
double[] data)
Creates a SparseIndexedVector with the specified index and data values.
|
densityadd, add, add, add, add, add, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addProduct, addProduct, addProduct, addWeighted, angle, applyOp, asElementList, asVector, broadcast, clamp, clampMax, clampMin, compareTo, copyTo, copyTo, copyTo, countZeros, crossProduct, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divideTo, dotProduct, elementCount, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, fill, fillRange, get, getElements, getLongShape, getShape, getSlices, hashCode, innerProduct, innerProduct, innerProduct, interpolate, interpolate, isElementConstrained, isMutable, isUnitLengthVector, isView, iterator, join, magnitude, multiply, multiplyTo, normalise, normaliseMaxAbsElement, outerProduct, outerProduct, projectToPlane, reshape, scale, scaleAdd, scaleAdd, scaleToMagnitude, set, set, set, set, set, set, set, set, setElements, setValues, signum, slice, sliceCount, square, sub, sub, sub, subMultiple, subVector, toArray, toList, toString, validateget, get, scale, set, set, setElementspublic final Index index
public final double[] data
public static SparseIndexedVector wrap(int length, Index index, double[] data)
public static SparseIndexedVector create(int length, Index index, double[] data)
public static SparseIndexedVector create(int length, Index index, AVector data)
public static SparseIndexedVector create(AVector source)
public static AVector createFromRow(AMatrix m, int row)
public int nonSparseElementCount()
ASparseVectornonSparseElementCount in class ASparseVectorpublic int length()
public void multiply(ArrayVector v)
public double magnitudeSquared()
magnitudeSquared in class AVectorpublic boolean isZeroVector()
AVectorisZeroVector in class AVectorpublic double maxAbsElement()
AVectormaxAbsElement in class AVectorpublic void applyOp(Op op)
INDArraypublic void abs()
AVectorpublic double get(int i)
public boolean isFullyMutable()
AVectorisFullyMutable in interface INDArrayisFullyMutable in class AVectorpublic double elementSum()
AVectorelementSum in class AVectorpublic double dotProduct(AVector v)
dotProduct in class AVectorpublic double dotProduct(ArrayVector v)
public void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
addMultipleToArray in class AVectorpublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
addToArray in class AVectorpublic void addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
addProductToArray in class AVectorpublic void addProductToArray(double factor,
int offset,
ArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
addProductToArray in class AVectorpublic void copyTo(double[] array,
int offset)
AVectorpublic void copySparseValuesTo(double[] array,
int offset)
public void copyTo(AVector v, int offset)
AVectorpublic void set(int i,
double value)
public Vector nonSparseValues()
ASparseVectornonSparseValues in class ASparseVectorpublic Index nonSparseIndexes()
ASparseVectornonSparseIndexes in class ASparseVectorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorpublic Vector clone()
AVectorpublic SparseIndexedVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorCopyright © 2013. All Rights Reserved.