cg_ne


cg_ne, a Python code which implements the conjugate gradient method (CG) for the normal equations, that is, a method for solving a system of linear equations of the form A*x=b, where the matrix A is not symmetric positive definite (SPD). In this case, it is attempted to set up and solve the normal equations A'*A*x=A'*b.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

cg_ne is available in a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

cg, a Python code which implements a simple version of the conjugate gradient (CG) method for solving a system of linear equations of the form A*x=b, suitable for situations where the matrix A is symmetric positive definite (SPD) (only real, positive eigenvalues).

cg_rc, a Python code which implements the conjugate gradient method for solving a symmetric positive definite (SPD) sparse linear system A*x=b, using reverse communication.

gauss_seidel, a Python code which implements the Gauss-Seidel iteration for linear systems.

gauss_seidel_stochastic, a Python code which uses a stochastic version of the Gauss-Seidel iteration to solve a linear system with a symmetric positive definite (SPD) matrix.

jacobi, a Python code which implements the Jacobi iteration for linear systems.

Reference:

  1. William Layton, Myron Sussman,
    Numerical Linear Algebra,
    ISBN13: 978-1-312-32985-0.

Source Code:


Last revised on 28 February 2026.