Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SAT4J
sat4j
Commits
2e621c29
Commit
2e621c29
authored
Nov 11, 2018
by
Daniel Le Berre
Browse files
Fixing last sonarqube vulnerabilities.
parent
05702b6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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