nr
Interface Vec

All Known Implementing Classes:
Vec_array, Vec_wrapper

public interface Vec

based on the vector template of Numerical Recipes. abstracts a vector of doubles

Author:
Daniel Wachsstock

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
 

Method Detail

size

int size()
the size of the vector


get

double get(int i)
the i-th element


set

void set(int i,
         double d)
set the i-th element

Parameters:
i - the element to set
d - the value to set it to
Throws:
java.lang.UnsupportedOperationException - if the vector is immutable

set

void set(double[] d)
Copy the vector from an array

Parameters:
d - the array to copy from
Throws:
java.lang.UnsupportedOperationException - if the vector is immutable

set

void set(Vec v)
Copy the vector from an array

Parameters:
v - the vector to copy from
Throws:
java.lang.UnsupportedOperationException - if the vector is immutable

copy

Vec copy()
return a copy of this, or some version that the user can manipulate at will. If the implementation of this is immutable, can return the original, or the implementation can do some kind of copy-on-write.

Returns:
a copy of the data

asArray

double[] asArray()
get the data

Returns:
the data as a double[]