78 void des_coef(
const double* cf,
int n,
double pzero,
79 const char* nomx,
const char* nomy,
const char* title,
const char* device,
80 int newgraph,
int nxpage,
int nypage) {
82 float xdes[2], ydes[2] ;
84 double pzerol =
log10(pzero) ;
85 ydes[0] = float(pzerol) ;
92 double ymin = pzerol ;
93 double ymax = pzerol ;
95 for (
int i=0; i<n; i++) {
96 double yl =
log10(fabs(cf[i])) ;
97 if ( yl > ymax ) ymax = yl ;
99 double yamp = ymax - ymin ;
100 ymax = ymax + 0.05 * yamp ;
101 ymin = ymin - 0.05 * yamp ;
103 if (ymax <= pzerol) ymax = 2*pzerol ;
108 if ( (newgraph == 1) || (newgraph == 3) ) {
110 if (device == 0x0) device =
"?" ;
112 int ier = cpgbeg(0, device, nxpage, nypage) ;
114 cout <<
"des_coef: problem in opening PGPLOT display !" << endl ;
120 float size = float(1.3) ;
131 float xmin1 = float(xmin) ;
132 float xmax1 = float(xmax) ;
133 float ymin1 = float(ymin) ;
134 float ymax1 = float(ymax) ;
135 cpgenv(xmin1, xmax1, ymin1, ymax1, 0, 0 ) ;
136 cpglab(nomx, nomy, title) ;
139 for (
int i=0; i<n; i++) {
141 xdes[0] = float( i ) ;
143 if ( fabs(cf[i]) < pzero ) {
144 ydes[1] = float(pzerol) ;
148 ydes[1] = float(
log10(fabs(cf[i])) ) ;
149 if (cf[i] < 0) lstyle = 2 ;
154 cpgline(2, xdes, ydes) ;
162 if ( (newgraph == 2) || (newgraph == 3) ) {
void des_coef(const double *cf, int n, double pzero, const char *nomx, const char *nomy, const char *title, const char *device, int newgraph, int nxpage, int nypage)
Basic routine for drawing spectral coefficients.
Cmp log10(const Cmp &)
Basis 10 logarithm.