本文整理汇总了C#中IVariable.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# IVariable.Skip方法的具体用法?C# IVariable.Skip怎么用?C# IVariable.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVariable
的用法示例。
在下文中一共展示了IVariable.Skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiplyNonBinaryIntegers
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());
}
示例2: CalculateBatches
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()));
}