CplexParams Structure

Cplex parameters.

Definition

Namespace: Orx.MathProg.Solvers
Assembly: Orx.MathProg (in Orx.MathProg.dll) Version: 1.0.0
C#
public struct CplexParams : IEquatable<CplexParams>
Inheritance
Object    ValueType    CplexParams
Implements
IEquatableCplexParams

Constructors

CplexParams Creates the cplex parameters with default values.

Properties

AbsMipGap Absolute tolerance on the gap between the best integer objective and the objective of the best node remaining. Default = 1e-06.
MipGap Relative tolerance on the gap between the best integer objective and the objective of the best node remaining. Default = 0.0001.
Silent The solver will execute silently when set to true; will log solver's output to the stdout when set to false. Default = true.
Threads Number of threads to use:
  • when 0 => automatic,
  • when 1 => sequential,
  • when >1 => parallel with the given number of threads.
Default = 0.
TimeLimit Time limit in seconds. Default = 1e+75.

Methods

GetType
(Inherited from Object)
Validate Validates the values of the cplex parameters, and returns Ok if all values are valid. Returns the error explaining values of which setting has an invalid value.
C#
CplexParams pars = new();
Res validation = pars.Validate();
Assert.True(validation.IsOk); // all default values must be valid :)

CplexParams parsBad = new()
{
    TimeLimit = -10 // not a valid time limit
};
Res validationBad = parsBad.Validate();
Assert.True(validationBad.IsErr);
Assert.True(validationBad.ErrorMessage().Unwrap().Contains("TimeLimit")); // error message describing the failing test

See Also