| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
| |
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now the simplex solver is able to remove fixed variables from its
constraints as to improve its running time.
The simplification consists of two actions that are done iteratively
until no possible changes exist:
1st) Look for constraints of type Var == Constant
Save constant as the trivial value of Var
2nd) Substitute known results in existing constraints
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
|
|
|
| |
The idea is to allow QSimplex solver to modify the constraints
without breaking other parts of the code that rely on the original
ones.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
| |
There is only one change in the actual code here, and it simply removes
an unnecessary initialization of hasSize in the ctors of the composite
anchors.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This assertion started failing after the addition of expanding
state. After some investigation we felt that the assertion itself
was too strong and would fail in some valid cases.
The new assertion is formally right as it tests whether the
simplex solver was able to satisfy the simplex constraints,
_exactly_ what it is expected to do.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
| |
Reviewed-by:TrustMe
|
| |
|
|
|
|
|
|
| |
printf() does not work very well on windows, since it will not send the
output to OutputDebugString(). This allows us to catch the output even
if the program is configured without "CONFIG += console".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Jan-Arve found a bug where QSimplex would return bad results in
some tight situations. The problem was triggered randomly but the
chances of appearance were higher in problems with only one
feasible solution, ie. problems what were in the boundary of
feasibility.
The QSimplex solver implements a two-phase simplex solver, the
first phase is responsible for finding a _feasible_ solution for
the problem (not the best one). The second phase starts with
the basic feasible solution (just found) and changes until
one that is _optimal_ is found.
To implement that solution we need to add artificial variables
to the original problem, before phase 1, and remove them, before
starting phase 2. Unfortunately though, there was some randomness
in the criteria used by the solver that would sometimes cause
the removal of a good variable instead of an artificial one,
between the phases.
With one good variable missing, the solver would also miss an
important restriction, without such, it would push the objective
function too far, thus returning a "wrong" result.
This commit adds a tie-breaker condition to the pivot row logic
to ensure the artificial variables are removed before the "good"
ones.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
|
|
|
|
|
|
|
|
|
| |
This private class is used by QGraphicsAnchorLayout as the linear
programming solver engine.
This method adds documentation to implementation, method and classes.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
|
| |
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
| |
Lots of warnings in the qreal == float case.
Some Q_UNUSED added.
Reviewed-by: thartman
|
|
|
|
| |
Reviewed-by: Trust Me
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
A small optimization.
Added a verification in combineRows to skip calculating
x = x + y*0.0 as it obviously won't change the value of x.
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The methods solveMin() and solveMax() had similar implementation, except
by a "-1" multiplier. This commit includes a new private method called
solver that is called by both solveMin() and solveMax().
A new enum 'solverFactor' was added admiting 2 values - Maximum (+1)
and Minimum (-1).
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both QGraphicsAnchorLayoutPrivate::solveMinMax() and solvePreferred()
were deleting the linear programming contraints while QSimplex still
had them.
For solveMinMax(), move the creation of constraints out of that
method.
For solvePreferred(), create the simplex solver in the heap so it can
be deleted before the constraints are.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
|
This implementation is based on the iterative algorithm presented in
http://en.wikibooks.org/wiki/Operations_Research/The_Simplex_Method.
It is capable of giving us the solution to any n variable LP model.
Although we focused on QGraphicsAnchorLayout, the solver is general
enough for being reused in any other Qt classes if needed.
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
|