Qwt Programmer's Manual
QwtMath
QwtMath - a set of mathematical routines
#include <qwtMath.h>
- qwtGetMin
- Find the smallest value in an array
- qwtGetMax
- Find the largest value in an array
- qwtTwistArray
- invert the order of an array
- qwtFloor125
- Find the largest value fitting in a 1-2-5 pattern
- qwtCeil125
- Find the smallest value fitting in a 1-2-5 pattern
- qwtChkMono
- Check for monotony
- qwtLinSpace
- construct an array of equally spaced values
- qwtLogSpace
- construct an array of logarithmically equally spaced values
- qwtMax
- Return the largest of two values
- qwtMin
- Return the smallest of two values
- qwtAbs
- return the absolute value
- qwtSign
- Return the sign of a number
- qwtSqr
- Return the square of a number
- qwtCopyArray
- Copy an array into another
- qwtShiftArray
- Shift an array
- qwtSwap
- Swap two values
- qwtSort (1)
- Sort two values
- qwtSort (2)
- Sort two values
- qwtInt
- Return nearest integer
- qwtLim
- Limit a values
Find the smallest value in an array
double qwtGetMin(double *array, int size)
- double *array, int size
-
Find the largest value in an array
double qwtGetMax(double *array, int size)
- double *array, int size
-
Find the smallest value out of {1,2,5}*10^n with an integer number n
which is greater than or equal to x
double qwtCeil125(double x)
- double x
-
Find the largest value out of {1,2,5}*10^n with an integer number n
which is smaller than or equal to x
double qwtFloor125(double x)
- double x
-
Checks if an array is a strictly monotonic sequence
int qwtChkMono(double *array, int size)
- double *array
- pointer to a double array
- int size
- size of the array
- 0
- sequence is not strictly monotonic
- 1
- sequence is strictly monotonically increasing
- -1
- sequence is strictly monotonically decreasing
Invert the order of array elements
void qwtTwistArray(double *array, int size)
- double *array, int size
-
Create an array of equally spaced values
void qwtLinSpace(double *array, int size, double xmin, double xmax)
- double *array
- where to put the values
- int size
- size of the array
- double xmin
- value associated with index 0
- double xmax
- value associated with index (size-1)
Create an array of logarithmically equally spaced values
void qwtLogSpace(double *array, int size, double xmin, double xmax)
- double *array
- where to put the values
- int size
- size of the array
- double xmin
- value associated with index 0
- double xmax
- value associated with index (size-1)
Return the largest of two values
template<class T> const T& qwtMax(const T& x, const T& y)
- const T& x, const T& y
- values to be compared
Return the smallest of two values
template<class T> const T& qwtMin(const T& x, const T& y)
- const T& x, const T& y
- values to be compared
Return the absolute value
template<class T> T qwtAbs(const T& x)
- const T& x
- input value
Return the sign
template <class T> int qwtSign(const T& x)
- const T& x
- input value
1, -1, or 0
Return the square of a number
template<class T> T qwtSqr(const T& x)
- const T& x
- input value
Copy an array into another
template <class T> void qwtCopyArray(T* dest, T* src, int n)
- T* dest
- destination
- T* src
- source
- int n
- number of elements
Shift an array by a specified number of positions
template<class T> void qwtShiftArray(T* arr, int size, int di)
- T* arr
- Pointer to an array
- int size
- Number of elements
- int di
- Number of positions. A positive number shifts right,
a negative number shifts left.
Swap two values
template <class T> void qwtSwap(T &x1, T& x2)
- T &x1, T& x2
- values to be swapped
Sort two values in ascending order
template<class T> void qwtSort(T& x1, T& x2)
- T& x1, T& x2
- Values to be sorted
Sort two values in ascending order
template<class T> void qwtSort(const T& x1, const T& x2, T& xmax, T& xmin)
- const T& x1, const T& x2
- input values
- T& xmax
- greater value
- T& xmin
- smaller value
Round a number to the nearest integer
int qwtInt(double x)
- double x
- input value
Limit a value to fit into a specified interval
template<class T> T qwtLim( T& x, T& x1, T& x2)
- const T& x
- input value
- const T& x1, const T& x2
- interval boundaries
Qwt Widget Library 27/04/96