Platinum Partner

Matrix operations: Gaussian elimination, Upper triangulization and Back-substitution example in C

A simple example of matrix operations (Gaussian elimination, Upper triangulization and Back-substitution) which can be used for solving systems of linear equations, or matrix inversion.

/** Gaussian elimination / Upper triangulization / Back-substitution example by Adrian Boeing
 adrianboeing.blogspot.com
 www.adrianboeing.com
 */

#include 

void PrintMatrix(double **mat, int m, int n) {
    for (int j=0;j0;p--) { //pivot backwards through all the rows
        for (int r=p-1;r>=0;r--) { //for each row above the pivot
            float multiple = mat[r][p]; //how many multiples of the pivot row do we need (to subtract)?
            for (int c=p-1;c
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}