eop_aux_randn< eT > Struct Template Reference
[Eop_aux]

#include <eop_aux.hpp>

List of all members.

Public Member Functions

 operator eT () const

Detailed Description

template<typename eT>
struct eop_aux_randn< eT >

Definition at line 47 of file eop_aux.hpp.


Member Function Documentation

template<typename eT >
eop_aux_randn< eT >::operator eT (  )  const [inline]

Definition at line 59 of file eop_aux.hpp.

References rand().

00060     {
00061     const u32 N  = 12;  // N must be >= 12 and an even number
00062     const u32 N2 = N/2;
00063     
00064     eT acc = eT(0);
00065     
00066     for(u32 i=0; i<N2; ++i)
00067       {
00068       const eT tmp1 = eT(std::rand()) / eT(RAND_MAX);
00069       const eT tmp2 = eT(std::rand()) / eT(RAND_MAX);
00070       acc += tmp1+tmp2;
00071       }
00072     
00073     return acc - eT(N2);
00074     }