SolutionCallback (Apache Commons Math 3.3 API)

org.apache.commons.math3.optim.linear

## Class SolutionCallback

- java.lang.Object
- - org.apache.commons.math3.optim.linear.SolutionCallback

- All Implemented Interfaces:
    OptimizationData

      public class SolutionCallback
      extends Object
      implements OptimizationData

  A constraint for a linear optimization problem indicating whether all variables must be restricted to non-negative values.
  Since:
    3.3
  Version:
    $Id: SolutionCallback.java 1560541 2014-01-22 22:12:42Z tn $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolutionCallback()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PointValuePair` | `getSolution()` Retrieve the best solution found so far.
    `boolean` | `isSolutionOptimal()` Returns if the found solution is optimal.

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

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

- - ### Constructor Detail

    - #### SolutionCallback

          public SolutionCallback()

  - ### Method Detail

    - #### getSolution

          public PointValuePair getSolution()

      Retrieve the best solution found so far.

      Note: the returned solution may not be optimal, e.g. in case the optimizer did reach the iteration limits.

      Returns:
        the best solution found so far by the optimizer, or `null` if no feasible solution could be found

    - #### isSolutionOptimal

          public boolean isSolutionOptimal()

      Returns if the found solution is optimal.
      Returns:
        `true` if the solution is optimal, `false` otherwise

Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.