83 double* cheb_ini(
const int n )
89 static double* table_sin[NMAX] ;
90 static int nwork = 0 ;
91 static int tbn[NMAX] ;
98 for ( i=0 ; i < nwork ; i++ ) {
99 if ( tbn[i] == n ) indice = i ;
104 if ( nwork >= NMAX ) {
105 cout <<
"cheb_ini : nwork >= NMAX !" << endl ;
108 indice = nwork ; nwork++ ; tbn[indice] = n ;
110 int nm1s2 = (n-1) / 2 ;
111 table_sin[indice] =
new double[nm1s2] ;
113 double xx = M_PI / double(n-1);
114 for ( i = 0; i < nm1s2 ; i++ ) {
115 table_sin[indice][i] =
sin( xx * i );
121 return table_sin[indice] ;
Cmp sin(const Cmp &)
Sine.