Hi;
I'm working on the Rosetta Code task:
"Stirling numbers of the second kind"
I have a working recursive solution written in Ada but I'd like to memoize it to cut down on the redundant and duplicative calls (similar to a recursive solution to calculating the Fibonacci sequence).
So I think I need a hash ADT (which I've used in Perl) but I've never used in Ada.
So I want to preserve the calculation of the Stirling2 for each N and K so I can do a lookup. If this were based on a single unsigned integer, an array would suffice. Maybe a 2d array would suffice?
Thanks,
Ken Wolcott
So, any resources on how to write Ada programs that take advantage of memoization?
So, any resources on how to write Ada programs that take advantage of memoization?Look here https://forum.ada-lang.io/ for discussions about Advent of Code puzzles. Some solutions use (and need, for completing in a reasonable time) memoization.
You find with HAC ( https://hacadacompiler.sourceforge.io/ ) a set of solutions (search "memoiz*" or "cache"), mostly compiling with the HAC subset.
Regarding HAC, isn't that Windows-only? I'm on a Mac (M1 chip). I'll
look again at HAC.
Regarding HAC, isn't that Windows-only?
Regarding HAC, isn't that Windows-only?Not at all :-)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:41:41 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,858,055 |