Commit 584b3920 authored by Daniel Le Berre's avatar Daniel Le Berre
Browse files

Add @Override when overriding default methods

parent 1357b084
Pipeline #20138 passed with stages
in 54 minutes and 45 seconds
......@@ -264,10 +264,6 @@ public class AtLeast implements Propagatable, Constr, Undoable, Serializable {
return this.lits[i];
}
public void rescaleBy(double d) {
throw new UnsupportedOperationException();
}
public void assertConstraint(UnitPropagationListener s) {
var ret = true;
for (Integer lit : this.lits) {
......
......@@ -30,7 +30,6 @@
package org.sat4j.minisat.constraints.card;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
......@@ -400,34 +399,10 @@ public final class MaxWatchCard
throw new UnsupportedOperationException();
}
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.constraints.pb.PBConstr#getCoefficient(int)
*/
public BigInteger getCoef(int literal) {
return BigInteger.ONE;
}
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.constraints.pb.PBConstr#getDegree()
*/
public BigInteger getDegree() {
return BigInteger.valueOf(this.degree);
}
public ILits getVocabulary() {
return this.voc;
}
/**
* @since 2.1
*/
public void forwardActivity(double claInc) {
}
public boolean canBePropagatedMultipleTimes() {
return false;
}
......
......@@ -144,6 +144,7 @@ public abstract class BinaryClause
/**
* @return the activity of the clause
*/
@Override
public double getActivity() {
return this.activity;
}
......@@ -186,6 +187,7 @@ public abstract class BinaryClause
/**
* @param d
*/
@Override
public void rescaleBy(double d) {
this.activity *= d;
}
......
......@@ -214,14 +214,6 @@ public class BinaryClauses implements Constr, Propagatable, Serializable {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void forwardActivity(double claInc) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void setActivity(double d) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void assertConstraintIfNeeded(UnitPropagationListener s) {
throw new UnsupportedOperationException("Not implemented yet!");
}
......
......@@ -168,6 +168,7 @@ public class CBClause implements Constr, Undoable, Propagatable, Serializable {
*
* @see org.sat4j.minisat.core.Constr#incActivity(double)
*/
@Override
public void incActivity(double claInc) {
activity += claInc;
}
......@@ -177,6 +178,7 @@ public class CBClause implements Constr, Undoable, Propagatable, Serializable {
*
* @see org.sat4j.minisat.core.Constr#getActivity()
*/
@Override
public double getActivity() {
return activity;
}
......@@ -224,6 +226,7 @@ public class CBClause implements Constr, Undoable, Propagatable, Serializable {
*
* @see org.sat4j.minisat.core.Constr#rescaleBy(double)
*/
@Override
public void rescaleBy(double d) {
activity *= d;
}
......@@ -288,14 +291,6 @@ public class CBClause implements Constr, Undoable, Propagatable, Serializable {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void forwardActivity(double claInc) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void setActivity(double d) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public void assertConstraintIfNeeded(UnitPropagationListener s) {
throw new UnsupportedOperationException("Not implemented yet!");
}
......
......@@ -191,6 +191,7 @@ public abstract class HTClause implements Propagatable, Constr, Serializable {
/**
* @return the activity of the clause
*/
@Override
public double getActivity() {
return this.activity;
}
......@@ -238,6 +239,7 @@ public abstract class HTClause implements Propagatable, Constr, Serializable {
/**
* @param d
*/
@Override
public void rescaleBy(double d) {
this.activity *= d;
}
......
......@@ -61,10 +61,12 @@ public class LearntBinaryClause extends BinaryClause {
/**
* @param claInc
*/
@Override
public void incActivity(double claInc) {
this.activity += claInc;
}
@Override
public void setActivity(double d) {
this.activity = d;
}
......
......@@ -92,10 +92,12 @@ public class LearntHTClause extends HTClause {
/**
* @param claInc
*/
@Override
public void incActivity(double claInc) {
this.activity += claInc;
}
@Override
public void setActivity(double d) {
this.activity = d;
}
......
......@@ -157,10 +157,12 @@ public abstract class WLClause implements Propagatable, Constr, Serializable {
/**
* @return the activity of the clause
*/
@Override
public double getActivity() {
return this.activity;
}
@Override
public void setActivity(double d) {
this.activity = d;
}
......@@ -212,6 +214,7 @@ public abstract class WLClause implements Propagatable, Constr, Serializable {
/**
* @param d
*/
@Override
public void rescaleBy(double d) {
this.activity *= d;
}
......
......@@ -60,14 +60,14 @@ public class SubsetVarOrder extends VarOrderHeap {
this.heap = new Heap(
new ActivityBasedVariableComparator(this.activity));
this.heap.setBounds(nlength);
for (int var : this.varsToTest) {
assert var > 0;
assert var <= this.lits.nVars() : "" + this.lits.nVars() + "/" //$NON-NLS-1$ //$NON-NLS-2$
+ var;
this.inSubset[var] = true;
this.activity[var] = 0.0;
if (this.lits.belongsToPool(var)) {
this.heap.insert(var);
for (int variable : this.varsToTest) {
assert variable > 0;
assert variable <= this.lits.nVars() : "" + this.lits.nVars() + "/" //$NON-NLS-1$ //$NON-NLS-2$
+ variable;
this.inSubset[variable] = true;
this.activity[variable] = 0.0;
if (this.lits.belongsToPool(variable)) {
this.heap.insert(variable);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment