当前位置: 首页>>代码示例>>C#>>正文


C# Mul.Execute方法代码示例

本文整理汇总了C#中xFunc.Maths.Expressions.Mul.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Mul.Execute方法的具体用法?C# Mul.Execute怎么用?C# Mul.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xFunc.Maths.Expressions.Mul的用法示例。


在下文中一共展示了Mul.Execute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteTest6

        public void ExecuteTest6()
        {
            var exp = new Mul(new Number(2), new Sqrt(new Number(-9)));
            var expected = new Complex(0, 6);

            Assert.Equal(expected, exp.Execute());
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:MulTest.cs

示例2: ExecuteTest4

        public void ExecuteTest4()
        {
            var exp = new Mul(new Number(2), new ComplexNumber(3, 2));
            var expected = new Complex(6, 4);

            Assert.Equal(expected, exp.Execute());
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:MulTest.cs

示例3: ExecuteTest3

        public void ExecuteTest3()
        {
            var exp = new Mul(new ComplexNumber(2, 5), new Number(2));
            var expected = new Complex(4, 10);

            Assert.Equal(expected, exp.Execute());
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:MulTest.cs

示例4: ExecuteTest2

        public void ExecuteTest2()
        {
            var exp = new Mul(new ComplexNumber(2, 5), new ComplexNumber(3, 2));
            var expected = new Complex(-4, 19);

            Assert.Equal(expected, exp.Execute());
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:MulTest.cs

示例5: MultiOpAddMul

        public void MultiOpAddMul()
        {
            // ({2, 3, 4} + {1, 2, 3}) * 4
            var vector1 = new Vector(new[] { new Number(1), new Number(2), new Number(3) });
            var vector2 = new Vector(new[] { new Number(2), new Number(3), new Number(4) });
            var add = new Add(vector2, vector1);
            var mul = new Mul(add, new Number(4));

            var expected = new Vector(new[] { new Number(12), new Number(20), new Number(28) });
            var result = mul.Execute();

            Assert.Equal(expected, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:13,代码来源:VectorTest.cs

示例6: MultiOpMulMul

        public void MultiOpMulMul()
        {
            // ({1, 2, 3} * 2) * 4
            var vector = new Vector(new[] { new Number(1), new Number(2), new Number(3) });
            var mul1 = new Mul(vector, new Number(2));
            var mul2 = new Mul(mul1, new Number(4));

            var expected = new Vector(new[] { new Number(8), new Number(16), new Number(24) });
            var result = mul2.Execute();

            Assert.Equal(expected, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:12,代码来源:VectorTest.cs

示例7: MultiOpSubMul

        public void MultiOpSubMul()
        {
            // ({2, 3, 4} - {1, 2, 3}) * 4
            var vector1 = new Vector(new[] { new Number(1), new Number(2), new Number(3) });
            var vector2 = new Vector(new[] { new Number(2), new Number(3), new Number(4) });
            var sub = new Sub(vector2, vector1);
            var mul = new Mul(sub, new Number(4));

            var expected = new Vector(new[] { new Number(4), new Number(4), new Number(4) });
            var result = mul.Execute();

            Assert.Equal(expected, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:13,代码来源:VectorTest.cs

示例8: ExecuteTest1

        public void ExecuteTest1()
        {
            var exp = new Mul(new Number(2), new Number(2));

            Assert.Equal(4.0, exp.Execute());
        }
开发者ID:sys27,项目名称:xFunc,代码行数:6,代码来源:MulTest.cs


注:本文中的xFunc.Maths.Expressions.Mul.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。