Skip to content

Commit a884b78

Browse files
committed
Fixes for ATMSP benchmark
Updates to ExprTk
1 parent 80fb443 commit a884b78

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

exprtk/exprtk.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33733,6 +33733,12 @@ namespace exprtk
3373333733
register_sf3(24) register_sf3(25) register_sf3(26) register_sf3(27)
3373433734
register_sf3(28) register_sf3(29) register_sf3(30)
3373533735
#undef register_sf3
33736+
33737+
#define register_sf3_extid(Id, Op) \
33738+
sf3_map[Id] = pair_t(details::sf##Op##_op<T>::process,details::e_sf##Op); \
33739+
33740+
register_sf3_extid("(t-t)-t",23) // (t-t)-t --> t-(t+t)
33741+
#undef register_sf3_extid
3373633742
}
3373733743

3373833744
inline void load_sf4_map(sf4_map_t& sf4_map)

exprtk/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ follows:
13251325
var y := x + 2; // Statement 2
13261326
y := x + 3y; // Statement 3
13271327
x - y; // Statement 4
1328-
8
1328+
13291329

13301330
(3) Conditional Statements (If-Then-Else)
13311331
ExprTk support two forms of conditional branching or otherwise known

src/BenchATMSP.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "BenchATMSP.h"
22

3-
//#include <windows.h>
43
#include <cmath>
54

65
// atmsp
@@ -104,17 +103,17 @@ double BenchATMSP::DoBenchmark(const std::string& sExpr, long iCount)
104103
ATMSB<double> test_bc;
105104
ATMSP<double> test_p;
106105

107-
bc.var[0] = 1.1;
108-
bc.var[1] = 2.2;
109-
bc.var[2] = 3.3;
110-
bc.var[3] = 2.123456;
111-
bc.var[4] = 3.123456;
112-
bc.var[5] = 4.123456;
113-
bc.var[6] = 5.123456;
106+
test_bc.var[0] = 1.1;
107+
test_bc.var[1] = 2.2;
108+
test_bc.var[2] = 3.3;
109+
test_bc.var[3] = 2.123456;
110+
test_bc.var[4] = 3.123456;
111+
test_bc.var[5] = 4.123456;
112+
test_bc.var[6] = 5.123456;
114113

115114
if (
116-
test_p.parse(test_bc, test.first, "a, b, c, x, y, z, w") ||
117-
(!is_equal(test.second, bc.run()))
115+
(0 != test_p.parse(test_bc, test.first, "a, b, c, x, y, z, w")) ||
116+
(!is_equal(test.second, test_bc.run()))
118117
)
119118
{
120119
test_result = false;

0 commit comments

Comments
 (0)