org.apache.commons.math3.ode.nonstiff

## Class AdamsMoultonIntegrator.Corrector

- java.lang.Object
- - org.apache.commons.math3.ode.nonstiff.AdamsMoultonIntegrator.Corrector

- All Implemented Interfaces:
    RealMatrixPreservingVisitor
  Enclosing class:
    AdamsMoultonIntegrator

      private class AdamsMoultonIntegrator.Corrector
      extends Object
      implements RealMatrixPreservingVisitor

  Corrector for current state in Adams-Moulton method.

  This visitor implements the Taylor series formula:

       Yn+1 = yn + s1(n+1) + [ -1 +1 -1 +1 ... ±1 ] rn+1

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private double[]` | `after` Current state after correction.
    `private double[]` | `before` Current state before correction.
    `private double[]` | `previous` Previous state.
    `private double[]` | `scaled` Current scaled first derivative.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdamsMoultonIntegrator.Corrector(double[] previous, double[] scaled, double[] state)` Simple constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `end()` End visiting the Nordsieck vector.
    `void` | `start(int rows, int columns, int startRow, int endRow, int startColumn, int endColumn)` Start visiting a matrix.
    `void` | `visit(int row, int column, double value)` Visit one matrix entry.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### previous

          private final double[] previous

      Previous state.

    - #### scaled

          private final double[] scaled

      Current scaled first derivative.

    - #### before

          private final double[] before

      Current state before correction.

    - #### after

          private final double[] after

      Current state after correction.

  - ### Constructor Detail

    - #### AdamsMoultonIntegrator.Corrector

          public AdamsMoultonIntegrator.Corrector(double[] previous,
                                          double[] scaled,
                                          double[] state)

      Simple constructor.
      Parameters:
        `previous` - previous state
        `scaled` - current scaled first derivative
        `state` - state to correct (will be overwritten after visit)

  - ### 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 `RealMatrixPreservingVisitor`
      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,
                   double value)

      Visit one matrix entry.
      Specified by:
        `visit` in interface `RealMatrixPreservingVisitor`
      Parameters:
        `row` - row index of the entry
        `column` - column index of the entry
        `value` - current value of the entry

    - #### end

          public double end()

      End visiting the Nordsieck vector.

      The correction is used to control stepsize. So its amplitude is considered to be an error, which must be normalized according to error control settings. If the normalized value is greater than 1, the correction was too large and the step must be rejected.

      Specified by:
        `end` in interface `RealMatrixPreservingVisitor`
      Returns:
        the normalized correction, if greater than 1, the step must be rejected

Copyright (c) 2003-2013 Apache Software Foundation