#include #include #include #include "nr.h" using namespace std; // Driver for routine fixrts int main(void) { const int NPOLES=6; const DP d_d[NPOLES]={6.0,-15.0,20.0,-15.0,6.0,0.0}; bool polish=true; int i; complex z1,z2; Vec_DP d(d_d,NPOLES); Vec_CPLX_DP zcoef(NPOLES+1),zeros(NPOLES); // finding roots of (z-1.0)^6=1.0 // first write roots zcoef[NPOLES]=1.0; for (i=0;i(-d[NPOLES-1-i],0.0); NR::zroots(zcoef,zeros,polish); cout << "Roots of (z-1.0)^6 = 1.0" << endl << endl; cout << setw(24) << "Root" << setw(28) << "(z-1.0)^6" << endl << endl; cout << fixed << setprecision(6) << showpos; for (i=0;i(-d[NPOLES-1-i],0.0); NR::zroots(zcoef,zeros,polish); cout << endl << "Roots reflected in unit circle" << endl << endl; cout << setw(24) << "Root" << setw(28) << "(z-1.0)^6" << endl << endl; for (i=0;i