Class HighsSolver14x
Solver adapter for the HiGHS solver. See also: https://ergo-code.github.io/HiGHS/index.html
Inherited Members
Namespace: OPTANO.Modeling.Optimization.Solver.Highs14x
Assembly: Optimization.Solver.Highs14x.dll
Syntax
public class HighsSolver14x : GenericSolverBase<HighsSolverConfiguration14x>, ISolver, ICanSolve<Model, Solution>, IAbortable, IDisposable
Constructors
HighsSolver14x(HighsSolverConfiguration14x, TriviallyFeasibleConstraintHandling)
Declaration
public HighsSolver14x(HighsSolverConfiguration14x config = null, TriviallyFeasibleConstraintHandling trivialConstraintHandling = TriviallyFeasibleConstraintHandling.Native)
Parameters
Type | Name | Description |
---|---|---|
HighsSolverConfiguration14x | config | |
TriviallyFeasibleConstraintHandling | trivialConstraintHandling |
Properties
HighsModel
Declaration
protected HighsWrapper14x.HighsModel HighsModel { get; set; }
Property Value
Type | Description |
---|---|
HighsWrapper14x.HighsModel |
HighsSolver
Declaration
protected HighsWrapper14x.HighsLpSolver HighsSolver { get; set; }
Property Value
Type | Description |
---|---|
HighsWrapper14x.HighsLpSolver |
Methods
Abort()
Aborts the current optimization.
Declaration
public override void Abort()
Overrides
AddObjective(Objective)
Internal method to add an Objective to the current solver model.
Should be called from the OPTANO.Modeling.Optimization.Solver.Interfaces.ICanManipulateANativeSolver.AddObjective(OPTANO.Modeling.Optimization.Objective) method.
This method does not check whether the solver
Declaration
protected override void AddObjective(Objective objective)
Parameters
Type | Name | Description |
---|---|---|
Objective | objective | The objective to add |
Overrides
BuildSolverModelAdapterSpecific(Int32)
This method needs to build the solver API's specific model from the current OPTANO Model. It is important to perform the whole work in this call, since benchmark statistics, such as required RAM, and time to build the model, are gathered during the execution of this method.
Declaration
protected override void BuildSolverModelAdapterSpecific(int prioLevel = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | prioLevel | The prio Level. |
Overrides
ClearIndexLists()
Declaration
protected void ClearIndexLists()
ClearLastModel()
Clears the last model.
Declaration
public override void ClearLastModel()
Overrides
RemoveConstraint(String)
Internal method to remove a constraint from the current solver model.
Should be called from the OPTANO.Modeling.Optimization.Solver.Interfaces.ICanManipulateANativeSolver.RemoveConstraint(System.String) method.
This method does not check whether the solver
Declaration
protected override void RemoveConstraint(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The Name of the constraint to remove. |
Overrides
SetConfigurationAdapterSpecific()
This method is called before every (re-)solve and should set all parameters from the adapter's Configuration in the respective solver.
Declaration
protected override void SetConfigurationAdapterSpecific()
Overrides
SolveAdapterSpecific(Int32, IDictionary<Variable, Double>)
This method should solve the CurrentModel, which is set in Solve(Model, Dictionary<Variable, Double>), before SolveAdapterSpecific(Int32, IDictionary<Variable, Double>) is called.
Declaration
protected override Solution SolveAdapterSpecific(int prioLevel = 0, IDictionary<Variable, double> variableValues = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | prioLevel | The priority level to solve for. |
System.Collections.Generic.IDictionary<Variable, System.Double> | variableValues | The variable values. |
Returns
Type | Description |
---|---|
Solution | The Solution. |
Overrides
ThrowOnHighsError(Func<HighsWrapper14x.HighsStatus>)
Declaration
protected void ThrowOnHighsError(Func<HighsWrapper14x.HighsStatus> highsAction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<HighsWrapper14x.HighsStatus> | highsAction |