mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 07:10:40 +01:00
[graph] Fix StorageCartesianFunction
This commit is contained in:
@@ -5,22 +5,14 @@ extern "C" {
|
||||
}
|
||||
#include <ion.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
//constexpr const char * StorageCartesianFunctionStore::k_functionNames[k_maxNumberOfFunctions];
|
||||
|
||||
Shared::StorageCartesianFunction StorageCartesianFunctionStore::NullModel() {
|
||||
return Shared::StorageCartesianFunction("");
|
||||
}
|
||||
|
||||
StorageCartesianFunctionStore::StorageCartesianFunctionStore() :
|
||||
Shared::StorageFunctionStore<Shared::StorageCartesianFunction>()
|
||||
Shared::StorageFunctionStore()
|
||||
{
|
||||
//addEmptyModel();
|
||||
}
|
||||
|
||||
char StorageCartesianFunctionStore::symbol() const {
|
||||
return 'x';
|
||||
addEmptyModel();
|
||||
}
|
||||
|
||||
void StorageCartesianFunctionStore::removeAll() {
|
||||
@@ -28,5 +20,26 @@ void StorageCartesianFunctionStore::removeAll() {
|
||||
addEmptyModel();
|
||||
}
|
||||
|
||||
void StorageCartesianFunctionStore::addEmptyModel() {
|
||||
Ion::Storage::Record::ErrorStatus error;
|
||||
StorageCartesianFunction newModel = StorageCartesianFunction::NewModel(&error);
|
||||
assert(error == Ion::Storage::Record::ErrorStatus::None);
|
||||
}
|
||||
|
||||
void StorageCartesianFunctionStore::privateSetMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const {
|
||||
assert(cacheIndex >= 0 && cacheIndex < k_maxNumberOfMemoizedModels);
|
||||
m_functions[cacheIndex] = StorageCartesianFunction(record);
|
||||
}
|
||||
|
||||
void StorageCartesianFunctionStore::moveMemoizedModel(int previousIndex, int nextIndex) const {
|
||||
assert(nextIndex >= 0 && nextIndex < k_maxNumberOfMemoizedModels);
|
||||
assert(previousIndex >= 0 && previousIndex < k_maxNumberOfMemoizedModels);
|
||||
m_functions[nextIndex] = m_functions[previousIndex];
|
||||
}
|
||||
|
||||
StorageExpressionModel * StorageCartesianFunctionStore::memoizedModelAtIndex(int cacheIndex) const {
|
||||
assert(cacheIndex >= 0 && cacheIndex < k_maxNumberOfMemoizedModels);
|
||||
return &m_functions[cacheIndex];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user