91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 122KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-07-17
  • 語言: 其他
  • 標簽: 三次樣條??

資源簡介

計算方法與算法分析課程中的一個上機實驗,自己看書寫很麻煩的,我都已經寫好了,直接下載copy交給老師就行啦

資源截圖

代碼片段和文件信息

#include
#include
int?main()
{
????//輸入數據
????int?n;
????double?y0yn;
????double?*x*y*h*a*B;
????cout<<“請輸入節點的個數:?“<????cin>>n;
????x?=?new?double?[n];
????y?=?new?double?[n];
????n=n-1;
????h?=?new?double?[n];
????a?=?new?double?[n];
????B?=?new?double?[n];
????int?i=0;
????cout<<“請輸入節點(x,y):“<????do{
????????cin>>x[i];
????????cin>>y[i];
????????i++;
????????}while(i!=(n+1));
????cout<<“請輸入初始節點的導數y0’:“<????cin>>y0;
????cout<<“請輸入最后一個節點的導數yn‘:?“<????cin>>yn;

????//列出需要求解的矩陣方程組
????for(i=0;i<=n;i++)
????????h[i]=x[i+1]-x[i];
????for(i=1;i????????{
????????a[i]=h[i-1]/(h[i]+h[i-1]);
????????B[i]=3*((1-a[i])*(y[i]-y[i-1])/h[i-1]+a[i]*(y[i+1]-y[i])/h[i]);
????????}

????//追趕法求方程組的根

????double?*d*b*c*N*M*utXtemp1temp2;
????d?=?new?double?[n];
????b?=?new?double?[n];
????c?=?new?double?[n];
????N?=?new?double?[n];
????M?=?new?double?[n];
????u?=?new?double?[n];
????b[1]=2;
????c[1]=a[1];
????d[1]=B[1]-(1-a[1])*y0;
????for(i=2;i????????{
????????c[i]=a[i];
????????a[i]=1-a[i];
????????b[i]=2;
????????d[i]=B[i];
????????}
????b[n-1]=2;
????d[n-1]=B[n-1]-a[n-1]*yn;
????a[n-1]=1-a[n-1];
????u[1]=c[1]/b[1];
????N[1]=d[1]/b[1];
????for(i=2;i????????{
?????????t=b[i]-u[i-1]*a[i];
?????????u[i]=c[i]/t;
?????????N[i]=(d[i]-N[i-1]*a[i])/t;
????????}
????N[n-1]=(d[n-1]-N[n-2]*a[n-1])/(b[n-1]-u[n-2]*a[n-1]);
????M[n-1]=N[n-1];
????for(i=n-2;i>=1;i--)
????M[i]=N[i]-u[i]*M[i+1];
????//輸出所求得的導數值
????cout<<“******************************************“<????cout<<“通過追趕法計算得到節點處的導數為:“<????for(i=1;i????????{
????????cout<<“f‘(“<????????}
????cout<<“******************************************“<
????//輸入要計算的自變量,計算其函數值
????cout<<“請輸入你所要求的自變量:“<????while(cin>>X)
????{
????i=0;
????temp1=0;
????temp2=0;
????do
????{
????????temp1=X-x[i];
????????temp2=X-x[i+1];
????????i++;
????}while(temp1<0||temp2>0);
????i=i-1;
????temp1=(X-x[i])/(x[i+1]-x[i]);
????temp2=(temp1-1)*(temp1-1)*(2*temp1+1)*y[i]+temp1*temp1*(3-2*temp1)*y[i+1]+(x[i+1]-x[i])*temp1*(temp1-1)*(temp1-1)*M[i]+(x[i+1]-x[i])*temp1*temp1*(temp1-1)*M[i+1];
????cout<<“通過計算得到:f(“<????}
????return?0;
}


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2462??2011-01-04?19:54??三次樣條函數\main.cpp

?????文件???????3377??2011-01-05?23:24??三次樣條函數\main.dsp

?????文件????????533??2011-01-05?23:26??三次樣條函數\main.dsw

?????文件?????491213??2011-01-04?19:54??三次樣條函數\main.exe

?????文件??????33792??2011-01-05?23:26??三次樣條函數\main.ncb

?????文件???????5587??2011-01-04?19:54??三次樣條函數\main.o

?????文件??????48640??2011-01-05?23:26??三次樣條函數\main.opt

?????文件???????1145??2011-01-05?23:24??三次樣條函數\main.plg

?????文件????????138??2011-01-04?18:34??三次樣條函數\測試數據.txt

?????目錄??????????0??2011-03-10?20:08??三次樣條函數

-----------?---------??----------?-----??----

???????????????586887????????????????????10


評論

共有 條評論