diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2025-03-23 15:36:22 +0100 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2025-03-23 15:36:22 +0100 |
| commit | 085906735bbadeb8e6cd47fc11610fe104080032 (patch) | |
| tree | 3ae60b6feb86e24efa3bdb0fcad28ccbd9564725 /cmd/main.c | |
| parent | 50da512936a9af6ad9aa808531af8f316a381dd4 (diff) | |
Add some cost calculation
Diffstat (limited to 'cmd/main.c')
| -rw-r--r-- | cmd/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -51,6 +51,18 @@ int main(int argc, char **argv) { 2, 1, 1, 0, 1, 2, 1, 1, 1, 1 ); + for(size_t i = 0; i < 4; i++) { + size_t a_tag_end = a_chunks[i]; + while(a[a_tag_end] != '>') a_tag_end++; + size_t a_len = a_tag_end - a_chunks[i]; + *imat_uint32_t(cost, i+1, 0) = a_len; + } + for(size_t j = 0; j < 4; j++) { + size_t b_tag_end = b_chunks[j]; + while(b[b_tag_end] != '>') b_tag_end++; + size_t b_len = b_tag_end - b_chunks[j]; + *imat_uint32_t(cost, 0, j+1) = b_len; + } for(size_t j = 0; j < 4; j++) { size_t b_tag_end = b_chunks[j]; while(b[b_tag_end] != '>') b_tag_end++; |
