private IVariable MultiplyNonBinaryIntegers(IMilpManager baseMilpManager, IVariable[] nonBinaries, Domain domain)
        {
            var first = nonBinaries[0];
            var second = nonBinaries[1];
            var mightBeNegatives = first.Domain == Domain.AnyInteger || first.Domain == Domain.AnyConstantInteger ||
                     second.Domain == Domain.AnyInteger || second.Domain == Domain.AnyConstantInteger;
            first = MakePositiveIfNeeded(first);
            second = MakePositiveIfNeeded(second);

            var zero = baseMilpManager.FromConstant(0);
            var result = MakeLongMultiplication(baseMilpManager, domain, zero, second, first);
            result = FixSign(baseMilpManager, nonBinaries, mightBeNegatives, zero, result);
            result = result.ChangeDomain(domain);

            return result.Operation(OperationType.Multiplication, nonBinaries.Skip(2).ToArray());
        }
 private static IEnumerable<IVariable> CalculateBatches(IMilpManager milpManager, ICompositeOperationParameters parameters,
     IVariable[] arguments)
 {
     var batchSize = milpManager.IntegerWidth;
     var batches = (arguments.Length - 1)/batchSize + 1;
     return Enumerable.Range(0, batches)
         .Select(
             index =>
                 CalculateBatch(milpManager, arguments.Skip(index*batchSize).Take(batchSize).ToArray(),
                     (parameters as LexicographicalCompareParameters).Pattern.Skip(index*batchSize).Take(batchSize).ToArray()));
 }