LMMS
Loading...
Searching...
No Matches
exprtk_benchmark.cpp File Reference
#include <cstdio>
#include <cmath>
#include <fstream>
#include <string>
#include <deque>
#include "exprtk.hpp"

Classes

struct  native< T >

Functions

template<typename T, typename Allocator, template< typename, typename > class Sequence>
bool load_expression (exprtk::symbol_table< T > &symbol_table, Sequence< exprtk::expression< T >, Allocator > &expr_seq)
template<typename T>
void run_exprtk_benchmark (T &x, T &y, exprtk::expression< T > &expression, const std::string &expr_string)
template<typename T, typename NativeFunction>
void run_native_benchmark (T &x, T &y, NativeFunction f, const std::string &expr_string)
template<typename T>
bool run_parse_benchmark (exprtk::symbol_table< T > &symbol_table)
double pgo_primer ()
void perform_file_based_benchmark (const std::string &file_name, const std::size_t &rounds=100000)
int main (int argc, char *argv[])
std::size_t load_expression_file (const std::string &file_name, std::deque< std::string > &expression_list)

Variables

const std::string global_expression_list []
const std::size_t global_expression_list_size = sizeof(global_expression_list) / sizeof(std::string)
static const double global_lower_bound_x = -100.0
static const double global_lower_bound_y = -100.0
static const double global_upper_bound_x = +100.0
static const double global_upper_bound_y = +100.0
static const double global_delta = 0.0111
const double pi = 3.141592653589793238462643383279502

Function Documentation

◆ load_expression()

template<typename T, typename Allocator, template< typename, typename > class Sequence>
bool load_expression ( exprtk::symbol_table< T > & symbol_table,
Sequence< exprtk::expression< T >, Allocator > & expr_seq )

◆ load_expression_file()

std::size_t load_expression_file ( const std::string & file_name,
std::deque< std::string > & expression_list )
inline

◆ main()

int main ( int argc,
char * argv[] )

◆ perform_file_based_benchmark()

void perform_file_based_benchmark ( const std::string & file_name,
const std::size_t & rounds = 100000 )

◆ pgo_primer()

double pgo_primer ( )

◆ run_exprtk_benchmark()

template<typename T>
void run_exprtk_benchmark ( T & x,
T & y,
exprtk::expression< T > & expression,
const std::string & expr_string )

◆ run_native_benchmark()

template<typename T, typename NativeFunction>
void run_native_benchmark ( T & x,
T & y,
NativeFunction f,
const std::string & expr_string )

◆ run_parse_benchmark()

template<typename T>
bool run_parse_benchmark ( exprtk::symbol_table< T > & symbol_table)

Variable Documentation

◆ global_delta

const double global_delta = 0.0111
static

◆ global_expression_list

const std::string global_expression_list[]
Initial value:
=
{
"(y + x)",
"2 * (y + x)",
"(2 * y + 2 * x)",
"((1.23 * x^2) / y) - 123.123",
"(y + x / y) * (x - y / x)",
"x / ((x + y) + (x - y)) / y",
"1 - ((x * y) + (y / x)) - 3",
"(5.5 + x) + (2 * x - 2 / 3 * y) * (x / 3 + y / 4) + (y + 7.7)",
"1.1x^1 + 2.2y^2 - 3.3x^3 + 4.4y^15 - 5.5x^23 + 6.6y^55",
"sin(2 * x) + cos(pi / y)",
"1 - sin(2 * x) + cos(pi / y)",
"sqrt(111.111 - sin(2 * x) + cos(pi / y) / 333.333)",
"(x^2 / sin(2 * pi / y)) - x / 2",
"x + (cos(y - sin(2 / x * pi)) - sin(x - cos(2 * y / pi))) - y",
"clamp(-1.0, sin(2 * pi * x) + cos(y / 2 * pi), +1.0)",
"max(3.33, min(sqrt(1 - sin(2 * x) + cos(pi / y) / 3), 1.11))",
"if((y + (x * 2.2)) <= (x + y + 1.1), x - y, x * y) + 2 * pi / x"
}

◆ global_expression_list_size

const std::size_t global_expression_list_size = sizeof(global_expression_list) / sizeof(std::string)

◆ global_lower_bound_x

const double global_lower_bound_x = -100.0
static

◆ global_lower_bound_y

const double global_lower_bound_y = -100.0
static

◆ global_upper_bound_x

const double global_upper_bound_x = +100.0
static

◆ global_upper_bound_y

const double global_upper_bound_y = +100.0
static

◆ pi

const double pi = 3.141592653589793238462643383279502