diff options
| author | wukong <wukong@longaeva> | 2026-04-10 23:46:12 -0700 |
|---|---|---|
| committer | wukong <wukong@longaeva> | 2026-04-10 23:46:12 -0700 |
| commit | 4c4eb1bd8f003b3b57707badd2dd089ed193a896 (patch) | |
| tree | 15b62907fffd70c46a9b4369df93ab33c6aa88ac /lupd.awk | |
| parent | e7d1781578e846a7b1d634cd43c8fab00a67b883 (diff) | |
renamed fir window generators;
minor edits to whitespace and comments for more consistent style;
Diffstat (limited to 'lupd.awk')
| -rw-r--r-- | lupd.awk | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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, |
