Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSimplex Class Referencefinal

#include <qsimplex_p.h>

Collaboration diagram for QSimplex:

Public Member Functions

 QSimplex ()
 ~QSimplex ()
qreal solveMin ()
qreal solveMax ()
bool setConstraints (const QList< QSimplexConstraint * > &constraints)
void setObjective (QSimplexConstraint *objective)
void dumpMatrix ()

Detailed Description

The QSimplex class is a Linear Programming problem solver based on the two-phase simplex method.

It takes a set of QSimplexConstraints as its restrictive constraints and an additional QSimplexConstraint as its objective function. Then methods to maximize and minimize the problem solution are provided.

The two-phase simplex method is based on the following steps: First phase: 1.a) Modify the original, complex, and possibly not feasible problem, into a new, easy to solve problem. 1.b) Set as the objective of the new problem, a feasible solution for the original complex problem. 1.c) Run simplex to optimize the modified problem and check whether a solution for the original problem exists.

Second phase: 2.a) Go back to the original problem with the feasibl (but not optimal) solution found in the first phase. 2.b) Set the original objective. 3.c) Run simplex to optimize the original problem towards its optimal solution.

Definition at line 121 of file qsimplex_p.h.

Constructor & Destructor Documentation

◆ QSimplex()

QSimplex::QSimplex ( )

Definition at line 46 of file qsimplex_p.cpp.

◆ ~QSimplex()

QSimplex::~QSimplex ( )

Definition at line 53 of file qsimplex_p.cpp.

Member Function Documentation

◆ dumpMatrix()

void QSimplex::dumpMatrix ( )

Definition at line 316 of file qsimplex_p.cpp.

◆ setConstraints()

bool QSimplex::setConstraints ( const QList< QSimplexConstraint * > & newConstraints)

Sets the new constraints in the simplex solver and returns whether the problem is feasible.

This method sets the new constraints, normalizes them, creates the simplex matrix and runs the first simplex phase.

Definition at line 94 of file qsimplex_p.cpp.

References QSimplexConstraint::artificial.

◆ setObjective()

void QSimplex::setObjective ( QSimplexConstraint * newObjective)

Definition at line 286 of file qsimplex_p.cpp.

◆ solveMax()

qreal QSimplex::solveMax ( )

Maximize the original objective.

Definition at line 530 of file qsimplex_p.cpp.

◆ solveMin()

qreal QSimplex::solveMin ( )

Minimize the original objective.

Definition at line 521 of file qsimplex_p.cpp.


The documentation for this class was generated from the following files: