|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnr.Vec_array
public class Vec_array
Implements a simple Vec based on a fixed array
| Constructor Summary | |
|---|---|
Vec_array(double[] data)
Creates a new instance of Vec_array by copying the input array |
|
Vec_array(int size)
Creates a new instance of Vec_array. |
|
Vec_array(Vec_array v)
Copy-creates a new instance of Vec_array. |
|
Vec_array(Vec v)
Copy-create a new instance of Vec_array. |
|
| Method Summary | |
|---|---|
double[] |
asArray()
get the data |
Vec |
copy()
return a copy of this, or some version that the user can manipulate at will. |
double |
get(int i)
the i-th element |
void |
set(double[] d)
Copy the vector from an array |
void |
set(int i,
double d)
set the i-th element |
void |
set(Vec v)
Copy the vector from an array |
int |
size()
the size of the vector |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vec_array(int size)
size - the number of dimensions of this vectorpublic Vec_array(double[] data)
data - the array to copypublic Vec_array(Vec_array v)
v - the vector to copypublic Vec_array(Vec v)
Vec_array(Vec_array)
since it uses the interface to get elements
v - the vector to copy| Method Detail |
|---|
public double get(int i)
Vec
get in interface Vec
public void set(int i,
double d)
Vec
set in interface Veci - the element to setd - the value to set it topublic void set(double[] d)
Vec
set in interface Vecd - the array to copy frompublic void set(Vec v)
Vec
set in interface Vecv - the vector to copy frompublic int size()
Vec
size in interface Vecpublic Vec copy()
Vec
copy in interface Vecpublic double[] asArray()
Vec
asArray in interface Vecpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||