public final class GrowableVector extends AVector
| Constructor and Description |
|---|
GrowableVector() |
GrowableVector(AVector v) |
GrowableVector(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(AVector v) |
void |
append(double... vs) |
void |
append(double v) |
AVector |
build()
Function to build a fixed-size vector containing a copy of data
once the GrowableVector is constructed
|
void |
clear() |
GrowableVector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
static GrowableVector |
create(AVector values)
Creates a GrowableVector containing a copy of the elements of a given vector
|
static Object |
create(double[] nonZeroValues) |
static GrowableVector |
create(Iterable<Number> iterable)
Creates a GrowableVector by consuming all numbers in the given iterable object
|
static GrowableVector |
create(Iterator<Number> iterator)
Creates a GrowableVector by consuming all numbers in the given iterator
|
int |
currentCapacity() |
double |
dotProduct(double[] data,
int offset)
Fast dot product with a double[] array.
|
void |
ensureCapacity(int capacity) |
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
GrowableVector |
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
|
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
void |
insert(int pos,
double value)
Inserts a double value at the specified position in this GrowableVector.
|
boolean |
isView()
Returns true if this vector is of a view type that references other vectors / data.
|
int |
length()
Returns the length of a vector, in terms of the number of elements.
|
static GrowableVector |
ofInitialCapacity(int capacity)
Returns a new, empty GrowableVector with the specified initial capacity
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
Vector |
toVector()
Coerces this vector to the standard dense Vector format.
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
void |
validate()
Validates the internal data structure of the INDArray.
|
static GrowableVector |
wrap(double[] values)
Creates a GrowableVector initialised with the given double[] values
|
abs, absCopy, add, add, add, add, add, add, add, add, add, addAt, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addToArray, addToArray, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, checkDimension, checkIndex, checkLength, checkRange, checkSameLength, checkSameLength, checkSameLength, clamp, clampMax, clampMin, compareTo, copy, copyTo, copyTo, copyTo, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, dotProduct, dotProduct, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, fill, fillRange, get, get, get, get, get, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isRangeZero, isSameShape, isSameShape, isUnitLengthVector, isUnitLengthVector, isZero, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduce, reduce, reduceSlices, 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, set, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, slice, sliceCount, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, tryEfficientJoinadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitaddOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, toArray, withComponentsforEach, spliteratorpublic GrowableVector(AVector v)
public GrowableVector(int initialCapacity)
public GrowableVector()
public static GrowableVector ofInitialCapacity(int capacity)
public static GrowableVector create(Iterable<Number> iterable)
iterable - An Iterable instance over java.lang.Number instancespublic static GrowableVector create(AVector values)
values - public static GrowableVector wrap(double[] values)
public static GrowableVector create(Iterator<Number> iterator)
iterable - An Iterable instance over java.lang.Number instancespublic int length()
IVectorpublic int currentCapacity()
public void ensureCapacity(int capacity)
public double get(int i)
INDArraypublic void set(int i,
double value)
INDArraypublic boolean isView()
AVectorpublic void append(double v)
public void append(double... vs)
public void append(AVector v)
public AVector build()
public GrowableVector clone()
AVectorpublic void clear()
public GrowableVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic void validate()
INDArraypublic Vector toVector()
AVectorpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AVectorpublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic boolean equalsArray(double[] data,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class AVectordata - Array of double element values to check for equalityoffset - Offset into the data arraypublic void insert(int pos,
double value)
pos - value - public static Object create(double[] nonZeroValues)
Copyright © 2016. All rights reserved.