SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.generic
Interface MatrixAccessor<F extends Field<F>>

Type Parameters:
F - the number Field
All Known Subinterfaces:
Matrix<T,F>
All Known Implementing Classes:
ComplexMatrix, GenericMatrix, RealMatrix

public interface MatrixAccessor<F extends Field<F>>

This interface defines methods for accessing elements in a matrix.

Indices count from 1, e.g., get(1,1), which is what mathematicians (not programmers) are accustomed to.

The only way to change a matrix is by set(int, int, com.numericalmethod.suanshu.mathstructure.Field). Other operations that "change" the matrix actually creates an independent copy.

See Also:
Field

Method Summary
 F get(int row, int col)
          Get the matrix element at [row, col].
 void set(int row, int col, F value)
          Set the matrix element at [row, col] to value.
 

Method Detail

set

void set(int row,
         int col,
         F value)
         throws MatrixAccessException
Set the matrix element at [row, col] to value.

This is the only function that may change the entries of a matrix.

Parameters:
row - the row index
col - the column index
value - the value to set A[row, col] to
Throws:
MatrixAccessException - if row or col is out of range

get

F get(int row,
      int col)
                       throws MatrixAccessException
Get the matrix element at [row, col].

Parameters:
row - the row index
col - the column index
Returns:
A[row, col]
Throws:
MatrixAccessException - if row or col is out of range

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.