コード例 #1
0
ファイル: EquationSolver.cs プロジェクト: Hadishh/AP97982
        /// <summary>
        /// Creates Matrix of multiples and returns it
        /// </summary>
        /// <returns></returns>
        public SquareMatrix <double> CreateMatrix()
        {
            SquareMatrix <double> matrix = new SquareMatrix <double>(AllVariables.Count);

            RighSide = new Vector <double>(AllVariables.Count);
            foreach (var equation in AllEquations)
            {
                RighSide.Add(equation.RightSide);
                matrix.Add(EquationParser.GetVetcor(equation.LeftSide, AllVariables));
            }
            for (int i = AllEquations.Count; i < matrix.Size; i++)
            {
                matrix.Add(new Vector <double>(matrix.Size));
            }
            return(matrix);
        }
コード例 #2
0
ファイル: EquationUI.cs プロジェクト: Hadishh/AP97982
 /// <summary>
 /// Finds new function for equation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void UpdateFunction()
 {
     try
     {
         Function = EquationParser.GetDelegate(DataTextBox.Text);
         double outputTest = Function(0.0000001);
     }
     catch (ArgumentException)
     {
         Function = null;
     }
     catch (KeyNotFoundException)
     {
         Function = null;
     }
     catch
     {
         Function = null;
         throw;
     }
 }