public final class JoinedVector extends AJoinedVector
length| 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(AVector a)
Adds another vector to this one
|
void |
add(AVector a,
int aOffset)
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,
int offset)
Adds to this vector from a given double array.
|
void |
add(int offset,
AVector a)
Adds another vector into this one, at the specified offset
|
void |
add(int offset,
AVector a,
int aOffset,
int length)
Adds a segment of another vector into this one, at the specified offset
|
void |
add(JoinedVector a) |
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.
|
AVector |
addCopy(AVector a)
Adds a vector element-wise to this vector, returning a new vector.
|
void |
addMultiple(AVector a,
double factor)
Adds a scaled multiple of another vector to this vector
|
void |
addMultiple(AVector a,
int aOffset,
double factor)
Adds a multiple of a subvector of another vector to this vector.
|
void |
addMultiple(JoinedVector a,
double factor) |
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
|
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
|
void |
addToArray(double[] dest,
int offset,
int stride)
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 |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
void |
clamp(double min,
double max)
Clamps all values in the vector to a given range
|
int |
componentCount()
Returns the number of components of this array.
|
void |
copyTo(AVector dest,
int offset)
Copies a the contents of a vector to a vector at the specified offset
|
void |
copyTo(int start,
AVector dest,
int destOffset,
int length)
Copies a subset of this vector to a vector at the specified offset
|
int |
depth() |
static int |
depthCalc(AVector v) |
void |
divideTo(double[] data,
int offset)
Divides the elements in the target array by corresponding elements in this vector
|
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(double[] data,
int offset)
Fast dot product with a double[] array.
|
double |
dotProduct(JoinedVector jv) |
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementProduct()
Returns the product of all elements in the array.
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
equals(AVector v) |
boolean |
equals(JoinedVector v) |
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
JoinedVector |
exactClone()
Returns an exact clone of this vector, i.e.
|
void |
exp()
Computes the function e^x (in-place) for all array elements
|
void |
fill(double value)
Fills the entire vector with a given value
|
double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
AVector |
getComponent(int k)
Gets a component from the array at the specified index
Will throw an error if components are not supported, or if the component is out of bounds as defined by 0 <= k |
void |
getElements(double[] data,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isRangeZero(int start,
int length)
Returns true if a sub-vector range is completely zero.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
AVector |
join(JoinedVector a) |
static AVector |
joinVectors(AVector left,
AVector right)
Returns a JoinedVector connecting the two vectors
|
void |
log()
Computes the natural logarithm (in-place) for all array elements
|
void |
logistic()
Computes the logistic function for every element in this vector.
|
void |
multiply(double value)
Multiplies the vector by a constant factor
|
void |
multiplyTo(double[] data,
int offset)
Multiplies the elements in the target array by corresponding elements in this vector
|
void |
negate()
Negates all emlements of this vector in place.
|
AVector |
negateCopy()
Negates all elements in the array, returning a new array
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
void |
reciprocal()
Replaces all elements in the array with their reciprocal
|
void |
scaleAdd(double factor,
double constant)
Scales this vector and adds a constant to every element
|
void |
set(AVector src)
Sets the vector to equal the value of another vector
|
void |
set(AVector src,
int srcOffset)
Set the vector equal to an offset into another vector
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
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)
|
void |
sqrt()
Computes the square root of all elements in the array
|
void |
square()
Squares all elements of the array in place
|
AVector |
subVector(int start,
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
|
AVector |
tryEfficientJoin(AVector a)
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.
|
JoinedVector |
withComponents(INDArray... segments)
Reconstructs a new joined vector of the same type and shape with the given segments.
|
applyOp, copyTo, copyTo, dotProduct, hasUncountable, isMutable, isView, reduce, reduce, scaleAdd, setElementscheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountadd, add, add, addAt, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addPower, addPower, addPower, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, checkDimension, checkSameLength, clampMax, clampMin, clone, compareTo, copy, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, dotProduct, dotProduct, elementAbsPowSum, elementIterator, elementPowSum, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fillRange, get, get, get, get, getElements, getElements, getLongShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, mutable, nonSparseIndex, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, selectView, set, set, set, set, set, set, set, set, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, slice, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, toList, toNormal, toSliceArray, toString, toStringFull, toVectoradd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, density, ensureMutable, get, get, get, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocalCopy, scale, set, set, signumCopy, sub, sub, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitaddOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, ensureMutable, get, get, get, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocalCopy, scale, set, set, signumCopy, sub, toArrayforEach, spliteratorpublic static AVector joinVectors(AVector left, AVector right)
left - right - public boolean isFullyMutable()
AVectorisFullyMutable in interface INDArrayisFullyMutable in class AVectorpublic boolean isZero()
AVectorisZero in interface INDArrayisZero in class AJoinedVectorpublic boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AVectorpublic void copyTo(AVector dest, int offset)
AVectorcopyTo in class AJoinedVectorpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AVectorpublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddToArray in class AVectorpublic void addToArray(double[] dest,
int offset,
int stride)
AVectoraddToArray in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddMultipleToArray in class AVectorpublic void addAt(int i,
double v)
AVectorpublic void getElements(double[] data,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void multiplyTo(double[] data,
int offset)
AVectormultiplyTo in class AVectoroffset - The offset into the target arraypublic void divideTo(double[] data,
int offset)
AVectorpublic void copyTo(int start,
AVector dest,
int destOffset,
int length)
AVectorcopyTo in class AJoinedVectorpublic AVector subVector(int start, int length)
AVectorpublic AVector tryEfficientJoin(AVector a)
AVectortryEfficientJoin in class AVectorpublic AVector join(JoinedVector a)
public void add(AVector a)
AVectorpublic AVector addCopy(AVector a)
IVectorpublic void add(JoinedVector a)
public void scaleAdd(double factor,
double constant)
AVectorpublic void add(double constant)
INDArraypublic void reciprocal()
INDArrayreciprocal in interface INDArrayreciprocal in class AbstractArray<Double>public void clamp(double min,
double max)
AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class AVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AJoinedVectorpublic double dotProduct(JoinedVector jv)
public void add(AVector a, int aOffset)
AVectorpublic void add(double[] data,
int offset)
AVectorpublic void add(int offset,
AVector a)
AVectorpublic void add(int offset,
AVector a,
int aOffset,
int length)
AVectorpublic void addMultiple(AVector a, double factor)
AVectoraddMultiple in class AVectorpublic void addMultiple(JoinedVector a, double factor)
public void addMultiple(AVector a, int aOffset, double factor)
AVectoraddMultiple in class AVectorpublic void addProduct(AVector a, AVector b, double factor)
AVectoraddProduct in class AVectorpublic void addProduct(AVector a, int aOffset, AVector b, int bOffset, double factor)
AVectoraddProduct in class AVectorpublic void signum()
INDArraypublic void abs()
INDArraypublic AVector absCopy()
INDArraypublic void exp()
INDArrayexp in interface INDArrayexp in class AbstractArray<Double>public void log()
INDArraypublic void negate()
AVectorpublic AVector negateCopy()
INDArraynegateCopy in interface INDArraynegateCopy in class AVectorpublic void applyOp(Op op)
INDArraypublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AJoinedVectorpublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AVectorpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AVectorpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AJoinedVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AVectorpublic double get(int i)
INDArraypublic void set(AVector src)
AVectorpublic void set(AVector src, int srcOffset)
AVectorpublic void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AVectorpos - 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 set(int i,
double value)
INDArraypublic void fill(double value)
AVectorpublic void square()
INDArraypublic void sqrt()
INDArraysqrt in interface INDArraysqrt in class AbstractArray<Double>public void tanh()
AVectorpublic void logistic()
AVectorpublic void multiply(double value)
AVectorpublic static int depthCalc(AVector v)
public int depth()
public double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AVectorpublic boolean equals(AVector v)
equals in class AJoinedVectorpublic boolean equals(JoinedVector v)
public boolean equalsArray(double[] data,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class AJoinedVectordata - Array of double element values to check for equalityoffset - Offset into the data arraypublic JoinedVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic void validate()
INDArraypublic int componentCount()
INDArraycomponentCount in interface INDArraycomponentCount in class AJoinedVectorpublic AVector getComponent(int k)
INDArraygetComponent in interface INDArraygetComponent in class AJoinedVectorpublic JoinedVector withComponents(INDArray... segments)
AJoinedVectorwithComponents in interface INDArraywithComponents in class AJoinedVectorCopyright © 2016. All rights reserved.