Commit Graph

  • db8fa8ae80 add getPrefixList to bro-tree (just folds over the tree in O(n) time, which is the best we can do for that data structure). Will add a benchmark comparison of this. Humza Shahid 2024-09-11 11:25:33 +01:00
  • af504350c7 further improvements to conv-words.sml, escaping chars when necessary, as we may generate an invalid .sml file otherwise Humza Shahid 2024-09-11 10:01:30 +01:00
  • 442f9f88d2 better word tokenisation algorithm in bench/conv-words.sml Humza Shahid 2024-09-11 09:50:07 +01:00
  • 662be1da75 a bit of progress moving insert functions into zip-string-set.sml Humza Shahid 2024-09-10 09:05:41 +01:00
  • f97d092996 implement getPrefixSubtrie to ZipStringSet Humza Shahid 2024-09-09 21:42:56 +01:00
  • ede0da6643 alternative isEmpty implementation in string-set.sml Humza Shahid 2024-09-09 18:22:56 +01:00
  • 6228a259bc extract more duplicated code into reusable functions (in src/string-set.sml) Humza Shahid 2024-09-09 18:17:07 +01:00
  • 272ccf1b03 amend compilation errors in zip-string-set.sml Humza Shahid 2024-09-09 18:04:11 +01:00
  • dbc0fdc178 progress with zip-string-set.sml (refactored up to the exists function), and reduce code duplication for one case in string-set.sml Humza Shahid 2024-09-09 17:39:45 +01:00
  • b7a365c6b8 implement 'exists' function on bro-tree as well, and benchmark it compared to string-set Humza Shahid 2024-09-09 15:57:58 +01:00
  • fc0fd6923b use larger set of words in words.txt dataset Humza Shahid 2024-09-09 15:19:18 +01:00
  • 7d707c9af4 add insert benchmark comparing StringSet to BroTree (StringSet is just a few ms faster for this) Humza Shahid 2024-09-09 14:54:25 +01:00
  • 4a16daaa1a begin coding bro-tree for benchmarks Humza Shahid 2024-09-09 14:20:25 +01:00
  • 6c9c6947cf implement foldl, foldlWithPrefix, foldr and foldrWithPrefix Humza Shahid 2024-09-09 07:08:00 +01:00
  • d1fb058186 add license, readme, and small to-do list Humza Shahid 2024-09-08 05:38:46 +01:00
  • 0d571468e7 use signature for StringSet Humza Shahid 2024-09-08 05:05:16 +01:00
  • 5d121f3864 done testing string-set.sml, with all tests passing Humza Shahid 2024-09-08 04:57:41 +01:00
  • 36c9b45c1a handle duplicates in insertion into trie properly (return same trie if it already has a FOUND/FOUND_WITH_CHILDREN node awith that key, or change tag of node from CHILDREN to FOUND_WITH_CHILDREN to mark it as inserted Humza Shahid 2024-09-08 04:41:14 +01:00
  • 88c48b0592 add 1-line toList function to StringSet, which is not useful to me but very convenient to add Humza Shahid 2024-09-07 21:57:01 +01:00
  • 738e7d93d1 fix all bugs in remove5; now, all remove tests have been ported and they all pass fully; should port other tests from KTrie next too Humza Shahid 2024-09-07 21:54:11 +01:00
  • 01d79cd801 address a bug where Vector.sub (keys, ~1) was used, solving subscript error, but revealing another error in a subsequent test case Humza Shahid 2024-09-07 21:35:31 +01:00
  • 352e4ff611 identify error (subscript raised) with a comment by the offending line stating that it needs to be fixed Humza Shahid 2024-09-07 20:56:21 +01:00
  • 65070d1b52 add test for removal Humza Shahid 2024-09-07 16:50:31 +01:00
  • 3c02a47c2e add getPrefixList tests Humza Shahid 2024-09-07 16:44:41 +01:00
  • ab1b7e4557 I think I'm done coding removal functionality; next thing to do is test it Humza Shahid 2024-09-06 10:31:52 +01:00
  • 9154fe5b3f added empty value for trie (which is different from an empty type constructor), and check against empty at the start of insert and search/exists function Humza Shahid 2024-09-05 03:06:00 +01:00
  • 7cfa393e05 tested getPrefixList, fixed errors, and now it seems to work fine Humza Shahid 2024-09-04 19:30:29 +01:00
  • dd41c971e3 seem to have fixed error with 'exists' function previously mentioned in todo, without introducing regressions Humza Shahid 2024-09-04 18:57:39 +01:00
  • b2b0837524 just formatting, and removing part of the todo list Humza Shahid 2024-09-04 16:39:13 +01:00
  • 20de15b349 fixed 'helpExists' function; error was in the FOUND case which checked 'keyPos = String.size searchKey' instead of 'keyPos = String.size searchKey - 1'. The latter is correct, because it checks that the keyPos ended at the last character, which is the intended meaning Humza Shahid 2024-09-04 16:38:27 +01:00
  • 86f171cd08 try implementing getPrefixList function, but it seems insert function has an error, so made a note of it to fix this error in a comment; fixing this error is the first priority Humza Shahid 2024-09-04 15:26:21 +01:00
  • ccd0ee42d5 add function to retrieve prefix subtrie (but will still want a function that returns a list of prefixes, and a vector of prefixes Humza Shahid 2024-09-04 14:56:20 +01:00
  • 65eff83c0b fix error with 'helpExists' function; the error was that we recursed in 'helpExists' function by calling keyPos + 1 (nextKeyPos) which is the wrong way to search when the trie key has a string size larger than 1 Humza Shahid 2024-09-04 13:32:45 +01:00
  • 6696480a39 amend a couple of errors (wrong sorting for some strings), and add todo for bug discovered Humza Shahid 2024-09-04 13:14:54 +01:00
  • ec7ff7ede6 some refactoring (and progress filling in the FOUND_WITH_CHILDREN case in the 'helpInsert' function) Humza Shahid 2024-09-04 12:17:06 +01:00
  • 0d25b88caa change 'helpInsert' function to return trie instead of trie option (I would guess there are fewer cases where the same string is inserted into the trie repeatedly) Humza Shahid 2024-09-04 12:05:43 +01:00
  • 90019de17f amend bug in 'insertBinSearch' function which caused subscriptt error, thereby addressing one of the todo items Humza Shahid 2024-09-04 11:53:00 +01:00
  • 7a4a99a408 add 'fromList' convenience function Humza Shahid 2024-09-04 08:16:56 +01:00
  • 38b534d935 discover error, make note of it, and update todo comment Humza Shahid 2024-09-04 08:11:43 +01:00
  • fa3245b47c progress coding insert function Humza Shahid 2024-09-04 07:54:35 +01:00
  • 88ec026921 progress with coding insert function Humza Shahid 2024-09-03 22:09:31 +01:00
  • f518ebb4b3 progress with insert function, adding note for next todo Humza Shahid 2024-09-03 20:16:39 +01:00
  • 2f14c99952 init with working 'exists' function for string set Humza Shahid 2024-09-03 10:15:55 +01:00
  • 2d6ee874af improve A (add space for other fonts to have tail, make the width a little narrower), and create new directory for fonts Humza Shahid 2024-08-30 22:01:24 +01:00
  • 42c4b92105 address edge case where Real32.toString 1.0 seems to give the string '1' instead of '1.0', and improve the drawing for upper case A Humza Shahid 2024-08-30 11:13:08 +01:00
  • c16fa58bf6 fix bug caused by the calculation change in the previous commit Humza Shahid 2024-08-30 09:15:33 +01:00
  • f3a0eb3e30 minor change to generated export code (avoid redundant maths operations) Humza Shahid 2024-08-30 05:20:56 +01:00
  • db92b95c41 tick another item off from the to-do list in the readme Humza Shahid 2024-08-30 03:57:13 +01:00
  • f5b0c8e705 tested export functionality, and fixed it so that it works as intended (previous error was that the drawn object was located on the wrong part of the Y-axis) Humza Shahid 2024-08-30 03:46:05 +01:00
  • acd68a055d code shortcut to trigger export (with <Ctrl-E>); it outputs syntatically valid .sml, but I am not sure if the output is correct as intended so it needs testing Humza Shahid 2024-08-30 02:34:24 +01:00
  • 7ab7b8931d code function to export triangle to .sml file (linear interpolation only; untested and also not currently executable by shortcut Humza Shahid 2024-08-30 02:22:02 +01:00
  • da2a652506 improve parsing code slightly, with successful parsing when saved .dsc file has inconsistent spacing Humza Shahid 2024-08-29 11:18:17 +01:00
  • 24bc45142d slight refactoring (move pure parsing functions to functional core in a separate file) Humza Shahid 2024-08-29 09:55:08 +01:00
  • 3bc43aec3a update readme to mark another to-do task as done Humza Shahid 2024-08-29 05:41:26 +01:00
  • e69c6b42ef done with loading file into app (loaded triangles are visible, etc.) Humza Shahid 2024-08-29 05:38:58 +01:00
  • 2549703dc7 verify that parsing saved file is successful Humza Shahid 2024-08-29 05:21:04 +01:00
  • f0958686b7 implement parser for loading (but this parser is untested) Humza Shahid 2024-08-29 04:39:23 +01:00
  • 84b7a6a2f5 minor changes to saved format Humza Shahid 2024-08-29 03:59:47 +01:00
  • 1fdd4f33ec remember to close file descriptor in file thread Humza Shahid 2024-08-29 00:43:51 +01:00
  • eb13636993 very basic saving (hardcoded file name, which is fine fow now) Humza Shahid 2024-08-29 00:05:30 +01:00
  • c40e8b98e0 slight renaming of constructors in FileMessage.t datatype, to provide more clarity (SAVE_TRIANGLES is for saving to a custom format, LOAD_TRIANGLES is for loading from a file in that custom format, and export is for generating code from custom format) Humza Shahid 2024-08-28 20:47:40 +01:00
  • 48c721e29b done with scaffolding for file mailbox; next, send message to file mailbox to export and import, and handle these messages properly from the file mailbox Humza Shahid 2024-08-28 20:42:52 +01:00
  • e587c6cf73 preparation for adding new additional threads/mailboxes (namely, the file mailbox) Humza Shahid 2024-08-28 20:11:00 +01:00
  • fb9202248c a little refactoring (different CML loops have their own files now) Humza Shahid 2024-08-28 19:34:47 +01:00
  • 0a4de92862 in C files where GLFW is included, #define GLFW_INCLUDE_NONE before GLFW is included in that file, because GLFW tries looking for <GL/gl.h> header otherwise, which is not on my system Humza Shahid 2024-08-28 00:58:12 +01:00
  • 1049f2b561 scaffolding in preparation for adding simple load/export/save functionality Humza Shahid 2024-08-17 09:46:53 +01:00
  • 3f4c52e0d8 upload new dots to GPU when there is a window resize too Humza Shahid 2024-08-14 21:35:01 +01:00
  • 30dd9de17a rename 'button' (the coloured square that appears over a clickpoint) to 'dot' throughout codebase, because I may want actual buttons later Humza Shahid 2024-08-14 21:24:46 +01:00
  • abddddbc9e fix minor bug when resizing (resizing caused graph to be drawn and resized, even when graph was toggled off) Humza Shahid 2024-08-14 03:54:52 +01:00
  • a3290337a0 done adding ability to toggle graph by pressing 'g' Humza Shahid 2024-08-14 02:35:44 +01:00
  • 9b639c9c53 progress towards toggling graph Humza Shahid 2024-08-14 02:31:28 +01:00
  • 575b8d009e amend order of Glfw.swapBuffers and Glfw.pollEvents in imperative shell (previous order polled events before swapping buffers which is not the intended order) Humza Shahid 2024-08-14 02:00:07 +01:00
  • dd9ecfcbe5 delete shaders after linking them in program, which reduces memory by like 0.1 MB (very minor) Humza Shahid 2024-08-14 01:44:30 +01:00
  • c740e5d751 delete shaders after linking them in program, which reduces memory by like 0.1 MB (very minor) Humza Shahid 2024-08-14 01:43:53 +01:00
  • 0c76edfde2 remove graph lines vector from app type, so the vector can be garbage collected (it is not really needed) Humza Shahid 2024-08-13 23:49:34 +01:00
  • 6878f7fa58 a little clean up (make the ClickPoints.getClickPosition easier for callers to use, because fewer arguments need to be passed) Humza Shahid 2024-08-13 23:38:04 +01:00
  • 1dccd14cfa rearrange dotscape.mlb a little Humza Shahid 2024-08-13 23:28:21 +01:00
  • c475a06341 fix minor bug with undo (was meant to call TriangleStage.secondToVector with an initial empty vector in one case, for drawing, but mistakenly used a non-empty vector as initial) Humza Shahid 2024-08-11 15:02:04 +01:00
  • d9c7b753f8 100/home/humza/Downloads/sml/dotscape/README.md done with undo/redo functionality (tested and both of them work as expected) Humza Shahid 2024-08-08 23:52:49 +01:00
  • 541fdd877f fix minor compiler errors Humza Shahid 2024-08-08 23:45:24 +01:00
  • 4d0d8ef0a1 done with functional-core logic for redo (now just need to send REDO_ACTION on key callback when shortcut is pressed) Humza Shahid 2024-08-08 23:43:38 +01:00
  • 10b3617689 add redo stack, and adjust functions to clear it when new triangle or triangle_stage is added; when an undo function is called, the undoHd becomes the redoHd, and undo becomes undoTl, which is expected behaviour. Still need to implement REDO_ACTION though. Humza Shahid 2024-08-08 23:10:38 +01:00
  • 4243e4c679 refactor a little bit, making signature of app-update.sml simpler to use by storing mouseX and mouseY inside the app_type Humza Shahid 2024-08-08 21:58:50 +01:00
  • 89f4ae3b13 undo implemented and working fine Humza Shahid 2024-08-08 21:35:48 +01:00
  • 5c7c61586a scaffolding in preparation for implementing undo Humza Shahid 2024-08-08 06:34:40 +01:00
  • a53c5e1ce3 restore imperative shell Humza Shahid 2024-08-08 05:56:20 +01:00
  • 1264e20dc8 remove instances of 'local ... in ... end', replacing it with opauque structures with signatures, because I like the lower indentation level and additional whitespace in the latter Humza Shahid 2024-08-08 01:37:46 +01:00
  • d9607d27d8 done refactoring functional core Humza Shahid 2024-08-08 00:58:59 +01:00
  • 2dd0ec5c66 additional refactoring (almost 100/home/humza/Downloads/sml/dotscape/dotscape.mlb done refactoring functional core) Humza Shahid 2024-08-08 00:50:36 +01:00
  • 894dca2017 begin refactoring Humza Shahid 2024-08-08 00:18:03 +01:00
  • 7c2f74b33b additional readme formatting Humza Shahid 2024-08-06 09:23:30 +01:00
  • 4a4916f032 additional readme formatting Humza Shahid 2024-08-06 09:23:02 +01:00
  • c4a13c0052 readme formatting Humza Shahid 2024-08-06 09:20:54 +01:00
  • 14be406e39 formatting Humza Shahid 2024-08-06 09:18:21 +01:00
  • ebcc1cfb31 add readme Humza Shahid 2024-08-06 09:15:51 +01:00
  • 78bd7a31cb add gif animation to repository to display the program Humza Shahid 2024-08-06 08:01:47 +01:00
  • ea5bbe2075 change clickable range Humza Shahid 2024-08-06 07:38:46 +01:00
  • ef8852350c remove print statement which is now unnecessary Humza Shahid 2024-08-03 12:07:24 +01:00
  • 7a6722cf60 done with resize functionality Humza Shahid 2024-08-03 07:10:38 +01:00
  • 82db7521b4 amend clickPoints when windowHeight > windowWidth Humza Shahid 2024-08-03 06:42:46 +01:00