mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 00:00:44 +01:00
[apps/sequence] Fix SequenceStore: sequences are not memoized but all
kept in the store (because we need all of them to evaluate one sequence). setMemoizedModelAtIndex now store u, v and w sequences in this order to avoid requiring expiring pointers.
This commit is contained in:
@@ -47,9 +47,14 @@ int SequenceStore::sequenceIndexForName(char name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SequenceStore::setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const {
|
||||
Shared::ExpressionModelHandle * SequenceStore::setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const {
|
||||
assert(cacheIndex >= 0 && cacheIndex < maxNumberOfMemoizedModels());
|
||||
m_sequences[cacheIndex] = Sequence(record);
|
||||
int index = cacheIndex;
|
||||
if (!record.isNull()) {
|
||||
index = SequenceStore::sequenceIndexForName(record.fullName()[0]);
|
||||
}
|
||||
m_sequences[index] = Sequence(record);
|
||||
return &m_sequences[index];
|
||||
}
|
||||
|
||||
Shared::ExpressionModelHandle * SequenceStore::memoizedModelAtIndex(int cacheIndex) const {
|
||||
|
||||
Reference in New Issue
Block a user