예제 #1
0
 public DIPMethod(Matrix a, Matrix b, double eps, FunctionVector func)
 {
     this.a    = a;
     this.a    = b;
     this.eps  = eps;
     functions = new FunctionVector(func);
 }
예제 #2
0
 public SvenMethod(Matrix x0, FunctionVector func)
 {
     c         = x0;
     h         = new Matrix(c.N, c.M);
     h[0][0]   = 3;
     functions = new FunctionVector(func);
 }
예제 #3
0
        public void ExecuteFunctionsCastTest()
        {
            functionsMask[] f = new functionsMask[8];

            f[0] = (Matrix x) => { return(x[0][0]); };
            f[1] = (Matrix x) => { return(x[0][1]); };
            f[2] = (Matrix x) => { return(x[0][2]); };
            f[3] = (Matrix x) => { return(x[0][3]); };
            f[4] = (Matrix x) => { return(x[0][4]); };
            f[5] = (Matrix x) => { return(x[0][5]); };
            f[6] = (Matrix x) => { return(x[0][6]); };
            f[7] = (Matrix x) => { return(x[0][7]); };

            Matrix arg = new Matrix(1, f.Length);

            for (int i = 0; i < f.Length; i++)
            {
                arg[0][i] = i;
            }

            FunctionVector functionVector = new FunctionVector(f);
            Vector         res            = functionVector.ExecuteFunctions(arg);

            for (int i = 0; i < f.Length; i++)
            {
                Assert.AreEqual(res[i], i);
            }
        }
예제 #4
0
 public SquereInterpolationMethod(Matrix a, Matrix b, double eps, FunctionVector func)
 {
     this.a    = a;
     this.a    = b;
     U         = (a + b) / 2;
     this.eps  = eps;
     functions = new FunctionVector(func);
 }
예제 #5
0
        public void DelegateIntoFuncCastTest()
        {
            functionsMask[] f = new functionsMask[1];
            f[0] = (Matrix x) => { return(x[0][0]); };


            FunctionVector functionVector = new FunctionVector(f);
        }
예제 #6
0
        public StepAdaptationMethod(Matrix x0, Matrix h, double Eps, FunctionVector func)
        {
            x = x0;

            this.Eps = Eps;

            bool IsColumn   = h.M == 1;
            int  ZerosCount = 0;

            if (x.M != h.M || x.N != h.M)
            {
                throw new ArgumentException("Размер вектора аргументов и " +
                                            "вектора шага должны быть одинаковы");
            }

            if (IsColumn)
            {
                for (int i = 0; i < h.M; i++)
                {
                    if (h[1][i] != 0)
                    {
                        break;
                    }
                    else
                    {
                        ZerosCount++;
                    }
                }
                if (ZerosCount == h.M)
                {
                    throw new ArgumentException("Шаг должен быть не нулевым.");
                }
            }
            else
            {
                for (int i = 0; i < h.N; i++)
                {
                    if (h[i][1] != 0)
                    {
                        break;
                    }
                    else
                    {
                        ZerosCount++;
                    }
                }
                if (ZerosCount == h.N)
                {
                    throw new ArgumentException("Шаг должен быть не нулевым.");
                }
            }
            this.h = (Matrix)h.Clone();

            functions = new FunctionVector(func);
        }
예제 #7
0
        public DIPMethod(Matrix x0, double eps, FunctionVector func)
        {
            SvenMethod sv = new SvenMethod(x0, func);

            sv.Start();
            Dictionary <string, Matrix> borderPoints = sv.BorderPoints;

            a         = borderPoints["a"];
            b         = borderPoints["b"];
            this.eps  = eps;
            functions = new FunctionVector(func);
        }
예제 #8
0
        public SquereInterpolationMethod(Matrix x0, FunctionVector func)
        {
            SvenMethod sv = new SvenMethod(x0, func);

            sv.Start();
            Dictionary <string, Matrix> borderPoints = sv.BorderPoints;

            a         = borderPoints["a"];
            U         = borderPoints["c"];
            b         = borderPoints["b"];
            eps       = 0.001;
            functions = new FunctionVector(func);
        }
예제 #9
0
        public StepAdaptationMethod(Matrix x0, FunctionVector func)
        {
            x = x0;
            int len = x.M == 1 ? x.N : x.M;

            h = new Matrix(1, len);
            for (int i = 0; i < len; i++)
            {
                h[0][i] = 4;
            }

            functions = new FunctionVector(func);
        }
예제 #10
0
 public SvenMethod(Matrix x0, Matrix h, FunctionVector func)
 {
     c         = x0;
     this.h    = h;
     functions = new FunctionVector(func);
 }
예제 #11
0
 public Huk_DjivsMethod(Matrix x0, double eps, FunctionVector func)
 {
     x         = x0;
     this.eps  = eps;
     functions = new FunctionVector(func);
 }
예제 #12
0
 public Huk_DjivsMethod(Matrix x0, FunctionVector func)
 {
     x         = x0;
     functions = new FunctionVector(func);
 }
예제 #13
0
 public NewtonMethod(Matrix x0, double Eps, FunctionVector func)
 {
     x         = x0;
     this.Eps  = Eps;
     functions = new FunctionVector(func);
 }
예제 #14
0
 public NewtonMethod(Matrix x0, FunctionVector func)
 {
     x         = x0;
     Eps       = 0.001;
     functions = new FunctionVector(func);
 }
예제 #15
0
 public SteepestDescendMethod(Matrix x0, double Eps, FunctionVector func)
 {
     x         = x0;
     this.Eps  = Eps;
     functions = new FunctionVector(func);
 }
예제 #16
0
 public SteepestDescendMethod(Matrix x0, FunctionVector func)
 {
     x         = x0;
     Eps       = 0.001;
     functions = new FunctionVector(func);
 }