java.lang.Object
com.darkcollective.relix.solver.ojalgo.OjAlgoSolver
All Implemented Interfaces:
MathProgrammingSolver

public final class OjAlgoSolver extends Object implements MathProgrammingSolver
The shipped MathProgrammingSolver: ojAlgo's deterministic branch-and-bound.

Every ojAlgo type in the build is named in this one class. Instances hold no state and are therefore thread-safe; a model is built per solve.

  • Constructor Details

    • OjAlgoSolver

      public OjAlgoSolver()
  • Method Details

    • name

      public String name()
      Description copied from interface: MathProgrammingSolver
      A short name for this solver, used in diagnostics.
      Specified by:
      name in interface MathProgrammingSolver
      Returns:
      the solver's name, for diagnostics
    • solve

      public SolverResult solve(LinearProgram program)
      Description copied from interface: MathProgrammingSolver
      Solves a program.

      Three outcomes, and a provider is expected to distinguish them rather than collapse the last two: an optimal assignment (SolverResult.Solved), a program proved to have none (SolverResult.Infeasible), and a search that did not decide — failed, cut off, unbounded, malformed (SolverResult.Undetermined, carrying a short reason). Infeasibility is a normal answer the engine acts on; an undecided search is an error it reports, because a query cannot honestly say "no rows" about a question nobody answered. An exception means the provider itself broke.

      Specified by:
      solve in interface MathProgrammingSolver
      Parameters:
      program - the program to solve; must not be null
      Returns:
      what the solver concluded; never null