Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
2e621c29
Commit
2e621c29
authored
Nov 11, 2018
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing last sonarqube vulnerabilities.
parent
05702b6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMapSwitchToClause.java
...rg/sat4j/pb/constraints/pb/ConflictMapSwitchToClause.java
+10
-2
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverCautious.java
....pb/src/main/java/org/sat4j/pb/core/PBSolverCautious.java
+2
-2
No files found.
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMapSwitchToClause.java
View file @
2e621c29
...
...
@@ -33,7 +33,7 @@ import java.math.BigInteger;
public
final
class
ConflictMapSwitchToClause
extends
ConflictMap
{
p
ublic
static
int
U
pperBound
;
p
rivate
static
int
u
pperBound
;
public
ConflictMapSwitchToClause
(
PBConstr
cpb
,
int
level
)
{
super
(
cpb
,
level
);
...
...
@@ -65,7 +65,7 @@ public final class ConflictMapSwitchToClause extends ConflictMap {
bigCoef
=
bigCoef
.
add
(
this
.
weightedLits
.
get
(
wpb
.
get
(
i
))
.
multiply
(
this
.
coefMult
));
}
if
(
bigCoef
.
toString
().
length
()
>
U
pperBound
)
{
if
(
bigCoef
.
toString
().
length
()
>
u
pperBound
)
{
// if we deal with really big integers
// reducing the constraint to a clause
this
.
numberOfReductions
++;
...
...
@@ -90,4 +90,12 @@ public final class ConflictMapSwitchToClause extends ConflictMap {
return
BigInteger
.
ONE
;
}
public
static
int
getUpperBound
()
{
return
upperBound
;
}
public
static
void
setUpperBound
(
int
upperBound
)
{
ConflictMapSwitchToClause
.
upperBound
=
upperBound
;
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverCautious.java
View file @
2e621c29
...
...
@@ -46,13 +46,13 @@ public class PBSolverCautious extends PBSolverCP {
public
PBSolverCautious
(
LearningStrategy
<
PBDataStructureFactory
>
learner
,
PBDataStructureFactory
dsf
,
IOrder
order
)
{
super
(
learner
,
dsf
,
order
);
ConflictMapSwitchToClause
.
UpperBound
=
BOUND
;
ConflictMapSwitchToClause
.
set
UpperBound
(
BOUND
)
;
}
public
PBSolverCautious
(
LearningStrategy
<
PBDataStructureFactory
>
learner
,
PBDataStructureFactory
dsf
,
IOrder
order
,
int
bound
)
{
super
(
learner
,
dsf
,
order
);
ConflictMapSwitchToClause
.
UpperBound
=
bound
;
ConflictMapSwitchToClause
.
set
UpperBound
(
bound
)
;
}
@Override
...
...
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