public final class Vector4 extends APrimitiveVector
| Constructor and Description |
|---|
Vector4() |
Vector4(double... values) |
Vector4(double x,
double y,
double z,
double t) |
Vector4(Vector4 source) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AVector v)
Adds another vector to this one
|
void |
add(double dx,
double dy,
double dz,
double dt) |
void |
add(Vector4 a) |
void |
addAt(int i,
double value)
Adds a value to a specific element of the vector
This function does not perform bounds checking, i.e.
|
void |
addMultiple(AVector v,
double factor)
Adds a scaled multiple of another vector to this vector
|
void |
addMultiple(double dx,
double dy,
double dz,
double dt,
double factor) |
void |
addMultiple(Vector4 v,
double factor) |
void |
addProduct(Vector4 a,
Vector4 b) |
void |
addProduct(Vector4 a,
Vector4 b,
double factor) |
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
Vector4 |
clone()
Clones the vector, creating a new mutable copy of all data.
|
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[] as,
int offset)
Fast dot product with a double[] array.
|
double |
dotProduct(Vector4 a) |
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 |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
Vector4 |
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[] data,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
double |
getT() |
double |
getX() |
double |
getY() |
double |
getZ() |
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
int |
length()
Returns the length of a vector, in terms of the number of elements.
|
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
void |
negate()
Negates all emlements of this vector in place.
|
static Vector4 |
of(double... values) |
static Vector4 |
of(double x,
double y,
double z,
double t) |
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.
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
set(Vector4 a) |
void |
setValues(double x,
double y,
double z,
double t) |
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
|
isFullyMutable, isMutable, isView, sparse, sparseClone, toNormalabs, absCopy, add, add, add, add, add, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, 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, 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, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMin, elementPowSum, elementsEqual, 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, isRangeZero, isSameShape, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, 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, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toList, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, unsafeGet, unsafeSet, validateadd, 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 Vector4()
public Vector4(Vector4 source)
public Vector4(double x,
double y,
double z,
double t)
public Vector4(double... values)
public static Vector4 of(double x, double y, double z, double t)
public static Vector4 of(double... values)
public void applyOp(Op op)
INDArraypublic double reduce(Op2 op, double init)
INDArraypublic double reduce(Op2 op)
INDArraypublic boolean isZero()
AVectorpublic void add(double dx,
double dy,
double dz,
double dt)
public void add(AVector v)
AVectorpublic void add(Vector4 a)
public void set(Vector4 a)
public void negate()
AVectorpublic void multiply(double factor)
AVectorpublic void addMultiple(double dx,
double dy,
double dz,
double dt,
double factor)
public void addMultiple(AVector v, double factor)
AVectoraddMultiple in class AVectorpublic void addMultiple(Vector4 v, double factor)
public double dotProduct(Vector4 a)
public double dotProduct(double[] as,
int offset)
AVectordotProduct in class AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class AVectorpublic int length()
IVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AVectorpublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AVectorpublic double get(int i)
INDArraypublic void set(int i,
double value)
INDArraypublic void addAt(int i,
double value)
AVectorpublic void setValues(double x,
double y,
double z,
double t)
public void getElements(double[] data,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AVectorpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AVectorpublic Vector4 clone()
AVectorpublic double getX()
getX in class APrimitiveVectorpublic double getY()
getY in class APrimitiveVectorpublic double getZ()
getZ in class APrimitiveVectorpublic double getT()
getT in class APrimitiveVectorpublic Vector4 exactClone()
AVectorexactClone in interface INDArrayexactClone in class APrimitiveVectorpublic 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 arrayCopyright © 2016. All rights reserved.