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

Code generator: use different arrays for constants, computed constants, and algebraic variables #1247

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

Commits on Aug 5, 2024

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

Commits on Aug 7, 2024

  1. Code generator: use different arrays for constants, computed constant…

    …s, and algebraic variables.
    agarny committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    0207ff9 View commit details
    Browse the repository at this point in the history
  2. Generator: use different arrays for constants, computed constants, an…

    …d algebraic variables for initialiseVariables().
    agarny committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    329b01f View commit details
    Browse the repository at this point in the history
  3. Generator: use different arrays for constants, computed constants, an…

    …d algebraic variables for computeRates().
    agarny committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    56a8658 View commit details
    Browse the repository at this point in the history
  4. Generator: use different arrays for constants, computed constants, an…

    …d algebraic variables for computeVariables().
    agarny committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    94515cc View commit details
    Browse the repository at this point in the history
  5. Generator: use different arrays for constants, computed constants, an…

    …d algebraic variables for computeComputedConstants().
    agarny committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    8488c49 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5287d5b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    82c104e View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Tests: automatically generate the expected file contents.

    To do it manually is very time consuming while here it gets done automatically. From there, we can quickly confirm, using git, whether the new expected file contents is correct.
    agarny committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    0f8fbf3 View commit details
    Browse the repository at this point in the history
  2. Generator profile: added setters/getters for constants, computed cons…

    …tants, and algebraic arrays.
    agarny committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    c2504d7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    01bfdec View commit details
    Browse the repository at this point in the history
  4. Some minor cleaning up.

    agarny committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    09fcc1f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a7c7774 View commit details
    Browse the repository at this point in the history
  6. Updated JavaScript tests.

    agarny committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    ef86447 View commit details
    Browse the repository at this point in the history
  7. Analyser: keep track of computed constants and external variables for…

    … an equation.
    
    We will also need to keep track of states and constants.
    agarny committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    9d7174d View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Configuration menu
    Copy the full SHA
    60b26bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05aa338 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

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

Commits on Aug 14, 2024

  1. Generator: generate the CONSTANT_INFO, COMPUTED_CONSTANT_INFO, ALGEBR…

    …AIC_INFO, and EXTERNAL_INFO arrays rather than just the VARIABLE_INFO array.
    agarny committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    9f8bf25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4bc05e8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    330f6d6 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Configuration menu
    Copy the full SHA
    aaaeed3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    46e4e93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa807fb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    71ae73b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b1b7536 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. Configuration menu
    Copy the full SHA
    a46dbca View commit details
    Browse the repository at this point in the history
  2. Generator: don't initialise our external variables in initialiseVaria…

    …bles().
    
    There was never a need to initialise them there in the first place. In fact, an external variable is effectively an algebraic variable which is computed by an end user. So, it needs to be computed in computeRates() (if available) and in computeVariables().
    
    Also fixed an issue with initialiseVariables() not always including the VOI.
    agarny committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    0a05ef9 View commit details
    Browse the repository at this point in the history
  3. Analyser: a variable using an NLA should always be an algebraic varia…

    …ble.
    
    Even if the NLA equation only uses constant variables and constant values.
    agarny committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    b514746 View commit details
    Browse the repository at this point in the history
  4. Analyser: some minor cleaning up.

    Constants are indexed using makeConstant().
    agarny committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    153b4b5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    19126a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    841c676 View commit details
    Browse the repository at this point in the history
  7. Analyser: simplified things.

    agarny committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    8afeb5c View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2024

  1. Generator: make sure that constants are initialised when they are nee…

    …ded to initialise a state.
    agarny committed Aug 17, 2024
    Configuration menu
    Copy the full SHA
    40d3fb4 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Generator: renamed the "external" array to "externals".

    Oversight on my part!
    agarny committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    b32d169 View commit details
    Browse the repository at this point in the history
  2. Generator: "initialise" computed constants in initialiseVariables().

    This effectively reverts commit b1b7536.
    
    Indeed, some computed constants are initialised using an equation (e.g., x = 3 rather than x with an initial value of 3). So, there is no need to compute those computed constants many times (using computeComputedConstants()). Instead, it's much better to compute them in initialiseVariables().
    
    Not to mention that we might have "computedConstants[1] = 1.0;" and then "computedConstants[0] = computedConstants[1];" so if we were to compute both of them in computeComputedConstants(), we would need to compute "computedConstants[1] = 1.0;" before computing "computedConstants[0] = computedConstants[1];", which would make things slightly more complicated to generate.
    agarny committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    8cba9cd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    65e1d18 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    327225a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d1020eb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f3bbce3 View commit details
    Browse the repository at this point in the history
  7. Generator: make sure that constants are initialised when they are nee…

    …ded to initialise a state.
    agarny committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    1f09630 View commit details
    Browse the repository at this point in the history
  8. GeneratorProfile: use the constants, computed constants, and algebrai…

    …c arrays rather than the variables array with findRoot() & Co.
    agarny committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    b54f688 View commit details
    Browse the repository at this point in the history
  9. GeneratorProfile: use the constants, computed constants, and algebrai…

    …c arrays rather than the variables array to compute external variables.
    agarny committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    d165208 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Tests: some minor cleaning up.

    agarny committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    183d531 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Some minor cleaning up.

    agarny committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    54e6673 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62dc092 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2024

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

    agarny committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    68ad0fc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ff5a1a2 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2024

  1. Some minor cleaning up.

    agarny committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    c83f5c7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26ba852 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. Configuration menu
    Copy the full SHA
    68c9895 View commit details
    Browse the repository at this point in the history
  2. Tests: added a test to generate some code for the DAE version of the …

    …HH52 model with various external variables.
    agarny committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    f0957e0 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. Tests: changed the external variable in algebraicEqnWithOneNonIsolate…

    …dUnknownWithExternalVariable.
    
    This is so that we can test an algebraic model with an external variable (in https://github.com/agarny/libCellMLGeneratedCodeTests).
    agarny committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    49b3a4f View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

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

    agarny committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    dcbd038 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

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