|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nr.Vec_wrapper
public class Vec_wrapper
Implements a simple Vec based on an external array. The underlying data is publicly available
Field Summary | |
---|---|
double[] |
data
the data underlying this Vec |
Constructor Summary | |
---|---|
Vec_wrapper(double[] array)
Creates a new instance of Vec_wrapper |
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 |
Field Detail |
---|
public final double[] data
Constructor Detail |
---|
public Vec_wrapper(double[] array)
array
- the array to useMethod Detail |
---|
public double get(int i)
Vec
get
in interface Vec
public void set(int i, double d)
Vec
set
in interface Vec
i
- the element to setd
- the value to set it topublic void set(double[] d)
Vec
set
in interface Vec
d
- the array to copy frompublic void set(Vec v)
Vec
set
in interface Vec
v
- the vector to copy frompublic int size()
Vec
size
in interface Vec
public Vec copy()
Vec
copy
in interface Vec
public double[] asArray()
Vec
asArray
in interface Vec
public 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 |