|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.retro.neural.Vector
| Field Summary | |
protected FieldElement[] |
entries
|
| Constructor Summary | |
Vector(FieldElement[] theEntries)
|
|
Vector(int length)
|
|
| Method Summary | |
Vector |
add(FieldElement scalar)
Returns the sum of this Vector and a scalar. |
Vector |
add(Vector anotherVector)
Returns the sum of this Vector and another. |
void |
addReplace(FieldElement scalar)
Adds a scalar to this Vector. |
void |
addReplace(Vector anotherVector)
Adds another vector to this Vector. |
Vector |
and(Vector anotherVector)
Returns the logical AND of this Vector with another. |
Vector |
apply(FieldElement scalar,
DyadicOperator fun)
Returns the result of applying a specified function to the elements of a this Vector a scalar. |
Vector |
apply(MonadicOperator fun)
Returns the result of applying a specified function to every element of this Vector. |
Vector |
apply(Vector anotherVector,
DyadicOperator fun)
Returns the result of applying a specified function to the elements of this Vector and another. |
void |
applyReplace(FieldElement scalar,
DyadicOperator fun)
Sets this Vector to the result of applying a specified function to elements of this Vector and a scalar. |
void |
applyReplace(MonadicOperator fun)
Sets this Vector to the result of applying a specified function to every element of this Vector. |
void |
applyReplace(Vector anotherVector,
DyadicOperator fun)
Sets this Vector to the result of applying a specified function to elements of this Vector and another's. |
Vector |
arrayMultiply(Vector anotherVector)
Returns the element-wise product of this Vector and another. |
Vector |
copy()
Returns a deep copy of this Vector. |
FieldElement |
cosine(Vector anotherVector)
Returns the cosine between this Vector and another. |
Matrix |
cross(Vector anotherVector)
Returns the cross-product of this Vector and another. |
Vector |
divide(FieldElement scalar)
Returns this Vector divided by a scalar. |
void |
divideReplace(FieldElement scalar)
Divides this Vector by a scalar. |
Vector |
eq(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are equal to a scalar, and zeros elsewhere. |
Vector |
eq(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are equal to those of another Vectors, and zeros elsewhere. |
boolean |
equals(Vector anotherVector)
Tests two Vectors for equality. |
int[] |
find(FieldElement scalar)
Returns indices where vector equals scalar argument. |
Vector |
ge(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are greater than or equal to a scalar, and zeros elsewhere. |
Vector |
ge(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are greater than or equal to those of another Vectors, and zeros elsewhere. |
FieldElement |
getEntry(int index)
Gets the entry of a certain index. |
Vector |
gt(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are greater than a scalar, and zeros elsewhere. |
Vector |
gt(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are greater than those of another Vectors, and zeros elsewhere. |
FieldElement |
L1Norm()
Returns the L1 norm of this Vector. |
Vector |
le(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are less than or equal to a scalar, and zeros elsewhere. |
Vector |
le(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are less than or equal to those of another Vectors, and zeros elsewhere. |
int |
length()
Returns the length of the Vector. |
Vector |
lt(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are less than a scalar, and zeros elsewhere. |
Vector |
lt(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are less than those of another Vectors, and zeros elsewhere. |
FieldElement |
max()
Computes the largest value of any element in this Vector. |
FieldElement |
mean()
Computes the mean over the elements of this Vector. |
FieldElement |
min()
Computes the smallest value of any element in this Vector. |
Vector |
multiply(FieldElement scalar)
Returns the product of this Vector and a scalar. |
Vector |
multiply(Matrix theMatrix)
Returns the product of this Vector and a Matrix. |
FieldElement |
multiply(Vector anotherVector)
Returns the standard inner (dot) product of this Vector and another. |
void |
multiplyReplace(FieldElement scalar)
Multiplies this Vector by a scalar. |
void |
multiplyReplace(Vector anotherVector)
Multiplies this Vector element-wise by another. |
Vector |
ne(FieldElement scalar)
Returns a Vector containing ones where this Vector's elements are not equal to a scalar, and zeros elsewhere. |
Vector |
ne(Vector anotherVector)
Returns a Vector containing ones where this Vector's elements are not equal to those of another Vector, and zeros elsewhere. |
Vector |
not()
Returns the logical negation of this Vector. |
FieldElement |
nycDist(Vector anotherVector)
Returns the Manhattan distance (L1 norm of differences) between this Vector and another. |
Vector |
or(Vector anotherVector)
Returns the logical OR of this Vector with another. |
Matrix |
repmat(int m)
Replicates this Vector as a Matrix. |
protected Vector |
safe_diff(Vector anotherVector,
java.lang.String method)
|
void |
setAll(FieldElement newEntry)
Sets all entries to a FieldElement. |
void |
setEntry(int index,
FieldElement newEntry)
Sets an entry to a FieldElement at a certain index. |
Vector |
sort()
Returns a copy of this Vector, sorted in ascending order. |
Vector |
subtract(FieldElement scalar)
Returns this Vector subtracted by a scalar. |
Vector |
subtract(Vector anotherVector)
Returns the result of subtracting another vector from this. |
void |
subtractReplace(FieldElement scalar)
Subtracts a scalar from this Vector. |
void |
subtractReplace(Vector anotherVector)
Subtracts another Vector from this. |
FieldElement |
sum()
Computes the sum over the elements of this Vector. |
void |
swapEntries(int index1,
int index2)
Swaps two Entries of a Vector. |
Matrix |
toMatrix()
Returns a new 1xN Matrix made from the N 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 FieldElement[] entries
| Constructor Detail |
public Vector(int length)
public Vector(FieldElement[] theEntries)
throws InvalidOperationException
| Method Detail |
public int length()
public FieldElement L1Norm()
public FieldElement nycDist(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if Vectors have unequal lengths
public FieldElement cosine(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if Vectors have unequal lengths
public FieldElement getEntry(int index)
throws InvalidOperationException
InvalidOperationException - if the index is out of bounds
public void setEntry(int index,
FieldElement newEntry)
index - newEntry -
InvalidOperationException - if the index is invalidepublic Matrix toMatrix()
public Vector divide(FieldElement scalar)
scalar -
public void divideReplace(FieldElement scalar)
scalar - public Vector multiply(FieldElement scalar)
scalar -
public Vector arrayMultiply(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic void multiplyReplace(FieldElement scalar)
scalar - public void multiplyReplace(Vector anotherVector)
InvalidOperationException - if the vectors have unequal lengthspublic Vector add(FieldElement scalar)
scalar -
public Vector add(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic void addReplace(FieldElement scalar)
scalar - public void addReplace(Vector anotherVector)
InvalidOperationException - if the vectors have unequal lengthspublic Vector subtract(FieldElement scalar)
scalar -
public Vector subtract(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic void subtractReplace(FieldElement scalar)
scalar - public void subtractReplace(Vector anotherVector)
InvalidOperationException - if the vectors have unequal lengths
public FieldElement multiply(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if the other vector is null
InvalidOperationException - if the vectors have unequal lengthspublic boolean equals(Vector anotherVector)
anotherVector -
public void swapEntries(int index1,
int index2)
index1 - 1st swap partnerindex2 - 2nd seap partnerpublic java.lang.String toString()
public Vector and(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector or(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector not()
public void applyReplace(MonadicOperator fun)
fun - the function to apply
public Vector apply(MonadicOperator fun)
fun - the function to apply
public void applyReplace(Vector anotherVector,
DyadicOperator fun)
anotherVector - fun - the function to apply
public Vector apply(Vector anotherVector,
DyadicOperator fun)
anotherVector - fun - the function to apply
public void applyReplace(FieldElement scalar,
DyadicOperator fun)
scalar - fun - the function to apply
public Vector apply(FieldElement scalar,
DyadicOperator fun)
scalar - fun - the function to apply
public Vector copy()
public Vector lt(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector lt(FieldElement scalar)
scalar -
public Vector le(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector le(FieldElement scalar)
scalar -
public Vector gt(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector gt(FieldElement scalar)
scalar -
public Vector ge(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector ge(FieldElement scalar)
scalar -
public Vector eq(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector eq(FieldElement scalar)
scalar -
public Vector ne(Vector anotherVector)
anotherVector -
InvalidOperationException - if the vectors have unequal lengthspublic Vector ne(FieldElement scalar)
scalar -
public FieldElement sum()
public FieldElement min()
public FieldElement max()
public FieldElement mean()
public int[] find(FieldElement scalar)
scalar -
public void setAll(FieldElement newEntry)
newEntry - the FieldElementpublic Matrix repmat(int m)
m - number of times to replicate
public Vector sort()
public Vector multiply(Matrix theMatrix)
throws InvalidOperationException
theMatrix -
InvalidOperationException - if the matrix is null
InvalidOperationException - if the inner dimensions mismatch
public Matrix cross(Vector anotherVector)
throws InvalidOperationException
anotherVector -
InvalidOperationException - if the other Vector is null
protected Vector safe_diff(Vector anotherVector,
java.lang.String method)
throws InvalidOperationException
InvalidOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||