C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
native< T > Struct Template Reference

Public Types

typedef exprtk::details::functor_t< T > functor_t
 
typedef functor_t::Type Type
 
typedef exprtk::details::functor_t< T > functor_t
 
typedef functor_t::Type Type
 
typedef exprtk::details::functor_t< T > functor_t
 
typedef functor_t::Type Type
 

Static Public Member Functions

static T avg (Type x, Type y)
 
static T clamp (const Type l, const Type v, const Type u)
 
static T func00 (Type x, Type y)
 
static T func01 (Type x, Type y)
 
static T func02 (Type x, Type y)
 
static T func03 (Type x, Type y)
 
static T func04 (Type x, Type y)
 
static T func05 (Type x, Type y)
 
static T func06 (Type x, Type y)
 
static T func07 (Type x, Type y)
 
static T func08 (Type x, Type y)
 
static T func09 (Type x, Type y)
 
static T func10 (Type x, Type y)
 
static T func11 (Type x, Type y)
 
static T func12 (Type x, Type y)
 
static T func13 (Type x, Type y)
 
static T func14 (Type x, Type y)
 
static T func15 (Type x, Type y)
 
static T func16 (Type x, Type y)
 
static T avg (Type x, Type y)
 
static T clamp (const Type l, const Type v, const Type u)
 
static T func00 (Type x, Type y)
 
static T func01 (Type x, Type y)
 
static T func02 (Type x, Type y)
 
static T func03 (Type x, Type y)
 
static T func04 (Type x, Type y)
 
static T func05 (Type x, Type y)
 
static T func06 (Type x, Type y)
 
static T func07 (Type x, Type y)
 
static T func08 (Type x, Type y)
 
static T func09 (Type x, Type y)
 
static T func10 (Type x, Type y)
 
static T func11 (Type x, Type y)
 
static T func12 (Type x, Type y)
 
static T func13 (Type x, Type y)
 
static T func14 (Type x, Type y)
 
static T func15 (Type x, Type y)
 
static T func16 (Type x, Type y)
 
static T avg (Type x, Type y)
 
static T clamp (const Type l, const Type v, const Type u)
 
static T func00 (Type x, Type y)
 
static T func01 (Type x, Type y)
 
static T func02 (Type x, Type y)
 
static T func03 (Type x, Type y)
 
static T func04 (Type x, Type y)
 
static T func05 (Type x, Type y)
 
static T func06 (Type x, Type y)
 
static T func07 (Type x, Type y)
 
static T func08 (Type x, Type y)
 
static T func09 (Type x, Type y)
 
static T func10 (Type x, Type y)
 
static T func11 (Type x, Type y)
 
static T func12 (Type x, Type y)
 
static T func13 (Type x, Type y)
 
static T func14 (Type x, Type y)
 
static T func15 (Type x, Type y)
 
static T func16 (Type x, Type y)
 

Detailed Description

template<typename T>
struct native< T >

Definition at line 199 of file exprtk_real_benchmark.cpp.

Member Typedef Documentation

◆ functor_t [1/3]

template<typename T >
typedef exprtk::details::functor_t<T> native< T >::functor_t

Definition at line 191 of file exprtk_benchmark.cpp.

◆ functor_t [2/3]

template<typename T >
typedef exprtk::details::functor_t<T> native< T >::functor_t

Definition at line 196 of file exprtk_mpfr_benchmark.cpp.

◆ functor_t [3/3]

template<typename T >
typedef exprtk::details::functor_t<T> native< T >::functor_t

Definition at line 201 of file exprtk_real_benchmark.cpp.

◆ Type [1/3]

template<typename T >
typedef functor_t::Type native< T >::Type

Definition at line 192 of file exprtk_benchmark.cpp.

◆ Type [2/3]

template<typename T >
typedef functor_t::Type native< T >::Type

Definition at line 197 of file exprtk_mpfr_benchmark.cpp.

◆ Type [3/3]

template<typename T >
typedef functor_t::Type native< T >::Type

Definition at line 202 of file exprtk_real_benchmark.cpp.

Member Function Documentation

◆ avg() [1/3]

template<typename T >
static T native< T >::avg ( Type  x,
Type  y 
)
inlinestatic

Definition at line 194 of file exprtk_benchmark.cpp.

195 {
196 return (x + y) / T(2);
197 }

◆ avg() [2/3]

template<typename T >
static T native< T >::avg ( Type  x,
Type  y 
)
inlinestatic

Definition at line 199 of file exprtk_mpfr_benchmark.cpp.

200 {
201 return (x + y) / T(2);
202 }

◆ avg() [3/3]

template<typename T >
static T native< T >::avg ( Type  x,
Type  y 
)
inlinestatic

Definition at line 204 of file exprtk_real_benchmark.cpp.

205 {
206 return (x + y) / T(2);
207 }

◆ clamp() [1/3]

template<typename T >
static T native< T >::clamp ( const Type  l,
const Type  v,
const Type  u 
)
inlinestatic

Definition at line 199 of file exprtk_benchmark.cpp.

200 {
201 return ((v < l) ? l : ((v > u) ? u : v));
202 }

Referenced by native< T >::func14().

Here is the caller graph for this function:

◆ clamp() [2/3]

template<typename T >
static T native< T >::clamp ( const Type  l,
const Type  v,
const Type  u 
)
inlinestatic

Definition at line 204 of file exprtk_mpfr_benchmark.cpp.

205 {
206 return ((v < l) ? l : ((v > u) ? u : v));
207 }

◆ clamp() [3/3]

template<typename T >
static T native< T >::clamp ( const Type  l,
const Type  v,
const Type  u 
)
inlinestatic

Definition at line 209 of file exprtk_real_benchmark.cpp.

210 {
211 return ((v < l) ? l : ((v > u) ? u : v));
212 }

◆ func00() [1/3]

template<typename T >
static T native< T >::func00 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 204 of file exprtk_benchmark.cpp.

205 {
206 return (y + x);
207 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func00() [2/3]

template<typename T >
static T native< T >::func00 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 209 of file exprtk_mpfr_benchmark.cpp.

210 {
211 return (y + x);
212 }

◆ func00() [3/3]

template<typename T >
static T native< T >::func00 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 214 of file exprtk_real_benchmark.cpp.

215 {
216 return (y + x);
217 }

◆ func01() [1/3]

template<typename T >
static T native< T >::func01 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 209 of file exprtk_benchmark.cpp.

210 {
211 return T(2) * (y + x);
212 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func01() [2/3]

template<typename T >
static T native< T >::func01 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 214 of file exprtk_mpfr_benchmark.cpp.

215 {
216 return T(2) * (y + x);
217 }

◆ func01() [3/3]

template<typename T >
static T native< T >::func01 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 219 of file exprtk_real_benchmark.cpp.

220 {
221 return T(2) * (y + x);
222 }

◆ func02() [1/3]

template<typename T >
static T native< T >::func02 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 214 of file exprtk_benchmark.cpp.

215 {
216 return (T(2) * y + T(2) * x);
217 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func02() [2/3]

template<typename T >
static T native< T >::func02 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 219 of file exprtk_mpfr_benchmark.cpp.

220 {
221 return (T(2) * y + T(2) * x);
222 }

◆ func02() [3/3]

template<typename T >
static T native< T >::func02 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 224 of file exprtk_real_benchmark.cpp.

225 {
226 return (T(2) * y + T(2) * x);
227 }

◆ func03() [1/3]

template<typename T >
static T native< T >::func03 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 219 of file exprtk_benchmark.cpp.

220 {
221 return ((T(1.23) * (x * x)) / y) - T(123.123);
222 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func03() [2/3]

template<typename T >
static T native< T >::func03 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 224 of file exprtk_mpfr_benchmark.cpp.

225 {
226 return ((T(1.23) * (x * x)) / y) - T(123.123);
227 }

◆ func03() [3/3]

template<typename T >
static T native< T >::func03 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 229 of file exprtk_real_benchmark.cpp.

230 {
231 return ((T(1.23) * (x * x)) / y) - T(123.123);
232 }

◆ func04() [1/3]

template<typename T >
static T native< T >::func04 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 224 of file exprtk_benchmark.cpp.

225 {
226 return (y + x / y) * (x - y / x);
227 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func04() [2/3]

template<typename T >
static T native< T >::func04 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 229 of file exprtk_mpfr_benchmark.cpp.

230 {
231 return (y + x / y) * (x - y / x);
232 }

◆ func04() [3/3]

template<typename T >
static T native< T >::func04 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 234 of file exprtk_real_benchmark.cpp.

235 {
236 return (y + x / y) * (x - y / x);
237 }

◆ func05() [1/3]

template<typename T >
static T native< T >::func05 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 229 of file exprtk_benchmark.cpp.

230 {
231 return x / ((x + y) + (x - y)) / y;
232 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func05() [2/3]

template<typename T >
static T native< T >::func05 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 234 of file exprtk_mpfr_benchmark.cpp.

235 {
236 return x / ((x + y) + (x - y)) / y;
237 }

◆ func05() [3/3]

template<typename T >
static T native< T >::func05 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 239 of file exprtk_real_benchmark.cpp.

240 {
241 return x / ((x + y) + (x - y)) / y;
242 }

◆ func06() [1/3]

template<typename T >
static T native< T >::func06 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 234 of file exprtk_benchmark.cpp.

235 {
236 return T(1) - ((x * y) + (y / x)) - T(3);
237 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func06() [2/3]

template<typename T >
static T native< T >::func06 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 239 of file exprtk_mpfr_benchmark.cpp.

240 {
241 return T(1) - ((x * y) + (y / x)) - T(3);
242 }

◆ func06() [3/3]

template<typename T >
static T native< T >::func06 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 244 of file exprtk_real_benchmark.cpp.

245 {
246 return T(1) - ((x * y) + (y / x)) - T(3);
247 }

◆ func07() [1/3]

template<typename T >
static T native< T >::func07 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 239 of file exprtk_benchmark.cpp.

240 {
241 return (T(5.5) + x) + (T(2) * x - T(2) / T(3) * y) * (x / T(3) + y / T(4)) + (y + T(7.7));
242 }

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func07() [2/3]

template<typename T >
static T native< T >::func07 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 244 of file exprtk_mpfr_benchmark.cpp.

245 {
246 return (T(5.5) + x) + (T(2) * x - T(2) / T(3) * y) * (x / T(3) + y / T(4)) + (y + T(7.7));
247 }

◆ func07() [3/3]

template<typename T >
static T native< T >::func07 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 249 of file exprtk_real_benchmark.cpp.

250 {
251 return (T(5.5) + x) + (T(2) * x - T(2) / T(3) * y) * (x / T(3) + y / T(4)) + (y + T(7.7));
252 }

◆ func08() [1/3]

template<typename T >
static T native< T >::func08 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 244 of file exprtk_benchmark.cpp.

245 {
246 using namespace std;
247 return (T(1.1)*pow(x,T(1))+T(2.2)*pow(y,T(2))-T(3.3)*pow(x,T(3))+T(4.4)*pow(y,T(15))-T(5.5)*pow(x,T(23))+T(6.6)*pow(y,T(55)));
248 }
complex_t pow(const complex_t v0, const complex_t v1)

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func08() [2/3]

template<typename T >
static T native< T >::func08 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 249 of file exprtk_mpfr_benchmark.cpp.

250 {
251 using namespace std;
252 return (T(1.1)*pow(x,T(1))+T(2.2)*pow(y,T(2))-T(3.3)*pow(x,T(3))+T(4.4)*pow(y,T(15))-T(5.5)*pow(x,T(23))+T(6.6)*pow(y,T(55)));
253 }

◆ func08() [3/3]

template<typename T >
static T native< T >::func08 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 254 of file exprtk_real_benchmark.cpp.

255 {
256 using namespace std;
257 return (T(1.1)*pow(x,T(1))+T(2.2)*pow(y,T(2))-T(3.3)*pow(x,T(3))+T(4.4)*pow(y,T(15))-T(5.5)*pow(x,T(23))+T(6.6)*pow(y,T(55)));
258 }

◆ func09() [1/3]

template<typename T >
static T native< T >::func09 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 250 of file exprtk_benchmark.cpp.

251 {
252 return std::sin(T(2) * x) + std::cos(pi / y);
253 }
const real::type pi

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func09() [2/3]

template<typename T >
static T native< T >::func09 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 255 of file exprtk_mpfr_benchmark.cpp.

256 {
257 return mpfr::sin(T(2) * x) + mpfr::cos(pi / y);
258 }

References pi.

◆ func09() [3/3]

template<typename T >
static T native< T >::func09 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 260 of file exprtk_real_benchmark.cpp.

261 {
262 return std::sin(T(2) * x) + std::cos(pi_d / y);
263 }
const double pi_d

References pi_d.

◆ func10() [1/3]

template<typename T >
static T native< T >::func10 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 255 of file exprtk_benchmark.cpp.

256 {
257 return T(1) - std::sin(T(2) * x) + std::cos(pi / y);
258 }

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func10() [2/3]

template<typename T >
static T native< T >::func10 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 260 of file exprtk_mpfr_benchmark.cpp.

261 {
262 return T(1) - mpfr::sin(T(2) * x) + mpfr::cos(pi / y);
263 }

References pi.

◆ func10() [3/3]

template<typename T >
static T native< T >::func10 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 265 of file exprtk_real_benchmark.cpp.

266 {
267 return T(1) - std::sin(T(2) * x) + std::cos(pi_d / y);
268 }

References pi_d.

◆ func11() [1/3]

template<typename T >
static T native< T >::func11 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 260 of file exprtk_benchmark.cpp.

261 {
262 return std::sqrt(T(111.111) - std::sin(T(2) * x) + std::cos(pi / y) / T(333.333));
263 }

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func11() [2/3]

template<typename T >
static T native< T >::func11 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 265 of file exprtk_mpfr_benchmark.cpp.

266 {
267 return mpfr::sqrt(T(111.111) - mpfr::sin(T(2) * x) + mpfr::cos(pi / y) / T(333.333));
268 }

References pi.

◆ func11() [3/3]

template<typename T >
static T native< T >::func11 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 270 of file exprtk_real_benchmark.cpp.

271 {
272 return std::sqrt(T(111.111) - std::sin(T(2) * x) + std::cos(pi_d / y) / T(333.333));
273 }

References pi_d.

◆ func12() [1/3]

template<typename T >
static T native< T >::func12 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 265 of file exprtk_benchmark.cpp.

266 {
267 return ((x * x) / std::sin(T(2) * pi / y)) - x / T(2);
268 }

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func12() [2/3]

template<typename T >
static T native< T >::func12 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 270 of file exprtk_mpfr_benchmark.cpp.

271 {
272 return ((x * x) / mpfr::sin(T(2) * pi / y)) - x / T(2);
273 }

References pi.

◆ func12() [3/3]

template<typename T >
static T native< T >::func12 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 275 of file exprtk_real_benchmark.cpp.

276 {
277 return ((x * x) / std::sin(T(2) * pi_d / y)) - x / T(2);
278 }

References pi_d.

◆ func13() [1/3]

template<typename T >
static T native< T >::func13 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 270 of file exprtk_benchmark.cpp.

271 {
272 return (x + (std::cos(y - std::sin(T(2) / x * pi)) - std::sin(x - std::cos(T(2) * y / pi))) - y);
273 }

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func13() [2/3]

template<typename T >
static T native< T >::func13 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 275 of file exprtk_mpfr_benchmark.cpp.

276 {
277 return (x + (mpfr::cos(y - mpfr::sin(T(2) / x * pi)) - mpfr::sin(x - mpfr::cos(T(2) * y / pi))) - y);
278 }

References pi.

◆ func13() [3/3]

template<typename T >
static T native< T >::func13 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 280 of file exprtk_real_benchmark.cpp.

281 {
282 return (x + (std::cos(y - std::sin(T(2) / x * pi_d)) - std::sin(x - std::cos(T(2) * y / pi_d))) - y);
283 }

References pi_d.

◆ func14() [1/3]

template<typename T >
static T native< T >::func14 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 275 of file exprtk_benchmark.cpp.

276 {
277 return clamp(T(-1), std::sin(T(2) * pi * x) + std::cos(y / T(2) * pi), + T(1));
278 }
static T clamp(const Type l, const Type v, const Type u)

References native< T >::clamp(), and pi.

Referenced by pgo_primer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ func14() [2/3]

template<typename T >
static T native< T >::func14 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 280 of file exprtk_mpfr_benchmark.cpp.

281 {
282 return clamp(T(-1), mpfr::sin(T(2) * pi * x) + mpfr::cos(y / T(2) * pi), + T(1));
283 }

References native< T >::clamp(), and pi.

Here is the call graph for this function:

◆ func14() [3/3]

template<typename T >
static T native< T >::func14 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 285 of file exprtk_real_benchmark.cpp.

286 {
287 return clamp(T(-1), std::sin(T(2) * pi_d * x) + std::cos(y / T(2) * pi_d), + T(1));
288 }

References native< T >::clamp(), and pi_d.

Here is the call graph for this function:

◆ func15() [1/3]

template<typename T >
static T native< T >::func15 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 280 of file exprtk_benchmark.cpp.

281 {
282 return std::max(T(3.33), std::min(sqrt(T(1) - std::sin(T(2) * x) + std::cos(pi / y) / T(3)), T(1.11)));
283 }
complex_t sqrt(const complex_t v)

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func15() [2/3]

template<typename T >
static T native< T >::func15 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 285 of file exprtk_mpfr_benchmark.cpp.

286 {
287 return mpfr::max(T(3.33), mpfr::min(sqrt(T(1) - mpfr::sin(T(2) * x) + mpfr::cos(pi / y) / T(3)), T(1.11)));
288 }

References pi.

◆ func15() [3/3]

template<typename T >
static T native< T >::func15 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 290 of file exprtk_real_benchmark.cpp.

291 {
292 return std::max(T(3.33), std::min(sqrt(T(1) - std::sin(T(2) * x) + std::cos(pi_d / y) / T(3)), T(1.11)));
293 }

References pi_d.

◆ func16() [1/3]

template<typename T >
static T native< T >::func16 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 285 of file exprtk_benchmark.cpp.

286 {
287 return (((y + (x * T(2.2))) <= (x + y + T(1.1))) ? x - y : x * y) + T(2) * pi / x;
288 }

References pi.

Referenced by pgo_primer().

Here is the caller graph for this function:

◆ func16() [2/3]

template<typename T >
static T native< T >::func16 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 290 of file exprtk_mpfr_benchmark.cpp.

291 {
292 return (((y + (x * T(2.2))) <= (x + y + T(1.1))) ? x - y : x * y) + T(2) * pi / x;
293 }

References pi.

◆ func16() [3/3]

template<typename T >
static T native< T >::func16 ( Type  x,
Type  y 
)
inlinestatic

Definition at line 295 of file exprtk_real_benchmark.cpp.

296 {
297 return (((y + (x * T(2.2))) <= (x + y + T(1.1))) ? x - y : x * y) + T(2) * pi_d / x;
298 }

References pi_d.


The documentation for this struct was generated from the following files: