FLA_random_number.c File Reference

(r)


Functions

float FLA_random_float ()
double FLA_random_double ()
scomplex FLA_random_scomplex ()
dcomplex FLA_random_dcomplex ()

Function Documentation

dcomplex FLA_random_dcomplex ( void   ) 

References FLA_random_double(), dcomplex::imag, and dcomplex::real.

Referenced by FLA_Random_matrix(), and FLA_Random_tri_matrix().

00056 {
00057   dcomplex z;
00058 
00059   z.real = FLA_random_double();
00060   z.imag = FLA_random_double();
00061 
00062   return z;
00063 }

double FLA_random_double ( void   ) 

Referenced by FLA_random_dcomplex(), FLA_Random_matrix(), and FLA_Random_tri_matrix().

00041 {
00042   return ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0;
00043 }

float FLA_random_float ( void   ) 

Referenced by FLA_Random_matrix(), FLA_random_scomplex(), and FLA_Random_tri_matrix().

00036 {
00037   return ( float )( ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0 );
00038 }

scomplex FLA_random_scomplex ( void   ) 

References FLA_random_float(), scomplex::imag, and scomplex::real.

Referenced by FLA_Random_matrix(), and FLA_Random_tri_matrix().

00046 {
00047   scomplex z;
00048 
00049   z.real = FLA_random_float();
00050   z.imag = FLA_random_float();
00051 
00052   return z;
00053 }


Generated on Mon Jul 6 05:45:53 2009 for libflame by  doxygen 1.5.9