Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Safety_ Class Reference

#include <Safety.hh>

List of all members.

Public Methods

 Safety_ (bool Safediv=true)
 ctor: set Safediv to true if you want to use the safe-division feature (default).

bool safe_div () const
 safe_div(): returns the Usesafediv variable. More...

bool safe_div (bool S)
double safe_div (double Num, double Denom, int Lineno=0) const
 safe_div(): returns Num/Denom if Denom is reliably non-0. More...

double pythag (double a, double b) const
 pythag(): returns the value sqrt(a^2+b^2) without over- or underflows. More...


Static Public Methods

double small ()
 return the smallest number which can still divide 1.0 w/o problems.


Private Attributes

bool Usesafediv
 use safe division check if set to true.


Static Private Attributes

Fparch_<double> Fp
 double-precision floating-point consts.

const double SMALL
 smallest non-0 for which 1.0/SMALL is OK.


Constructor & Destructor Documentation

RazorBack::Safety_::Safety_ ( bool Safediv = true ) [inline, explicit]
 

ctor: set Safediv to true if you want to use the safe-division feature (default).

Definition at line 44 of file Safety.hh.


Member Function Documentation

double RazorBack::Safety_::small ( ) [inline, static]
 

return the smallest number which can still divide 1.0 w/o problems.

Definition at line 47 of file Safety.hh.

bool RazorBack::Safety_::safe_div ( ) const [inline]
 

safe_div(): returns the Usesafediv variable.

safe_div(S): sets Usesafediv, returns old value.

Definition at line 53 of file Safety.hh.

bool RazorBack::Safety_::safe_div ( bool S ) [inline]
 

Definition at line 54 of file Safety.hh.

double RazorBack::Safety_::safe_div ( double Num,
double Denom,
int Lineno = 0 ) const
 

safe_div(): returns Num/Denom if Denom is reliably non-0.

If it is closer to 0 then the internal parameter SMALL, then it will be replaced by SMALL and the division is performed with a warning. The line number is printed when greater than 0 (default).

double RazorBack::Safety_::pythag ( double a,
double b ) const
 

pythag(): returns the value sqrt(a^2+b^2) without over- or underflows.

On some machines the math library contains the function hypot(x, y) which does the same job and will be used whenever possible.


Member Data Documentation

Fparch_<double> RazorBack::Safety_::Fp [static, private]
 

double-precision floating-point consts.

Definition at line 33 of file Safety.hh.

const double RazorBack::Safety_::SMALL [static, private]
 

smallest non-0 for which 1.0/SMALL is OK.

Definition at line 34 of file Safety.hh.

bool RazorBack::Safety_::Usesafediv [private]
 

use safe division check if set to true.

Definition at line 35 of file Safety.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:26 2002 for The Razorback C++ Library: Linear Algebra by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001