diff options
author | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-10-20 21:54:43 (GMT) |
---|---|---|
committer | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-10-26 22:17:55 (GMT) |
commit | fa767bf7b104a4e44e4e283522f0dfd942094375 (patch) | |
tree | dc069c09dc298ac914317ed1c60574eac6c3c343 /src/gui/graphicsview/qsimplex_p.h | |
parent | 3f29c77a26d0a898ca3a7c9c6715da90f1ecc50a (diff) | |
download | Qt-fa767bf7b104a4e44e4e283522f0dfd942094375.zip Qt-fa767bf7b104a4e44e4e283522f0dfd942094375.tar.gz Qt-fa767bf7b104a4e44e4e283522f0dfd942094375.tar.bz2 |
QGAL (QSimplex): Make deep copy of constraints inside QSimplex
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>
Diffstat (limited to 'src/gui/graphicsview/qsimplex_p.h')
-rw-r--r-- | src/gui/graphicsview/qsimplex_p.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qsimplex_p.h b/src/gui/graphicsview/qsimplex_p.h index 423f9bc..5ec13c3 100644 --- a/src/gui/graphicsview/qsimplex_p.h +++ b/src/gui/graphicsview/qsimplex_p.h @@ -106,7 +106,7 @@ struct QSimplexConstraint Q_ASSERT(constant > 0 || qFuzzyCompare(1, 1 + constant)); - if (qFuzzyCompare(1000 + leftHandSide, 1000 + constant)) + if ((leftHandSide == constant) || qFuzzyCompare(1000 + leftHandSide, 1000 + constant)) return true; switch (ratio) { @@ -152,7 +152,6 @@ public: qreal solveMin(); qreal solveMax(); - QList<QSimplexVariable *> constraintsVariables(); bool setConstraints(const QList<QSimplexConstraint *> constraints); void setObjective(QSimplexConstraint *objective); @@ -191,11 +190,6 @@ private: qreal *matrix; }; -inline QList<QSimplexVariable *> QSimplex::constraintsVariables() -{ - return variables; -} - inline qreal QSimplex::valueAt(int rowIndex, int columnIndex) { return matrix[rowIndex * columns + columnIndex]; |