- java.lang.Object
-
- org.logicng.cardinalityconstraints.CCSorting
-
public final class CCSorting extends Object
Implementation of a sorting network.- Since:
- 1.1
- Version:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCCSorting.ImplicationDirectionThe implication direction.
-
Constructor Summary
Constructors Constructor Description CCSorting()Constructs a new sorting network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmerge(int m, LNGVector<Literal> inputA, LNGVector<Literal> inputB, EncodingResult formula, LNGVector<Literal> output, CCSorting.ImplicationDirection direction)Merges to input vectors.voidsort(int m, LNGVector<Literal> input, EncodingResult result, LNGVector<Literal> output, CCSorting.ImplicationDirection direction)Generates a sorter encoding for the given input.
-
-
-
Method Detail
-
sort
public void sort(int m, LNGVector<Literal> input, EncodingResult result, LNGVector<Literal> output, CCSorting.ImplicationDirection direction)Generates a sorter encoding for the given input.- Parameters:
m- the counterinput- the input literalsresult- the result of the encodingoutput- the output literalsdirection- the sorting direction
-
merge
public void merge(int m, LNGVector<Literal> inputA, LNGVector<Literal> inputB, EncodingResult formula, LNGVector<Literal> output, CCSorting.ImplicationDirection direction)Merges to input vectors.- Parameters:
m- parameter minputA- the first input vectorinputB- the second input vectorformula- the result formulaoutput- the output vectordirection- the sorting direction
-
-