summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qsimplex_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* QGAL: Limit absolute size of anchors and add offset to calculationEduardo M. Fleury2009-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | This commit is groundwork for the support of negative-sized anchors by the simplex solver. The idea is to add to all variables an offset large enough to ensure they are never negative. The implementation limits all variable sizes in the range [-limit, limit] and feed them into the simplex with an offset of "limit". Subtracting this offset later to find out the real values. "limit" is defined as QWIDGETSIZE_MAX for platforms where qreal is double and as QWIDGETSIZE_MAX / 32 when it is float. This is to avoid numerical errors in the simplex solver. This commit also modifies the ASSERT clause inside QSimplex so it becomes less prone to false positives due to numerical errors. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Avoid false assertions due to floating point precision errorsEduardo M. Fleury2009-11-041-1/+1
| | | | | Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* Compile on 64bitOlivier Goffart2009-10-281-2/+2
| | | | Reviewed-by: Jan-Arve
* QGAL (QSimplex): Add constraints simplificationEduardo M. Fleury2009-10-261-2/+5
| | | | | | | | | | | | | | | 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>
* QGAL (QSimplex): Make deep copy of constraints inside QSimplexEduardo M. Fleury2009-10-261-7/+1
| | | | | | | | | 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>
* QGAL: Add QSimplexConstraint::toString() method for debuggingEduardo M. Fleury2009-10-261-0/+23
| | | | | Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* Cosmetic fixes to the previous patches.Jan-Arve Sæther2009-10-071-2/+2
| | | | | | 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.
* QSimplex: Remove overly conservative assertionEduardo M. Fleury2009-10-061-1/+25
| | | | | | | | | | | | | 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>
* Implement hasConflicts().Jan-Arve Sæther2009-09-171-1/+1
|
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Removing a few superfluous semicolons.Alessandro Portale2009-09-031-2/+2
| | | | Reviewed-By: TrustMe
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Add missing license headers and header guards.Jason McDonald2009-08-211-5/+44
| | | | Reviewed-by: Trust Me
* make the new anchor layout code compile with namespaceshjk2009-08-211-1/+4
|
* QSimplex: new method solver, avoinding code replicationAnselmo Lacerda S. de Melo2009-07-221-0/+2
| | | | | | | | | | | 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>
* QSimplex: Adding the Simplex solver for linear systemsJesus Sanchez-Palencia2009-07-221-0/+120
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>