Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to interpret a model (initially algebraic and ODE models) #1220

Open
wants to merge 94 commits into
base: main
Choose a base branch
from

Commits on Apr 8, 2024

  1. Interpreter: skeleton code.

    agarny committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    99672cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d6f5b87 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b67ea7d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7f97aa4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    412d8d4 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Configuration menu
    Copy the full SHA
    0488b1b View commit details
    Browse the repository at this point in the history
  2. Some minor cleaning up.

    agarny committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    c3690ea View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Configuration menu
    Copy the full SHA
    3d6552b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d93b7d8 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Generator: extracted the code that generates the code to compute the …

    …model.
    
    So that we can reuse them for the interpreter later on.
    agarny committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    907da52 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5412941 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d9e4258 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a9914f6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d408b5f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    09fe513 View commit details
    Browse the repository at this point in the history
  7. Address coverage issues.

    agarny committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    38b608a View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. Configuration menu
    Copy the full SHA
    4dbd96d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac65d8a View commit details
    Browse the repository at this point in the history
  3. GeneratorInterpreter: merged generateDoubleOrConstantVariableNameCode…

    …() into generateInitialisationCode().
    
    To make it easier to work with both the Generator and Interpreter classes.
    agarny committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    32eedd1 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. GeneratorProfile: don't define the min() and max() functions for the …

    …C profile.
    
    There are indeed C functions to get the minimum/maximum of two values: fmin() and fmax().
    agarny committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    db0665f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d959235 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9a96766 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cab734a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9341694 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    52219db View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. Configuration menu
    Copy the full SHA
    4a6c420 View commit details
    Browse the repository at this point in the history
  2. Debug: some minor improvements to the printing of an AST / Interprete…

    …rStatement as a tree.
    agarny committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    fb67039 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    743b33e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c0e0525 View commit details
    Browse the repository at this point in the history
  5. Debug: make it easier to check the name of CI elements when printing …

    …an InterpreterStatement object as a tree.
    agarny committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    b38dc48 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2024

  1. Configuration menu
    Copy the full SHA
    f01ef9d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07b99d2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a08fec0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    34ab752 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c139ced View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2a9415e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c3c8c45 View commit details
    Browse the repository at this point in the history
  8. Debug: refactoring of code.

    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    03607ef View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1204fb1 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a97ac29 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e0f1dbc View commit details
    Browse the repository at this point in the history
  12. InterpreterStatement: removed the DIFF type.

    Indeed, it's accounted for in the CI type and the `rate()` method.
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    9373065 View commit details
    Browse the repository at this point in the history
  13. InterpreterStatement: re-enabled the evaluation of some types.

    We had disabled them for coverage reasons.
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    0b31297 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7d48ea0 View commit details
    Browse the repository at this point in the history
  15. GeneratorProfile: simplified the definition of some trigonometric fun…

    …ctions.
    
    ... and actually fixed the one for acoth()!
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    b6aa691 View commit details
    Browse the repository at this point in the history
  16. Analyser: allow a piecewise element to have no children or only an …

    …`otherwise` element.
    
    See https://www.w3.org/TR/MathML2/chapter4.html#contm.piecewise for more details. Basically, a `piecewise` element can have 0+ `piece` child elements and optionally 1 `otherwise` child element. If there are no child elements then it's undefined, which in our case means that our InterpreterStatement class will evaluate such a `piecewise` element to NAN.
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    9460678 View commit details
    Browse the repository at this point in the history
  17. InterpreterStatement: don't need the OTHERWISE type.

    When evaluating it, we would have one extra call for nothing while we could directly evaluate the otherwise part.
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    290beda View commit details
    Browse the repository at this point in the history
  18. GeneratorInterpreter: the default profile doesn't have an XOR opera…

    …tor.
    
    So, we need to construct our statement in the other branch!
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    3f0be73 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3c3df21 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    532efc1 View commit details
    Browse the repository at this point in the history
  21. Utils: moved areNearlyEqual() to src/commonutils.cpp.

    So that it can be used in tests/test_utils.cpp.
    agarny committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    5cd4a41 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Configuration menu
    Copy the full SHA
    3126a0e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f835aa5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1148d08 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8077ffa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6bbb036 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a94e396 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6614251 View commit details
    Browse the repository at this point in the history
  8. InterpreterStatement: cache a variable's index.

    This means fewer calls when evaluating a model.
    agarny committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    ce7570f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    62dd985 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    262608e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    53e262a View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2024

  1. Configuration menu
    Copy the full SHA
    dc51437 View commit details
    Browse the repository at this point in the history
  2. Interpreter: return the states, rates, and variables by reference.

    So that the end-user can modify their values, if needed (e.g., for integration purposes).
    agarny committed Apr 21, 2024
    Configuration menu
    Copy the full SHA
    63f8333 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    acb462b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    265759b View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    208157f View commit details
    Browse the repository at this point in the history
  2. GeneratorInterpreter: removed NLA system statements.

    Since we don't currently support the interpretation of DAE models.
    agarny committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    dcecc8d View commit details
    Browse the repository at this point in the history
  3. InterpretStatement: renamed to InterpretAstStatement.

    So that we can compare it to our future InterpreterRpnStatement.
    agarny committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    5755083 View commit details
    Browse the repository at this point in the history
  4. Debug: some minor cleaning up.

    agarny committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    76e743c View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2024

  1. Configuration menu
    Copy the full SHA
    fa196e4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    50a4923 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Interpreter: removed the RPN-based interpreter.

    Indeed, it is 15 to 20 times slower than the AST-based interpreter. Clearly, handling a stack is more costly than handling recursion.
    agarny committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    cf5da30 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    03d6043 View commit details
    Browse the repository at this point in the history
  3. Generator tests: don't compare the compiled and interpreted models.

    This was only done to check that we do indeed get the same results... and we do.
    agarny committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    960472a View commit details
    Browse the repository at this point in the history
  4. Coverage tests: check the values we get from the interpreter.

    Very important to make sure that we do indeed get the results we expect for all aspects of the interpreter.
    agarny committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    0e40acd View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. Configuration menu
    Copy the full SHA
    91595e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f2884bc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d81efdf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50ef61a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f87c44d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9900f4e View commit details
    Browse the repository at this point in the history
  7. Interpreter: directly use double *.

    Rather than `std::vector<double>` (and then retrieve the data using `data()`. Indeed, some solvers may want to use temporary arrays (e.g., CVODE uses a temporary array of doubles for states and rates), which means that we need to be able to set them, if needed.
    agarny committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    519faa2 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Configuration menu
    Copy the full SHA
    107fb7b View commit details
    Browse the repository at this point in the history
  2. Interpreter: don't keep track of the VOI, states, rates, and variables.

    We now rely on the user providing them since some solvers may use temporary arrays to compute rates (e.g., CVODE uses temporary arrays for states and rates).
    agarny committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    2bcc1ca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c922a79 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8fe2e97 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Make gcc happy.

    agarny committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    987b3db View commit details
    Browse the repository at this point in the history

Commits on May 11, 2024

  1. Configuration menu
    Copy the full SHA
    160d855 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Configuration menu
    Copy the full SHA
    584ebb5 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. Configuration menu
    Copy the full SHA
    33a527a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83fe400 View commit details
    Browse the repository at this point in the history
  3. Some minor cleaning up.

    agarny committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    4966bad View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d51df65 View commit details
    Browse the repository at this point in the history