org.apache.commons.math.linear
Class MatrixUtils.FractionMatrixConverter

java.lang.Object
  extended by org.apache.commons.math.linear.DefaultFieldMatrixPreservingVisitor<Fraction>
      extended by org.apache.commons.math.linear.MatrixUtils.FractionMatrixConverter
All Implemented Interfaces:
FieldMatrixPreservingVisitor<Fraction>
Enclosing class:
MatrixUtils

private static class MatrixUtils.FractionMatrixConverter
extends DefaultFieldMatrixPreservingVisitor<Fraction>

Converter for FieldMatrix/Fraction.


Field Summary
private  double[][] data
          Converted array.
 
Constructor Summary
MatrixUtils.FractionMatrixConverter()
          Simple constructor.
 
Method Summary
(package private)  Array2DRowRealMatrix getConvertedMatrix()
          Get the converted matrix.
 void start(int rows, int columns, int startRow, int endRow, int startColumn, int endColumn)
          Start visiting a matrix.
 void visit(int row, int column, Fraction value)
          Visit one matrix entry.
 
Methods inherited from class org.apache.commons.math.linear.DefaultFieldMatrixPreservingVisitor
end
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private double[][] data
Converted array.

Constructor Detail

MatrixUtils.FractionMatrixConverter

public MatrixUtils.FractionMatrixConverter()
Simple constructor.

Method Detail

start

public void start(int rows,
                  int columns,
                  int startRow,
                  int endRow,
                  int startColumn,
                  int endColumn)
Start visiting a matrix.

This method is called once before any entry of the matrix is visited.

Specified by:
start in interface FieldMatrixPreservingVisitor<Fraction>
Overrides:
start in class DefaultFieldMatrixPreservingVisitor<Fraction>
Parameters:
rows - number of rows of the matrix
columns - number of columns of the matrix
startRow - Initial row index
endRow - Final row index (inclusive)
startColumn - Initial column index
endColumn - Final column index (inclusive)

visit

public void visit(int row,
                  int column,
                  Fraction value)
Visit one matrix entry.

Specified by:
visit in interface FieldMatrixPreservingVisitor<Fraction>
Overrides:
visit in class DefaultFieldMatrixPreservingVisitor<Fraction>
Parameters:
row - row index of the entry
column - column index of the entry
value - current value of the entry

getConvertedMatrix

Array2DRowRealMatrix getConvertedMatrix()
Get the converted matrix.

Returns:
converted matrix


Copyright (c) 2003-2009 Apache Software Foundation