public abstract class AVector extends Object implements IVector, Cloneable, Comparable<AVector>, Serializable, Iterable<Double>
| Constructor and Description |
|---|
AVector() |
| Modifier and Type | Method and Description |
|---|---|
void |
absolute()
Sets each component of the vector to its absolute value
|
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) |
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 another vector into this one, at the specified offset
|
void |
addAt(int i,
double v) |
void |
addMultiple(AVector v,
double factor)
Adds a scaled multiple of another vector to this one
|
void |
addMultiple(AVector v,
int vOffset,
double factor) |
void |
addMultiple(int offset,
AVector v,
double factor) |
void |
addMultiple(int offset,
AVector v,
int vOffset,
int length,
double factor) |
void |
addMultiple(Vector vector,
Index index,
double factor) |
void |
addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length) |
void |
addProduct(AVector a,
AVector b) |
void |
addProduct(AVector a,
AVector b,
double factor) |
void |
addProduct(AVector a,
int aOffset,
AVector b,
int bOffset,
double factor) |
void |
addProductToArray(double factor,
int offset,
ArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length) |
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(IOp 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)
|
List<Double> |
asList() |
AVector |
asVector() |
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 copy of all data.
|
int |
compareTo(AVector a) |
void |
copyTo(ArrayVector 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(double[] data,
int offset)
Copies a the contents of a vector to a double array 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) |
int |
countZeros() |
void |
crossProduct(AVector a) |
int |
dimensionality() |
double |
distance(AVector v) |
double |
distanceL1(AVector v) |
double |
distanceLinf(AVector v) |
double |
distanceSquared(AVector v) |
void |
divide(AVector v) |
void |
divide(double factor) |
void |
divide(double[] data,
int offset) |
void |
divideTo(double[] data,
int offset) |
double |
dotProduct(AVector v) |
double |
dotProduct(AVector v,
Index ix) |
long |
elementCount() |
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
epsilonEquals(AVector v) |
boolean |
epsilonEquals(AVector v,
double tolerance) |
boolean |
equals(AVector v) |
boolean |
equals(INDArray v) |
boolean |
equals(Object o)
Test for equality on vectors.
|
boolean |
equalsArray(double[] data) |
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(int... indexes) |
abstract double |
get(int i) |
int[] |
getShape() |
int |
hashCode() |
void |
interpolate(AVector a,
AVector b,
double alpha) |
void |
interpolate(AVector v,
double alpha) |
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isMutable()
Returns true if this vector is mutable.
|
boolean |
isUnitLengthVector()
Returns true if the vector has unit length
|
boolean |
isView()
Returns true if this vector is of a view type that references other vectors / data.
|
boolean |
isZeroVector()
Returns true if this vector is a zero vector (all components zero)
|
Iterator<Double> |
iterator() |
AVector |
join(AVector second)
Returns a new vector that refers to this vector joined to a second vector
|
abstract int |
length() |
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared() |
double |
maxAbsElement()
Returns the maximum absolute element of a vector
|
void |
multiply(AVector v) |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
void |
multiply(double[] data,
int offset) |
void |
multiplyTo(double[] data,
int offset) |
void |
negate() |
double |
normalise() |
double |
normaliseMaxAbsElement()
Normalises so that the maximum absolute element is 1.0
Returns the previous maximum absolute element.
|
void |
projectToPlane(AVector normal,
double distance) |
INDArray |
reshape(int... dimensions) |
void |
scale(AVector v)
Scales the vector by another vector of the same size
|
void |
scale(double factor)
Scales the vector by a scalar factor
|
void |
scaleAdd(double factor,
AVector v) |
void |
scaleAdd(double factor,
double constant) |
double |
scaleToMagnitude(double targetMagnitude)
Scales the vector up to a specific target magnitude
|
void |
set(AVector src)
Sets the vector to equal the value of another vector
|
void |
set(AVector v,
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
|
abstract void |
set(int i,
double value) |
void |
set(int offset,
double[] data,
int dataOffset,
int length)
Set part of this vector from a double array
|
void |
set(IVector vector) |
void |
setValues(double... values) |
AScalar |
slice(int position) |
void |
sub(AVector v)
Subtracts a vector from this vector
|
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 that refers to this vector.
|
double[] |
toArray() |
List<Double> |
toList() |
String |
toString() |
public int dimensionality()
dimensionality in interface INDArraypublic long elementCount()
elementCount in interface INDArraypublic AVector subVector(int offset, int length)
public AVector join(AVector second)
second - public int compareTo(AVector a)
compareTo in interface Comparable<AVector>public boolean equals(Object o)
public boolean equals(AVector v)
public boolean epsilonEquals(AVector v)
public boolean epsilonEquals(AVector v, double tolerance)
public void copyTo(double[] data,
int offset)
public void copyTo(int offset,
double[] dest,
int destOffset,
int length)
public double[] toArray()
public void copyTo(AVector dest, int destOffset)
public void copyTo(ArrayVector dest, int destOffset)
public void copyTo(int offset,
AVector dest,
int destOffset,
int length)
public void fill(double value)
value - public void fillRange(int offset,
int length,
double value)
public void clamp(double min,
double max)
value - public void clampMax(double max)
public void clampMin(double min)
public void multiply(double factor)
factor - Factor by which to multiply each component of the vectorpublic void multiply(AVector v)
public void multiply(double[] data,
int offset)
public void multiplyTo(double[] data,
int offset)
public void divide(double factor)
public void divide(AVector v)
public void divide(double[] data,
int offset)
public void divideTo(double[] data,
int offset)
public void absolute()
public void scale(double factor)
factor - public 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 double magnitudeSquared()
public double dotProduct(AVector v)
public void crossProduct(AVector a)
public double magnitude()
public double distanceSquared(AVector v)
public double distance(AVector v)
public double distanceL1(AVector v)
public double distanceLinf(AVector v)
public double maxAbsElement()
public double normaliseMaxAbsElement()
public double elementSum()
public double angle(AVector v)
public double normalise()
public void negate()
public void set(AVector src)
public void set(AVector src, int srcOffset)
src - srcOffset - public void setValues(double... values)
public int countZeros()
public AVector clone()
public boolean isView()
public boolean isMutable()
public boolean isFullyMutable()
isFullyMutable in interface INDArraypublic void add(AVector v)
v - public void add(AVector src, int srcOffset)
src - public void add(int offset,
AVector a)
offset - a - public void add(int offset,
AVector a,
int aOffset,
int length)
offset - a - public void addMultiple(AVector v, double factor)
v - public void addMultiple(AVector v, int vOffset, double factor)
public void addMultiple(int offset,
AVector v,
int vOffset,
int length,
double factor)
public void addMultiple(int offset,
AVector v,
double factor)
public void addWeighted(AVector v, double factor)
v - public void sub(AVector v)
v - public boolean isZeroVector()
public boolean isUnitLengthVector()
public void projectToPlane(AVector normal, double distance)
public void subMultiple(AVector v, double factor)
v - public void set(IVector vector)
public void set(AVector v, Index indexes)
public void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
public void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int 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,
ArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
public void applyOp(IOp op)
INDArraypublic void applyOp(Op op)
INDArraypublic void addAt(int i,
double v)
public void scaleAdd(double factor,
double constant)
public void add(double constant)
public abstract AVector exactClone()
public boolean equalsArray(double[] data)
public void set(int offset,
double[] data,
int dataOffset,
int length)
Copyright © 2013. All Rights Reserved.