Post Reply 
How much memory may a HPPL program use on a G2?
09-13-2023, 05:03 AM (This post was last modified: 09-13-2023 05:06 AM by jte.)
Post: #50
RE: How much memory may a HPPL program use on a G2?
Another approach to handle blocks of characters when checking for matches (against a pattern of the sort mentioned above — single-character wildcards) that follows more traditional computer-y approaches would be to use 5 bits per character (assuming <= 32 different characters) for the encoding (and thus pack up to 12 characters into a 64-bit integer) and then use a mask to select which characters must match specific characters.

E.g., using
Code:
BITAND(#00001 00010 00011b,#11111 00000 11111b) = #00001 00000 00100b
to check “abc” against pattern “a?d”, where “a” is encoded as 00001, “b” as 00010, … (I’ve used extra spaces to help demarcate the 5-bit blocks.)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How much memory may a HPPL program use on a G2? - jte - 09-13-2023 05:03 AM



User(s) browsing this thread: 1 Guest(s)