public override MatrixEquation Read() { ObjectTableManagerReader reader = new ObjectTableManagerReader(Stream); var tables = reader.Read(); var leftSide = tables.Get("L"); var rightSide = tables.Get("R"); var n = Matrix.Parse(leftSide); var u = Matrix.Parse(rightSide); return(new MatrixEquation(n, u, Name)); }
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 MatrixEquation Read() { ObjectTableManagerReader reader = new ObjectTableManagerReader(Stream); var tables = reader.Read(); var leftSide = tables.Get(MatrixEquationNameBuiler.L); var rightSide = tables.Get(MatrixEquationNameBuiler.R); var QofRightSide = tables.Get(MatrixEquationNameBuiler.Q); var n = Matrix.Parse(leftSide); var u = Matrix.Parse(rightSide); Matrix q = null; if (QofRightSide != null) { q = Matrix.Parse(QofRightSide); } return(new MatrixEquation(n, u) { QofU = q, Name = this.Name }); }
public override IMatrix Read() { var table = ObjectTableReader.Read(this.FilePath); return(Matrix.Parse(table)); }