nr
Interface Mat

All Known Implementing Classes:
Mat_array, Mat_wrapper

public interface Mat

based on the Matrix template from Numerical Recipes. Abstracts a square vector of vectors of double

Author:
Daniel Wachsstock

Method Summary
 double[][] asArray()
          get the data
 Mat copy()
          return a copy of this, or some version that the user can manipulate at will.
 double get(int i, int j)
          get an individual element
 Vec getColumn(int i)
          get a column
 Vec getRow(int i)
          get a row
 void set(int i, int j, double d)
          set an individual element
 int size()
          the size of the matrix
 

Method Detail

size

int size()
the size of the matrix

Returns:
the size of the square matrix

get

double get(int i,
           int j)
get an individual element

Parameters:
i - the row
j - the column
Returns:
the value at i,j

getRow

Vec getRow(int i)
get a row

Parameters:
i - the row
Returns:
the actual row, or a Vec whose changes are reflected in the original matrix

getColumn

Vec getColumn(int i)
get a column

Parameters:
i - the column
Returns:
the actual column, or a Vec whose changes are reflected in the original matrix

set

void set(int i,
         int j,
         double d)
set an individual element

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

copy

Mat 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[][]