3 From: "Anthony Beurive'" <beurive@labri.u-bordeaux.fr>
5 To: gjb@cs.washington.edu
6 Date: Tue, 9 Mar 1999 12:42:24 +0100 (CET)
8 I believe there's a bug in cassowary. It seems to be related to the
9 previous one I encountered a while ago, concerning the removal of
12 The three following examples may help you to track the bug, I hope.
14 --------------------------------------------------------------------------------
19 ClSimplexSolver *solver = new ClSimplexSolver();
20 ClVariable *var = new ClVariable();
21 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),1.0);
23 solver->AddConstraint(*stcn);
25 solver->RemoveConstraint(*stcn);
28 --------------------------------------------------------------------------------
32 Now, the factor of the stay constraint is changed.
33 --------------------------------------------------------------------------------
38 ClSimplexSolver *solver = new ClSimplexSolver();
39 ClVariable *var = new ClVariable();
40 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),2.0);
42 solver->AddConstraint(*stcn);
44 solver->RemoveConstraint(*stcn);
47 --------------------------------------------------------------------------------
49 test2: ClSimplexSolver.cc:1199: void ClSimplexSolver::Optimize(class ClVariable): Assertion \
50 `pzRow != __null' failed.
54 Now, the solver is created after the variable.
55 --------------------------------------------------------------------------------
60 ClVariable *var = new ClVariable();
61 ClSimplexSolver *solver = new ClSimplexSolver();
62 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),2.0);
64 solver->AddConstraint(*stcn);
66 solver->RemoveConstraint(*stcn);
69 --------------------------------------------------------------------------------
73 Can you reproduce the same results? Maybe the cause is my c++
74 compiler (egcs-2.90.29 980515 (egcs-1.0.3 release)). I don't know.
78 #include <cassowary/Cl.h>
82 ClSimplexSolver *solver = new ClSimplexSolver();
83 ClVariable *var = new ClVariable();
84 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),1.0);
86 solver->AddConstraint(*stcn);
88 solver->RemoveConstraint(*stcn);
95 ClSimplexSolver *solver = new ClSimplexSolver();
96 ClVariable *var = new ClVariable();
97 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),2.0);
99 solver->AddConstraint(*stcn);
101 solver->RemoveConstraint(*stcn);
108 ClVariable *var = new ClVariable();
109 ClSimplexSolver *solver = new ClSimplexSolver();
110 ClStayConstraint *stcn = new ClStayConstraint(*var,ClsWeak(),2.0);
112 solver->AddConstraint(*stcn);
114 solver->RemoveConstraint(*stcn);
121 cerr << "Test1: " << endl;
124 cerr << "\nTest2: " << endl;
127 cerr << "\nTest3: " << endl;