欢迎来到天天文库
浏览记录
ID:43324052
大小:167.50 KB
页数:12页
时间:2019-09-29
《C编写数值分析程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、高斯消去法;#includeusingnamespacestd;templateT**Allocation2D(intm,intn){T**a;a=newT*[m];for(inti=0;i(n,n+1);cout«endl«n输入增广矩阵的各值:/n";for(i=0;i2、for(j=();j=0;k—)temp=0;for(j=k+l;j3、[k];}for(i=0;ientsandSettingsAd>inistratorDebug高斯■驱釘输入系数矩阵的N值,N:2输入增广矩阵的各值:/n2274&K0:-3.33333xl:7.33333Pressanykeytocontinue拉格朗口插值法#include#include#defineN3usingnamespacestd;doublefun(double*x,double*y4、,intn,doublep);voidmain(){inti;doublea[N],p;doubleb[N];cout«,pleaseinputxianglianga=M«cndl;for(i=0;i5、doublefun(doublex[],doubley[],intn,doublep){doublez=0,s=1.0;intk,i=();doubleL[N];k=0;while(k6、+){z=z+L[iJ;}returnz;:Docu>entsandSettingsAd>inistratorYDebu:pleaseinputxianglianga=pleaseinputxiangliangb=741pleaseinputLagelangrichazhiJieDianp=3TheAnswer=11PressanykeytocontinueNewton插值法;#include#includevoidmain(){charL;do(doubleM[100][100];doublex[7、100],y[100];doubleX=1,xx=0,w=l,N=0,P,R=l;intn;cout<<"请输入所求均差阶数:";cin»n;for(inti=0;i<=n;i++){cout<<"请输入x"«i«"的值:"<8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
2、for(j=();j=0;k—)temp=0;for(j=k+l;j3、[k];}for(i=0;ientsandSettingsAd>inistratorDebug高斯■驱釘输入系数矩阵的N值,N:2输入增广矩阵的各值:/n2274&K0:-3.33333xl:7.33333Pressanykeytocontinue拉格朗口插值法#include#include#defineN3usingnamespacestd;doublefun(double*x,double*y4、,intn,doublep);voidmain(){inti;doublea[N],p;doubleb[N];cout«,pleaseinputxianglianga=M«cndl;for(i=0;i5、doublefun(doublex[],doubley[],intn,doublep){doublez=0,s=1.0;intk,i=();doubleL[N];k=0;while(k6、+){z=z+L[iJ;}returnz;:Docu>entsandSettingsAd>inistratorYDebu:pleaseinputxianglianga=pleaseinputxiangliangb=741pleaseinputLagelangrichazhiJieDianp=3TheAnswer=11PressanykeytocontinueNewton插值法;#include#includevoidmain(){charL;do(doubleM[100][100];doublex[7、100],y[100];doubleX=1,xx=0,w=l,N=0,P,R=l;intn;cout<<"请输入所求均差阶数:";cin»n;for(inti=0;i<=n;i++){cout<<"请输入x"«i«"的值:"<8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
3、[k];}for(i=0;ientsandSettingsAd>inistratorDebug高斯■驱釘输入系数矩阵的N值,N:2输入增广矩阵的各值:/n2274&K0:-3.33333xl:7.33333Pressanykeytocontinue拉格朗口插值法#include#include#defineN3usingnamespacestd;doublefun(double*x,double*y
4、,intn,doublep);voidmain(){inti;doublea[N],p;doubleb[N];cout«,pleaseinputxianglianga=M«cndl;for(i=0;i5、doublefun(doublex[],doubley[],intn,doublep){doublez=0,s=1.0;intk,i=();doubleL[N];k=0;while(k6、+){z=z+L[iJ;}returnz;:Docu>entsandSettingsAd>inistratorYDebu:pleaseinputxianglianga=pleaseinputxiangliangb=741pleaseinputLagelangrichazhiJieDianp=3TheAnswer=11PressanykeytocontinueNewton插值法;#include#includevoidmain(){charL;do(doubleM[100][100];doublex[7、100],y[100];doubleX=1,xx=0,w=l,N=0,P,R=l;intn;cout<<"请输入所求均差阶数:";cin»n;for(inti=0;i<=n;i++){cout<<"请输入x"«i«"的值:"<8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
5、doublefun(doublex[],doubley[],intn,doublep){doublez=0,s=1.0;intk,i=();doubleL[N];k=0;while(k6、+){z=z+L[iJ;}returnz;:Docu>entsandSettingsAd>inistratorYDebu:pleaseinputxianglianga=pleaseinputxiangliangb=741pleaseinputLagelangrichazhiJieDianp=3TheAnswer=11PressanykeytocontinueNewton插值法;#include#includevoidmain(){charL;do(doubleM[100][100];doublex[7、100],y[100];doubleX=1,xx=0,w=l,N=0,P,R=l;intn;cout<<"请输入所求均差阶数:";cin»n;for(inti=0;i<=n;i++){cout<<"请输入x"«i«"的值:"<8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
6、+){z=z+L[iJ;}returnz;:Docu>entsandSettingsAd>inistratorYDebu:pleaseinputxianglianga=pleaseinputxiangliangb=741pleaseinputLagelangrichazhiJieDianp=3TheAnswer=11PressanykeytocontinueNewton插值法;#include#includevoidmain(){charL;do(doubleM[100][100];doublex[
7、100],y[100];doubleX=1,xx=0,w=l,N=0,P,R=l;intn;cout<<"请输入所求均差阶数:";cin»n;for(inti=0;i<=n;i++){cout<<"请输入x"«i«"的值:"<8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
8、M[i-j+l][0]);}}for(i=l;i<=n;i++){cout<<"其"<
此文档下载收益归作者所有