home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19344 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.8 KB  |  41 lines

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