?? xspctrm.cpp
字號(hào):
#include <fstream>
#include <iostream>
#include <iomanip>
#include "nr.h"
using namespace std;
// Driver for routine spctrm
int main(void)
{
const int M=16;
bool ovrlap;
int j,k;
Vec_DP p(M),q(M);
ifstream fp("spctrl.dat");
if (fp.fail())
NR::nrerror("Data file spctrl.dat not found");
k=8;
ovrlap=true;
NR::spctrm(fp,p,k,ovrlap);
fp.seekg(0,ios_base::beg);
k=16;
ovrlap=false;
NR::spctrm(fp,q,k,ovrlap);
fp.close();
cout << endl << "Spectrum of data in file spctrl.dat" << endl;
cout << "index" << " " << "overlapped " << " " ;
cout << "non-overlapped" << endl;
cout << fixed << setprecision(6);
for (j=0;j<M;j++) {
cout << setw(3) << j << " " << setw(13) << p[j];
cout << " " << setw(13) << q[j] << endl;
}
return 0;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -