Beispiel #1
0
        public void Update_Function_Param2(int[] grays, double[] Voltages)
        {
            SJH_Matrix M = new SJH_Matrix();

            double[][] A = M.MatrixCreate(DP213_Static.Max_Gray_Amount, DP213_Static.Max_Gray_Amount);

            for (int i = 0; i <= (DP213_Static.Max_Gray_Amount - 1); i++)
            {
                int count = 0;
                for (int j = (DP213_Static.Max_Gray_Amount - 1); j >= 0; j--)
                {
                    //A[i][count] = Math.Pow(Voltages[i], j);
                    A[i][count++] = Math.Pow(grays[i], j);
                }
            }

            //C = M.Matrix_Multiply(M.MatrixInverse(A), DoubleGrays);
            C = M.Matrix_Multiply(M.MatrixInverse(A), Voltages);
        }
Beispiel #2
0
        public void Update_Function_Param(int[] grays, double[] Voltages)
        {
            SJH_Matrix M = new SJH_Matrix();

            double[][] A = M.MatrixCreate(DP213_Static.Max_Gray_Amount, DP213_Static.Max_Gray_Amount);

            for (int i = 0; i <= (DP213_Static.Max_Gray_Amount - 1); i++)
            {
                int count = 0;
                for (int j = (DP213_Static.Max_Gray_Amount - 1); j >= 0; j--)
                {
                    A[i][count++] = Math.Pow(Voltages[i], j);
                }
            }

            double[] DoubleGrays = new double[grays.Length];
            for (int i = 0; i < grays.Length; i++)
            {
                DoubleGrays[i] = Convert.ToDouble(grays[i]);
            }

            C = M.Matrix_Multiply(M.MatrixInverse(A), DoubleGrays);
        }