/// <summary>
        /// 获取法方程
        /// </summary>
        /// <returns></returns>
        public MatrixEquationManager GetNormalEquations()
        {
            MatrixEquationManager result = new MatrixEquationManager();

            foreach (var item in this)
            {
                result.Add(item.Name, item.NormalEquation);
            }
            return(result);
        }
Exemple #2
0
        public override MatrixEquationManager Read()
        {
            ObjectTableManagerReader reader = new ObjectTableManagerReader(Stream);

            var           tables = reader.Read();
            var           keys   = tables.Keys;
            List <string> names  = new List <string>();

            foreach (var item in keys)
            {
                var name = MatrixEquationNameBuiler.GetName(item);
                if (!names.Contains(name))
                {
                    names.Add(name);
                }
            }
            MatrixEquationManager manager = new MatrixEquationManager();

            foreach (var name in names)
            {
                var leftName     = MatrixEquationNameBuiler.GetLeftSideName(name);
                var rightName    = MatrixEquationNameBuiler.GetRightSideName(name);
                var QOfrightName = MatrixEquationNameBuiler.GetInverseWeightNameOfRightSide(name);
                var left         = tables.Get(leftName);
                var right        = tables.Get(rightName);
                var QofRightSide = tables.Get(QOfrightName);


                var n = Matrix.Parse(left);
                var u = Matrix.Parse(right);

                Matrix q = null;
                if (QofRightSide != null)
                {
                    q = Matrix.Parse(QofRightSide);
                }
                var eq = new MatrixEquation(n, u, name)
                {
                    QofU = q
                };
                manager[name] = eq;
            }
            return(manager);
        }
        public override void Write(MatrixEquationManager product)
        {
            ObjectTableManager objects = product.GetObjectTables();

            objects.WriteAsOneFile(Stream);
        }