?? qromb.cpp
字號(hào):
#include <cmath>
#include "nr.h"
using namespace std;
DP NR::qromb(DP func(const DP), DP a, DP b)
{
const int JMAX=20, JMAXP=JMAX+1, K=5;
const DP EPS=1.0e-10;
DP ss,dss;
Vec_DP s(JMAX),h(JMAXP),s_t(K),h_t(K);
int i,j;
h[0]=1.0;
for (j=1;j<=JMAX;j++) {
s[j-1]=trapzd(func,a,b,j);
if (j >= K) {
for (i=0;i<K;i++) {
h_t[i]=h[j-K+i];
s_t[i]=s[j-K+i];
}
polint(h_t,s_t,0.0,ss,dss);
if (fabs(dss) <= EPS*fabs(ss)) return ss;
}
h[j]=0.25*h[j-1];
}
nrerror("Too many steps in routine qromb");
return 0.0;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -