本文整理汇总了C#中Variables.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Variables.Clone方法的具体用法?C# Variables.Clone怎么用?C# Variables.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Variables
的用法示例。
在下文中一共展示了Variables.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QpProgressReport
public QpProgressReport(QpTerminationCode status, int iterations, double meritFunction, Variables currentIterate)
{
this.solveStatus = status;
this.iterations = iterations;
this.currentIterate = currentIterate == null ? null : currentIterate.Clone();
this.meritFunction = meritFunction;
}
示例2: DetermineProgress
public QpProgressReport DetermineProgress(Variables iterate, Residuals residuals, double mu, int count)
{
var code = QpTerminationCode.InProgress;
double residualsNorm = residuals.InfinityNorm();
double phi = ComputeMeritFunction(residuals, residualsNorm);
this.UpdateMeritFunctionHistory(phi, count);
bool isMuSatisfied = (mu < Tolerance);
bool isRnormSatisfied = (residualsNorm < Tolerance * this.dataInfinityNorm);
if (isMuSatisfied && isRnormSatisfied)
{
code = QpTerminationCode.Success;
}
else if (count >= MaxIterations)
{
code = QpTerminationCode.MaxIterationsExceeded;
}
else if (count > 20 && phi >= 1e-8 && phi >= 1e4 * this.phiMinimumHistory[count - 1])
{
code = QpTerminationCode.Infeasible;
}
else if (count >= 30 && this.phiMinimumHistory[count] >= .5 * this.phiMinimumHistory[count - 30])
{
code = QpTerminationCode.Unknown;
}
return includeDetailedReport || code != QpTerminationCode.InProgress ?
new QpProgressReport(code, count, phi, iterate.Clone()) :
new QpProgressReport(code, count, phi, null);
}