home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!jepler
- From: jepler@nyx.cs.du.edu (Jeff Epler)
- Subject: Sparse 4+dimentional array?
- Message-ID: <1993Jan7.012616.11730@mnemosyne.cs.du.edu>
- Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
- Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
- Date: Thu, 7 Jan 93 01:26:16 GMT
- Lines: 30
-
- I recently created a program that creates "words" based on letter
- probabilities found in text files fed to it. It uses a table which
- relates the last two letters in the word to the probability of the next
- letter. (IE maybe "o" follows "zo" 95% of the time, but "n" does 5%).
- I now have the desire to allow the program to use a table of more than
- the past two letters.
-
- However, my compiler (No, this is *not* an implementation specific query,
- really) and OS restrict me to 640K, with no array bigger than 64K (Can you
- guess what OS this is? You're right.) -- This means that declaring such
- a large array as
- int table[27][27][27][28]
- is *not* an option.. (this is some 500K), and more levels are also "out
- of the question." However, many letter combinations will never be used
- -- ZZZ? or QAA? or QWE? -- So I concieved of the idea of using a sparse
- array.
-
- So, since I have seen (Though more often in comp.lang.pascal) posts
- which detail how to create and manipulate sparse matricies, I hope
- someone here can help me.. (All of the posts, which are probably
- expired, have only spoken about two-dimensional sparse matricies, though.)
-
- Code would be nice, (Some sparse-matrix C program even) but ideas or
- algorithm pointers would do fine.. Thanks.. (Feel free to mail or
- post -- I try to keep up in here..)
-
- --
- Jeff Epler jepler@nyx.cs.du.edu or bx304@cleveland.freenet.edu (preferred)
-
- Signature under construction
-