SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype
Interface MatrixData

All Superinterfaces:
DeepCopyable
All Known Implementing Classes:
DenseData

public interface MatrixData
extends DeepCopyable

This interface defines for (an abstract) storage of matrix data.

It allow us to:

1. We can provide default implementations for some matrix operations that do not depend on the particular matrix implementation. E.g., MatrixMathImpl. 2. Conceivably, we could experiment different ways of implementing a matrix. This interface allows us to swap implementations.


Method Summary
 double get(int row, int col)
          Get the matrix entry at [row, col].
 void set(int row, int col, double value)
          Set the matrix entry at [row, col] to value.
 
Methods inherited from interface com.numericalmethod.suanshu.DeepCopyable
deepCopy
 

Method Detail

set

void set(int row,
         int col,
         double value)
Set the matrix entry 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

double get(int row,
           int col)
Get the matrix entry 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.