示例#1
0
        public IActionResult FormJacobiMethod(JacobiMethod jacobiMethod)
        {
            if (jacobiMethod.VectorB != null && jacobiMethod.MatrixA != null && jacobiMethod.VectorX != null)
            {
                JacobiMethodCPlusPlus jacobiMethodCPP = new JacobiMethodCPlusPlus();

                if (jacobiMethodCPP.method(jacobiMethod.MatrixA, jacobiMethod.VectorB, jacobiMethod.VectorX, jacobiMethod.Eps))
                {
                    _jacobiMethodCPP.Result = jacobiMethodCPP.getVectorX();
                }
            }
            return(View(_jacobiMethodCPP));
        }
示例#2
0
        public IActionResult FormJacobiMethod(JacobiMethod jacobiMethod)
        {
            if (jacobiMethod.VectorB != null && jacobiMethod.MatrixA != null && jacobiMethod.VectorX != null)
            {
                try
                {
                    JacobiMethodCPlusPlus jacobiMethodCPP = new JacobiMethodCPlusPlus();

                    if (jacobiMethodCPP.method(jacobiMethod.MatrixA, jacobiMethod.VectorB, jacobiMethod.VectorX, jacobiMethod.Eps))
                    {
                        _jacobiMethodCPP.Result = jacobiMethodCPP.getVectorX();
                    }
                    else
                    {
                        _jacobiMethodCPP.Result = "It is not strictly diagonally dominant system of linear equations.";
                    }
                }
                catch (Exception) { }
            }
            return(View(_jacobiMethodCPP));
        }