public final class Vector2 extends APrimitiveVector
| Modifier and Type | Method and Description |
|---|---|
void |
add(AVector v)
Adds another vector to this one
|
void |
add(double constant)
Adds a double value to all elements in this array
|
void |
add(double dx,
double dy) |
void |
add(Vector2 v) |
void |
addAt(int i,
double value)
Adds a value to a specific element of the vector
This function does not perform bounds checking
|
void |
addMultiple(Vector2 v,
double factor) |
void |
addProduct(Vector2 a,
Vector2 b) |
void |
addProduct(Vector2 a,
Vector2 b,
double factor) |
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
Vector2 |
clone()
Clones the vector, creating a new copy of all data.
|
Vector2 |
complexConjugate() |
void |
complexMultiply(Vector2 a)
Complex multiplication by another Vector2, treating an (x,y) vector as the complex value x+iy
|
Vector2 |
complexNegation() |
Vector2 |
complexReciprocal() |
void |
copyTo(double[] data,
int offset)
Copies a the contents of a vector to a double array at the specified offset
|
static Vector2 |
create(AVector v) |
double |
dotProduct(AVector a) |
double |
dotProduct(double[] data,
int offset)
Fast dot product with a double[] array.
|
double |
dotProduct(Vector v) |
double |
dotProduct(Vector2 a) |
double |
elementSum()
Returns the sum of all elements in a vector
|
Vector2 |
exactClone()
Returns an exact clone of this vector, i.e.
|
void |
fill(double v)
Fills the entire vector with a given value
|
double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
double |
getX() |
double |
getY() |
int |
length() |
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared() |
void |
negate()
Negates all elements in the array
|
static Vector2 |
of(double... values) |
static Vector2 |
of(double x,
double y) |
void |
rotateInPlace(int angle)
Rorates a 2D vector around the origin by a given angle
|
void |
scaleAdd(double factor,
AVector constant) |
void |
scaleAdd(double factor,
double constant)
Scales all elements of the array by a given double value and adds a constant vale
|
void |
scaleAdd(double factor,
Vector2 constant) |
void |
set(int i,
double value) |
void |
setValues(double x,
double y) |
void |
sub(Vector2 v) |
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
Vector2 |
toNormal()
Creates a new mutable vector representing the normalised value of this vector
|
getT, getZ, isFullyMutable, isMutable, isViewabs, add, add, add, add, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleToArray, addProduct, addProduct, addProduct, addProductToArray, addProductToArray, addToArray, addToArray, addWeighted, angle, applyOp, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, clamp, clampMax, clampMin, compareTo, copyTo, copyTo, copyTo, copyTo, copyTo, crossProduct, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideTo, dotProduct, elementCount, elementIterator, elementSquaredSum, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, fillRange, get, get, getElements, getLongShape, getShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, interpolate, isElementConstrained, isSameShape, isSameShape, isUnitLengthVector, isZero, iterator, join, log, logistic, maxAbsElement, multiply, multiply, multiply, multiply, multiplyTo, nonZeroCount, normalise, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reshape, scale, scaleToMagnitude, set, set, set, set, set, set, set, set, setElements, setElements, setRange, setValues, signum, slice, slice, sliceCount, square, sub, sub, sub, subMultiple, subVector, tanh, toDoubleArray, toList, toString, toVector, unsafeGet, unsafeSet, validate, zeroCountbroadcastCloneLike, ensureMutable, exp, get, getSliceViews, isBoolean, reciprocal, scale, set, set, sqrt, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitbroadcastCloneLike, ensureMutable, exp, get, getSliceViews, isBoolean, reciprocal, scale, set, set, sqrt, toArraypublic static Vector2 of(double x, double y)
public static Vector2 of(double... values)
public void applyOp(Op op)
INDArraypublic void add(Vector2 v)
public void sub(Vector2 v)
public void addMultiple(Vector2 v, double factor)
public double dotProduct(AVector a)
dotProduct in class AVectorpublic double dotProduct(Vector v)
dotProduct in class AVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic double dotProduct(Vector2 a)
public void scaleAdd(double factor,
double constant)
INDArraypublic void scaleAdd(double factor,
Vector2 constant)
public void complexMultiply(Vector2 a)
a - public Vector2 complexConjugate()
public Vector2 complexReciprocal()
public Vector2 complexNegation()
public void negate()
INDArraypublic void add(double constant)
INDArraypublic void add(double dx,
double dy)
public void add(AVector v)
AVectorpublic int length()
public double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AVectorpublic double magnitudeSquared()
magnitudeSquared in class AVectorpublic double magnitude()
AVectorpublic double get(int i)
INDArraypublic void copyTo(double[] data,
int offset)
AVectorpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AVectorpublic Vector2 toNormal()
AVectortoNormal in class APrimitiveVectorpublic void set(int i,
double value)
public void fill(double v)
AVectorpublic void addAt(int i,
double value)
AVectorpublic void rotateInPlace(int angle)
angle - public void setValues(double x,
double y)
public Vector2 clone()
AVectorclone in interface INDArrayclone in class APrimitiveVectorpublic double getX()
getX in class APrimitiveVectorpublic double getY()
getY in class APrimitiveVectorpublic Vector2 exactClone()
AVectorexactClone in interface INDArrayexactClone in class APrimitiveVectorCopyright © 2013. All Rights Reserved.