資源簡介
實例測試通過,可直接運行,并帶有詳細代碼注釋
采用全局收斂的牛頓-拉普森迭代算法求解編制問題
絕對物超所值!

代碼片段和文件信息
/*計算正向差分以逼近雅克比行列式*/
#include?
#include?“nr.h“
using?namespace?std;
/*輸入x[0...n-1]是雅克比行列式被計算的點fvec[0...n-1]是在那點的函數值向量;
??vecfunc(xf)是用戶提供的程序它返回x點處的函數向量;
??輸出df[0...n-1][0...n-1]是雅克比矩陣*/
void?NR::fdjac(Vec_IO_DP?&x?Vec_I_DP?&fvec?Mat_O_DP?&dfvoid?vecfunc(Vec_I_DP?&?Vec_O_DP?&))
{
const?DP?EPS=1.0e-8;???//逼近機器精度的平方根
int?ij;
DP?htemp;
int?n=x.size();
Vec_DP?f(n);
for?(j=0;j temp=x[j];
h=EPS*fabs(temp);
if?(h?==?0.0)?h=EPS;
x[j]=temp+h;
h=x[j]-temp;???????????//減小有限精度誤差的技巧
vecfunc(xf);
x[j]=temp;
for?(i=0;i df[i][j]=(f[i]-fvec[i])/h;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????6876129??2013-05-03?11:30??two-point-problem\Ballistic.txt
?????文件??????17684??2013-05-02?18:22??two-point-problem\Debug\fdjac.obj
?????文件??????????0??2013-05-02?18:23??two-point-problem\Debug\fdjac.sbr
?????文件??????14488??2013-05-03?16:40??two-point-problem\Debug\fmin.obj
?????文件??????????0??2013-05-03?16:40??two-point-problem\Debug\fmin.sbr
?????文件??????64800??2013-05-02?18:25??two-point-problem\Debug\lnsrch.obj
?????文件??????????0??2013-05-02?18:25??two-point-problem\Debug\lnsrch.sbr
?????文件??????15449??2013-05-02?18:22??two-point-problem\Debug\lubksb.obj
?????文件??????????0??2013-05-02?18:23??two-point-problem\Debug\lubksb.sbr
?????文件??????64460??2013-05-02?18:22??two-point-problem\Debug\ludcmp.obj
?????文件??????????0??2013-05-02?18:23??two-point-problem\Debug\ludcmp.sbr
?????文件??????73476??2013-05-02?18:22??two-point-problem\Debug\newt.obj
?????文件??????????0??2013-05-02?18:23??two-point-problem\Debug\newt.sbr
?????文件??????66526??2013-05-03?16:39??two-point-problem\Debug\odeint.obj
?????文件??????????0??2013-05-03?16:39??two-point-problem\Debug\odeint.sbr
?????文件?????705536??2013-05-03?16:41??two-point-problem\Debug\opt_shoot.bsc
?????文件?????630883??2013-05-03?16:41??two-point-problem\Debug\opt_shoot.exe
?????文件?????934468??2013-05-03?16:41??two-point-problem\Debug\opt_shoot.ilk
?????文件????2820692??2013-05-03?16:41??two-point-problem\Debug\opt_shoot.pch
?????文件????1467392??2013-05-03?16:41??two-point-problem\Debug\opt_shoot.pdb
?????文件??????23819??2013-05-02?18:23??two-point-problem\Debug\rkck.obj
?????文件??????????0??2013-05-02?18:23??two-point-problem\Debug\rkck.sbr
?????文件??????64981??2013-05-03?09:20??two-point-problem\Debug\rkqs.obj
?????文件??????????0??2013-05-03?09:20??two-point-problem\Debug\rkqs.sbr
?????文件??????16105??2013-05-03?16:41??two-point-problem\Debug\shoot.obj
?????文件??????????0??2013-05-03?16:41??two-point-problem\Debug\shoot.sbr
?????文件?????258035??2013-05-03?16:41??two-point-problem\Debug\sphoot.obj
?????文件??????????0??2013-05-03?16:41??two-point-problem\Debug\sphoot.sbr
?????文件?????156672??2013-05-03?16:41??two-point-problem\Debug\vc60.idb
?????文件?????143360??2013-05-03?16:41??two-point-problem\Debug\vc60.pdb
............此處省略27個文件信息
- 上一篇:全國省級行政區shp
- 下一篇:基于知識圖譜的自動問答系統
評論
共有 條評論