Loading files
366e28f22This file is pinned to the selected release. Download the original to open it in your design tool.
using System.Collections.Generic;
namespace IDE.Core.Modeling.Solver.Constraints
{
public class PositiveParameter : ConstraintRefBase
{
public override double Calc(List<double> parameters)
{
var temp = parameters[Index] > 0 ? 0 : 10000;
return temp;
}
public override double Grad(List<double> parameters, int index)
{
if (index == Index)
{
return parameters[Index] > 0 ? 0 : 10000;
}
return 0;
}
}
}