public void add ( final Modulo2Equation equation ) { int i = 0 , j = 0 , k = 0 ; final int s = variables . size ( ) , t = equation . variables . size ( ) ; final int [ ] a = variables . elements ( ) , b = equation . variables . elements ( ) , result = new int [ s + t ] ; if ( t != 0 && s != 0 ) { for ( ; ; ) { if ( a [ i ] < b [ j ] ) { result [ k ++ ] = a [ i ++ ] ; if ( i == s ) break ; } else if ( a [ i ] > b [ j ] ) { result [ k ++ ] = b [ j ++ ] ; if ( j == t ) break ; } else { i ++ ; j ++ ; if ( i == s ) break ; if ( j == t ) break ; } } } while ( i < s ) result [ k ++ ] = a [ i ++ ] ; while ( j < t ) result [ k ++ ] = b [ j ++ ] ; c ^= equation . c ; variables . size ( k ) ; System . arraycopy ( result , 0 , variables . elements ( ) , 0 , k ) ; }
Adds the provided equation to this equation .