protected static class Modulo2System.Modulo2Equation extends Object
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
bits
The
bv.bits(), cached. |
protected LongArrayBitVector |
bitVector
The vector representing the coefficients (one bit for each variable).
|
protected long |
c
The constant term.
|
protected int |
firstVar
The first variable.
|
| Modifier | Constructor and Description |
|---|---|
|
Modulo2Equation(long c,
int numVars)
Creates a new equation.
|
protected |
Modulo2Equation(Modulo2System.Modulo2Equation equation) |
| Modifier and Type | Method and Description |
|---|---|
Modulo2System.Modulo2Equation |
add(int variable)
Adds a new variable.
|
void |
add(Modulo2System.Modulo2Equation equation)
Add another equation to this equation.
|
Modulo2System.Modulo2Equation |
copy() |
boolean |
equals(Object o) |
boolean |
isIdentity() |
boolean |
isUnsolvable() |
static long |
scalarProduct(long[] bits,
long[] values)
Returns the modulo-2 scalar product of the two provided bit vectors.
|
String |
toString() |
void |
updateFirstVar()
Updates the information contained in
firstVar. |
int[] |
variables()
Returns an array containing the variables in increasing order.
|
protected final LongArrayBitVector bitVector
protected final long[] bits
bv.bits(), cached.protected long c
protected int firstVar
Integer.MAX_VALUE if the
first variable is not known. This field must be updated by updateFirstVar() to be meaningful.public Modulo2Equation(long c,
int numVars)
c - the constant term.numVars - the number of variables.protected Modulo2Equation(Modulo2System.Modulo2Equation equation)
public Modulo2System.Modulo2Equation add(int variable)
variable - a variable.IllegalStateException - if you try to add twice the same variable.public int[] variables()
Mainly for debugging purposes.
public void add(Modulo2System.Modulo2Equation equation)
equation - an equation.public void updateFirstVar()
firstVar.public boolean isUnsolvable()
public boolean isIdentity()
public static long scalarProduct(long[] bits,
long[] values)
bits - a bit vector represented as an array of longs.values - an array of long representing the 64-bit values associated with each variable.x and {code y}.public Modulo2System.Modulo2Equation copy()