Pb with "tred2"


Ahy_Goon
08-11-2005, 10:02 AM
I want to use the function tred2 to diagonalised a symetric matrix.
I used the function tred2.
But in this function i see:
"g=d[m]-d[l]+e[l]/(g+SIGN(r,g));"

Wath is the function SIGN with 2 parameters?
I have the "NUMERICAL RECIPES in C ", second edition
isbn 0 521 43108 5
thank you for your help.
Ahy_Goon



"May the Force by with you"

gaspari
08-12-2005, 05:05 PM
Dear Ahy_Goon,

SIGN is a macro. It is defined in nrutil.c as

#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))

its meaning should be evident if you know the C language
Regards

Massimo.