Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/analyser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,11 +1620,8 @@ double Analyser::AnalyserImpl::powerValue(const AnalyserEquationAstPtr &ast,
return 1.0;
case AnalyserEquationAst::Type::FALSE:
return 0.0;
case AnalyserEquationAst::Type::E: {
static const double E = exp(1.0);

return E;
}
case AnalyserEquationAst::Type::E:
return M_E;
case AnalyserEquationAst::Type::PI:
return M_PI;
case AnalyserEquationAst::Type::INF: {
Expand Down
18 changes: 6 additions & 12 deletions src/generatorprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

#ifdef _WIN32
# define _USE_MATH_DEFINES
#endif

#include "libcellml/generatorprofile.h"

#include <cmath>

#include "generatorprofile_p.h"
#include "utilities.h"

Expand Down Expand Up @@ -123,8 +117,8 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi

mTrueString = "1.0";
mFalseString = "0.0";
mEString = convertToString(exp(1.0));
mPiString = convertToString(M_PI);
mEString = "2.7182818284590452";
mPiString = "3.1415926535897932";
mInfString = "INFINITY";
mNanString = "NAN";

Expand Down Expand Up @@ -225,7 +219,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"#include <stdlib.h>\n";

mInterfaceVersionString = "extern const char VERSION[];\n";
mImplementationVersionString = "const char VERSION[] = \"0.8.0\";\n";
mImplementationVersionString = "const char VERSION[] = \"0.8.1\";\n";

mInterfaceLibcellmlVersionString = "extern const char LIBCELLML_VERSION[];\n";
mImplementationLibcellmlVersionString = "const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n";
Expand Down Expand Up @@ -639,8 +633,8 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi

mTrueString = "1.0";
mFalseString = "0.0";
mEString = convertToString(exp(1.0));
mPiString = convertToString(M_PI);
mEString = "2.7182818284590452";
mPiString = "3.1415926535897932";
mInfString = "inf";
mNanString = "nan";

Expand Down Expand Up @@ -741,7 +735,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi
"\n";

mInterfaceVersionString = "";
mImplementationVersionString = "__version__ = \"0.8.0\"\n";
mImplementationVersionString = "__version__ = \"0.8.1\"\n";

mInterfaceLibcellmlVersionString = "";
mImplementationLibcellmlVersionString = "LIBCELLML_VERSION = \"[LIBCELLML_VERSION]\"\n";
Expand Down
4 changes: 2 additions & 2 deletions src/generatorprofilesha1values.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace libcellml {
* The content of this file is generated, do not edit this file directly.
* See docs/dev_utilities.rst for further information.
*/
static const char C_GENERATOR_PROFILE_SHA1[] = "949c36b0108bc8cf9f41ff563f9ec1369d399a7c";
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "1f277b0e20a102ae0b63b63383cf4c0606f28034";
static const char C_GENERATOR_PROFILE_SHA1[] = "4dc18688db4d0e306b35c54e0239153fee9f2104";
static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "54919955bccbbeaf019519cd600bc0f0deade5c3";

} // namespace libcellml
6 changes: 3 additions & 3 deletions tests/bindings/python/test_generator_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def test_e_string(self):

g = GeneratorProfile()

self.assertEqual('2.71828182845905', g.eString())
self.assertEqual('2.7182818284590452', g.eString())
g.setEString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.eString())

Expand Down Expand Up @@ -949,7 +949,7 @@ def test_implementation_version_string(self):

g = GeneratorProfile()

self.assertEqual('const char VERSION[] = "0.8.0";\n', g.implementationVersionString())
self.assertEqual('const char VERSION[] = "0.8.1";\n', g.implementationVersionString())
g.setImplementationVersionString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.implementationVersionString())

Expand Down Expand Up @@ -1432,7 +1432,7 @@ def test_pi_string(self):

g = GeneratorProfile()

self.assertEqual('3.14159265358979', g.piString())
self.assertEqual('3.1415926535897932', g.piString())
g.setPiString(GeneratorProfileTestCase.VALUE)
self.assertEqual(GeneratorProfileTestCase.VALUE, g.piString())

Expand Down
6 changes: 3 additions & 3 deletions tests/generator/generatorprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ TEST(GeneratorProfile, defaultConstantValues)

EXPECT_EQ("1.0", generatorProfile->trueString());
EXPECT_EQ("0.0", generatorProfile->falseString());
EXPECT_EQ(convertToString(exp(1.0)), generatorProfile->eString());
EXPECT_EQ(convertToString(M_PI), generatorProfile->piString());
EXPECT_EQ("2.7182818284590452", generatorProfile->eString());
EXPECT_EQ("3.1415926535897932", generatorProfile->piString());
EXPECT_EQ("INFINITY", generatorProfile->infString());
EXPECT_EQ("NAN", generatorProfile->nanString());
}
Expand Down Expand Up @@ -271,7 +271,7 @@ TEST(GeneratorProfile, defaultMiscellaneousValues)
generatorProfile->implementationHeaderString());

EXPECT_EQ("extern const char VERSION[];\n", generatorProfile->interfaceVersionString());
EXPECT_EQ("const char VERSION[] = \"0.8.0\";\n", generatorProfile->implementationVersionString());
EXPECT_EQ("const char VERSION[] = \"0.8.1\";\n", generatorProfile->implementationVersionString());

EXPECT_EQ("extern const char LIBCELLML_VERSION[];\n", generatorProfile->interfaceLibcellmlVersionString());
EXPECT_EQ("const char LIBCELLML_VERSION[] = \"[LIBCELLML_VERSION]\";\n", generatorProfile->implementationLibcellmlVersionString());
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down Expand Up @@ -442,8 +442,8 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
computedConstants[179] = 123.456789e99;
computedConstants[181] = 1.0;
computedConstants[182] = 0.0;
computedConstants[183] = 2.71828182845905;
computedConstants[184] = 3.14159265358979;
computedConstants[183] = 2.7182818284590452;
computedConstants[184] = 3.1415926535897932;
computedConstants[185] = INFINITY;
computedConstants[186] = NAN;
computedConstants[198] = 1.0;
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/coverage/generator/model.implementation.out
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
computedConstants[179] = 123.456789e99;
computedConstants[181] = 1.0;
computedConstants[182] = 0.0;
computedConstants[183] = 2.71828182845905;
computedConstants[184] = 3.14159265358979;
computedConstants[183] = 2.7182818284590452;
computedConstants[184] = 3.1415926535897932;
computedConstants[185] = INFINITY;
computedConstants[186] = NAN;
computedConstants[198] = 1.0;
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.modified.profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0.post0";
const char VERSION[] = "0.8.1.post0";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down Expand Up @@ -442,8 +442,8 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
computedConstants[179] = 123.456789e99;
computedConstants[181] = 1.0;
computedConstants[182] = 0.0;
computedConstants[183] = 2.71828182845905;
computedConstants[184] = 3.14159265358979;
computedConstants[183] = 2.7182818284590452;
computedConstants[184] = 3.1415926535897932;
computedConstants[185] = INFINITY;
computedConstants[186] = NAN;
computedConstants[198] = 1.0;
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.modified.profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0.post0"
__version__ = "0.8.1.post0"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down Expand Up @@ -409,8 +409,8 @@ def initialise_arrays(states, rates, constants, computed_constants, algebraic_va
computed_constants[179] = 123.456789e99
computed_constants[181] = 1.0
computed_constants[182] = 0.0
computed_constants[183] = 2.71828182845905
computed_constants[184] = 3.14159265358979
computed_constants[183] = 2.7182818284590452
computed_constants[184] = 3.1415926535897932
computed_constants[185] = inf
computed_constants[186] = nan
computed_constants[198] = 1.0
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.no.tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down Expand Up @@ -211,8 +211,8 @@ void initialiseArrays(double *states, double *rates, double *constants, double *
double my_component_eqnCnDoubleWithExponent = 123.456789e99;
double my_component_eqnTrue = 1.0;
double my_component_eqnFalse = 0.0;
double my_component_eqnExponentiale = 2.71828182845905;
double my_component_eqnPi = 3.14159265358979;
double my_component_eqnExponentiale = 2.7182818284590452;
double my_component_eqnPi = 3.1415926535897932;
double my_component_eqnInfinity = INFINITY;
double my_component_eqnNotanumber = NAN;
double my_component_eqnComputedConstant1 = 1.0;
Expand Down
6 changes: 3 additions & 3 deletions tests/resources/coverage/generator/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down Expand Up @@ -409,8 +409,8 @@ def initialise_arrays(states, rates, constants, computed_constants, algebraic_va
computed_constants[179] = 123.456789e99
computed_constants[181] = 1.0
computed_constants[182] = 0.0
computed_constants[183] = 2.71828182845905
computed_constants[184] = 3.14159265358979
computed_constants[183] = 2.7182818284590452
computed_constants[184] = 3.1415926535897932
computed_constants[185] = inf
computed_constants[186] = nan
computed_constants[198] = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

CONSTANT_COUNT = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

CONSTANT_COUNT = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

CONSTANT_COUNT = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

CONSTANT_COUNT = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t STATE_COUNT = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import *


__version__ = "0.8.0"
__version__ = "0.8.1"
LIBCELLML_VERSION = "0.7.1"

STATE_COUNT = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.8.0";
const char VERSION[] = "0.8.1";
const char LIBCELLML_VERSION[] = "0.7.1";

const size_t CONSTANT_COUNT = 0;
Expand Down
Loading
Loading