From adda6869cb2a07984b48c39fcd70ee76449c353d Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 9 Oct 2023 21:08:25 -0600 Subject: updates 10/9 --- notes/Oct-4.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 notes/Oct-4.org (limited to 'notes/Oct-4.org') diff --git a/notes/Oct-4.org b/notes/Oct-4.org new file mode 100644 index 0000000..8b8466f --- /dev/null +++ b/notes/Oct-4.org @@ -0,0 +1,22 @@ +[[ a_{11} a_{12} \cdots a_{1n} | b_1] + [ 0 (a_{22} - \frac{a_{}_{21}}{a_{22}}a_{11}) \cdots a_{2n} | b_2 - \frac{a_{21}}{a_{11}}b_1 ]] + +#+BEGIN_SRC c + for (int i = 1; i < n; i++) { + float factor = -a[i][0] / a[0][0]; + for (int j = 1; j < n; j++) { + a[i][j] = a[i][j] + factor * a[0][j]; + } + b[i] = b[i] + factor * b[0]; + } + + for (int k = 0; k < (n - 1); k++) { + for (int i = k+1; i < n; i++) { + float factor = -a[i][k] / a[k][k]; + for (int j = k+1; j < n; j++) { + a[i][j] = a[i][j] + factor * a[j][k]; + } + b[i] = b[i] + factor*b[k]; + } + } +#+END_SRC -- cgit v1.2.3-70-g09d2