예제 #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);