Skip to content

Commit 9f40909

Browse files
committed
Generator: have our computedConstants() method use algebraicVariables rather than algebraic.
1 parent 7cc5bea commit 9f40909

File tree

244 files changed

+2121
-2121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+2121
-2121
lines changed

src/generatorprofile.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
225225
"#include <stdlib.h>\n";
226226

227227
mInterfaceVersionString = "extern const char VERSION[];\n";
228-
mImplementationVersionString = "const char VERSION[] = \"0.7.0\";\n";
228+
mImplementationVersionString = "const char VERSION[] = \"0.8.0\";\n";
229229

230230
mInterfaceLibcellmlVersionString = "extern const char LIBCELLML_VERSION[];\n";
231231
mImplementationLibcellmlVersionString = "const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n";
@@ -489,14 +489,14 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
489489
"[CODE]"
490490
"}\n";
491491

492-
mInterfaceComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n";
493-
mImplementationComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n"
492+
mInterfaceComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n";
493+
mImplementationComputeComputedConstantsMethodNonDiffString = "void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n"
494494
"{\n"
495495
"[CODE]"
496496
"}\n";
497497

498-
mInterfaceComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n";
499-
mImplementationComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n"
498+
mInterfaceComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n";
499+
mImplementationComputeComputedConstantsMethodDiffString = "void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n"
500500
"{\n"
501501
"[CODE]"
502502
"}\n";
@@ -741,7 +741,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
741741
"\n";
742742

743743
mInterfaceVersionString = "";
744-
mImplementationVersionString = "__version__ = \"0.6.0\"\n";
744+
mImplementationVersionString = "__version__ = \"0.8.0\"\n";
745745

746746
mInterfaceLibcellmlVersionString = "";
747747
mImplementationLibcellmlVersionString = "LIBCELLML_VERSION = \"[LIBCELLML_VERSION]\"\n";
@@ -799,8 +799,8 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
799799
mRatesArrayString = "rates";
800800
mConstantsArrayString = "constants";
801801
mComputedConstantsArrayString = "computed_constants";
802-
mAlgebraicVariablesArrayString = "algebraicVariables";
803-
mExternalVariablesArrayString = "externalVariables";
802+
mAlgebraicVariablesArrayString = "algebraic_variables";
803+
mExternalVariablesArrayString = "external_variables";
804804

805805
mExternalVariableMethodTypeDefinitionNonDiffString = "";
806806
mExternalVariableMethodTypeDefinitionDiffString = "";
@@ -928,12 +928,12 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
928928

929929
mInterfaceComputeComputedConstantsMethodNonDiffString = "";
930930
mImplementationComputeComputedConstantsMethodNonDiffString = "\n"
931-
"def compute_computed_constants(constants, computed_constants, algebraic):\n"
931+
"def compute_computed_constants(constants, computed_constants, algebraic_variables):\n"
932932
"[CODE]";
933933

934934
mInterfaceComputeComputedConstantsMethodDiffString = "";
935935
mImplementationComputeComputedConstantsMethodDiffString = "\n"
936-
"def compute_computed_constants(states, rates, constants, computed_constants, algebraic):\n"
936+
"def compute_computed_constants(states, rates, constants, computed_constants, algebraic_variables ):\n"
937937
"[CODE]";
938938

939939
mInterfaceComputeRatesMethodWoevString = "";

src/generatorprofilesha1values.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace libcellml {
2424
* The content of this file is generated, do not edit this file directly.
2525
* See docs/dev_utilities.rst for further information.
2626
*/
27-
static const char C_GENERATOR_PROFILE_SHA1[] = "24b7a2f82510d2f79aeaee509a1b1b04ea1d749b";
28-
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "b117a2500aae147f477127f0bfb0e2c9e242c6c8";
27+
static const char C_GENERATOR_PROFILE_SHA1[] = "4270b05a372c6224e650ca4efd193fb0f0838b14";
28+
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "143e1fe4a300b1b447fb8a2eda5144e7aca27e5e";
2929

3030
} // namespace libcellml

tests/bindings/python/test_generator_profile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,12 @@ def test_implementation_compute_computed_constants_method_string(self):
698698

699699
g = GeneratorProfile()
700700

701-
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n{\n[CODE]}\n',
701+
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n{\n[CODE]}\n',
702702
g.implementationComputeComputedConstantsMethodString(False))
703703
g.setImplementationComputeComputedConstantsMethodString(False, GeneratorProfileTestCase.VALUE)
704704
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationComputeComputedConstantsMethodString(False))
705705

706-
self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n{\n[CODE]}\n',
706+
self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n{\n[CODE]}\n',
707707
g.implementationComputeComputedConstantsMethodString(True))
708708
g.setImplementationComputeComputedConstantsMethodString(True, GeneratorProfileTestCase.VALUE)
709709
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationComputeComputedConstantsMethodString(True))
@@ -949,7 +949,7 @@ def test_implementation_version_string(self):
949949

950950
g = GeneratorProfile()
951951

952-
self.assertEqual('const char VERSION[] = "0.7.0";\n', g.implementationVersionString())
952+
self.assertEqual('const char VERSION[] = "0.8.0";\n', g.implementationVersionString())
953953
g.setImplementationVersionString(GeneratorProfileTestCase.VALUE)
954954
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationVersionString())
955955

@@ -985,12 +985,12 @@ def test_interface_compute_computed_constants_method_string(self):
985985

986986
g = GeneratorProfile()
987987

988-
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n',
988+
self.assertEqual('void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n',
989989
g.interfaceComputeComputedConstantsMethodString(False))
990990
g.setInterfaceComputeComputedConstantsMethodString(False, GeneratorProfileTestCase.VALUE)
991991
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceComputeComputedConstantsMethodString(False))
992992

993-
self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n',
993+
self.assertEqual('void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n',
994994
g.interfaceComputeComputedConstantsMethodString(True))
995995
g.setInterfaceComputeComputedConstantsMethodString(True, GeneratorProfileTestCase.VALUE)
996996
self.assertEqual(GeneratorProfileTestCase.VALUE, g.interfaceComputeComputedConstantsMethodString(True))

tests/generator/generatorprofile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
271271
generatorProfile->implementationHeaderString());
272272

273273
EXPECT_EQ("extern const char VERSION[];\n", generatorProfile->interfaceVersionString());
274-
EXPECT_EQ("const char VERSION[] = \"0.7.0\";\n", generatorProfile->implementationVersionString());
274+
EXPECT_EQ("const char VERSION[] = \"0.8.0\";\n", generatorProfile->implementationVersionString());
275275

276276
EXPECT_EQ("extern const char LIBCELLML_VERSION[];\n", generatorProfile->interfaceLibcellmlVersionString());
277277
EXPECT_EQ("const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n", generatorProfile->implementationLibcellmlVersionString());
@@ -574,17 +574,17 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
574574
"}\n",
575575
generatorProfile->implementationInitialiseArraysMethodString(true));
576576

577-
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraic);\n",
577+
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables);\n",
578578
generatorProfile->interfaceComputeComputedConstantsMethodString(false));
579-
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraic)\n"
579+
EXPECT_EQ("void computeComputedConstants(double *constants, double *computedConstants, double *algebraicVariables)\n"
580580
"{\n"
581581
"[CODE]"
582582
"}\n",
583583
generatorProfile->implementationComputeComputedConstantsMethodString(false));
584584

585-
EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);\n",
585+
EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);\n",
586586
generatorProfile->interfaceComputeComputedConstantsMethodString(true));
587-
EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)\n"
587+
EXPECT_EQ("void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)\n"
588588
"{\n"
589589
"[CODE]"
590590
"}\n",

tests/resources/coverage/generator/model.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <math.h>
66
#include <stdlib.h>
77

8-
const char VERSION[] = "0.7.0";
8+
const char VERSION[] = "0.8.0";
99
const char LIBCELLML_VERSION[] = "0.6.3";
1010

1111
const size_t STATE_COUNT = 1;
@@ -452,7 +452,7 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
452452
algebraicVariables[1] = 1.0;
453453
}
454454

455-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)
455+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)
456456
{
457457
computedConstants[0] = constants[1] == constants[0];
458458
computedConstants[1] = constants[1]/(constants[0] == constants[0]);

tests/resources/coverage/generator/model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ void deleteArray(double *array);
3737
typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, size_t index);
3838

3939
void initialiseArrays(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
40-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);
40+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
4141
void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);
4242
void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);

tests/resources/coverage/generator/model.implementation.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
211211
algebraicVariables[1] = 1.0;
212212
}
213213

214-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)
214+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)
215215
{
216216
computedConstants[0] = eq(constants[1], constants[0]);
217217
computedConstants[1] = constants[1]/eq(constants[0], constants[0]);

tests/resources/coverage/generator/model.interface.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ void deleteArray(double *array);
1515
typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, size_t index);
1616

1717
void initialiseArrays(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
18-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);
18+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
1919
void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);
2020
void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);

tests/resources/coverage/generator/model.modified.profile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <math.h>
66
#include <stdlib.h>
77

8-
const char VERSION[] = "0.7.0.post0";
8+
const char VERSION[] = "0.8.0.post0";
99
const char LIBCELLML_VERSION[] = "0.6.3";
1010

1111
const size_t STATE_COUNT = 1;
@@ -452,7 +452,7 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
452452
algebraicVariables[1] = 1.0;
453453
}
454454

455-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic)
455+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables)
456456
{
457457
computedConstants[0] = constants[1] == constants[0];
458458
computedConstants[1] = constants[1]/(constants[0] == constants[0]);

tests/resources/coverage/generator/model.modified.profile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ void deleteArray(double *array);
3737
typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, size_t index);
3838

3939
void initialiseArrays(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
40-
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraic);
40+
void computeComputedConstants(double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables);
4141
void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);
4242
void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraicVariables, double *externalVariables, ExternalVariable externalVariable);

0 commit comments

Comments
 (0)