Skip to content

Commit

Permalink
Consistent naming of abbreviations in classes and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
czengler committed Sep 16, 2024
1 parent 42de505 commit 52b2070
Show file tree
Hide file tree
Showing 377 changed files with 9,812 additions and 9,810 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import com.booleworks.logicng.formulas.FormulaFactory;
import com.booleworks.logicng.formulas.Variable;
import com.booleworks.logicng.handlers.ComputationHandler;
import com.booleworks.logicng.handlers.LNGResult;
import com.booleworks.logicng.handlers.LngResult;
import com.booleworks.logicng.handlers.NopHandler;
import com.booleworks.logicng.solvers.SATSolver;
import com.booleworks.logicng.solvers.SatSolver;
import com.booleworks.logicng.solvers.functions.BackboneFunction;
import com.booleworks.logicng.solvers.sat.SATSolverConfig;
import com.booleworks.logicng.solvers.sat.SatSolverConfig;
import com.booleworks.logicng.util.FormulaHelper;

import java.util.Collection;
Expand Down Expand Up @@ -45,16 +45,16 @@ private BackboneGeneration() {
* @param type the type of backbone variables that should be computed
* @param handler a handler
* @return the backbone or {@code null} if the computation was canceled by
* the handler
* the handler
*/
public static LNGResult<Backbone> compute(final FormulaFactory f, final Collection<Formula> formulas,
public static LngResult<Backbone> compute(final FormulaFactory f, final Collection<Formula> formulas,
final Collection<Variable> variables, final BackboneType type,
final ComputationHandler handler) {
if (formulas == null || formulas.isEmpty()) {
throw new IllegalArgumentException("Provide at least one formula for backbone computation");
}
final SATSolver solver = SATSolver.newSolver(f,
SATSolverConfig.builder().cnfMethod(SATSolverConfig.CNFMethod.PG_ON_SOLVER).build());
final SatSolver solver = SatSolver.newSolver(f,
SatSolverConfig.builder().cnfMethod(SatSolverConfig.CnfMethod.PG_ON_SOLVER).build());
solver.add(formulas);
return solver.execute(BackboneFunction.builder().variables(variables).type(type).build(), handler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
* A simple vector for boolean elements implementation (inspired by MiniSat and
* CleaneLing).
* <p>
* In theory one could use the {@link LNGVector} also for boolean. But Java's
* In theory one could use the {@link LngVector} also for boolean. But Java's
* auto-boxing comes with such a large performance penalty that for the
* mission-critical data structures of the SAT solvers we use this specialized
* implementation.
* @version 3.0.0
* @since 1.0
*/
public final class LNGBooleanVector {
public final class LngBooleanVector {

private boolean[] elements;
private int size;

/**
* Creates a vector with an initial capacity of 5 elements.
*/
public LNGBooleanVector() {
public LngBooleanVector() {
this(5);
}

/**
* Creates a vector with a given capacity.
* @param size the capacity of the vector.
*/
public LNGBooleanVector(final int size) {
public LngBooleanVector(final int size) {
elements = new boolean[size];
}

Expand All @@ -42,7 +42,7 @@ public LNGBooleanVector(final int size) {
* @param size the capacity of the vector
* @param pad the initial element
*/
public LNGBooleanVector(final int size, final boolean pad) {
public LngBooleanVector(final int size, final boolean pad) {
elements = new boolean[size];
Arrays.fill(elements, pad);
this.size = size;
Expand All @@ -52,7 +52,7 @@ public LNGBooleanVector(final int size, final boolean pad) {
* Copy constructor.
* @param other the other byte vector.
*/
public LNGBooleanVector(final LNGBooleanVector other) {
public LngBooleanVector(final LngBooleanVector other) {
elements = Arrays.copyOf(other.elements, other.size);
size = other.size;
}
Expand All @@ -61,12 +61,12 @@ public LNGBooleanVector(final LNGBooleanVector other) {
* Creates a vector with the given elements.
* @param elems the elements
*/
public LNGBooleanVector(final boolean... elems) {
public LngBooleanVector(final boolean... elems) {
elements = Arrays.copyOf(elems, elems.length);
size = elems.length;
}

public LNGBooleanVector(final boolean[] elements, final int size) {
public LngBooleanVector(final boolean[] elements, final int size) {
this.elements = elements;
this.size = size;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
* A simple vector for byte elements implementation (inspired by MiniSat and
* CleaneLing).
* <p>
* In theory one could use the {@link LNGVector} also for bytes. But Java's
* In theory one could use the {@link LngVector} also for bytes. But Java's
* auto-boxing comes with such a large performance penalty that for the
* mission-critical data structures of the SAT solvers we use this specialized
* implementation.
* @version 3.0.0
* @since 1.0
*/
public final class LNGByteVector {
public final class LngByteVector {

private byte[] elements;
private int size;

/**
* Creates a vector with an initial capacity of 5 elements.
*/
public LNGByteVector() {
public LngByteVector() {
this(5);
}

/**
* Creates a vector with a given capacity.
* @param size the capacity of the vector.
*/
public LNGByteVector(final int size) {
public LngByteVector(final int size) {
elements = new byte[size];
}

Expand All @@ -42,7 +42,7 @@ public LNGByteVector(final int size) {
* @param size the capacity of the vector
* @param pad the initial element
*/
public LNGByteVector(final int size, final byte pad) {
public LngByteVector(final int size, final byte pad) {
elements = new byte[size];
Arrays.fill(elements, pad);
this.size = size;
Expand All @@ -52,7 +52,7 @@ public LNGByteVector(final int size, final byte pad) {
* Copy constructor.
* @param other the other byte vector.
*/
public LNGByteVector(final LNGByteVector other) {
public LngByteVector(final LngByteVector other) {
elements = Arrays.copyOf(other.elements, other.size);
size = other.size;
}
Expand All @@ -61,7 +61,7 @@ public LNGByteVector(final LNGByteVector other) {
* Creates a vector with the given elements.
* @param elems the elements
*/
public LNGByteVector(final byte... elems) {
public LngByteVector(final byte... elems) {
elements = Arrays.copyOf(elems, elems.length);
size = elems.length;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
* A simple vector for double elements implementation (inspired by MiniSat,
* CleaneLing, Sat4J).
* <p>
* In theory one could use the {@link LNGVector} also for doubles. But Java's
* In theory one could use the {@link LngVector} also for doubles. But Java's
* auto-boxing comes with such a large performance penalty that for the
* mission-critical data structures of the SAT solvers we use this specialized
* implementation.
* @version 3.0.0
* @since 1.0
*/
public final class LNGDoubleVector {
public final class LngDoubleVector {

private double[] elements;
private int size;

/**
* Creates a vector with an initial capacity of 5 elements.
*/
public LNGDoubleVector() {
public LngDoubleVector() {
this(5);
}

/**
* Creates a vector with a given capacity.
* @param size the capacity of the vector.
*/
public LNGDoubleVector(final int size) {
public LngDoubleVector(final int size) {
elements = new double[size];
}

Expand All @@ -42,7 +42,7 @@ public LNGDoubleVector(final int size) {
* @param size the capacity of the vector
* @param pad the initial element
*/
public LNGDoubleVector(final int size, final double pad) {
public LngDoubleVector(final int size, final double pad) {
elements = new double[size];
Arrays.fill(elements, pad);
this.size = size;
Expand All @@ -52,7 +52,7 @@ public LNGDoubleVector(final int size, final double pad) {
* Copy constructor.
* @param other the other byte vector.
*/
public LNGDoubleVector(final LNGDoubleVector other) {
public LngDoubleVector(final LngDoubleVector other) {
elements = Arrays.copyOf(other.elements, other.size);
size = other.size;
}
Expand All @@ -61,7 +61,7 @@ public LNGDoubleVector(final LNGDoubleVector other) {
* Creates a vector with the given elements.
* @param elems the elements
*/
public LNGDoubleVector(final double... elems) {
public LngDoubleVector(final double... elems) {
elements = Arrays.copyOf(elems, elems.length);
size = elems.length;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@
/**
* A simple vector for integer elements implementation (inspired by MiniSat).
* <p>
* In theory one could use the {@link LNGVector} also for integers. But Java's
* In theory one could use the {@link LngVector} also for integers. But Java's
* auto-boxing comes with such a large performance penalty that for the
* mission-critical data structures of the SAT solvers we use this specialized
* implementation.
* @version 3.0.0
* @since 1.0
*/
public final class LNGIntVector {
public final class LngIntVector {

private int[] elements;
private int size;

/**
* Creates a vector with an initial capacity of 5 elements.
*/
public LNGIntVector() {
public LngIntVector() {
this(5);
}

/**
* Creates a vector with a given capacity.
* @param size the capacity of the vector.
*/
public LNGIntVector(final int size) {
public LngIntVector(final int size) {
elements = new int[size];
}

/**
* Copy constructor.
* @param other the other byte vector.
*/
public LNGIntVector(final LNGIntVector other) {
public LngIntVector(final LngIntVector other) {
elements = Arrays.copyOf(other.elements, other.size);
size = other.size;
}

public LNGIntVector(final int[] elements, final int size) {
public LngIntVector(final int[] elements, final int size) {
this.elements = elements;
this.size = size;
}
Expand All @@ -55,8 +55,8 @@ public LNGIntVector(final int[] elements, final int size) {
* @param elements the elements
* @return the new vector
*/
public static LNGIntVector of(final int... elements) {
final LNGIntVector result = new LNGIntVector(elements.length);
public static LngIntVector of(final int... elements) {
final LngIntVector result = new LngIntVector(elements.length);
result.elements = Arrays.copyOf(elements, elements.length);
result.size = elements.length;
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
* A simple vector for long elements implementation (inspired by MiniSat,
* CleaneLing, Sat4J).
* <p>
* In theory one could use the {@link LNGVector} also for longs. But Java's
* In theory one could use the {@link LngVector} also for longs. But Java's
* auto-boxing comes with such a large performance penalty that for the
* mission-critical data structures of the SAT solvers we use this specialized
* implementation.
* @version 3.0.0
* @since 1.0
*/
public final class LNGLongVector {
public final class LngLongVector {

private long[] elements;
private int size;

/**
* Creates a vector with an initial capacity of 5 elements.
*/
public LNGLongVector() {
public LngLongVector() {
this(5);
}

/**
* Creates a vector with a given capacity.
* @param size the capacity of the vector.
*/
public LNGLongVector(final int size) {
public LngLongVector(final int size) {
elements = new long[size];
}

Expand All @@ -42,7 +42,7 @@ public LNGLongVector(final int size) {
* @param size the capacity of the vector
* @param pad the initial element
*/
public LNGLongVector(final int size, final long pad) {
public LngLongVector(final int size, final long pad) {
elements = new long[size];
Arrays.fill(elements, pad);
this.size = size;
Expand All @@ -52,7 +52,7 @@ public LNGLongVector(final int size, final long pad) {
* Copy constructor.
* @param other the other byte vector.
*/
public LNGLongVector(final LNGLongVector other) {
public LngLongVector(final LngLongVector other) {
elements = Arrays.copyOf(other.elements, other.size);
size = other.size;
}
Expand All @@ -61,12 +61,12 @@ public LNGLongVector(final LNGLongVector other) {
* Creates a vector with the given elements.
* @param elems the elements
*/
public LNGLongVector(final long... elems) {
public LngLongVector(final long... elems) {
elements = Arrays.copyOf(elems, elems.length);
size = elems.length;
}

public LNGLongVector(final long[] elements, final int size) {
public LngLongVector(final long[] elements, final int size) {
this.elements = elements;
this.size = size;
}
Expand Down
Loading

0 comments on commit 52b2070

Please sign in to comment.