The vnl_math namespace provides a standard set of the simple mathematical functions (min, max, sqr, sgn, rnd, abs), and some predefined constants such as pi and e, which are not defined by the ANSI C++ standard.
There are complex versions defined in vnl_complex.h
That's right, M_PI is nonstandard!
Aside from e, pi and their associates the class also defines eps, the IEEE double machine precision. This is the smallest number eps such that 1+eps != 1.
The operations are overloaded for int, float and double arguments, which in combination with inlining can make them more efficient than their counterparts in the standard C library.
Modifications
210598 AWF Removed conditional VCL_IMPLEMENT_STATIC_CONSTS, sometimes gcc needs them.
LSB (Modifications) 23/1/01 Documentation tidied
Peter Vanroose - 7 Sept. 2002 - maxdouble etc. replaced by vnl_numeric_traits<T>::maxval
Amitha Perera - 13 Sep 2002 - make constant initialization standards compliant.
Definition in file vnl_math.h.
#include <vcl_cmath.h>
#include "dll.h"
#include <vxl_config.h>
Go to the source code of this file.
Classes | |
| class | vnl_math |
| real numerical constants. More... | |
Functions | |
| template<class T> | |
| T | vnl_huge_val (T) |
| Type-accessible infinities for use in templates. | |
| double | vnl_huge_val (double) |
| float | vnl_huge_val (float) |
| long int | vnl_huge_val (long int) |
| int | vnl_huge_val (int) |
| short | vnl_huge_val (short) |
| char | vnl_huge_val (char) |
| bool | vnl_math_isnan (char) |
| bool | vnl_math_isnan (short) |
| bool | vnl_math_isnan (int) |
| bool | vnl_math_isnan (long) |
| bool | vnl_math_isnan (signed char) |
| bool | vnl_math_isnan (unsigned char) |
| bool | vnl_math_isnan (float) |
| bool | vnl_math_isnan (double) |
| bool | vnl_math_isnan (long double) |
| template<class T> | |
| bool | vnl_math_isnan (T) |
| bool | vnl_math_isinf (char) |
| bool | vnl_math_isinf (short) |
| bool | vnl_math_isinf (int) |
| bool | vnl_math_isinf (long) |
| bool | vnl_math_isinf (signed char) |
| bool | vnl_math_isinf (unsigned char) |
| bool | vnl_math_isinf (float) |
| bool | vnl_math_isinf (double) |
| bool | vnl_math_isinf (long double) |
| template<class T> | |
| bool | vnl_math_isinf (T) |
| bool | vnl_math_isfinite (char) |
| bool | vnl_math_isfinite (short) |
| bool | vnl_math_isfinite (int) |
| bool | vnl_math_isfinite (long) |
| bool | vnl_math_isfinite (signed char) |
| bool | vnl_math_isfinite (unsigned char) |
| bool | vnl_math_isfinite (float) |
| bool | vnl_math_isfinite (double) |
| bool | vnl_math_isfinite (long double) |
| template<class T> | |
| bool | vnl_math_isfinite (T) |
| int | vnl_math_rnd (float x) |
| int | vnl_math_rnd (double x) |
| int | vnl_math_floor (float x) |
| int | vnl_math_floor (double x) |
| int | vnl_math_ceil (float x) |
| int | vnl_math_ceil (double x) |
| bool | vnl_math_abs (bool x) |
| unsigned char | vnl_math_abs (unsigned char x) |
| unsigned char | vnl_math_abs (signed char x) |
| unsigned char | vnl_math_abs (char x) |
| unsigned short | vnl_math_abs (short x) |
| unsigned short | vnl_math_abs (unsigned short x) |
| unsigned int | vnl_math_abs (int x) |
| unsigned int | vnl_math_abs (unsigned int x) |
| unsigned long | vnl_math_abs (long x) |
| unsigned long | vnl_math_abs (unsigned long x) |
| float | vnl_math_abs (float x) |
| double | vnl_math_abs (double x) |
| long double | vnl_math_abs (long double x) |
| int | vnl_math_max (int x, int y) |
| unsigned int | vnl_math_max (unsigned int x, unsigned int y) |
| long | vnl_math_max (long x, long y) |
| unsigned long | vnl_math_max (unsigned long x, unsigned long y) |
| float | vnl_math_max (float x, float y) |
| double | vnl_math_max (double x, double y) |
| int | vnl_math_min (int x, int y) |
| unsigned int | vnl_math_min (unsigned int x, unsigned int y) |
| long | vnl_math_min (long x, long y) |
| unsigned long | vnl_math_min (unsigned long x, unsigned long y) |
| float | vnl_math_min (float x, float y) |
| double | vnl_math_min (double x, double y) |
| bool | vnl_math_sqr (bool x) |
| int | vnl_math_sqr (int x) |
| unsigned int | vnl_math_sqr (unsigned int x) |
| long | vnl_math_sqr (long x) |
| unsigned long | vnl_math_sqr (unsigned long x) |
| float | vnl_math_sqr (float x) |
| double | vnl_math_sqr (double x) |
| bool | vnl_math_cube (bool x) |
| int | vnl_math_cube (int x) |
| unsigned int | vnl_math_cube (unsigned int x) |
| long | vnl_math_cube (long x) |
| unsigned long | vnl_math_cube (unsigned long x) |
| float | vnl_math_cube (float x) |
| double | vnl_math_cube (double x) |
| int | vnl_math_sgn (int x) |
| int | vnl_math_sgn (long x) |
| int | vnl_math_sgn (float x) |
| int | vnl_math_sgn (double x) |
| int | vnl_math_sgn0 (int x) |
| int | vnl_math_sgn0 (long x) |
| int | vnl_math_sgn0 (float x) |
| int | vnl_math_sgn0 (double x) |
| unsigned int | vnl_math_squared_magnitude (char x) |
| unsigned int | vnl_math_squared_magnitude (unsigned char x) |
| unsigned int | vnl_math_squared_magnitude (int x) |
| unsigned int | vnl_math_squared_magnitude (unsigned int x) |
| unsigned long | vnl_math_squared_magnitude (long x) |
| unsigned long | vnl_math_squared_magnitude (unsigned long x) |
| float | vnl_math_squared_magnitude (float x) |
| double | vnl_math_squared_magnitude (double x) |
| long double | vnl_math_squared_magnitude (long double x) |
| float | vnl_math_cuberoot (float a) |
| double | vnl_math_cuberoot (double a) |
| double | vnl_math_hypot (int x, int y) |
| float | vnl_math_hypot (float x, float y) |
| double | vnl_math_hypot (double x, double y) |
| long double | vnl_math_hypot (long double x, long double y) |
| char vnl_huge_val | ( | char | ) |
Definition at line 280 of file vnl_math.cxx.
| short vnl_huge_val | ( | short | ) |
Definition at line 279 of file vnl_math.cxx.
| int vnl_huge_val | ( | int | ) |
Definition at line 277 of file vnl_math.cxx.
| long int vnl_huge_val | ( | long | int | ) |
| float vnl_huge_val | ( | float | ) |
Definition at line 255 of file vnl_math.cxx.
| double vnl_huge_val | ( | double | ) |
Definition at line 254 of file vnl_math.cxx.
| T vnl_huge_val | ( | T | ) |
Type-accessible infinities for use in templates.
| long double vnl_math_abs | ( | long double | x | ) | [inline] |
Definition at line 202 of file vnl_math.h.
| double vnl_math_abs | ( | double | x | ) | [inline] |
Definition at line 201 of file vnl_math.h.
| float vnl_math_abs | ( | float | x | ) | [inline] |
Definition at line 200 of file vnl_math.h.
| unsigned long vnl_math_abs | ( | unsigned long | x | ) | [inline] |
Definition at line 199 of file vnl_math.h.
| unsigned long vnl_math_abs | ( | long | x | ) | [inline] |
Definition at line 198 of file vnl_math.h.
| unsigned int vnl_math_abs | ( | unsigned int | x | ) | [inline] |
Definition at line 197 of file vnl_math.h.
| unsigned int vnl_math_abs | ( | int | x | ) | [inline] |
Definition at line 196 of file vnl_math.h.
| unsigned short vnl_math_abs | ( | unsigned short | x | ) | [inline] |
Definition at line 195 of file vnl_math.h.
| unsigned short vnl_math_abs | ( | short | x | ) | [inline] |
Definition at line 194 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | char | x | ) | [inline] |
Definition at line 193 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | signed char | x | ) | [inline] |
Definition at line 192 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | unsigned char | x | ) | [inline] |
Definition at line 191 of file vnl_math.h.
| bool vnl_math_abs | ( | bool | x | ) | [inline] |
Definition at line 190 of file vnl_math.h.
| int vnl_math_ceil | ( | double | x | ) | [inline] |
Definition at line 187 of file vnl_math.h.
| int vnl_math_ceil | ( | float | x | ) | [inline] |
Definition at line 186 of file vnl_math.h.
| double vnl_math_cube | ( | double | x | ) | [inline] |
Definition at line 236 of file vnl_math.h.
| float vnl_math_cube | ( | float | x | ) | [inline] |
Definition at line 235 of file vnl_math.h.
| unsigned long vnl_math_cube | ( | unsigned long | x | ) | [inline] |
Definition at line 234 of file vnl_math.h.
| long vnl_math_cube | ( | long | x | ) | [inline] |
Definition at line 233 of file vnl_math.h.
| unsigned int vnl_math_cube | ( | unsigned int | x | ) | [inline] |
Definition at line 232 of file vnl_math.h.
| int vnl_math_cube | ( | int | x | ) | [inline] |
Definition at line 231 of file vnl_math.h.
| bool vnl_math_cube | ( | bool | x | ) | [inline] |
Definition at line 230 of file vnl_math.h.
| double vnl_math_cuberoot | ( | double | a | ) | [inline] |
Definition at line 263 of file vnl_math.h.
| float vnl_math_cuberoot | ( | float | a | ) | [inline] |
Definition at line 262 of file vnl_math.h.
| int vnl_math_floor | ( | double | x | ) | [inline] |
Definition at line 183 of file vnl_math.h.
| int vnl_math_floor | ( | float | x | ) | [inline] |
Definition at line 182 of file vnl_math.h.
| long double vnl_math_hypot | ( | long double | x, | |
| long double | y | |||
| ) | [inline] |
Definition at line 269 of file vnl_math.h.
| double vnl_math_hypot | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 268 of file vnl_math.h.
| float vnl_math_hypot | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 267 of file vnl_math.h.
| double vnl_math_hypot | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 266 of file vnl_math.h.
| bool vnl_math_isfinite | ( | T | ) |
| bool vnl_math_isfinite | ( | long | double | ) |
Definition at line 214 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | double | ) |
Definition at line 213 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | float | ) |
Definition at line 212 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | unsigned | char | ) | [inline] |
Definition at line 132 of file vnl_math.h.
| bool vnl_math_isfinite | ( | signed | char | ) | [inline] |
Definition at line 131 of file vnl_math.h.
| bool vnl_math_isfinite | ( | long | ) | [inline] |
Definition at line 130 of file vnl_math.h.
| bool vnl_math_isfinite | ( | int | ) | [inline] |
Definition at line 129 of file vnl_math.h.
| bool vnl_math_isfinite | ( | short | ) | [inline] |
Definition at line 128 of file vnl_math.h.
| bool vnl_math_isfinite | ( | char | ) | [inline] |
Definition at line 127 of file vnl_math.h.
| bool vnl_math_isinf | ( | T | ) |
| bool vnl_math_isinf | ( | long | double | ) |
Definition at line 241 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | double | ) |
Definition at line 240 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | float | ) |
Definition at line 239 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | unsigned | char | ) | [inline] |
Definition at line 115 of file vnl_math.h.
| bool vnl_math_isinf | ( | signed | char | ) | [inline] |
Definition at line 114 of file vnl_math.h.
| bool vnl_math_isinf | ( | long | ) | [inline] |
Definition at line 113 of file vnl_math.h.
| bool vnl_math_isinf | ( | int | ) | [inline] |
Definition at line 112 of file vnl_math.h.
| bool vnl_math_isinf | ( | short | ) | [inline] |
Definition at line 111 of file vnl_math.h.
| bool vnl_math_isinf | ( | char | ) | [inline] |
Definition at line 110 of file vnl_math.h.
| bool vnl_math_isnan | ( | T | ) |
| bool vnl_math_isnan | ( | long | double | ) |
Definition at line 166 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | double | ) |
Definition at line 165 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | float | ) |
Definition at line 164 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | unsigned | char | ) | [inline] |
Definition at line 98 of file vnl_math.h.
| bool vnl_math_isnan | ( | signed | char | ) | [inline] |
Definition at line 97 of file vnl_math.h.
| bool vnl_math_isnan | ( | long | ) | [inline] |
Definition at line 96 of file vnl_math.h.
| bool vnl_math_isnan | ( | int | ) | [inline] |
Definition at line 95 of file vnl_math.h.
| bool vnl_math_isnan | ( | short | ) | [inline] |
Definition at line 94 of file vnl_math.h.
| bool vnl_math_isnan | ( | char | ) | [inline] |
Definition at line 93 of file vnl_math.h.
| double vnl_math_max | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 210 of file vnl_math.h.
| float vnl_math_max | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 209 of file vnl_math.h.
| unsigned long vnl_math_max | ( | unsigned long | x, | |
| unsigned long | y | |||
| ) | [inline] |
Definition at line 208 of file vnl_math.h.
| long vnl_math_max | ( | long | x, | |
| long | y | |||
| ) | [inline] |
Definition at line 207 of file vnl_math.h.
| unsigned int vnl_math_max | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 206 of file vnl_math.h.
| int vnl_math_max | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 205 of file vnl_math.h.
| double vnl_math_min | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 218 of file vnl_math.h.
| float vnl_math_min | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 217 of file vnl_math.h.
| unsigned long vnl_math_min | ( | unsigned long | x, | |
| unsigned long | y | |||
| ) | [inline] |
Definition at line 216 of file vnl_math.h.
| long vnl_math_min | ( | long | x, | |
| long | y | |||
| ) | [inline] |
Definition at line 215 of file vnl_math.h.
| unsigned int vnl_math_min | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 214 of file vnl_math.h.
| int vnl_math_min | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 213 of file vnl_math.h.
| int vnl_math_rnd | ( | double | x | ) | [inline] |
Definition at line 178 of file vnl_math.h.
| int vnl_math_rnd | ( | float | x | ) | [inline] |
Definition at line 177 of file vnl_math.h.
| int vnl_math_sgn | ( | double | x | ) | [inline] |
Definition at line 242 of file vnl_math.h.
| int vnl_math_sgn | ( | float | x | ) | [inline] |
Definition at line 241 of file vnl_math.h.
| int vnl_math_sgn | ( | long | x | ) | [inline] |
Definition at line 240 of file vnl_math.h.
| int vnl_math_sgn | ( | int | x | ) | [inline] |
Definition at line 239 of file vnl_math.h.
| int vnl_math_sgn0 | ( | double | x | ) | [inline] |
Definition at line 248 of file vnl_math.h.
| int vnl_math_sgn0 | ( | float | x | ) | [inline] |
Definition at line 247 of file vnl_math.h.
| int vnl_math_sgn0 | ( | long | x | ) | [inline] |
Definition at line 246 of file vnl_math.h.
| int vnl_math_sgn0 | ( | int | x | ) | [inline] |
Definition at line 245 of file vnl_math.h.
| double vnl_math_sqr | ( | double | x | ) | [inline] |
Definition at line 227 of file vnl_math.h.
| float vnl_math_sqr | ( | float | x | ) | [inline] |
Definition at line 226 of file vnl_math.h.
| unsigned long vnl_math_sqr | ( | unsigned long | x | ) | [inline] |
Definition at line 225 of file vnl_math.h.
| long vnl_math_sqr | ( | long | x | ) | [inline] |
Definition at line 224 of file vnl_math.h.
| unsigned int vnl_math_sqr | ( | unsigned int | x | ) | [inline] |
Definition at line 223 of file vnl_math.h.
| int vnl_math_sqr | ( | int | x | ) | [inline] |
Definition at line 222 of file vnl_math.h.
| bool vnl_math_sqr | ( | bool | x | ) | [inline] |
Definition at line 221 of file vnl_math.h.
| long double vnl_math_squared_magnitude | ( | long double | x | ) | [inline] |
Definition at line 259 of file vnl_math.h.
| double vnl_math_squared_magnitude | ( | double | x | ) | [inline] |
Definition at line 258 of file vnl_math.h.
| float vnl_math_squared_magnitude | ( | float | x | ) | [inline] |
Definition at line 257 of file vnl_math.h.
| unsigned long vnl_math_squared_magnitude | ( | unsigned long | x | ) | [inline] |
Definition at line 256 of file vnl_math.h.
| unsigned long vnl_math_squared_magnitude | ( | long | x | ) | [inline] |
Definition at line 255 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | unsigned int | x | ) | [inline] |
Definition at line 254 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | int | x | ) | [inline] |
Definition at line 253 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | unsigned char | x | ) | [inline] |
Definition at line 252 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | char | x | ) | [inline] |
Definition at line 251 of file vnl_math.h.
1.5.1