Class MatrixUtils.FractionMatrixConverter

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

private static class MatrixUtils.FractionMatrixConverter extends DefaultFieldMatrixPreservingVisitor<Fraction>
Converter for FieldMatrix/Fraction.
  • Field Details

    • data

      private double[][] data
      Converted array.
  • Constructor Details

    • FractionMatrixConverter

      FractionMatrixConverter()
      Simple constructor.
  • Method Details

    • 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:
      the converted matrix.