The MCFClass Project
Compile-time switches in MCFSimplex.h

There is only one macro in MCFSimplex, but it is very important! More...

Macros

#define QUADRATICCOST   0
 Setting QUADRATICCOST == 1 the solver can solve problems with linear and quadratic costs too (but the latter only with the Primal Simplex).
 

Detailed Description

There is only one macro in MCFSimplex, but it is very important!

Macro Definition Documentation

◆ QUADRATICCOST

#define QUADRATICCOST   0

Setting QUADRATICCOST == 1 the solver can solve problems with linear and quadratic costs too (but the latter only with the Primal Simplex).

The reason for having a macro is that when quadratic costs are present the "arcType" struct has the additional field "quadraticCost" to hold it. Furthermore, the field "ident" is not created because the solver doesn't use the classical TLU tripartition. Instead, closed arcs and deleted arcs are characterized as follows:

  • closed arcs have the field "cost" to INFINITY (Inf< FNumber >());
  • deleted arcs have the field "upper" to INFINITY and the "tail" and "head" field are NULL. Furthermore, the solver needs the variables "ignoredEnteringArc" and "firstIgnoredEnteringArc", used to avoid nasty loops during the execution of the Quadratic Primal Simplex algorithm. If, instead, QUADRATICCOST == 0 then the solver can solve only problems with linear costs. Hence, the field "quadraticCost" is useless and it isn't created. Furthermore, Primal Simplex and Dual Simplex use the tripartition TLU to divide the arcs, so the solver creates the field "ident", which differentiates the set of the arcs in among deleted arcs, closed arcs, arcs in T, arcs in L, arcs in U. Thus, with QUADRATICCOST == 0 the solver cannot solve problems with quadratic costs, but it does solve problems with linear costs faster.