private void GaussSeidelIteration(MatrixEquation <Double> eq, Matrix <Double> newVector, int i)
        {
            IMatrixDataType <double> x = new MatrixDouble(0);

            for (int j = 0; j < eq.A.ColCount; j++)
            {
                if (i != j)
                {
                    x = (x.Add(eq.A.ValueMatrix[i][j].Multiply(newVector.ValueMatrix[j][0])));
                }
            }
            x = x.Multiply(MatrixDouble.MINUSONE);
            x = x.Add(eq.B.ValueMatrix[i][0]);
            x = x.Divide(eq.A.ValueMatrix[i][i]);

            newVector.ValueMatrix[i][0] = x;
        }
Example #2
0
 public IMatrixDataType <double> GetInverse()
 {
     return(ONE.Divide(this));
 }