Loading files
using System;
using System.Collections.Generic;
namespace IDE.Core.Modeling.Solver.Constraints
{
public class VerticalRef : ConstraintRefBase
{
public override double Calc(List<double> parameters)
{
var calc = parameters[L1.P2.X] - parameters[L1.P1.X];
return Math.Abs(calc);// * calc);
}
public override double Grad(List<double> parameters, int index)
{
var sign = parameters[L1.P2.X] - parameters[L1.P1.X] >= 0 ? 1 : -1;
if (index == L1.P2.X)
return sign;
if (index == L1.P1.X)
return -sign;
return 0;
}
}
}
797882a6aThis file is pinned to the selected release. Download the original to open it in your design tool.