|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for dense or sparse arrays which store numbers.
Method Summary | |
Array |
add(Array addend)
Returns this + addend does not change receiver. |
int |
cardinality()
Returns number of nonzero entries in array |
Object |
clone()
Returns deep copy of Array |
int |
columnIndex()
Returns column index of column vector |
boolean |
containsKey(int key)
Returns true if the array contains index key |
double |
distance(Array other)
Returns Euclidean distance from this to other |
Array |
divide(Array dividend)
Returns componentwise divide: this/dividend |
Array |
divide(double dividend)
Scalar divide |
double |
dot(Array other)
Returns dot product of this with other |
Set |
entrySet()
Returns a set view of the Entries contained in this array. |
boolean |
equals(Object o)
Returns true if o==this |
double |
get(int index)
Gets double value of element at index i |
Iterator |
iterator()
Returns an iterator over the entries in the matrix |
Array |
multiply(Array multiplicand)
Returns componentwise multiply |
Array |
multiply(double multiplicand)
Scalar multiply |
Array |
newInstance(int size)
Returns an empty Array of the same dynamic type with given size |
double |
norm()
Returns L2 norm of vector |
Array |
normalize()
Returns vector with euclidian distance normalized to 1. |
Array |
scale(double factor)
Returns this * factor does not change receiver. |
void |
set(int i,
double val)
Sets value of element at index i to val |
void |
setAll(double value)
Sets all elements = value
(in sparse matrices, sets all nonzero elements = value) |
void |
setColumnIndex(int ci)
Sets column index of column vector. |
int |
size()
Returns number of elements in Array |
Array |
toLogSpace()
Transforms the array to log space. |
String |
toString()
Returns String representation of Array |
Method Detail |
public void setColumnIndex(int ci)
public int columnIndex()
public void setAll(double value)
value
(in sparse matrices, sets all nonzero elements = value)
public double get(int index)
public void set(int i, double val)
public int size()
public Set entrySet()
public boolean containsKey(int key)
key
public Iterator iterator()
public boolean equals(Object o)
o==this
equals
in class Object
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public Array newInstance(int size)
public Array add(Array addend)
this + addend
does not change receiver.
public Array scale(double factor)
this * factor
does not change receiver.
public double norm()
public double distance(Array other)
this
to other
public double dot(Array other)
this
with other
public Array multiply(Array multiplicand)
public Array divide(Array dividend)
public Array multiply(double multiplicand)
public Array divide(double dividend)
public Array normalize()
public int cardinality()
public Array toLogSpace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |