资源简介
double gauss_ch2(double(*f)(double), int n);Gauss-Chebyeshev II 积分
double comp_gauss_leg(double (*f)(double), double a, double b)逐次减半Gauss-legender两点求积
double comp_trep(double (*f)(double), double a, double b)
double romberg(double (*f)(double), double a, double b)
代码片段和文件信息
#include “NumInt.h“
int main(int argc char *argv[])
{
LARGE_INTEGER BegainTime;
LARGE_INTEGER EndTime;
LARGE_INTEGER Frequency;
QueryPerformanceFrequency(&Frequency);
int flag[4];
int n = 5 ;//gass分段数
double resultreal;
//Gauss-ChebyeshevII公式积分
QueryPerformanceCounter(&BegainTime);
result = gauss_ch2(*f3 n);
QueryPerformanceCounter(&EndTime);
cout<<“gauss_ch2积分结果: “;
printf(“%.8f\n“result);
printf( “运行时间(单位:s):%.8f\n\n“ (double)(EndTime.QuadPart - BegainTime.QuadPart)/Frequency.QuadPart);
//逐次减半法复化梯形公式积分
QueryPerformanceCounter(&BegainTime);
result = comp_trep(*f4 -1 1);
QueryPerformanceCounter(&EndTime);
cout<<“comp_trep积分结果: “;
printf(“%.8f\n“result);
printf( “运行时间(单位:s):%.8f\n\n“ (double)(EndTime.QuadPart - BegainTime.QuadPart)/Frequency.QuadPart);
//逐次减半复化Gauss-Legender两点积分
QueryPerformanceCounter(&BegainTime);
result = comp_gauss_leg(*f4 -1 1);
QueryPerformanceCounter(&EndTime);
cout<<“comp_gauss_leg积分结果: “;
printf(“%.8f\n“result);
printf( “运行时间(单位:s):%.8f\n\n“ (double)(EndTime.QuadPart - BegainTime.QuadPart)/Frequency.QuadPart);
//Rombert法积分
QueryPerformanceCounter(&BegainTime);
result = romberg(*f4 -1 1);
QueryPerformanceCounter(&EndTime);
cout<<“romberg积分结果: “;
printf(“%.8f\n“result);
printf( “运行时间(单位:s):%.8f\n\n“ (double)(EndTime.QuadPart - BegainTime.QuadPart)/Frequency.QuadPart);
system(“PAUSE“);
return EXIT_SUCCESS;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 167439 2011-05-27 11:32 数值积分\NumInt\Debug\main.obj
文件 0 2011-05-27 11:32 数值积分\NumInt\Debug\main.sbr
文件 2122752 2011-05-27 11:32 数值积分\NumInt\Debug\NumInt.bsc
文件 577630 2011-05-27 11:32 数值积分\NumInt\Debug\NumInt.exe
文件 815320 2011-05-27 11:32 数值积分\NumInt\Debug\NumInt.ilk
文件 163319 2011-05-26 23:09 数值积分\NumInt\Debug\NumInt.obj
文件 6416612 2011-05-27 09:22 数值积分\NumInt\Debug\NumInt.pch
文件 1131520 2011-05-27 11:32 数值积分\NumInt\Debug\NumInt.pdb
文件 189440 2011-05-27 11:49 数值积分\NumInt\Debug\vc60.idb
文件 135168 2011-05-27 11:32 数值积分\NumInt\Debug\vc60.pdb
文件 1702 2011-05-27 11:32 数值积分\NumInt\main.cpp
文件 24 2011-05-26 23:09 数值积分\NumInt\NumInt.cpp
文件 4341 2011-05-27 01:21 数值积分\NumInt\NumInt.dsp
文件 520 2011-05-26 21:48 数值积分\NumInt\NumInt.dsw
文件 5770 2011-05-27 09:22 数值积分\NumInt\NumInt.h
文件 50176 2011-06-08 14:06 数值积分\NumInt\NumInt.ncb
文件 48640 2011-06-08 14:06 数值积分\NumInt\NumInt.opt
文件 1718 2011-05-27 11:32 数值积分\NumInt\NumInt.plg
文件 289 2011-06-08 14:06 数值积分\NumInt\NumInt.positions
文件 145547 2010-04-03 17:00 数值积分\数值积分.pdf
目录 0 2011-07-24 11:33 数值积分\NumInt\Debug
目录 0 2011-07-24 11:33 数值积分\NumInt
目录 0 2011-07-24 11:33 数值积分
----------- --------- ---------- ----- ----
11977927 23
- 上一篇:MSP430用户手册英文版.pdf
- 下一篇:小型办公局域网设计.
评论
共有 条评论