summaryrefslogtreecommitdiff
path: root/cmd/main.c
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-03-23 15:36:22 +0100
committerJesper Jensen <jesper@jnsn.dev>2025-03-23 15:36:22 +0100
commit085906735bbadeb8e6cd47fc11610fe104080032 (patch)
tree3ae60b6feb86e24efa3bdb0fcad28ccbd9564725 /cmd/main.c
parent50da512936a9af6ad9aa808531af8f316a381dd4 (diff)
Add some cost calculation
Diffstat (limited to 'cmd/main.c')
-rw-r--r--cmd/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/main.c b/cmd/main.c
index 4e4c42d..62292f9 100644
--- a/cmd/main.c
+++ b/cmd/main.c
@@ -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++;