示例#1
0
        /// <summary>
        /// Intepreting real values of func as X,
        /// imaginary as Y we iterate on range [from; to]
        /// </summary>
        /// <param name="func"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        public void PlotIterativeComplex(FastExpression func, ComplexNumber from, ComplexNumber to)
        {
            Func <int, double> X = it => func.Call(((from + to) / (pointCount - 1) * it).AsComplex()).Real;
            Func <int, double> Y = it => func.Call(((from + to) / (pointCount - 1) * it).AsComplex()).Imaginary;

            BuildData(X, Y);
            destination.plt.PlotScatter(dataX, dataY);
        }
示例#2
0
        /// <summary>Intepreting real values of func as X, imaginary as Y we iterate on range [from; to]</summary>
        public void PlotIterativeComplex(FastExpression func, Entity.Number.Complex from, Entity.Number.Complex to)
        {
            double X(int it) => func.Call(((from + to) / (pointCount - 1) * it).ToNumerics()).Real;
            double Y(int it) => func.Call(((from + to) / (pointCount - 1) * it).ToNumerics()).Imaginary;

            BuildData(X, Y);
            destination.plt.PlotScatter(dataX, dataY);
        }
示例#3
0
        /// <summary>
        /// Plots from an expression over variable x
        /// </summary>
        /// <param name="expr">
        /// Expression to build
        /// </param>
        /// <param name="from">
        /// Low bound
        /// </param>
        /// <param name="to">
        /// High bound
        /// </param>
        public void PlotScatter(FastExpression func, ComplexNumber from, ComplexNumber to)
        {
            Func <int, double> inner = it => ((to - from) / (pointCount - 1) * it).Real;

            Clear();
            BuildData(inner,
                      it => func.Call(new Complex((double)inner(it), 0)).Real);
            destination.plt.PlotScatter(dataX, dataY);
            destination.Render();
        }
示例#4
0
        /// <summary>Plots from an expression over variable x</summary>
        /// <param name="expr">Expression to build</param>
        /// <param name="from">Low bound</param>
        /// <param name="to">High bound</param>
        public void PlotScatter(FastExpression func, Entity.Number.Complex from, Entity.Number.Complex to)
        {
            double inner(int it) => ((to - from) / (pointCount - 1) * it).RealPart.EDecimal.ToDouble();

            Clear();
            BuildData(inner,
                      it => func.Call(new Complex((double)inner(it), 0)).Real);
            destination.plt.PlotScatter(dataX, dataY);
            destination.Render();
        }
示例#5
0
 [Benchmark] public Complex MyCompiled() => complexFunc.Call(ComToSub);
示例#6
0
 public void RunHard()
 => toRunHard.Call(toSub);
示例#7
0
 public void RunMedium()
 => toRunMedium.Call(toSub);
示例#8
0
 public void RunEasy()
 => toRunEasy.Call(toSub);
示例#9
0
 public void MultiFunc() => multiFunc.Call(3);
示例#10
0
 [Benchmark] public void MultiFunc() => multiFunc.Call(CToSub);
示例#11
0
 public void MultiFunc() => multiFunc.Call(CToSub);
 public ComplexNumber MyCompiled() => complexFunc.Call(3);