示例#1
0
        /// <summary>
        /// 合并,产生新的。
        /// </summary>
        /// <param name="linesA"></param>
        /// <param name="linesB"></param>
        /// <returns></returns>
        public static List <MatrixLine> Merge(List <MatrixLine> linesA, List <MatrixLine> linesB)
        {
            double[][]        matrixA = SinexMatrixConvertor.GetMatrixArrayJagged(linesA);
            double[][]        matrixB = SinexMatrixConvertor.GetMatrixArrayJagged(linesB);
            double[][]        matrixC = MatrixUtil.BuildMatrix(matrixA, matrixB);
            List <MatrixLine> lines   = SinexMatrixConvertor.GetMatrixLines(matrixC);

            return(lines);
        }
示例#2
0
        /// <summary>
        /// 更新标准差
        /// </summary>
        /// <param name="merge"></param>
        /// <param name="SolutionValueBlockMerged"></param>
        public static void UpdateStdDev(SolutionMatrixBlock merge, ICollectionBlock <SolutionValue> SolutionValueBlockMerged)
        {
            //更新标准差
            double[] steDevs = SinexMatrixConvertor.GetStdDevs(merge.Items);
            int      i       = 0;

            foreach (var item in SolutionValueBlockMerged.Items)
            {
                item.StdDev = steDevs[i];
                i++;
            }
        }
示例#3
0
        /// <summary>
        /// 合并,产生新的。
        /// 乘以协方差系数。 varFactor = NowFactor / OldFactor
        /// </summary>
        /// <param name="list1"></param>
        /// <param name="varFactorA"></param>
        /// <param name="list2"></param>
        /// <param name="varFactorB"></param>
        /// <returns></returns>
        public static List <MatrixLine> Merge(List <MatrixLine> linesA, double varFactorA, List <MatrixLine> linesB, double varFactorB)
        {
            double[][] matrixA = SinexMatrixConvertor.GetMatrixArrayJagged(linesA);
            double[][] matrixB = SinexMatrixConvertor.GetMatrixArrayJagged(linesB);
            //乘以协方差系数。
            MatrixUtil.Multiply(matrixA, varFactorA);
            MatrixUtil.Multiply(matrixB, varFactorB);

            double[][]        matrixC = MatrixUtil.BuildMatrix(matrixA, matrixB);
            List <MatrixLine> lines   = SinexMatrixConvertor.GetMatrixLines(matrixC);

            return(lines);
        }
示例#4
0
        /// <summary>
        /// 合并协方差阵,并更新标准差。
        /// </summary>
        /// <param name="merge"></param>
        /// <param name="solutionMatrixBlockA"></param>
        /// <param name="varFactorA"></param>
        /// <param name="solutionMatrixBlockB"></param>
        /// <param name="varFactorB"></param>
        /// <param name="SolutionValueBlockMerged"></param>
        public static void MergeSolutionMatrix(
            SolutionMatrixBlock merge,
            SolutionMatrixBlock solutionMatrixBlockA,
            double varFactorA,
            SolutionMatrixBlock solutionMatrixBlockB,
            double varFactorB,
            ICollectionBlock <SolutionValue> SolutionValueBlockMerged)
        {
            if (solutionMatrixBlockA != null && solutionMatrixBlockA.Items.Count != 0)
            {
                merge.Items =
                    SinexMatrixConvertor.Merge(
                        solutionMatrixBlockA.Items, varFactorA,
                        solutionMatrixBlockB.Items, varFactorB);

                UpdateStdDev(merge, SolutionValueBlockMerged);
            }
        }
示例#5
0
        /// <summary>
        /// 清除非坐标的信息。同时清理对应的矩阵。
        /// </summary>
        /// <param name="solutionValues"></param>
        /// <param name="matrixBlock"></param>
        public static void CleanNonCoordSolutionValue(ICollectionBlock <SolutionValue> solutionValues, SolutionMatrixBlock matrixBlock)
        {
            if (solutionValues == null || solutionValues.Items == null || solutionValues.Items.Count == 0)
            {
                return;
            }

            List <int> tobeRemoveIndexes = new List <int>();
            int        index             = 0;

            foreach (var item in solutionValues.Items)
            {
                if (item.ParameterType != ParameterType.STAX &&
                    item.ParameterType != ParameterType.STAY &&
                    item.ParameterType != ParameterType.STAZ)
                {
                    tobeRemoveIndexes.Add(index);
                }
                index++;
            }

            for (int i = tobeRemoveIndexes.Count - 1; i >= 0; i--)
            {
                solutionValues.Items.RemoveAt(tobeRemoveIndexes[i]);
            }

            //清理对应的矩阵
            if (matrixBlock == null || matrixBlock.Items.Count == 0)
            {
                return;
            }
            double[][] matrix        = SinexMatrixConvertor.GetMatrix(matrixBlock.Items);
            double[][] cleanedMatrix = MatrixUtil.ShrinkMatrix(matrix, tobeRemoveIndexes);

            //更新
            matrixBlock.Items = SinexMatrixConvertor.GetMatrixLines(cleanedMatrix);
        }
示例#6
0
 public static SolutionMatrixBlock CreateSolutionMatrixAprioriCova(double[][] matrix)
 {
     return(CreateSolutionMatrixAprioriCova(SinexMatrixConvertor.GetMatrixLines(matrix)));
 }
示例#7
0
 /// <summary>
 /// 法方程系数阵
 /// </summary>
 /// <returns></returns>
 public double[][] GetNormalEquationMatrix()
 {
     return(SinexMatrixConvertor.GetMatrix(this.SolutionNormalEquationMatrix.Items));
 }
示例#8
0
 /// <summary>
 /// 估值协方差阵。
 /// </summary>
 /// <returns></returns>
 public double[][] GetEstimateCovaMatrix()
 {
     return(SinexMatrixConvertor.GetMatrix(SolutionMatrixEstimateCova.Items));
 }
示例#9
0
 /// <summary>
 /// 得到先验协方差阵。
 /// </summary>
 /// <returns></returns>
 public double[][] GetAprioriCovaMatrix()
 {
     return(SinexMatrixConvertor.GetMatrix(SolutionMatrixAprioriCova.Items));
 }