public class SparseIndexedVector extends ASparseVector
| Modifier and Type | Method and Description |
|---|---|
void |
absolute()
Sets each component of the vector to its absolute value
|
void |
addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length) |
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length) |
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(int length,
Index index,
AVector data) |
static SparseIndexedVector |
create(int length,
Index index,
double[] data) |
double |
dotProduct(ArrayVector v) |
double |
dotProduct(AVector v) |
double |
elementSum()
Returns the sum of all elements in a vector
|
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.
|
Vector |
nonSparseValues()
Returns the non-sparse values as a 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.
|
add, add, addMultiple, addMultiple, addMultiple, addProduct, addProduct, addProduct, addWeighted, angle, asList, asVector, clamp, clampMax, clampMin, clone, compareTo, copy, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divideTo, dotProduct, epsilonEquals, epsilonEquals, equals, fill, fillRange, get, hashCode, interpolate, interpolate, isMutable, isReference, isUnitLengthVector, iterator, join, magnitude, multiply, multiplyTo, normalise, normaliseMaxAbsElement, projectToPlane, reshape, scale, scale, scaleAdd, scaleToMagnitude, set, set, set, set, setValues, sub, subMultiple, subVector, toArray, toList, toStringpublic 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 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 absolute()
AVectorpublic double get(int i)
public boolean isFullyMutable()
AVectorisFullyMutable 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 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 boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorCopyright © 2013. All Rights Reserved.