Elementary Operations

Overview

The Gaussian eliminatoin method is a method for soliving systems of linear equations such as

Scaling

Scale multiplies one row by a scalar, a.
\begin{bmatrix} 1 & 0 & 0 \\ 0 & a & 0\\ 0 & 0 & 1 \\ \end{bmatrix}

Addition

Addition adds a times one row to another column
\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0\\ a & 0 & 1 \\ \end{bmatrix}

Interchange

Interchange switches on row for another.
\begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0\\ 0 & 0 & 1 \\ \end{bmatrix}

Example




	let la = await import('/lib/linear-algebra/v1.0.0/linear-algebra.mjs');
	
	let matrix = [[1,2,3],[4,5,6],[7,8,9]];
	
	let a=10;
	let interchange = [[0,1,0],[1,0,0],[0,0,1]];
	let scale = [[1,0,0],[0,a,0],[0,0,1]];
	let add = [[1,0,0],[0,1,0],[a,0,1]]
	
	let result1 = la.multiply(interchange, matrix);
	let result2 = la.multiply(scale, matrix);
	let result3 = la.multiply(add, matrix);
	
Try it!