說明數(shù)據(jù)及軟件f04mcc cl05_第1頁
說明數(shù)據(jù)及軟件f04mcc cl05_第2頁
說明數(shù)據(jù)及軟件f04mcc cl05_第3頁
說明數(shù)據(jù)及軟件f04mcc cl05_第4頁
說明數(shù)據(jù)及軟件f04mcc cl05_第5頁
已閱讀5頁,還剩3頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

nagrealcholeskyskylinesolvenagrealcholeskyskylinesolve(f04mcc)computestheapproximatesolutionofasystemofrealvariable-bandwidthmatrix,whichhaspreviouslybeenfactorizedbynagrealcholeskyskyline(f01mcc).Relatedsystemsmayalsobesolved.#lude#ludevoig_real_cholesky_skyline_solve(Nag_SolveSystemselct,Integern,Integernrhs,doubleal[],Integerlal,doubled[],Integerrow[],doubleb[],Integertdb,doublex[],Integertdx,NagErrorThenormaluseofthisfunctionisthesolutionofthesystemsAX=B,followingacallofnagrealcholeskyskyline(f01mcc)todetermheCholeskyfactorizationA=LDLTofthesymmetricpositive-de?nitevariable-bandwidthmatrixA.LDLTX=B(usual DLTLLT=LTordern,andBasetofright-handsides.ThematrixLisrepresentedbytheelementslyingwithinivelope,i.e.,betweenthe?rstnon-zeroofeachrowandthediagonal(seeSection8foranexample).Thewidthrow[i]oftheithn

selct=NagLDLTX:solveLDLTX=selct=NagLDX:solveLDX=Bselct=NagDLTX:solveDLTX=Bselct=NagLLTX:solveLLTX=Bselct=NagLX:solveLX=Bselct=NagLTX:solveLTX=Constraint:selctmustbeoneofNagLDLTX,NagLDX,NagDLTX,NagLLTX,NagLX,NagLTX.Input:n,theorderofthematrixL.Constraint:n≥1.Constraint:nrhs≥1.

Input:theelementswithintheenvelopeofthelowertriangularmatrixL,takeninrowbyLmustbestoredexplicitly.Input:thedimensionofthearrayalasdeclaredinthefunctionfromwhichnagrealcholeskyskylinesolveiscalled.Constraint:lal≥row[0]+row[1]+...+row[n?Input:thediagonalelementsofthediagonalmatrixD.disnotreferencedifselctNagLLTX,NagLXorNag?rst(left-most)non-zeroelementandtheelementonthediagonal, Constraint:1≤row[i]≤i+1fori=0,1,...,n?1.

Input:theseconddimensionofthearraybasdeclaredinthefunctionfromwhichnagrealcholeskyskylinesolveiscalled.Constraint:tdb≥Output:thenbyrsolutionmatrixX.SeealsoSection

Input:theseconddimensionofthearrayxasdeclaredinthefunctionfromwhichnagrealcholeskyskylinesolveiscalled.Constraint:tdx≥ErrorIndicationsandNEINTARGOnentry,nmustnotbelessthan1:n=Onentry,nrhsmustnotbelessthan1:nrhs=hvaluei.NE2INTARGNE2INTARGOnentry,lal=hvalueiwhilerow[0]+...+row[n?1]=hvaluei.Theseparametersmustsatisfylal≥row[0]+...+row[n?1].Onentry,tdb=hvalueiwhilenrhs=hvaluei.Theseparametersmustsatisfytdb≥nrhs.Onentry,tdx=hvalueiwhilenrhs=hvaluei.Theseparametersmustsatisfytdx≥nrhs.NEBADNEZEROhasbeenlocatedinthearrayd[hvaluei]NENOTUNITThe?rstnon-uni ementhasbeenlocatedinthearrayal[hvaluei]Further...+row[n?Thefunctionmaybecalledwiththesameactualarraydfortheparametersbandx,inwhichcasethesolutionmatrixwilloverwritetheright-handsidematrix.Theusualbackwarderrorysisofthesolutionoftriangularsystemapplies:eachcomputedReinsch(1971)pp25-27and54-55).WilkinsonJHandReinschC(1971)HandbookforAutomaticComputation(Vol,Linear-SeenagrealcholeskyskylineTosolvethesystemofequationsAX=B, A

3

855 02417660Program/*nag_real_cholesky_skyline_solve(f04mcc)Example*Copyright1996NumericalAlgorithms*Mark4, lude<nag.h> lude<math.h> lude lude<nag_stdlib.h> lude<nagf01.h> lude#defineNMAX DB DX{Integeri,nrhs,k,k1,k2,lal,Integerrow[NMAX];Nag_SolveSystemselect;staticNagErrorfail;/*Skipheadingindatafile*/{Vprintf("\nnisoutofrange:n=%ld\n",n);}for(i=0;i<n;++i)k2=for(i=0;i<n;{k1=k2=k2+for(k=k1;k<k2;++k)}lal=if(lal>{Vprintf("\nlalisoutofrange:lal=%ld\n",lal);}if(nrhs<1||{Vprintf("\nnrhsisoutofrange:nrhs=%ld\n",nrhs);}for(i=0;i<n;for(k=0;k<nrhs;++k)fail.print=f01mcc(n,a,lal,row,al,d,&fail);if(fail.code!=NE_NOERROR)select=f04mcc(select,n,nrhs,al,lal,d,row,(double*)b,(Integer)TDB,(double*)x,(Integer)TDX,&fail);if(fail.code!=NE_NOERROR)Vprintf("\nSolution\n");for(i=0;i<n;++i){for(k=0;k<nrhs;++k)}}Programf04mccExampleProgramData12215 ---2Programnagcholeskynagrealcholeskyskylinesolv(f04mcc)AXB的近似解,其中A是對(duì)稱正定有限變帶寬矩陣,其具有之前已被nagrealcholeskyskyline(f01mcc)分解。相關(guān)系統(tǒng)也可能得到解決。規(guī)范包含<nag.h># lude<nagf04.h>voig_real_cholesky_skyline_solve(Nag_SolveSystemselct,整數(shù)n,整數(shù)nrhs,雙al[],整數(shù)lal,雙d[],整數(shù)row[],雙b[],整數(shù)tdb,雙x[],整數(shù)tdx,NagError*失敗)AXBnagrealcholeskyskylineCholeskyALDLTA。LDLTXB(通常系統(tǒng))(1)LDXB(下三角系統(tǒng))2DLTXB(上三角系統(tǒng))(3)LLTB4LXB(單位下三角系統(tǒng))(5)LTXB(單位上三角系)LnDn,B的示例)irow[i](含)NagLDLTX:LDLTXBNagLDXLDXBNagDLTX:求解DLTXBNagLLTX:LLTXBNagLXLXBNagLTX:LTXB。約束:selctNagLDLTX、NagLDX、NagDLTX、NagLLTX、NagLX、NagLTX之一。nnL約束:nrhs≥1。]LnagrealcholeskyskylineLlalnagrealcholeskyskylinesolveallal≥row[0]+row[1]+...+row[n。1]。d[n]DselctNagLLTX、NagLXNagLTX,dorow[n]輸入:row[i]必須包含L的第i行的寬度,即第一個(gè)(最左邊)非零元素和對(duì)角線上的元素(包括)之間的元素?cái)?shù)量。約束:1≤row[i]≤i+1(i=0,1,...,n)。1.輸入:nrB6tdbnagrealcholeskyskylinesolveb束:tdb≥nrhs。輸出:nrX6tdxnagrealcholeskyskylinesolvex束:tdx≥nrhs。failNAG錯(cuò)誤參數(shù),請(qǐng)參見NAGC錯(cuò)誤指示和警告NEINTARGLT輸入時(shí),n不得小于1:n=value。輸入時(shí),row[]不得小于1:rowvaluevalue。輸入時(shí),nrhs不得小于1:nrhsvalue2INTARGGTrow[i]=valueivaluerow[i]i+1。2INTARGLT輸入時(shí),lal=valuewhilerow[0]+...+row[n。1]=值。這些參數(shù)必須滿足lalrow[0]row[n1tdbvaluenrhsvaluetdbnrhstdxvaluenrhsvaluetdxnrhs。NEBADPARAM輸入時(shí),參數(shù)selct具有非法值。d[valueNENOTUNITDIAGL1。第一個(gè)非單位元素已位于數(shù)組al[value]中prprow[0]row[1]row[n。1]。D來說是精確的(視情況而定)(參見Wilkinson和Reinsch(1971)第25-27頁和54-55)。6.2.WilkinsonJHReinschC1971)(第二nagrealcholeskyskylineAXB,120050253014003130180000168245141800024和.1015.211130245146Anagrealcholeskyskyline(f01mcc)nag_real_cholesky_skyline_solve(f04mcc)*1996數(shù)值算法組。**1996年4號(hào)。*/lude<nag.h>#lude<math.h>#lude<stdio.h>#lude<nag_stdlib.h>#<nagf01.h>#ludeNMAX6NRHSMAX2TDBNRHSMAXTDXNRHSMAXLALMAXx[NMAX][TDX];整數(shù)行[NMAX];Nag_SolveSystem選擇;靜態(tài)NagError失??;Vprintf("f04mcc示例程序結(jié)果\n");/*跳過數(shù)據(jù)文件中的標(biāo)題*/Vscanf("%*[^\n]");Vscanf("%ld",&n);如果(n<1||n>NMAX)Vprintf("\nnn%ld\n",n);退出(EXIT_FAILURE);對(duì)于(i=0;i<n;++i)Vscanf("%ld",&row[i]);k

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論