vendredi 2 février 2018

C++11 lookup table container for model output

I have a model system ready to produce a list of variables at some time step. The users, on the other hand, are only interested in a subset of these variables at each time step. And I need to save them at each time step.

So how can I design a container/map to handle this? Currently I used a switch/case at each time step: within a iterator loop, if a desired variable (std::string) is inside the container, then it will be saved.

I fear this is not efficient enough because the program needs to judge that at every time step even though once is enough and I have 100+ variables in the table, and user desired could be 10+.

Is there better way to do it?

Aucun commentaire:

Enregistrer un commentaire