Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
49d14caa
Commit
49d14caa
authored
Jun 26, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the midpoints test pass. Fixes incorrect Row.reverseSign
parent
20908034
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
row.dart
packages/cassowary/lib/row.dart
+4
-1
solver.dart
packages/cassowary/lib/solver.dart
+1
-1
cassowary_test.dart
packages/cassowary/test/cassowary_test.dart
+4
-4
No files found.
packages/cassowary/lib/row.dart
View file @
49d14caa
...
...
@@ -34,7 +34,10 @@ class _Row {
cells
.
remove
(
symbol
);
}
void
reverseSign
()
=>
cells
.
forEach
((
s
,
v
)
=>
cells
[
s
]
=
-
v
);
void
reverseSign
()
{
constant
=
-
constant
;
cells
.
forEach
((
s
,
v
)
=>
cells
[
s
]
=
-
v
);
}
void
solveForSymbol
(
_Symbol
symbol
)
{
assert
(
cells
.
containsKey
(
symbol
));
...
...
packages/cassowary/lib/solver.dart
View file @
49d14caa
...
...
@@ -12,7 +12,7 @@ class Solver {
final
List
<
_Symbol
>
_infeasibleRows
=
new
List
<
_Symbol
>();
final
_Row
_objective
=
new
_Row
(
0.0
);
_Row
_artificial
=
new
_Row
(
0.0
);
int
tick
=
0
;
int
tick
=
1
;
/// Attempts to add the constraints in the list to the solver. If it cannot
/// add any for some reason, a cleanup is attempted so that either all
...
...
packages/cassowary/test/cassowary_test.dart
View file @
49d14caa
...
...
@@ -432,13 +432,13 @@ void main() {
});
test
(
'midpoints'
,
()
{
var
left
=
new
Param
(
0.0
);
var
right
=
new
Param
(
0.0
);
var
mid
=
new
Param
(
0.0
);
var
left
=
new
Param
(
0.0
)
..
name
=
"left"
;
var
right
=
new
Param
(
0.0
)
..
name
=
"right"
;
var
mid
=
new
Param
(
0.0
)
..
name
=
"mid"
;
Solver
s
=
new
Solver
();
expect
(
s
.
addConstraint
((
left
+
right
==
CM
(
2.0
)
*
mid
)
as
Constraint
),
expect
(
s
.
addConstraint
((
right
+
left
==
mid
*
CM
(
2.0
)
)
as
Constraint
),
Result
.
success
);
expect
(
s
.
addConstraint
(
right
-
left
>=
CM
(
100.0
)),
Result
.
success
);
expect
(
s
.
addConstraint
(
left
>=
CM
(
0.0
)),
Result
.
success
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment