SoftSUSY is hosted by Hepforge, IPPP Durham
SOFTSUSY  4.0
utils.h File Reference

A few handy bits and pieces - little mathematical functions and the like. More...

#include "mycomplex.h"
#include "def.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string>
#include <exception>
#include <csignal>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <dirent.h>

Go to the source code of this file.

Macros

#define dout   if(0)cout
 

Functions

double zeroSqrt (double f)
 returns either sqrt(f) for f>0 or 0 otherwise
 
double frexp (const Complex &c, int *i)
 Gives exponent of the largest number: either imaginary or real part.
 
void FPE_ExceptionHandler (int nErrType)
 Exception handler - will even trap errors in the fortran portion. More...
 
int theta (double a)
 Standard theta function: 1 is a>0, 0 otherwise.
 
void outputCharacteristics (int)
 Sets number of decimal places to display in scientific output.
 
double sqr (double a)
 square of a number
 
double maximum (double a, double b)
 maximum of two numbers
 
double minimum (double a, double b)
 minimum of a and b
 
int minimum (int a, int b)
 minimum of a and b
 
double toleranceCheck (double sTin, double sTout)
 Finds fractional difference between |a| and |b|.
 
double minimum (double a, double b, double c)
 
double maximum (double a, double b, double c)
 
double middle (double a, double b, double c)
 
int massorder (double &a, double &b, double &c)
 
bool close (double m1, double m2, double tol)
 
bool close (Complex m1, Complex m2, double tol)
 Requres that both the real and imaginary parts are close.
 
double sign (double a, double b)
 Returns |a| with sign of b in front.
 
int sgn (double x)
 gives the sign (+-1) of x
 
void printRow (ostream &o, double x)
 
bool testNan (double f)
 

Detailed Description

A few handy bits and pieces - little mathematical functions and the like.

Function Documentation

bool close ( double  m1,
double  m2,
double  tol 
)

Checks if ABSOLUTE (or squared) values are closer than tol, or both numbers are smaller than EPSTOL

void FPE_ExceptionHandler ( int  nErrType)

Exception handler - will even trap errors in the fortran portion.

< This reverts back to softsusy code!

void printRow ( ostream &  o,
double  x 
)

Outputs a space if greater than zero, a minus otherwise. Useful for outputting negative numbers in rows

bool testNan ( double  f)

Returns true if f's a nan. Unfortunately, the behaviour of this function is not standardised across all platforms yet.