Beispiel #1
0
 public static Matrix operator -(Matrix A, Matrix B)
 {
     return(MatrixComputation.Subtract(A.elements, B.elements));
 }
Beispiel #2
0
        //求Q
        internal static double[,] GetQ(double[,] A, double[,] X, double[,] L, int PointCount)
        {
            /*
             * 平差课本
             * (P130,7-3-2) 单位权中误差σ0 = √((V^(T)*PV)/r)
             * P = I
             * (P112,7-1-4)V = AX - L
             * r = n - t
             * (P132,表7-9) Qxx = NBB^(-1) = (A^(T)*PA)^(-1)
             * (P133,7-3-15) σx = σ0 * √Qxx
             */

            double m0 = Math.Sqrt((MatrixComputation.Multiply(MatrixComputation.Transpose(MatrixComputation.Subtract(MatrixComputation.Multiply(A, X), L)), MatrixComputation.Subtract(MatrixComputation.Multiply(A, X), L))[0, 0] / (2 * PointCount - 6)));

            double[,] Q = MatrixComputation.Inverse(MatrixComputation.Multiply(MatrixComputation.Transpose(A), A));
            for (int i = 0; i < Q.GetLength(0); i++)
            {
                for (int j = 0; j < Q.GetLength(1); j++)
                {
                    Q[i, j] = Math.Sqrt(Q[i, j]) * m0;
                }
            }
            return(Q);
        }