Public
Edited
Dec 6, 2022
Fork of RREF
Insert cell
md`# RREF`
Insert cell
M = [
[6, 1, 5, 5],
[0, 0, 0, -1],
[-12, -2, -10, -9],
[2, 1, 1, 0]
]
Insert cell
Insert cell
Insert cell
Insert cell
function* RowReduce(m, n, zero) {
let i;
let j;
let ip;
let sm = {
init: function() {
i = 1;
j = 1;
ip = 1;
return 'search';
},
search: function() {
if (zero(i, j)) {
i = i + 1;
if (i > m) {
i = ip;
j = j + 1;
}
if (j > n) return 'stop';
return 'search';
} else {
return 'pivot';
}
},
pivot: function() {
return 'scale';
},
scale: function() {
return 'swap';
},
swap: function() {
i = 1;
return 'eliminate';
},
eliminate: function() {
i = i + 1;
if (i > m) {
j = j + 1;
if (j > n) return 'stop';
ip = ip + 1;
i = ip;
if (i > m) return 'stop';
return 'search';
} else return 'eliminate';
}
};
let st = 'init';
do {
st = sm[st]();
yield { action: st, i, j, ip };
} while (st !== 'stop');
}
Insert cell
Insert cell
anime = require('https://unpkg.com/animejs/lib/anime.min.js')
Insert cell
Guacyra = require('guacyra')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more