Exemple #1
0
        /// <summary>
        /// 提取观测量的权逆阵。是否只提取对角阵??
        /// </summary>
        /// <param name="fileA"></param>
        /// <param name="fileB"></param>
        /// <returns></returns>
        public static double[][] GetCovaMatrixOfObs(SinexFile fileA, SinexFile fileB)
        {
            int paramCountA = fileA.EstimateParamCount;
            int row         = paramCountA + fileB.EstimateParamCount;

            double[][] array = MatrixUtil.Create(row);

            //fileA直接设置。
            //这里应该定权!
            SinexStatistic statisticA = fileA.GetStatistic();
            SinexStatistic statisticB = fileB.GetStatistic();

            SinexStatistic statisticNew = SinexStatistic.Merge(statisticA, statisticB);
            double         varFactorA   = statisticNew.VarianceOfUnitWeight / statisticA.VarianceOfUnitWeight;
            double         varFactorB   = statisticNew.VarianceOfUnitWeight / statisticB.VarianceOfUnitWeight;

            double[][] matrixA = fileA.GetEstimateCovaMatrix();
            double[][] matrixB = fileB.GetEstimateCovaMatrix();

            MatrixUtil.Multiply(matrixA, varFactorA);
            MatrixUtil.Multiply(matrixB, varFactorB);

            MatrixUtil.SetSubMatrix(array, matrixA);
            MatrixUtil.SetSubMatrix(array, matrixB, paramCountA, paramCountA);

            return(array);
        }
Exemple #2
0
        private void button_exportEstimateLCova_Click(object sender, EventArgs e)
        {
            if (!file.HasEstimateCovaMatrix)
            {
                MessageBox.Show("估值协方差为空!"); return;
            }

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.FileName = "EstimateCova.txt";
            saveFileDialog1.Filter   = "文本文档(*.txt)|*.txt";
            if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MatrixUtil.Print(new FileStream(saveFileDialog1.FileName, FileMode.Create),
                                 file.GetEstimateCovaMatrix());
                FormUtil.ShowIfOpenDirMessageBox(saveFileDialog1.FileName);
            }
        }