Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
sat4j
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
53
Issues
53
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SAT4J
sat4j
Commits
ccd7b10b
Commit
ccd7b10b
authored
Sep 21, 2017
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format code.
parent
f0332be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/WatchPbLong.java
...rc/main/java/org/sat4j/pb/constraints/pb/WatchPbLong.java
+13
-14
No files found.
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/WatchPbLong.java
View file @
ccd7b10b
...
...
@@ -48,12 +48,12 @@ import org.sat4j.specs.Propagatable;
import
org.sat4j.specs.UnitPropagationListener
;
import
org.sat4j.specs.VarMapper
;
public
abstract
class
WatchPbLong
implements
Propagatable
,
Constr
,
Undoable
,
Serializable
{
public
abstract
class
WatchPbLong
implements
Propagatable
,
Constr
,
Undoable
,
Serializable
{
/**
*
*/
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
int
LIMIT_SELECTION_SORT
=
15
;
...
...
@@ -142,9 +142,8 @@ public abstract class WatchPbLong implements Propagatable, Constr, Undoable,
public
boolean
isAssertive
(
int
dl
)
{
long
slack
=
0
;
for
(
int
i
=
0
;
i
<
this
.
lits
.
length
;
i
++)
{
if
(
this
.
coefs
[
i
]
>
0
&&
(!
this
.
voc
.
isFalsified
(
this
.
lits
[
i
])
||
this
.
voc
.
getLevel
(
this
.
lits
[
i
])
>=
dl
))
{
if
(
this
.
coefs
[
i
]
>
0
&&
(!
this
.
voc
.
isFalsified
(
this
.
lits
[
i
])
||
this
.
voc
.
getLevel
(
this
.
lits
[
i
])
>=
dl
))
{
slack
=
slack
+
this
.
coefs
[
i
];
}
}
...
...
@@ -154,8 +153,8 @@ public abstract class WatchPbLong implements Propagatable, Constr, Undoable,
}
for
(
int
i
=
0
;
i
<
this
.
lits
.
length
;
i
++)
{
if
(
this
.
coefs
[
i
]
>
0
&&
(
this
.
voc
.
isUnassigned
(
this
.
lits
[
i
])
||
this
.
voc
.
getLevel
(
this
.
lits
[
i
])
>=
dl
)
&&
(
this
.
voc
.
isUnassigned
(
this
.
lits
[
i
])
||
this
.
voc
.
getLevel
(
this
.
lits
[
i
])
>=
dl
)
&&
slack
<
this
.
coefs
[
i
])
{
return
true
;
}
...
...
@@ -362,7 +361,7 @@ public abstract class WatchPbLong implements Propagatable, Constr, Undoable,
for
(
j
=
i
+
1
;
j
<
to
;
j
++)
{
if
(
this
.
coefs
[
j
]
>
this
.
coefs
[
bestIndex
]
||
this
.
coefs
[
j
]
==
this
.
coefs
[
bestIndex
]
&&
this
.
lits
[
j
]
>
this
.
lits
[
bestIndex
])
{
&&
this
.
lits
[
j
]
>
this
.
lits
[
bestIndex
])
{
bestIndex
=
j
;
}
}
...
...
@@ -445,12 +444,12 @@ public abstract class WatchPbLong implements Propagatable, Constr, Undoable,
for
(;;)
{
do
{
i
++;
}
while
(
this
.
coefs
[
i
]
>
pivot
||
this
.
coefs
[
i
]
==
pivot
&&
this
.
lits
[
i
]
>
litPivot
);
}
while
(
this
.
coefs
[
i
]
>
pivot
||
this
.
coefs
[
i
]
==
pivot
&&
this
.
lits
[
i
]
>
litPivot
);
do
{
j
--;
}
while
(
pivot
>
this
.
coefs
[
j
]
||
this
.
coefs
[
j
]
==
pivot
&&
this
.
lits
[
j
]
<
litPivot
);
}
while
(
pivot
>
this
.
coefs
[
j
]
||
this
.
coefs
[
j
]
==
pivot
&&
this
.
lits
[
j
]
<
litPivot
);
if
(
i
>=
j
)
{
break
;
...
...
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