#memory allocated by library must be
1 messages · Page 1 of 1 (latest)
I just popped the hood on the library and most of the functions are doing something similar to
std::vector<double> RoadRunner::getFloatingSpeciesConcentrationsV() {
if (!impl->model) {
throw CoreException(gEmptyModelMessage);
}
std::vector<double> result(impl->model->getNumFloatingSpecies(), 0);
if (result.size()) {
impl->model->getFloatingSpeciesConcentrations(result.size(), 0, &result[0]);
}
return result;
}
So I guess that explains why it's failing, and my solution would just be creating my own wrapper which allocates the std::vectors instead of letting the library create them?
if you're in unreal layer - use TArray over std::vector, you can still pass Data and Num to the impl