C++ Mathematical Expression Toolkit (ExprTk) release
|
#include <cstdio>
#include <cmath>
#include <iostream>
#include <fstream>
#include <string>
#include <deque>
#include <mpreal.h>
#include "exprtk_mpfr_adaptor.hpp"
#include "exprtk.hpp"
Go to the source code of this file.
Classes | |
struct | native< T > |
Typedefs | |
typedef mpfr::mpreal | numeric_type |
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) |
void | 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 numeric_type | global_lower_bound_x = -100.0 |
static const numeric_type | global_lower_bound_y = -100.0 |
static const numeric_type | global_upper_bound_x = +100.0 |
static const numeric_type | global_upper_bound_y = +100.0 |
static const numeric_type | global_delta = 0.1111 |
const numeric_type | pi = 3.14159265358979323846 |
typedef mpfr::mpreal numeric_type |
Definition at line 32 of file exprtk_mpfr_benchmark.cpp.
bool load_expression | ( | exprtk::symbol_table< T > & | symbol_table, |
Sequence< exprtk::expression< T >, Allocator > & | expr_seq | ||
) |
Definition at line 67 of file exprtk_mpfr_benchmark.cpp.
References exprtk::parser< T >::compile(), exprtk::parser< T >::error(), global_expression_list, global_expression_list_size, and exprtk::expression< T >::register_symbol_table().
Referenced by main().
|
inline |
Definition at line 402 of file exprtk_mpfr_benchmark.cpp.
References expression_list.
Referenced by perform_file_based_benchmark().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 299 of file exprtk_mpfr_benchmark.cpp.
References exprtk::symbol_table< T >::add_constants(), exprtk::symbol_table< T >::add_variable(), global_expression_list, load_expression(), perform_file_based_benchmark(), run_exprtk_benchmark(), run_native_benchmark(), and run_parse_benchmark().
void perform_file_based_benchmark | ( | const std::string & | file_name, |
const std::size_t & | rounds = 100000 |
||
) |
Definition at line 426 of file exprtk_mpfr_benchmark.cpp.
References exprtk::details::numeric::constant::e, expression_list, load_expression_file(), rounds, exprtk::timer::start(), exprtk::timer::stop(), and exprtk::timer::time().
Referenced by main().
void pgo_primer | ( | ) |
Definition at line 367 of file exprtk_mpfr_benchmark.cpp.
References delta, native< T >::func00(), native< T >::func01(), native< T >::func02(), native< T >::func03(), native< T >::func04(), native< T >::func05(), native< T >::func06(), native< T >::func07(), native< T >::func08(), native< T >::func09(), native< T >::func10(), native< T >::func11(), native< T >::func12(), native< T >::func13(), native< T >::func14(), native< T >::func15(), native< T >::func16(), lower_bound_x, lower_bound_y, upper_bound_x, and upper_bound_y.
void run_exprtk_benchmark | ( | T & | x, |
T & | y, | ||
exprtk::expression< T > & | expression, | ||
const std::string & | expr_string | ||
) |
Definition at line 93 of file exprtk_mpfr_benchmark.cpp.
References global_delta, global_lower_bound_x, global_lower_bound_y, global_upper_bound_x, global_upper_bound_y, exprtk::timer::start(), exprtk::timer::stop(), exprtk::timer::time(), and exprtk::expression< T >::value().
Referenced by main().
void run_native_benchmark | ( | T & | x, |
T & | y, | ||
NativeFunction | f, | ||
const std::string & | expr_string | ||
) |
Definition at line 126 of file exprtk_mpfr_benchmark.cpp.
References global_delta, global_lower_bound_x, global_lower_bound_y, global_upper_bound_x, global_upper_bound_y, exprtk::timer::start(), exprtk::timer::stop(), and exprtk::timer::time().
Referenced by main().
bool run_parse_benchmark | ( | exprtk::symbol_table< T > & | symbol_table | ) |
Definition at line 155 of file exprtk_mpfr_benchmark.cpp.
References exprtk::parser< T >::compile(), exprtk::parser< T >::error(), global_expression_list, global_expression_list_size, exprtk::expression< T >::register_symbol_table(), rounds, exprtk::timer::start(), exprtk::timer::stop(), and exprtk::timer::time().
Referenced by main().
|
static |
Definition at line 61 of file exprtk_mpfr_benchmark.cpp.
Referenced by run_exprtk_benchmark(), and run_native_benchmark().
const std::string global_expression_list[] |
Definition at line 34 of file exprtk_mpfr_benchmark.cpp.
Referenced by load_expression(), main(), and run_parse_benchmark().
const std::size_t global_expression_list_size = sizeof(global_expression_list) / sizeof(std::string) |
Definition at line 55 of file exprtk_mpfr_benchmark.cpp.
Referenced by load_expression(), and run_parse_benchmark().
|
static |
Definition at line 57 of file exprtk_mpfr_benchmark.cpp.
Referenced by run_exprtk_benchmark(), and run_native_benchmark().
|
static |
Definition at line 58 of file exprtk_mpfr_benchmark.cpp.
Referenced by run_exprtk_benchmark(), and run_native_benchmark().
|
static |
Definition at line 59 of file exprtk_mpfr_benchmark.cpp.
Referenced by run_exprtk_benchmark(), and run_native_benchmark().
|
static |
Definition at line 60 of file exprtk_mpfr_benchmark.cpp.
Referenced by run_exprtk_benchmark(), and run_native_benchmark().
const numeric_type pi = 3.14159265358979323846 |
Definition at line 191 of file exprtk_mpfr_benchmark.cpp.