From 4c4eb1bd8f003b3b57707badd2dd089ed193a896 Mon Sep 17 00:00:00 2001 From: wukong Date: Fri, 10 Apr 2026 23:46:12 -0700 Subject: renamed fir window generators; minor edits to whitespace and comments for more consistent style; --- lupd.awk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lupd.awk') diff --git a/lupd.awk b/lupd.awk index 39bf00c..08e1e30 100644 --- a/lupd.awk +++ b/lupd.awk @@ -9,6 +9,7 @@ # note, matrix indexing begins with 1 and uses i=row, j=col # lu = L + U - I + # solve A[n,n] * x[n] = b[n] function lu_solve(A, b, n) { @@ -56,6 +57,7 @@ function lu_solve(A, b, n) { } + # regex to identify strings that look like numbers BEGIN { OFS = FS @@ -66,19 +68,21 @@ BEGIN { number = "^" sign "(" decimal "|" fraction ")" exponent "$" } + # column headers NR == 1 { for (y=1; y<=NF; y++) ($y ~ number) ? header[y] = "col" y : header[y] = $y } + # read input data NF > 0 { (NF > nf_max) ? nf_max = NF : nf_max = nf_max - ### columns + # columns for (y=1; y<=nf_max; y++) { - ### rows + # rows if ($y !~ number) { continue } @@ -90,12 +94,13 @@ NF > 0 { } } + END { print length(row_sum), length(col_sum) - ### columns + # columns for (y=1; y<=nf_max; y++) { if (y in col_sum) { - ### rows + # rows for (x=1; x<=NR; x++) { if (x in row_sum) { printf("[" OFMT "," OFMT "]" OFS OFMT OFS OFMT, -- cgit v1.2.3