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."],[[["`LatticeMemoryManager` is a C++ class designed for efficient memory management in dynamic programming algorithms, particularly for Hamiltonian path problems."],["It provides methods for calculating memory offsets, storing and retrieving values associated with sets and nodes, crucial for the Held-Karp algorithm."],["Methods like `Offset`, `BaseOffset`, and `OffsetDelta` are optimized for quick access to data during DP iterations, improving performance."],["`SetValue` and `Value` offer general access, while `SetValueAtOffset` and `ValueAtOffset` are optimized for use within dynamic programming loops."],["The class requires initialization via `Init` to allocate and prepare the memory structure before use."]]],["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"]]