![]() |
JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
|
Classes | |
| struct | JKQTPPolynomialFunctor |
| a C++-functor, which evaluates a polynomial More... | |
Macros | |
| #define | JKQTP_DOUBLE_EPSILON (std::numeric_limits<double>::epsilon()) |
| double-value epsilon | |
| #define | JKQTP_DOUBLE_NAN (std::numeric_limits<double>::signaling_NaN()) |
| double-value NotANumber | |
| #define | JKQTP_EPSILON JKQTP_DOUBLE_EPSILON |
| double-value NotANumber | |
| #define | JKQTP_FLOAT_EPSILON (std::numeric_limits<float>::epsilon()) |
| float-value epsilon | |
| #define | JKQTP_FLOAT_NAN (std::numeric_limits<float>::signaling_NaN()) |
| float-value NotANumber | |
| #define | JKQTP_NAN JKQTP_DOUBLE_NAN |
| double-value NotANumber | |
| #define | JKQTPSTATISTICS_LN10 2.30258509299404568402 |
| #define | JKQTPSTATISTICS_PI 3.14159265358979323846 |
| #define | JKQTPSTATISTICS_SQRT_2PI 2.50662827463 |
Functions | |
| bool | jkqtp_approximatelyEqual (double a, double b, double epsilon=2.0 *JKQTP_DOUBLE_EPSILON) |
| compare two doubles a and b for euqality, where any difference smaller than epsilon is seen as equality | |
| bool | jkqtp_approximatelyEqual (float a, float b, float epsilon=2.0f *JKQTP_FLOAT_EPSILON) |
| compare two floats a and b for euqality, where any difference smaller than epsilon is seen as equality | |
| bool | jkqtp_approximatelyUnequal (double a, double b, double epsilon=2.0 *JKQTP_DOUBLE_EPSILON) |
| compare two doubles a and b for uneuqality, where any difference smaller than epsilon is seen as equality | |
| bool | jkqtp_approximatelyUnequal (float a, float b, float epsilon=2.0f *JKQTP_FLOAT_EPSILON) |
| compare two floats a and b for uneuqality, where any difference smaller than epsilon is seen as equality | |
| template<typename T> | |
| T | jkqtp_bounded (T min, T v, T max) |
| limits a value v to the given range min ... max | |
| template<typename T, typename TIn> | |
| T | jkqtp_bounded (TIn v) |
limits a value v to the range of the given type T , i.e. std::numeric_limits<T>::min() ... std::numeric_limits<T>::max() | |
| template<typename T> | |
| T | jkqtp_boundedRoundTo (const double &v) |
round a double v using round() and convert it to a specified type T (static_cast!). Finally the value is bounded to the range std::numeric_limits<T>::min() ... std::numeric_limits<T>::max() | |
| template<typename T> | |
| T | jkqtp_boundedRoundTo (T min, const double &v, T max) |
| round a double v using round() and convert it to a specified type T (static_cast!). Finally the value is bounded to the range min ... max | |
| template<typename T> | |
| T | jkqtp_ceilTo (const double &v) |
| round a double v using ceil() and convert it to a specified type T (static_cast!) | |
| template<class T = int> | |
| T | jkqtp_combination (T n, T k) |
| Calculates a combination | |
| void | jkqtp_combine_hash (std::size_t &seed, std::size_t hsh) |
| can be used to build a hash-values from several hash-values | |
| template<class T> | |
| T | jkqtp_cube (T x) |
| cube of a number | |
| double | jkqtp_distance (const QPoint &p1, const QPoint &p2) |
| calculate the distance between two QPoint points | |
| double | jkqtp_distance (const QPointF &p1, const QPointF &p2) |
| calculate the distance between two QPointF points | |
| JKQTCOMMON_LIB_EXPORT void | jkqtp_estimateFraction (double input, int &sign, uint64_t &intpart, uint64_t &num, uint64_t &denom, unsigned int precision=9) |
| calculates numeratur integer part intpart , num and denominator denom of a fraction, representing a given floating-point number input | |
| template<class T = int> | |
| T | jkqtp_factorial (T n) |
| Calculates a factorial | |
| template<typename T> | |
| T | jkqtp_floorTo (const double &v) |
| round a double v using floor() and convert it to a specified type T (static_cast!) | |
| double | jkqtp_gaussdist (double x, double mu=0.0, double sigma=1.0) |
| evaluates a gaussian propability density function | |
| JKQTCOMMON_LIB_EXPORT uint64_t | jkqtp_gcd (uint64_t a, uint64_t b) |
| calculate the grwates common divisor (GCD) of a and b | |
| template<class PolyItP> | |
| std::function< double(double)> | jkqtp_generatePolynomialModel (PolyItP firstP, PolyItP lastP) |
| returns a C++-functor, which evaluates a polynomial | |
| template<class T> | |
| void | jkqtp_hash_combine (std::size_t &seed, const T &v) |
| can be used to build a hash-values from several hash-values | |
| template<typename T> | |
| T | jkqtp_identity (const T &v) |
| returns the given value v (i.e. identity function) | |
| template<typename T> | |
| T | jkqtp_inverseProp (const T &v) |
| returns the inversely proportional value 1/v of v | |
| template<typename T> | |
| T | jkqtp_inversePropSave (const T &v, const T &absMinV) |
| returns the inversely proportional value 1/v of v and ensures that | |
| template<typename T> | |
| T | jkqtp_inversePropSaveDefault (const T &v) |
returns the inversely proportional value 1/v of v and ensures that absMinV=std::numeric_limits<T>::epsilon()*100.0 | |
| double | jkqtp_j0 (double x) |
| j0() function (without compiler issues) | |
| double | jkqtp_j1 (double x) |
| j1() function (without compiler issues) | |
| double | jkqtp_jn (int n, double x) |
| jn() function (without compiler issues) | |
| template<class T> | |
| std::function< T(T)> | jkqtp_makeBernstein (int n, int i) |
| creates a functor that evaluates the Bernstein polynomial | |
| template<class PolyItP> | |
| double | jkqtp_polyEval (double x, PolyItP firstP, PolyItP lastP) |
| evaluate a polynomial | |
| template<class PolyItP> | |
| QString | jkqtp_polynomialModel2Latex (PolyItP firstP, PolyItP lastP) |
| Generates a LaTeX string for the polynomial model with the coefficients firstP ... lastP. | |
| template<class T> | |
| T | jkqtp_pow4 (T x) |
| 4-th power of a number | |
| template<class T> | |
| T | jkqtp_pow5 (T x) |
| 5-th power of a number | |
| template<class T> | |
| T | jkqtp_reversed (const T &l) |
| returns the reversed containter l | |
| template<typename T> | |
| T | jkqtp_roundTo (const double &v) |
| round a double v using round() and convert it to a specified type T (static_cast!) | |
| double | jkqtp_roundToDigits (const double &v, const int decDigits) |
| round a double v using round() to a given number of decimal digits | |
| template<class T> | |
| T | jkqtp_sign (T x) |
| calculates the sign of number x (-1 for x<0 and +1 for x>=0) | |
| template<typename T> | |
| T | jkqtp_sqr (const T &v) |
returns the quare of the value v, i.e. v*v | |
| template<> | |
| constexpr double | jkqtp_todouble (const bool &d) |
| converts a boolean to a double, is used to convert boolean to double by JKQTPDatastore | |
| template<typename T> | |
| constexpr double | jkqtp_todouble (const T &d) |
| converts a boolean to a double, is used to convert boolean to double by JKQTPDatastore | |
| template<typename T> | |
| T | jkqtp_truncTo (const double &v) |
| round a double v using trunc() and convert it to a specified type T (static_cast!) | |
| double | jkqtp_y0 (double x) |
| y0() function (without compiler issues) | |
| double | jkqtp_y1 (double x) |
| y1() function (without compiler issues) | |
| double | jkqtp_yn (int n, double x) |
| yn() function (without compiler issues) | |
| template<typename T> | |
| bool | JKQTPIsOKFloat (T v) |
| check whether the dlotaing point number is OK (i.e. non-inf, non-NAN) | |
This group assembles a variety of mathematical tool functions that are used in different places.
| #define JKQTP_DOUBLE_EPSILON (std::numeric_limits<double>::epsilon()) |
double-value epsilon
| #define JKQTP_DOUBLE_NAN (std::numeric_limits<double>::signaling_NaN()) |
double-value NotANumber
| #define JKQTP_EPSILON JKQTP_DOUBLE_EPSILON |
double-value NotANumber
| #define JKQTP_FLOAT_EPSILON (std::numeric_limits<float>::epsilon()) |
float-value epsilon
| #define JKQTP_FLOAT_NAN (std::numeric_limits<float>::signaling_NaN()) |
float-value NotANumber
| #define JKQTP_NAN JKQTP_DOUBLE_NAN |
double-value NotANumber
| #define JKQTPSTATISTICS_LN10 2.30258509299404568402 |

| #define JKQTPSTATISTICS_PI 3.14159265358979323846 |

| #define JKQTPSTATISTICS_SQRT_2PI 2.50662827463 |

|
inline |
compare two doubles a and b for euqality, where any difference smaller than epsilon is seen as equality
|
inline |
compare two floats a and b for euqality, where any difference smaller than epsilon is seen as equality
|
inline |
compare two doubles a and b for uneuqality, where any difference smaller than epsilon is seen as equality
|
inline |
compare two floats a and b for uneuqality, where any difference smaller than epsilon is seen as equality
|
inline |
limits a value v to the given range min ... max
| T | a numeric datatype (int, double, ...) |
| min | minimum output value |
| v | the value to round and cast |
| max | maximum output value |
|
inline |
limits a value v to the range of the given type T , i.e. std::numeric_limits<T>::min() ... std::numeric_limits<T>::max()
| T | a numeric datatype (int, double, ...) for the output |
| TIn | a numeric datatype (int, double, ...) or the input v |
| v | the value to round and cast |
std::numeric_limits<T>::min() .
|
inline |
round a double v using round() and convert it to a specified type T (static_cast!). Finally the value is bounded to the range std::numeric_limits<T>::min() ... std::numeric_limits<T>::max()
| T | a numeric datatype (int, double, ...) |
| v | the value to round and cast |
this is equivalent to
|
inline |
round a double v using round() and convert it to a specified type T (static_cast!). Finally the value is bounded to the range min ... max
| T | a numeric datatype (int, double, ...) |
| min | minimum output value |
| v | the value to round and cast |
| max | maximum output value |
this is equivalent to
|
inline |
round a double v using ceil() and convert it to a specified type T (static_cast!)
| T | a numeric datatype (int, double, ...) |
| v | the value to ceil and cast |
this is equivalent to
|
inline |
Calculates a combination 
|
inline |
can be used to build a hash-values from several hash-values
|
inline |
cube of a number
|
inline |
calculate the distance between two QPoint points
|
inline |
calculate the distance between two QPointF points
| JKQTCOMMON_LIB_EXPORT void jkqtp_estimateFraction | ( | double | input, |
| int & | sign, | ||
| uint64_t & | intpart, | ||
| uint64_t & | num, | ||
| uint64_t & | denom, | ||
| unsigned int | precision = 9 ) |
calculates numeratur integer part intpart , num and denominator denom of a fraction, representing a given floating-point number input
|
inline |
Calculates a factorial 
|
inline |
round a double v using floor() and convert it to a specified type T (static_cast!)
| T | a numeric datatype (int, double, ...) |
| v | the value to floor and cast |
this is equivalent to
|
inline |
evaluates a gaussian propability density function
![\[ f(x,\mu, \sigma)=\frac{1}{\sqrt{2\pi\sigma^2}}\cdot\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \]](form_14.png)
| JKQTCOMMON_LIB_EXPORT uint64_t jkqtp_gcd | ( | uint64_t | a, |
| uint64_t | b ) |
calculate the grwates common divisor (GCD) of a and b
|
inline |
returns a C++-functor, which evaluates a polynomial
| PolyItP | iterator for the polynomial coefficients |
| firstP | points to the first polynomial coefficient |
| lastP | points behind the last polynomial coefficient |
|
inline |
can be used to build a hash-values from several hash-values
|
inline |
returns the given value v (i.e. identity function)
|
inline |
returns the inversely proportional value 1/v of v
|
inline |
returns the inversely proportional value 1/v of v and ensures that 
|
inline |
returns the inversely proportional value 1/v of v and ensures that 
absMinV=std::numeric_limits<T>::epsilon()*100.0
|
inline |
j0() function (without compiler issues)
|
inline |
j1() function (without compiler issues)
|
inline |
jn() function (without compiler issues)
| std::function< T(T)> jkqtp_makeBernstein | ( | int | n, |
| int | i ) |
creates a functor that evaluates the Bernstein polynomial 
|
inline |
evaluate a polynomial 

| PolyItP | iterator for the polynomial coefficients |
| x | where to evaluate |
| firstP | points to the first polynomial coefficient |
| lastP | points behind the last polynomial coefficient |

| QString jkqtp_polynomialModel2Latex | ( | PolyItP | firstP, |
| PolyItP | lastP ) |
Generates a LaTeX string for the polynomial model with the coefficients firstP ... lastP.
| PolyItP | iterator for the polynomial coefficients |
| firstP | points to the first polynomial coefficient |
| lastP | points behind the last polynomial coefficient |
|
inline |
4-th power of a number
|
inline |
5-th power of a number
|
inline |
returns the reversed containter l
|
inline |
round a double v using round() and convert it to a specified type T (static_cast!)
| T | a numeric datatype (int, double, ...) |
| v | the value to round and cast |
this is equivalent to
|
inline |
round a double v using round() to a given number of decimal digits
| v | the value to round and cast |
| decDigits | number of decimal digits, i.e. precision of the result |
this is equivalent to
|
inline |
calculates the sign of number x (-1 for x<0 and +1 for x>=0)
|
inline |
returns the quare of the value v, i.e. v*v
|
inlineconstexpr |
converts a boolean to a double, is used to convert boolean to double by JKQTPDatastore
Specialisation of the generic template jkqtp_todouble() with (true -> 1.0, false -> 0.0)
|
inlineconstexpr |
converts a boolean to a double, is used to convert boolean to double by JKQTPDatastore
This function uses static_cast<double>() by default, but certain specializations (e.g. for bool) are readily available.
|
inline |
round a double v using trunc() and convert it to a specified type T (static_cast!)
| T | a numeric datatype (int, double, ...) |
| v | the value to trunc and cast |
this is equivalent to
|
inline |
y0() function (without compiler issues)
|
inline |
y1() function (without compiler issues)
|
inline |
yn() function (without compiler issues)
|
inline |
check whether the dlotaing point number is OK (i.e. non-inf, non-NAN)