|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.retro.neural.SNVector
| Field Summary | |
protected Vector |
vec
|
| Constructor Summary | |
|
SNVector(double[] a)
|
|
SNVector(int n)
|
protected |
SNVector(Vector x)
|
| Method Summary | |
void |
add(double s)
|
void |
add(SNVector x)
|
static SNVector |
add(SNVector x,
double s)
|
static SNVector |
add(SNVector x,
SNVector y)
|
SNVector |
and(SNVector x)
Returns the logical AND of this vector with another. |
void |
arrayMultiply(SNVector x)
Multiplies the elements of this vector by those of another. |
static SNVector |
arrayMultiply(SNVector x,
SNVector y)
Returns a vector containing the products of the elements of two vectors. |
SNVector |
copy()
Returns a deep copy of this vector. |
void |
divide(double s)
|
static SNVector |
divide(SNVector x,
double s)
|
double |
eucDist(SNVector x)
Returns the Euclidean distance between this vector and another. |
int[] |
find(double s)
Returns indices where vector equals scalar argument. |
static SNVector |
gaussianNoise(int n,
java.util.Random r)
Returns a vector of normally distributed random values. |
SNVector |
ge(double s)
Returns a vector containing ones where this vector's elements are greater than or equal to a scalar, and zeros elsewhere. |
double |
getValue(int i)
|
double[] |
getValues()
Returns a 1D array of the values contained in this vector. |
SNVector |
le(double s)
Returns a vector containing ones where this vector's elements are less than or equal to a scalar, and zeros elsewhere. |
int |
length()
|
double |
max()
Returns the largest value of any element in this vector. |
double |
min()
Returns the value of the smallest element of this vector. |
void |
multiply(double s)
|
SNVector |
multiply(SNMatrix a)
Returns the product of this Vector and a Matrix. |
void |
multiply(SNVector x)
|
static SNVector |
multiply(SNVector x,
double s)
|
SNVector |
ne(double s)
Returns a vector containing ones where this vector's elements are not equal to a scalar, and zeros elsewhere. |
double |
nycDist(SNVector x)
Returns the Manhattan distance (L1 norm of differences) between this vector and another. |
SNMatrix |
outer(SNVector x)
Returns the outer product of this vector and another. |
SNMatrix |
repmat(int m)
Replicates this vector as a matrix. |
void |
setAll(double s)
Sets all entries to a scalar. |
void |
setValue(int i,
double s)
Sets an entry to a scalar at a certain index. |
SNVector |
sort()
Returns a copy of this vector, sorted in ascending order. |
void |
subtract(double s)
|
void |
subtract(SNVector x)
|
static SNVector |
subtract(SNVector x,
double s)
|
static SNVector |
subtract(SNVector x,
SNVector y)
|
double |
sum()
Returns the sum of the elements of this vector. |
java.lang.String |
toString()
Returns a String representation of this vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Vector vec
| Constructor Detail |
public SNVector(int n)
public SNVector(double[] a)
protected SNVector(Vector x)
| Method Detail |
public int length()
public double getValue(int i)
throws java.lang.RuntimeException
java.lang.RuntimeExceptionpublic void add(double s)
public void subtract(double s)
public void multiply(double s)
public void divide(double s)
public static SNVector add(SNVector x,
double s)
public static SNVector subtract(SNVector x,
double s)
public static SNVector multiply(SNVector x,
double s)
public static SNVector divide(SNVector x,
double s)
public void add(SNVector x)
throws java.lang.RuntimeException
java.lang.RuntimeException
public void subtract(SNVector x)
throws java.lang.RuntimeException
java.lang.RuntimeException
public void multiply(SNVector x)
throws java.lang.RuntimeException
java.lang.RuntimeException
public static SNVector add(SNVector x,
SNVector y)
throws java.lang.RuntimeException
java.lang.RuntimeException
public static SNVector subtract(SNVector x,
SNVector y)
throws java.lang.RuntimeException
java.lang.RuntimeException
public static SNVector arrayMultiply(SNVector x,
SNVector y)
throws java.lang.RuntimeException
x - one vectory - the other vector
java.lang.RuntimeException - if the vectors have unequal lengths
public void arrayMultiply(SNVector x)
throws java.lang.RuntimeException
x - the other vector
java.lang.RuntimeException - if the vectors have unequal lengthspublic double[] getValues()
public double sum()
public double min()
public double eucDist(SNVector x)
throws java.lang.RuntimeException
x - the other vector
java.lang.RuntimeException - if the vectors have unequal lengthspublic SNMatrix repmat(int m)
m - number of times to replicate
public SNVector sort()
public int[] find(double s)
public double nycDist(SNVector x)
throws java.lang.RuntimeException
x - the other vector
java.lang.RuntimeException - if Vectors have unequal lengths
public static SNVector gaussianNoise(int n,
java.util.Random r)
public SNMatrix outer(SNVector x)
x - the other vector
java.lang.RuntimeException - if the other vector is nullpublic SNVector copy()
public void setAll(double s)
s - the scalar
public void setValue(int i,
double s)
throws java.lang.RuntimeException
i - indexs - scalar
java.lang.RuntimeException - if the index is invalidepublic SNVector ne(double s)
s - the scalar
public SNVector ge(double s)
s - the scalar
public SNVector le(double s)
s - the scalar
public double max()
public SNVector and(SNVector x)
throws java.lang.RuntimeException
x - the other vector
java.lang.RuntimeException - if the vectors have unequal lengths
public SNVector multiply(SNMatrix a)
throws java.lang.RuntimeException
a - the matrix
InvalidOperationException - if the matrix is null
InvalidOperationException - if the inner dimensions mismatch
java.lang.RuntimeExceptionpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||