Returns the base offset in memory for f(s, node), with node contained in s.
This is useful in the Dynamic Programming iterations.
Note(user): inlining this function gains about 5%.
TODO(user): Investigate how to compute BaseOffset(card - 1, s \ { n })
from BaseOffset(card, n) to speed up the DP iteration.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eLatticeMemoryManager\u003c/code\u003e is a C++ class designed for efficient memory management in dynamic programming algorithms, particularly for Hamiltonian path problems.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for calculating memory offsets, storing and retrieving values associated with sets and nodes, crucial for the Held-Karp algorithm.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003eOffset\u003c/code\u003e, \u003ccode\u003eBaseOffset\u003c/code\u003e, and \u003ccode\u003eOffsetDelta\u003c/code\u003e are optimized for quick access to data during DP iterations, improving performance.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSetValue\u003c/code\u003e and \u003ccode\u003eValue\u003c/code\u003e offer general access, while \u003ccode\u003eSetValueAtOffset\u003c/code\u003e and \u003ccode\u003eValueAtOffset\u003c/code\u003e are optimized for use within dynamic programming loops.\u003c/p\u003e\n"],["\u003cp\u003eThe class requires initialization via \u003ccode\u003eInit\u003c/code\u003e to allocate and prepare the memory structure before use.\u003c/p\u003e\n"]]],["The `LatticeMemoryManager` class manages memory for storing values related to sets and nodes. Key actions include: initializing memory with `Init`, retrieving memory offsets with `Offset` and `BaseOffset`, and calculating offset changes using `OffsetDelta`. Values are stored and retrieved using `SetValue`, `SetValueAtOffset`, `Value`, and `ValueAtOffset`. These methods handle the dynamic programming iterations and other memory access, providing the ability to store and recall calculated results at given memory offsets.\n"],null,[]]