public abstract class AVector extends AbstractArray<Double> implements IVector, Comparable<AVector>
| Constructor and Description |
|---|
AVector() |
| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
AVector |
absCopy()
Returns a copy of the array with the abs operator applied to each element
|
void |
add(ADenseArrayVector v)
Add a DenseArrayVector to this vector
|
void |
add(AVector v)
Adds another vector to this one
|
void |
add(AVector src,
int srcOffset)
Adds part another vector to this one, starting at the specified offset in the source vector
|
void |
add(double constant)
Adds a double value to all elements in this array.
|
void |
add(double[] data)
Adds the values from a double[] array to this vector
|
void |
add(double[] data,
int offset)
Adds to this vector from a given double array.
|
void |
add(INDArray a)
Adds all the elements of another array to this array, in an elementwise order.
|
void |
add(int offset,
AVector src)
Adds another vector into this one, at the specified offset
|
void |
add(int offset,
AVector src,
int srcOffset,
int length)
Adds a segment of another vector into this one, at the specified offset
|
void |
addAt(int i,
double v)
Adds a value to a specific element of the vector
This function does not perform bounds checking, i.e.
|
void |
addAt(long i,
double v)
Adds to a mutable array, indexed by element position in row major order.
|
AVector |
addCopy(AVector a)
Adds a vector element-wise to this vector, returning a new vector.
|
AVector |
addCopy(double a)
Creates a new array equal to this array with a constant value added to every element
|
INDArray |
addCopy(INDArray a)
Creates a new array equal to the sum of this array with another array.
|
void |
addInnerProduct(AMatrix a,
AVector b)
Adds the inner product of the arguments (matrix a and vector b) to this vector.
|
void |
addInnerProduct(AVector a,
AMatrix b)
Adds the inner product of the arguments (vector a and matrix b) to this vector.
|
void |
addInnerProduct(INDArray a,
INDArray b)
Adds the inner product of two arrays to this array.
|
void |
addMultiple(AVector src,
double factor)
Adds a scaled multiple of another vector to this vector
|
void |
addMultiple(AVector source,
Index sourceToDest,
double factor)
Adds source vector to this vector at the specified indexes which should map from source->this
|
void |
addMultiple(AVector src,
int srcOffset,
double factor)
Adds a multiple of a subvector of another vector to this vector.
|
void |
addMultiple(INDArray src,
double factor)
Adds a scaled multiple of another array to this array
|
void |
addMultiple(int offset,
AVector v,
double factor) |
void |
addMultiple(int offset,
AVector src,
int srcOffset,
int length,
double factor) |
void |
addMultiple(SparseIndexedVector src,
double factor)
Adds a scaled multiple of a sparse indexed vector to this vector
|
void |
addMultiple(Vector source,
Index sourceToDest,
double factor)
Adds source vector to this vector at the specified indexes which should map from source->this
|
AVector |
addMultipleCopy(AVector src,
double factor)
Returns the sum of this vector with a scaled multiple of a second vector.
|
void |
addMultipleToArray(double factor,
double[] array,
int arrayOffset)
Adds a multiple of this vector into a double array at the specified offset
|
void |
addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
Adds a multiple of a subvector of this vector into a double array at the specified offset
|
protected void |
addPower(AVector src,
double exponent,
double factor)
Adds a multiple of the source vector raised to the specified power to this vector
|
void |
addPower(INDArray src,
double exponent)
Adds an array with all elements raised to the specified power
|
void |
addPower(INDArray src,
double exponent,
double factor)
Adds an array with all elements raised to the specified power and scaled by the given factor
|
void |
addProduct(AVector a,
AVector b)
Adds the element-wise product of two vectors to this vector.
|
void |
addProduct(AVector a,
AVector b,
double factor)
Adds the element-wise product of two vectors and a constant factor to this vector.
|
void |
addProduct(AVector a,
int aOffset,
AVector b,
int bOffset,
double factor)
Adds the scaled elementwise product of two vectors to this vector
|
AVector |
addProductCopy(AVector a,
AVector b)
Adds the element-wise product of two vectors to this vector.
|
AVector |
addProductCopy(AVector a,
AVector b,
double factor)
Adds the element-wise product of two vectors and a constant factor to this vector.
|
void |
addProductToArray(double factor,
int offset,
ADenseArrayVector other,
int otherOffset,
double[] dest,
int destOffset,
int length)
Adds the scaled elementwise product of this vector and another vector to the destimation array
|
void |
addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addToArray(double[] array,
int offset)
Adds this vector to a double[] array, starting at the specified offset.
|
void |
addToArray(double[] dest,
int destOffset,
int destStride)
Adds this vector to a double[] array, using the specified offset and stride into the destination array
|
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length)
Adds a subvector of this vector into a double array at the specified offset
|
void |
addWeighted(AVector v,
double factor)
Updates a weighted average of this vector with another vector
|
double |
angle(AVector v)
Returns the Euclidean angle between this vector and another vector
|
void |
applyOp(IOperator op)
Applies a unary operator to all elements of the array (in-place)
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
void |
applyOp(Op2 op,
AVector b)
Applies a binary operator to this vector and a second vector
|
void |
applyOp(Op2 op,
double b)
Applies a binary operator to this array and a double value.
|
void |
applyOp(Op2 op,
INDArray b)
Applies a binary operator to this array and a second array.
|
AVector |
applyOpCopy(Op op)
Applies a unary operator to all elements of the array (creating a new array)
|
double[] |
asDoubleArray()
Returns the underlying double array representing the densely packed elements of this array
Returns null if there is no such array
|
List<Double> |
asElementList()
Returns a List
|
AVector |
asVector()
Constructs a view of all elements in the array as a single vector in row-major order.
|
INDArray |
broadcast(int... targetShape)
Returns a view of this array broadcasted up to a larger shape
|
AMatrix |
broadcastLike(AMatrix target)
Broadcasts an array to match the shape of the target matrix
|
AVector |
broadcastLike(AVector target)
Broadcasts an array to match the shape of the target vector
|
INDArray |
broadcastLike(INDArray target)
Broadcasts an array to match the shape of the target
|
protected void |
checkDimension(int dimension)
Checks if an array has the specified dimension.
|
int |
checkIndex(int i)
Utility function to check an index and throw an exception in not in bounds.
|
int |
checkLength(int length)
Checks that a vector is the specified length, throws an exception if not.
|
int |
checkRange(int offset,
int length)
Utility function to check vector range and throw an exception if not valid.
|
protected int |
checkSameLength(ASizedVector v) |
protected int |
checkSameLength(AVector v)
Utility function to check vector length and throw an exception if not same shape.
|
protected int |
checkSameLength(AVector v,
AVector w)
Utility function to check vector length and throw an exception if not same shape.
|
void |
clamp(double min,
double max)
Clamps all values in the vector to a given range
|
void |
clampMax(double max) |
void |
clampMin(double min) |
AVector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
int |
compareTo(AVector a) |
AVector |
copy()
Returns a defensive copy of the array data.
|
void |
copyTo(ADenseArrayVector dest,
int destOffset)
Copies a the contents of a vector to a vector at the specified offset
|
void |
copyTo(AVector dest,
int destOffset)
Copies a the contents of a vector to a vector at the specified offset
|
void |
copyTo(int offset,
AVector dest,
int destOffset,
int length)
Copies a subset of this vector to a vector at the specified offset
|
void |
copyTo(int offset,
double[] dest,
int destOffset,
int length)
Copies a subset of this vector to a specified destination array offset
|
void |
copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
Copies a subset of this vector to a specified destination array offset
using the given stride.
|
void |
crossProduct(AVector a)
Computes the crossProduct of this vector with another vector, and stores the result in this vector.
|
void |
crossProduct(Vector3 a)
Computes the crossProduct of this vector with another vector, and stores the result in this vector.
|
AVector |
dense()
Coerces this INDArray to a dense format, without changing its element values.
|
Vector |
denseClone()
Creates a fully mutable dense clone of this array.
|
int |
dimensionality()
Returns the dimensionality of the array (i.e.
|
double |
distance(AVector v)
Returns the Euclidean distance to another vector.
|
double |
distanceL1(AVector v)
Returns the distance from this vector to another vector according to the L1 (Taxicab) norm.
|
double |
distanceLinf(AVector v)
Returns the distance from this vector to another vector according to the Linf norm.
|
double |
distanceSquared(AVector v)
Returns the squared Euclidean distance to another vector.
|
void |
divide(AVector v) |
void |
divide(double factor)
Divides all elements by a given factor
|
void |
divide(double[] data,
int offset)
Divides the elements in this vector by corresponding elements in the target array
|
void |
divide(INDArray a)
Divides all elements in place by the equivalent elements in a second array
|
AVector |
divideCopy(AVector a)
Divides this vector element-wise by another vector, returning a new vector.
|
INDArray |
divideCopy(INDArray a)
Divides all elements by the equivalent elements in a second array.
|
void |
divideTo(double[] data,
int offset)
Divides the elements in the target array by corresponding elements in this vector
|
double |
dotProduct(ADenseArrayVector v)
Returns the dot product of this vector with a target ADenseArrayVector.
|
double |
dotProduct(AVector v)
Returns the dot product of this vector with another vector
The vectors must have the same length: if not the result is undefined
|
double |
dotProduct(AVector v,
Index ix)
Returns the dotProduct of this vector with the elements of another vector mapped to specified indexes in this vector.
|
abstract double |
dotProduct(double[] data,
int offset)
Fast dot product with a double[] array.
|
double |
dotProduct(double[] data,
int offset,
int stride)
Fast dot product with a double[] array and a stride.
|
double |
elementAbsPowSum(double exponent)
Returns the sum of the absolute values of all the elements raised to a specified power
|
long |
elementCount()
Returns the total number of elements in this array.
|
Iterator<Double> |
elementIterator()
Returns an iterator over all elements in this array, in row-major order
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementPowSum(double exponent)
Returns the sum of all the elements raised to a specified power
|
double |
elementProduct()
Returns the product of all elements in the array.
|
boolean |
elementsEqual(double value)
Returns true if all elements are equal to a specific value
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
epsilonEquals(AVector v)
Returns true if this vector is approximately equal to another vector.
|
boolean |
epsilonEquals(AVector v,
double tolerance) |
boolean |
epsilonEquals(INDArray a)
Tests if this array is approximately equal to another array.
|
boolean |
epsilonEquals(INDArray a,
double tolerance)
Tests is this array is approximately equal to another array, up to a given tolerance (epsilon)
The arrays must have the same shape
|
boolean |
equals(AVector v) |
boolean |
equals(INDArray v)
Checks if two arrays are equal exactly in terms of both value and shape
|
boolean |
equals(Object o)
Test for equality on vectors.
|
boolean |
equalsArray(double[] data)
Returns true if this vector exactly matches a double[] array.
|
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
abstract AVector |
exactClone()
Returns an exact clone of this vector, i.e.
|
void |
fill(double value)
Fills the entire vector with a given value
|
void |
fillRange(int offset,
int length,
double value) |
double |
get()
Returns the double value of a scalar array
|
double |
get(int... indexes)
Returns the double value at the specified index position in an array
|
abstract double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
double |
get(int x,
int y)
Returns the double value at the specified position in a 2D matrix
|
double |
get(long i)
Returns the double value at the specified position in a 1D vector
|
double |
get(long[] indexes)
Returns the double value at the specified index position in an array
|
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
void |
getElements(double[] dest,
int destOffset,
int[] indices)
Gets the elements in this vector from the specified indices, storing at the specified
offset in the destination array
|
void |
getElements(Object[] dest,
int offset)
Gets all elements of the array, copying them into an object array at the specified offset
|
long[] |
getLongShape()
Returns the shape of the array as an array of longs.
|
int[] |
getShape()
Returns the shape of the array as an array of ints.
|
int |
getShape(int dim)
Returns the dimension size for a specific dimension in the array's shape
|
int[] |
getShapeClone()
Returns the shape of the array as an array of ints, guaranteed to be a new array
i.e.
|
List<Double> |
getSlices()
Returns a list of all major slices of this array.
|
AVector |
getTranspose()
Returns the transpose of this array.
|
AVector |
getTransposeCopy()
Returns a transposed copy of the array.
|
AVector |
getTransposeView()
Returns a transposed view of the array.
|
int |
hashCode()
Computes the hashcode of a vector.
|
boolean |
hasUncountable()
Returns true if any element is this array is NaN or infinite
|
AVector |
immutable()
Creates an immutable copy of a vector
|
Scalar |
innerProduct(ADenseArrayVector v)
Overloaded inner product for dense array vector argument
|
AVector |
innerProduct(AMatrix m)
Computes the inner product of this vector with a matrix
|
AVector |
innerProduct(AScalar s)
Computes the inner product of this vector with a scalar
|
AScalar |
innerProduct(AVector v)
Computes the inner product of this vector with another vector
|
AVector |
innerProduct(double a)
Calculates the inner product of this array with a double value
|
INDArray |
innerProduct(INDArray a)
Calculates the inner product of this array with another array.
|
void |
interpolate(AVector v,
double alpha) |
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.
|
boolean |
isRangeZero(int start,
int length)
Returns true if a sub-vector range is completely zero.
|
boolean |
isSameShape(AVector a)
Returns true if this vector is exactly the same shape as another vector.
|
boolean |
isSameShape(INDArray a)
Returns true if this array is the same shape as another array
|
boolean |
isUnitLengthVector()
Returns true if the vector has unit length
|
boolean |
isUnitLengthVector(double tolerance) |
boolean |
isView()
Returns true if this vector is of a view type that references other vectors / data.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
Iterator<Double> |
iterator() |
AVector |
join(AVector second) |
AVector |
join(INDArray b)
Returns a new vector that refers to this vector joined to a second vector.
|
INDArray |
join(INDArray a,
int dimension)
Joins an array with another array along a specified dimension
|
abstract int |
length()
Returns the length of a vector, in terms of the number of elements.
|
void |
log()
Computes the natural logarithm (in-place) for all array elements
|
void |
logistic()
Computes the logistic function for every element in this vector.
|
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared()
Computes the squared magnitude (sum of squares) for this vector
|
double |
maxAbsElement()
Returns the maximum absolute element value of a vector
|
int |
maxAbsElementIndex()
Returns the index of the maximum absolute element of a vector
|
double |
maxElement()
Returns the maximum element value in a vector.
|
int |
maxElementIndex()
Returns the index of the maximum element of a vector
|
double |
minElement()
Returns the minimum element value in a vector.
|
int |
minElementIndex()
Returns the index of the minimum element of a vector
|
void |
multiply(ADenseArrayVector v) |
void |
multiply(AVector v) |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
void |
multiply(double[] data,
int offset)
Multiplies the elements in this vector by corresponding elements in the target array
|
void |
multiply(INDArray a)
Multiplies all elements by the equivalent elements in a second array, i.e.
|
AVector |
multiplyCopy(AVector a)
Multiplies a vector element-wise with this vector, returning a new vector.
|
AVector |
multiplyCopy(double d)
Returns a copy of the array with all elements multiplied by a single constant value
|
INDArray |
multiplyCopy(INDArray a)
Multiplies all elements by the equivalent elements in a second array, i.e.
|
void |
multiplyTo(double[] dest,
int offset)
Multiplies the elements in the target array by corresponding elements in this vector
|
AVector |
mutable()
Coerces to a mutable version of a vector.
|
void |
negate()
Negates all emlements of this vector in place.
|
AVector |
negateCopy()
Negates all elements in the array, returning a new array
|
Index |
nonSparseIndex()
Returns an Index indicating which elements of this vector are defined as non-sparse.
|
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
|
double |
normalise()
Normalises this vector to a magnitude of 1.0
Has no effect on a zero-length vector (i.e.
|
AVector |
normaliseCopy()
Returns a copy of this vector normalised to a Euclidean length of 1.0
Has no effect on a zero-length vector (i.e.
|
double |
normaliseMaxAbsElement()
Normalises so that the maximum absolute element is 1.0
Returns the previous maximum absolute element.
|
AMatrix |
outerProduct(AVector a)
Computes the outer product of this vector with another vector
|
INDArray |
outerProduct(INDArray a)
Calculates the outer product of this array with another array.
|
void |
pow(double exponent)
Raises all elements of the array to a specified power in place
|
void |
projectToPlane(AVector normal,
double distance)
Projects the vector to the plane defined by: x.normal=distance
|
double |
reduce(Op2 op)
Reduces over all elements of the array in row-major order.
|
double |
reduce(Op2 op,
double init)
Reduces over all elements of the array in row-major order.
|
AVector |
reduceSlices(Op2 op)
Reduces each slice of the array by the given operator
|
AVector |
reduceSlices(Op2 op,
double init)
Reduces each slice of the array by the given operator
Uses the specified init value for reduction of each slice
|
AVector |
reorder(int[] order)
Returns a re-ordered array by taking the specified order of slices along dimension 0
|
AVector |
reorder(int dim,
int[] order)
Returns a re-ordered array by taking the specified order of slices along a given dimension
May or may not use views of underlying slices (i.e.
|
INDArray |
reshape(int... dimensions)
Returns a new array by rearranging the elements of this array into the desired shape
Truncates or zero-pads the elements as required to fill the new shape
|
AVector |
rotateCopy(int shift)
Rotates a vector by the specified number of elements, wrapping around element values.
|
AVector |
rotateView(int shift)
Rotates a vector by the specified number of elements, wrapping around element values.
|
INDArray |
rotateView(int dimension,
int shift)
Returns rotated view of this array
|
void |
scale(AVector v)
Scales the vector by another vector of the same size
|
void |
scaleAdd(double factor,
AVector v) |
void |
scaleAdd(double factor,
AVector b,
double bfactor,
double constant)
Scales all elements of the array by a given double value, adds a
scaled second vector and adds a constant value
|
void |
scaleAdd(double factor,
double constant)
Scales this vector and adds a constant to every element
|
void |
scaleAdd(double factor,
INDArray b,
double bfactor,
double constant)
Scales all elements of the array by a given double value, adds a scaled second array and adds a constant value
|
AVector |
scaleCopy(double d)
Scales all elements of the array by a given double value, returning a new array
|
double |
scaleToMagnitude(double targetMagnitude)
Scales the vector up to a specific target magnitude
|
AVector |
select(int... indices)
Selects a subset of indices from a vector
|
AVector |
selectClone(int... inds)
Selects a subset of indices from a vector, returning a mutable clone of data
|
AVector |
selectView(int... indices)
Selects a subset of indices from a vector, returning a view
|
void |
set(ADenseArrayVector v)
Sets the vector equal to the value of an ADenseArrayVector
|
void |
set(AVector src)
Sets the vector to equal the value of another vector
|
void |
set(AVector source,
Index indexes)
sets the vector using values indexed from another vector
|
void |
set(AVector src,
int srcOffset)
Set the vector equal to an offset into another vector
|
void |
set(AVector source,
int[] indexes)
sets the vector using values indexed from another vector
|
void |
set(double a)
Sets all elements of an array to a specific double value
|
void |
set(INDArray a)
Sets this array to the element values contained in another array.
|
void |
set(int[] indexes,
double value)
Sets the element at the given indexed position in a mutable array
|
abstract void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
set(long[] indexes,
double value)
Sets the element at the given indexed position in a mutable array
|
void |
set(long i,
double value) |
void |
setElements(double... data)
Sets all elements in an array using the given double values
|
void |
setElements(double[] data,
int offset)
Sets all elements in an array using the given double values
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
void |
setInnerProduct(AMatrix a,
AVector b)
Sets this vector to the inner product of the arguments (matrix a and vector b).
|
void |
setInnerProduct(AVector a,
AMatrix b)
Sets this vector to the inner product of the arguments (vector a and matrix b) to this vector.
|
void |
setInnerProduct(INDArray a,
INDArray b)
Sets this array to the inner product of two arrays.
|
void |
setMultiple(AVector a,
AVector b)
Sets this vector to the element-wise product of two otehr vectors
|
void |
setMultiple(AVector a,
double b)
Sets this vector to be a multiple of another vector
|
void |
setMultiple(INDArray a,
double b)
Sets this array to be the multiple of another array.
|
void |
setMultiple(INDArray a,
INDArray b)
Sets this array to the element-wise multiple of two arrays.
|
AVector |
shiftCopy(int shift)
Shifts a vector by the specified number of elements, filling with zeros.
|
void |
signum()
Calculates the signum of all elements of this mutable array
Sets each component of the array to its sign value (-1, 0 or 1)
|
AScalar |
slice(int position)
Returns the specified major slice of this array as a view (slice along dimension 0)
0 dimensional slice results are permitted, but attempting to slice a 0 dimensional array
will result in an error.
|
AScalar |
slice(int dimension,
int index)
Returns a slice view of this array along the specified dimension
|
int |
sliceCount()
Returns the number of major slices in this array (i.e.
|
Object |
sliceValue(int i)
Returns the value of a major slice of this array (slice along dimension 0)
Like 'slice', except returns a Double value for slices of 1D vectors
|
void |
softmax()
Computes the softmax function over this vector, mutating this vector
|
AVector |
softmaxCopy()
Computes the softmax function over this vector, returning a new mutable vector
|
AVector |
sparse()
Coerces this INDArray to a sparse format, without changing its element values.
|
AVector |
sparseClone()
Clones the vector into a sparse mutable format
|
AVector |
sqrtCopy()
Computes the square root for each element in this vector, returning a new vector.
|
void |
square()
Squares all elements of the array in place
|
AVector |
squareCopy()
Squares all elements of the array, returning a new array
|
void |
sub(AVector v)
Subtracts a vector from this vector
|
void |
sub(INDArray a)
Subtracts all the elements of another array from this array, in an elementwise order.
|
AVector |
subArray(int[] offsets,
int[] shape)
Returns a subarray view of a larger array
|
void |
subAt(int i,
double v)
Subtracts a value from the specified element in this vector.
|
AVector |
subCopy(AVector a)
Subtracts a vector element-wise from this vector, returning a new vector.
|
INDArray |
subCopy(INDArray a)
Creates a new array equal to the subtraction of another array from this array
|
void |
subMultiple(AVector v,
double factor)
Subtracts a scaled multiple of another vector from this vector
|
AVector |
subVector(int offset,
int length)
Obtains a sub-vector view that refers to this vector.
|
void |
tanh()
Computes the tanh of every element in this vector.
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
List<Double> |
toList()
Returns a java.util.List instance containing all elements of this vector
|
AVector |
toNormal()
Creates a new mutable vector representing the normalised value of this vector
Returns null if the vector cannot be normalised (i.e.
|
INDArray[] |
toSliceArray()
Copies the slices of this array to a new INDArray[]
|
String |
toString() |
String |
toStringFull() |
Vector |
toVector()
Coerces this vector to the standard dense Vector format.
|
AVector |
tryEfficientJoin(AVector second)
Attempts to perform an efficient join with a second vector.
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
void |
validate()
Validates the internal data structure of the INDArray.
|
add, 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 abstract int length()
IVectorpublic abstract double get(int i)
INDArraypublic abstract void set(int i,
double value)
INDArraypublic double get(long i)
INDArrayget in interface INDArrayget in class AbstractArray<Double>public void set(long i,
double value)
public void set(int[] indexes,
double value)
INDArraypublic void set(long[] indexes,
double value)
INDArrayset in interface INDArrayset in class AbstractArray<Double>public void unsafeSet(int i,
double value)
public double unsafeGet(int i)
public final double get(int x,
int y)
INDArrayget in interface INDArrayget in class AbstractArray<Double>public final int dimensionality()
INDArraydimensionality in interface INDArraypublic final double get(int... indexes)
INDArraypublic final double get(long[] indexes)
INDArrayget in interface INDArrayget in class AbstractArray<Double>public double get()
INDArrayget in interface INDArrayget in class AbstractArray<Double>public AScalar slice(int position)
INDArraypublic Object sliceValue(int i)
INDArraysliceValue in interface INDArraysliceValue in class AbstractArray<Double>public AScalar slice(int dimension, int index)
INDArraypublic int sliceCount()
INDArraysliceCount in interface INDArraypublic List<Double> getSlices()
INDArraygetSlices in interface INDArraygetSlices in class AbstractArray<Double>public int[] getShape()
INDArraypublic int[] getShapeClone()
INDArraygetShapeClone in interface INDArraygetShapeClone in class AbstractArray<Double>public final int getShape(int dim)
INDArraygetShape in interface INDArraygetShape in class AbstractArray<Double>public long[] getLongShape()
INDArraygetLongShape in interface INDArraygetLongShape in class AbstractArray<Double>public long elementCount()
INDArrayelementCount in interface INDArraypublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AbstractArray<Double>public double[] nonZeroValues()
public AVector subArray(int[] offsets, int[] shape)
INDArraysubArray in interface INDArraysubArray in class AbstractArray<Double>public INDArray rotateView(int dimension, int shift)
INDArrayrotateView in interface INDArrayrotateView in class AbstractArray<Double>public AVector rotateView(int shift)
IVectorrotateView in interface IVectorpublic AVector rotateCopy(int shift)
IVectorrotateCopy in interface IVectorpublic AVector subVector(int offset, int length)
public AVector join(INDArray b)
join in interface INDArrayjoin in class AbstractArray<Double>second - public AVector tryEfficientJoin(AVector second)
public INDArray join(INDArray a, int dimension)
INDArrayjoin in interface INDArrayjoin in class AbstractArray<Double>public int compareTo(AVector a)
compareTo in interface Comparable<AVector>public boolean equals(Object o)
equals in class AbstractArray<Double>public boolean equals(AVector v)
equals in class AbstractArray<Double>public boolean equals(INDArray v)
INDArrayequals in interface INDArrayequals in class AbstractArray<Double>public List<Double> toList()
public boolean epsilonEquals(INDArray a, double tolerance)
INDArrayepsilonEquals in interface INDArrayepsilonEquals in class AbstractArray<Double>public boolean epsilonEquals(INDArray a)
INDArrayepsilonEquals in interface INDArrayepsilonEquals in class AbstractArray<Double>public boolean epsilonEquals(AVector v)
v - public boolean epsilonEquals(AVector v, double tolerance)
epsilonEquals in interface IVectorpublic int hashCode()
hashCode in class AbstractArray<Double>public double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AbstractArray<Double>public INDArray[] toSliceArray()
INDArraytoSliceArray in interface INDArraytoSliceArray in class AbstractArray<Double>public double[] asDoubleArray()
INDArrayasDoubleArray in interface INDArrayasDoubleArray in class AbstractArray<Double>public void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AbstractArray<Double>public void copyTo(AVector dest, int destOffset)
public void copyTo(ADenseArrayVector dest, int destOffset)
public void copyTo(int offset,
AVector dest,
int destOffset,
int length)
public void copyTo(int offset,
double[] dest,
int destOffset,
int length)
public void copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
public void fill(double value)
fill in interface INDArrayfill in class AbstractArray<Double>value - public void fillRange(int offset,
int length,
double value)
public void clamp(double min,
double max)
clamp in interface INDArrayclamp in class AbstractArray<Double>value - public void clampMax(double max)
public void clampMin(double min)
public void multiply(double factor)
multiply in interface INDArraymultiply in class AbstractArray<Double>factor - Factor by which to multiply each component of the vectorpublic void multiply(INDArray a)
INDArraymultiply in interface INDArraymultiply in class AbstractArray<Double>public void multiply(AVector v)
public void multiply(ADenseArrayVector v)
public void multiply(double[] data,
int offset)
data - offset - The offset into the target arraypublic void multiplyTo(double[] dest,
int offset)
data - offset - The offset into the target arraypublic AVector multiplyCopy(double d)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AbstractArray<Double>d - A scalar factorpublic INDArray multiplyCopy(INDArray a)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AbstractArray<Double>public AVector multiplyCopy(AVector a)
IVectormultiplyCopy in interface IVectorpublic INDArray divideCopy(INDArray a)
INDArraydivideCopy in interface INDArraydivideCopy in class AbstractArray<Double>public AVector divideCopy(AVector a)
IVectordivideCopy in interface IVectorpublic void divide(double factor)
INDArraydivide in interface INDArraydivide in class AbstractArray<Double>public void divide(INDArray a)
INDArraydivide in interface INDArraydivide in class AbstractArray<Double>public void divide(AVector v)
public void divide(double[] data,
int offset)
data - offset - The offset into the target arraypublic void divideTo(double[] data,
int offset)
data - offset - The offset into the target arraypublic void abs()
INDArrayabs in interface INDArrayabs in class AbstractArray<Double>public AVector absCopy()
INDArrayabsCopy in interface INDArrayabsCopy in class AbstractArray<Double>public void log()
INDArraylog in interface INDArraylog in class AbstractArray<Double>public void signum()
INDArraysignum in interface INDArraysignum in class AbstractArray<Double>public AVector softmaxCopy()
public void softmax()
public void square()
INDArraysquare in interface INDArraysquare in class AbstractArray<Double>public AVector squareCopy()
INDArraysquareCopy in interface INDArraysquareCopy in class AbstractArray<Double>public AVector sqrtCopy()
IVectorpublic void tanh()
public void logistic()
public final void scale(AVector v)
v - public double scaleToMagnitude(double targetMagnitude)
public void scaleAdd(double factor,
AVector v)
public void interpolate(AVector v, double alpha)
public final double magnitudeSquared()
public final AVector getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in class AbstractArray<Double>public AVector getTransposeCopy()
INDArraygetTransposeCopy in interface INDArraygetTransposeCopy in class AbstractArray<Double>public final AVector getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AbstractArray<Double>public AVector select(int... indices)
indices - public AVector selectView(int... indices)
indices - public AVector selectClone(int... inds)
indices - public AMatrix outerProduct(AVector a)
a - public final INDArray outerProduct(INDArray a)
INDArrayouterProduct in interface INDArrayouterProduct in class AbstractArray<Double>public AScalar innerProduct(AVector v)
innerProduct in interface INDArrayinnerProduct in class AbstractArray<Double>v - A vectorpublic Scalar innerProduct(ADenseArrayVector v)
v - public AVector innerProduct(AMatrix m)
m - public AVector innerProduct(AScalar s)
innerProduct in interface INDArrayinnerProduct in class AbstractArray<Double>s - A scalar instancepublic INDArray innerProduct(INDArray a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Double>public final AVector innerProduct(double a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Double>public double dotProduct(AVector v)
v - public double dotProduct(ADenseArrayVector v)
v - public double dotProduct(AVector v, Index ix)
v - ix - public abstract double dotProduct(double[] data,
int offset)
public double dotProduct(double[] data,
int offset,
int stride)
public void crossProduct(AVector a)
a - public void crossProduct(Vector3 a)
a - public double magnitude()
public double distanceSquared(AVector v)
v - public double distance(AVector v)
v - public double distanceL1(AVector v)
v - public double distanceLinf(AVector v)
v - public double maxAbsElement()
public int maxAbsElementIndex()
public final double maxElement()
public int maxElementIndex()
public final double minElement()
public int minElementIndex()
public double normaliseMaxAbsElement()
public double elementSum()
elementSum in interface INDArrayelementSum in class AbstractArray<Double>public double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AbstractArray<Double>public double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AbstractArray<Double>public double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AbstractArray<Double>public double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AbstractArray<Double>public double elementPowSum(double exponent)
AbstractArrayelementPowSum in interface INDArrayelementPowSum in class AbstractArray<Double>public double elementAbsPowSum(double exponent)
AbstractArrayelementAbsPowSum in interface INDArrayelementAbsPowSum in class AbstractArray<Double>public double angle(AVector v)
public double normalise()
public AVector normaliseCopy()
normaliseCopy in interface IVectorpublic void negate()
negate in interface INDArraynegate in class AbstractArray<Double>public AVector negateCopy()
INDArraynegateCopy in interface INDArraynegateCopy in class AbstractArray<Double>public final AVector scaleCopy(double d)
INDArrayscaleCopy in interface INDArrayscaleCopy in class AbstractArray<Double>public AVector shiftCopy(int shift)
IVectorpublic void pow(double exponent)
INDArraypow in interface INDArraypow in class AbstractArray<Double>public void set(AVector src)
public void set(ADenseArrayVector v)
v - public void set(double a)
INDArrayset in interface INDArrayset in class AbstractArray<Double>public void setElements(double... data)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<Double>data - Element values in a double[] array. There must be at least as many element values as elements in this array.public void setElements(double[] data,
int offset)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<Double>data - Element values in a double[] array. There must be at least as many element values as elements in this array.offset - Position in the values array from which to start taking values.public void set(INDArray a)
INDArrayset in interface INDArrayset in class AbstractArray<Double>public void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<Double>pos - Offset into this array, expressed in terms of number of elements in row major ordervalues - Element values in a double[] array. There must be at least as many element values as elements in this array.offset - Position in the values array from which to start taking values.length - Number of elements to set.public void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<Double>public void getElements(Object[] dest, int offset)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<Double>public void getElements(double[] dest,
int destOffset,
int[] indices)
dest - destOffset - indices - public void set(AVector src, int srcOffset)
public AVector clone()
public AVector copy()
INDArraycopy in interface INDArraycopy in class AbstractArray<Double>public AVector sparseClone()
sparseClone in interface INDArraysparseClone in class AbstractArray<Double>public final AVector asVector()
INDArrayasVector in interface INDArrayasVector in class AbstractArray<Double>public INDArray reshape(int... dimensions)
INDArrayreshape in interface INDArrayreshape in class AbstractArray<Double>public final AVector reorder(int[] order)
INDArrayreorder in interface INDArrayreorder in class AbstractArray<Double>public final AVector reorder(int dim, int[] order)
INDArrayreorder in interface INDArrayreorder in class AbstractArray<Double>public boolean isView()
public boolean isMutable()
isMutable in interface INDArrayisMutable in class AbstractArray<Double>public boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArrayisElementConstrained in class AbstractArray<Double>public boolean isFullyMutable()
isFullyMutable in interface INDArrayisFullyMutable in class AbstractArray<Double>public void add(AVector v)
public final void add(ADenseArrayVector v)
v - public final void add(INDArray a)
INDArrayadd in interface INDArrayadd in class AbstractArray<Double>public INDArray addCopy(INDArray a)
INDArrayaddCopy in interface INDArrayaddCopy in class AbstractArray<Double>public AVector addCopy(AVector a)
IVectorpublic AVector addCopy(double a)
INDArrayaddCopy in interface INDArrayaddCopy in class AbstractArray<Double>public INDArray subCopy(INDArray a)
INDArraysubCopy in interface INDArraysubCopy in class AbstractArray<Double>public AVector subCopy(AVector a)
IVectorpublic void sub(INDArray a)
INDArraysub in interface INDArraysub in class AbstractArray<Double>public void add(AVector src, int srcOffset)
src - public void add(int offset,
AVector src)
offset - src - public void add(int offset,
AVector src,
int srcOffset,
int length)
offset - src - public void addProduct(AVector a, AVector b)
a - b - public AVector addProductCopy(AVector a, AVector b)
a - b - public AVector addProductCopy(AVector a, AVector b, double factor)
a - b - public void addProduct(AVector a, AVector b, double factor)
a - b - public int checkLength(int length)
length - protected final void checkDimension(int dimension)
AbstractArraycheckDimension in class AbstractArray<Double>public void addMultiple(INDArray src, double factor)
INDArrayaddMultiple in interface INDArrayaddMultiple in class AbstractArray<Double>public void addMultiple(AVector src, double factor)
src - public void addMultiple(SparseIndexedVector src, double factor)
src - public AVector addMultipleCopy(AVector src, double factor)
src - factor - public void addMultiple(AVector src, int srcOffset, double factor)
src - srcOffset - factor - public void addMultiple(int offset,
AVector src,
int srcOffset,
int length,
double factor)
public final void addMultiple(int offset,
AVector v,
double factor)
public final void addWeighted(AVector v, double factor)
v - public final void scaleAdd(double factor,
INDArray b,
double bfactor,
double constant)
INDArrayscaleAdd in interface INDArrayscaleAdd in class AbstractArray<Double>public void scaleAdd(double factor,
AVector b,
double bfactor,
double constant)
factor - b - bfactor - constant - public void addPower(INDArray src, double exponent)
INDArrayaddPower in interface INDArrayaddPower in class AbstractArray<Double>public void addPower(INDArray src, double exponent, double factor)
INDArrayaddPower in interface INDArrayaddPower in class AbstractArray<Double>protected void addPower(AVector src, double exponent, double factor)
src - exponent - factor - public void sub(AVector v)
v - public void subAt(int i,
double v)
i - v - public boolean isZero()
isZero in interface INDArrayisZero in class AbstractArray<Double>public boolean isRangeZero(int start,
int length)
start - length - public boolean isUnitLengthVector()
public boolean isUnitLengthVector(double tolerance)
public final boolean isSameShape(INDArray a)
INDArrayisSameShape in interface INDArrayisSameShape in class AbstractArray<Double>public boolean isSameShape(AVector a)
IVectorisSameShape in interface IVectorprotected int checkSameLength(AVector v)
protected int checkSameLength(AVector v, AVector w)
public int checkRange(int offset,
int length)
public int checkIndex(int i)
protected int checkSameLength(ASizedVector v)
public void projectToPlane(AVector normal, double distance)
normal - A Vector of unit lengthdistance - public void subMultiple(AVector v, double factor)
v - public String toString()
toString in class AbstractArray<Double>public String toStringFull()
toStringFull in class AbstractArray<Double>public Vector toVector()
toVector in interface INDArraytoVector in class AbstractArray<Double>public AVector immutable()
immutable in interface INDArrayimmutable in class AbstractArray<Double>public AVector mutable()
mutable in interface INDArraymutable in class AbstractArray<Double>public AVector sparse()
INDArraysparse in interface INDArraysparse in class AbstractArray<Double>public AVector dense()
INDArraydense in interface INDArraydense in class AbstractArray<Double>public final Vector denseClone()
INDArraydenseClone in interface INDArraydenseClone in class AbstractArray<Double>public AVector toNormal()
public List<Double> asElementList()
INDArrayasElementList in interface INDArrayasElementList in class AbstractArray<Double>public Iterator<Double> elementIterator()
INDArrayelementIterator in interface INDArrayelementIterator in class AbstractArray<Double>public void addMultiple(Vector source, Index sourceToDest, double factor)
source - sourceToDest - factor - public void addMultiple(AVector source, Index sourceToDest, double factor)
source - sourceToDest - factor - public final void set(AVector source, Index indexes)
public void set(AVector source, int[] indexes)
public void addToArray(double[] array,
int offset)
addToArray in interface INDArrayaddToArray in class AbstractArray<Double>array - offset - public void addToArray(double[] dest,
int destOffset,
int destStride)
public void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
offset - array - arrayOffset - length - public void addMultipleToArray(double factor,
double[] array,
int arrayOffset)
offset - array - arrayOffset - length - public void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
offset - array - arrayOffset - length - public void addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
public void addProductToArray(double factor,
int offset,
ADenseArrayVector other,
int otherOffset,
double[] dest,
int destOffset,
int length)
factor - offset - other - otherOffset - dest - destOffset - length - public void addProduct(AVector a, int aOffset, AVector b, int bOffset, double factor)
a - aOffset - b - bOffset - factor - public final void setInnerProduct(INDArray a, INDArray b)
INDArraysetInnerProduct in interface INDArraysetInnerProduct in class AbstractArray<Double>public final void addInnerProduct(INDArray a, INDArray b)
INDArrayaddInnerProduct in interface INDArrayaddInnerProduct in class AbstractArray<Double>public void addInnerProduct(AMatrix a, AVector b)
a - A matrix with the same number or rows as this vectorb - A vector with the same lengths as the number of columns in the parameter apublic void addInnerProduct(AVector a, AMatrix b)
a - A vector with the same lengths as the number of rows in the matrix parameter bb - A matrix with the same number of columns as this vectorpublic void setInnerProduct(AMatrix a, AVector b)
a - A matrix with the same number or rows as this vectorb - A vector with the same lengths as the number of columns in the parameter apublic void setInnerProduct(AVector a, AMatrix b)
a - A vector with the same lengths as the number of rows in the matrix parameter bb - A matrix with the same number of columns as this vectorpublic final void setMultiple(INDArray a, INDArray b)
INDArraysetMultiple in interface INDArraysetMultiple in class AbstractArray<Double>public final void setMultiple(AVector a, AVector b)
a - b - public final void setMultiple(INDArray a, double b)
INDArraysetMultiple in interface INDArraysetMultiple in class AbstractArray<Double>public final void setMultiple(AVector a, double b)
a - b - public void applyOp(IOperator op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Double>op - The operator to apply to the arraypublic void applyOp(Op op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Double>public void applyOp(Op2 op, INDArray b)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Double>public void applyOp(Op2 op, AVector b)
op - b - public void applyOp(Op2 op, double b)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Double>public AVector applyOpCopy(Op op)
INDArrayapplyOpCopy in interface INDArrayapplyOpCopy in class AbstractArray<Double>public double reduce(Op2 op, double init)
INDArrayreduce in interface INDArrayreduce in class AbstractArray<Double>public double reduce(Op2 op)
INDArrayreduce in interface INDArrayreduce in class AbstractArray<Double>public final AVector reduceSlices(Op2 op)
INDArrayreduceSlices in interface INDArrayreduceSlices in class AbstractArray<Double>public AVector reduceSlices(Op2 op, double init)
INDArrayreduceSlices in interface INDArrayreduceSlices in class AbstractArray<Double>public void addAt(int i,
double v)
i - v - public void addAt(long i,
double v)
INDArrayaddAt in interface INDArrayaddAt in class AbstractArray<Double>public void scaleAdd(double factor,
double constant)
scaleAdd in interface INDArrayscaleAdd in class AbstractArray<Double>public void add(double constant)
INDArrayadd in interface INDArrayadd in class AbstractArray<Double>public void add(double[] data,
int offset)
data - offset - public void add(double[] data)
data - public abstract AVector exactClone()
exactClone in interface INDArraypublic boolean equalsArray(double[] data)
equalsArray in interface INDArrayequalsArray in class AbstractArray<Double>data - public boolean elementsEqual(double value)
INDArrayelementsEqual in interface INDArrayelementsEqual in class AbstractArray<Double>public boolean equalsArray(double[] data,
int offset)
equalsArray in interface INDArrayequalsArray in class AbstractArray<Double>data - offset - Offset into the data arraypublic INDArray broadcast(int... targetShape)
INDArraybroadcast in interface INDArraybroadcast in class AbstractArray<Double>public INDArray broadcastLike(INDArray target)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Double>target - The target arraypublic AVector broadcastLike(AVector target)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Double>target - The target vectorpublic AMatrix broadcastLike(AMatrix target)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Double>target - The target matrixpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class AbstractArray<Double>public Index nonSparseIndex()
public int[] nonZeroIndices()
public boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class AbstractArray<Double>Copyright © 2016. All rights reserved.