public void DeBoorB_behavior() { //setup double x = 0.1d; MyMathLib.Grid tau = new MyMathLib.Grid(4, 6, 0, 5); int index = 0; int deg = 4; Console.WriteLine("сетка = " + tau.ToString()); //run double B = MyMathLib.BasisSpline.DeBoorMethods.DeBoorB(x, tau, deg, index); bool expect = B > 0; //compare Assert.AreEqual(expect, true); }
public void CreateNewBasisSplineGrid_CountMustbe11() { //enter data int deg = 4; int GridSize = 7; double a = 0; double b = 1; MyMathLib.Vector knots = MyMathLib.Vector.CreateUniformGrid(GridSize, a, b); int expect = 11; //code MyMathLib.Grid tau = new MyMathLib.Grid(deg, knots, a, b); int actual = tau.Count; Console.WriteLine(tau.ToString()); Console.WriteLine(tau.ToStringOrigin()); //compare Assert.AreEqual(expect, actual, "Неверный расчет сетки для базисного сплайна"); }