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
21 May 1998 AWF Removed conditional VCL_IMPLEMENT_STATIC_CONSTS, sometimes gcc needs them.
LSB (Modifications) 23 Jan 2001 Documentation tidied
Peter Vanroose - 7 Sep 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>
#include <vnl/vnl_config.h>
Go to the source code of this file.
Classes | |
| class | vnl_math |
| real numerical constants. More... | |
Defines | |
| #define | GCC_USE_FAST_IMPL 0 |
| #define | VC_USE_FAST_IMPL 0 |
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_halfinttoeven (float x) |
| int | vnl_math_rnd_halfinttoeven (double x) |
| int | vnl_math_rnd_halfintup (float x) |
| int | vnl_math_rnd_halfintup (double x) |
| 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) |
| #define GCC_USE_FAST_IMPL 0 |
Definition at line 59 of file vnl_math.h.
| #define VC_USE_FAST_IMPL 0 |
Definition at line 65 of file vnl_math.h.
| char vnl_huge_val | ( | char | ) |
Definition at line 284 of file vnl_math.cxx.
| short vnl_huge_val | ( | short | ) |
Definition at line 283 of file vnl_math.cxx.
| int vnl_huge_val | ( | int | ) |
Definition at line 281 of file vnl_math.cxx.
| long int vnl_huge_val | ( | long | int | ) |
| float vnl_huge_val | ( | float | ) |
Definition at line 259 of file vnl_math.cxx.
| double vnl_huge_val | ( | double | ) |
Definition at line 258 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 529 of file vnl_math.h.
| double vnl_math_abs | ( | double | x | ) | [inline] |
Definition at line 528 of file vnl_math.h.
| float vnl_math_abs | ( | float | x | ) | [inline] |
Definition at line 527 of file vnl_math.h.
| unsigned long vnl_math_abs | ( | unsigned long | x | ) | [inline] |
Definition at line 526 of file vnl_math.h.
| unsigned long vnl_math_abs | ( | long | x | ) | [inline] |
Definition at line 525 of file vnl_math.h.
| unsigned int vnl_math_abs | ( | unsigned int | x | ) | [inline] |
Definition at line 524 of file vnl_math.h.
| unsigned int vnl_math_abs | ( | int | x | ) | [inline] |
Definition at line 523 of file vnl_math.h.
| unsigned short vnl_math_abs | ( | unsigned short | x | ) | [inline] |
Definition at line 522 of file vnl_math.h.
| unsigned short vnl_math_abs | ( | short | x | ) | [inline] |
Definition at line 521 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | char | x | ) | [inline] |
Definition at line 520 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | signed char | x | ) | [inline] |
Definition at line 519 of file vnl_math.h.
| unsigned char vnl_math_abs | ( | unsigned char | x | ) | [inline] |
Definition at line 518 of file vnl_math.h.
| bool vnl_math_abs | ( | bool | x | ) | [inline] |
Definition at line 517 of file vnl_math.h.
| int vnl_math_ceil | ( | double | x | ) | [inline] |
Definition at line 507 of file vnl_math.h.
| int vnl_math_ceil | ( | float | x | ) | [inline] |
Definition at line 503 of file vnl_math.h.
| double vnl_math_cube | ( | double | x | ) | [inline] |
Definition at line 563 of file vnl_math.h.
| float vnl_math_cube | ( | float | x | ) | [inline] |
Definition at line 562 of file vnl_math.h.
| unsigned long vnl_math_cube | ( | unsigned long | x | ) | [inline] |
Definition at line 561 of file vnl_math.h.
| long vnl_math_cube | ( | long | x | ) | [inline] |
Definition at line 560 of file vnl_math.h.
| unsigned int vnl_math_cube | ( | unsigned int | x | ) | [inline] |
Definition at line 559 of file vnl_math.h.
| int vnl_math_cube | ( | int | x | ) | [inline] |
Definition at line 558 of file vnl_math.h.
| bool vnl_math_cube | ( | bool | x | ) | [inline] |
Definition at line 557 of file vnl_math.h.
| double vnl_math_cuberoot | ( | double | a | ) | [inline] |
Definition at line 590 of file vnl_math.h.
| float vnl_math_cuberoot | ( | float | a | ) | [inline] |
Definition at line 589 of file vnl_math.h.
| int vnl_math_floor | ( | double | x | ) | [inline] |
Definition at line 422 of file vnl_math.h.
| int vnl_math_floor | ( | float | x | ) | [inline] |
Definition at line 418 of file vnl_math.h.
| long double vnl_math_hypot | ( | long double | x, | |
| long double | y | |||
| ) | [inline] |
Definition at line 596 of file vnl_math.h.
| double vnl_math_hypot | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 595 of file vnl_math.h.
| float vnl_math_hypot | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 594 of file vnl_math.h.
| double vnl_math_hypot | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 593 of file vnl_math.h.
| bool vnl_math_isfinite | ( | T | ) |
| bool vnl_math_isfinite | ( | long | double | ) |
Definition at line 218 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | double | ) |
Definition at line 217 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | float | ) |
Definition at line 216 of file vnl_math.cxx.
| bool vnl_math_isfinite | ( | unsigned | char | ) | [inline] |
Definition at line 164 of file vnl_math.h.
| bool vnl_math_isfinite | ( | signed | char | ) | [inline] |
Definition at line 163 of file vnl_math.h.
| bool vnl_math_isfinite | ( | long | ) | [inline] |
Definition at line 162 of file vnl_math.h.
| bool vnl_math_isfinite | ( | int | ) | [inline] |
Definition at line 161 of file vnl_math.h.
| bool vnl_math_isfinite | ( | short | ) | [inline] |
Definition at line 160 of file vnl_math.h.
| bool vnl_math_isfinite | ( | char | ) | [inline] |
Definition at line 159 of file vnl_math.h.
| bool vnl_math_isinf | ( | T | ) |
| bool vnl_math_isinf | ( | long | double | ) |
Definition at line 245 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | double | ) |
Definition at line 244 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | float | ) |
Definition at line 243 of file vnl_math.cxx.
| bool vnl_math_isinf | ( | unsigned | char | ) | [inline] |
Definition at line 147 of file vnl_math.h.
| bool vnl_math_isinf | ( | signed | char | ) | [inline] |
Definition at line 146 of file vnl_math.h.
| bool vnl_math_isinf | ( | long | ) | [inline] |
Definition at line 145 of file vnl_math.h.
| bool vnl_math_isinf | ( | int | ) | [inline] |
Definition at line 144 of file vnl_math.h.
| bool vnl_math_isinf | ( | short | ) | [inline] |
Definition at line 143 of file vnl_math.h.
| bool vnl_math_isinf | ( | char | ) | [inline] |
Definition at line 142 of file vnl_math.h.
| bool vnl_math_isnan | ( | T | ) |
| bool vnl_math_isnan | ( | long | double | ) |
Definition at line 168 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | double | ) |
Definition at line 167 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | float | ) |
Definition at line 166 of file vnl_math.cxx.
| bool vnl_math_isnan | ( | unsigned | char | ) | [inline] |
Definition at line 127 of file vnl_math.h.
| bool vnl_math_isnan | ( | signed | char | ) | [inline] |
Definition at line 126 of file vnl_math.h.
| bool vnl_math_isnan | ( | long | ) | [inline] |
Definition at line 125 of file vnl_math.h.
| bool vnl_math_isnan | ( | int | ) | [inline] |
Definition at line 124 of file vnl_math.h.
| bool vnl_math_isnan | ( | short | ) | [inline] |
Definition at line 123 of file vnl_math.h.
| bool vnl_math_isnan | ( | char | ) | [inline] |
Definition at line 122 of file vnl_math.h.
| double vnl_math_max | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 537 of file vnl_math.h.
| float vnl_math_max | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 536 of file vnl_math.h.
| unsigned long vnl_math_max | ( | unsigned long | x, | |
| unsigned long | y | |||
| ) | [inline] |
Definition at line 535 of file vnl_math.h.
| long vnl_math_max | ( | long | x, | |
| long | y | |||
| ) | [inline] |
Definition at line 534 of file vnl_math.h.
| unsigned int vnl_math_max | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 533 of file vnl_math.h.
| int vnl_math_max | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 532 of file vnl_math.h.
| double vnl_math_min | ( | double | x, | |
| double | y | |||
| ) | [inline] |
Definition at line 545 of file vnl_math.h.
| float vnl_math_min | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Definition at line 544 of file vnl_math.h.
| unsigned long vnl_math_min | ( | unsigned long | x, | |
| unsigned long | y | |||
| ) | [inline] |
Definition at line 543 of file vnl_math.h.
| long vnl_math_min | ( | long | x, | |
| long | y | |||
| ) | [inline] |
Definition at line 542 of file vnl_math.h.
| unsigned int vnl_math_min | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 541 of file vnl_math.h.
| int vnl_math_min | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Definition at line 540 of file vnl_math.h.
| int vnl_math_rnd | ( | double | x | ) | [inline] |
Definition at line 339 of file vnl_math.h.
| int vnl_math_rnd | ( | float | x | ) | [inline] |
Definition at line 338 of file vnl_math.h.
| int vnl_math_rnd_halfinttoeven | ( | double | x | ) | [inline] |
Definition at line 265 of file vnl_math.h.
| int vnl_math_rnd_halfinttoeven | ( | float | x | ) | [inline] |
Definition at line 248 of file vnl_math.h.
| int vnl_math_rnd_halfintup | ( | double | x | ) | [inline] |
Definition at line 310 of file vnl_math.h.
| int vnl_math_rnd_halfintup | ( | float | x | ) | [inline] |
Definition at line 305 of file vnl_math.h.
| int vnl_math_sgn | ( | double | x | ) | [inline] |
Definition at line 569 of file vnl_math.h.
| int vnl_math_sgn | ( | float | x | ) | [inline] |
Definition at line 568 of file vnl_math.h.
| int vnl_math_sgn | ( | long | x | ) | [inline] |
Definition at line 567 of file vnl_math.h.
| int vnl_math_sgn | ( | int | x | ) | [inline] |
Definition at line 566 of file vnl_math.h.
| int vnl_math_sgn0 | ( | double | x | ) | [inline] |
Definition at line 575 of file vnl_math.h.
| int vnl_math_sgn0 | ( | float | x | ) | [inline] |
Definition at line 574 of file vnl_math.h.
| int vnl_math_sgn0 | ( | long | x | ) | [inline] |
Definition at line 573 of file vnl_math.h.
| int vnl_math_sgn0 | ( | int | x | ) | [inline] |
Definition at line 572 of file vnl_math.h.
| double vnl_math_sqr | ( | double | x | ) | [inline] |
Definition at line 554 of file vnl_math.h.
| float vnl_math_sqr | ( | float | x | ) | [inline] |
Definition at line 553 of file vnl_math.h.
| unsigned long vnl_math_sqr | ( | unsigned long | x | ) | [inline] |
Definition at line 552 of file vnl_math.h.
| long vnl_math_sqr | ( | long | x | ) | [inline] |
Definition at line 551 of file vnl_math.h.
| unsigned int vnl_math_sqr | ( | unsigned int | x | ) | [inline] |
Definition at line 550 of file vnl_math.h.
| int vnl_math_sqr | ( | int | x | ) | [inline] |
Definition at line 549 of file vnl_math.h.
| bool vnl_math_sqr | ( | bool | x | ) | [inline] |
Definition at line 548 of file vnl_math.h.
| long double vnl_math_squared_magnitude | ( | long double | x | ) | [inline] |
Definition at line 586 of file vnl_math.h.
| double vnl_math_squared_magnitude | ( | double | x | ) | [inline] |
Definition at line 585 of file vnl_math.h.
| float vnl_math_squared_magnitude | ( | float | x | ) | [inline] |
Definition at line 584 of file vnl_math.h.
| unsigned long vnl_math_squared_magnitude | ( | unsigned long | x | ) | [inline] |
Definition at line 583 of file vnl_math.h.
| unsigned long vnl_math_squared_magnitude | ( | long | x | ) | [inline] |
Definition at line 582 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | unsigned int | x | ) | [inline] |
Definition at line 581 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | int | x | ) | [inline] |
Definition at line 580 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | unsigned char | x | ) | [inline] |
Definition at line 579 of file vnl_math.h.
| unsigned int vnl_math_squared_magnitude | ( | char | x | ) | [inline] |
Definition at line 578 of file vnl_math.h.
1.5.1