Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/ray/src/lib/numerics/num_math.h File Reference

The math.h analogon of the numerics code. Always include. More...

#include <lib/sconfig.h>
#include <math.h>

Include dependency graph for num_math.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  NUM

Defines

#define SCFMinit(x)
#define NUM_OVERLOADED_R(func, cfunc)
#define NUM_OVERLOADED(func)   NUM_OVERLOADED_R(func,func)
#define NUM_OVERLOADED2_R(func, cfunc)
#define NUM_OVERLOADED2(func)   NUM_OVERLOADED2_R(func,func)
#define IROUND_OVERLOADED(func, itype)


Detailed Description

The math.h analogon of the numerics code. Always include.

Author:
Wolfgang Wieser ] wwieser (a) gmx <*> de [
This file contains the most basic and essential numerics functions and should always be included at locations where otherwise math.h would have stood. (num_math.h includes math.h itself).

NOTE: Put all your numerics code into the NUM namespace. Otherwise including <num_math.h> will "not help".

This file is meant to collect all the ugly floating point HAVE_XXX handling, etc. Only functions in that file should be used in numerical Calculations; do NOT use <math.h> functions directly. This normally happens automatically if you include num_math.h and put your code into namespace NUM.

Note that this file provides some (potentially) optimized versions of floating-point functionality, such as max(x,y), min(x,y), fabs(x) which are faster as using e.g. (x<0 -x : x). Hence, try to use as much functionality from this file as you can!

Definition in file num_math.h.


Define Documentation

#define IROUND_OVERLOADED func,
itype   ) 
 

Value:

template<> inline itype func<itype,double>(double x) \
        { return(NUM::func<int32>(x)); } \
    template<> inline itype func<itype,float>(float x) \
        { return(NUM::func<int32>(x)); } \
    template<> inline itype func<itype,long double>(long double x) \
        { return(NUM::func<int32>(x)); }

Definition at line 342 of file num_math.h.

#define NUM_OVERLOADED func   )     NUM_OVERLOADED_R(func,func)
 

Definition at line 279 of file num_math.h.

#define NUM_OVERLOADED2 func   )     NUM_OVERLOADED2_R(func,func)
 

Definition at line 286 of file num_math.h.

#define NUM_OVERLOADED2_R func,
cfunc   ) 
 

Value:

inline double func(double x,double y)  {  return(::cfunc(x,y));  } \
    inline float func(float x,float y)     {  return(::cfunc ## f(x,y));  } \
    inline long double func(long double x,long double y) \
        {  return(::cfunc ## l(x,y));  }

Definition at line 281 of file num_math.h.

#define NUM_OVERLOADED_R func,
cfunc   ) 
 

Value:

inline double func(double x)  {  return(::cfunc(x));  } \
    inline float func(float x)    {  return(::cfunc ## f(x));  } \
    inline long double func(long double x)  {  return(::cfunc ## l(x));  }

Definition at line 275 of file num_math.h.

#define SCFMinit  ) 
 

Definition at line 89 of file num_math.h.


Generated on Sat Feb 19 22:34:20 2005 for Ray by doxygen 1.3.5