public override object Evaluate()
        {
            CPolynomial poly  = LeftExpression.EvaluateAsCPolynomial();
            int         order = RightExpression.EvaluateAsInt32();

            return(new CMatrix(poly.NthDerivative(order).ToArray()));
        }
Esempio n. 2
0
        public void NthDerivativeTest_Analytical()
        {
            //arrange
            CPolynomial target   = new CPolynomial(new Complex[] { 5, 8, -14, 3, 6, -22 });
            CPolynomial expected = new CPolynomial(new Complex[] { 18, 144, -1320 });

            //action
            CPolynomial actual = target.NthDerivative(3);

            //assert
            actual.Should().Be(expected);
        }
Esempio n. 3
0
        public void NthDerivativeTest()
        {
            //arrange
            CPolynomial target   = new CPolynomial(new Complex[] { 5, 8, -14, 3, 6, -22 });
            Complex     c        = 3;
            Complex     expected = -11430;

            //action
            Complex actual = target.NthDerivative(3, c);

            //assert
            actual.Should().Be(expected);
        }
Esempio n. 4
0
        public void NthDerivativeTest_Analytical()
        {
            //arrange
            CPolynomial target = new CPolynomial(new Complex[] { 5, 8, -14, 3, 6, -22 });
            CPolynomial expected = new CPolynomial(new Complex[] { 18, 144, -1320 });

            //action
            CPolynomial actual = target.NthDerivative(3);

            //assert
            actual.Should().Be(expected);
        }
Esempio n. 5
0
        public void NthDerivativeTest()
        {
            //arrange
            CPolynomial target = new CPolynomial(new Complex[] { 5, 8, -14, 3, 6, -22 });
            Complex c = 3;
            Complex expected = -11430;

            //action
            Complex actual = target.NthDerivative(3, c);

            //assert
            actual.Should().Be(expected);
        }