说明数据及软件f04mcc cl05_第1页
说明数据及软件f04mcc cl05_第2页
说明数据及软件f04mcc cl05_第3页
说明数据及软件f04mcc cl05_第4页
说明数据及软件f04mcc cl05_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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-definitevariable-bandwidthmatrixA.LDLTX=B(usual DLTLLT=LTordern,andBasetofright-handsides.ThematrixLisrepresentedbytheelementslyingwithinivelope,i.e.,betweenthefirstnon-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,NagLXorNagfirst(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]NENOTUNITThefirstnon-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是对称正定有限变带宽矩阵,其具有之前已被nagrealcholeskyskyline(f01mcc)分解。相关系统也可能得到解决。规范包含<nag.h># lude<nagf04.h>voig_real_cholesky_skyline_solve(Nag_SolveSystemselct,整数n,整数nrhs,双al[],整数lal,双d[],整数row[],双b[],整数tdb,双x[],整数tdx,NagError*失败)AXBnagrealcholeskyskylineCholeskyALDLTA。LDLTXB(通常系统)(1)LDXB(下三角系统)2DLTXB(上三角系统)(3)LLTB4LXB(单位下三角系统)(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行的宽度,即第一个(最左边)非零元素和对角线上的元素(包括)之间的元素数量。约束:1≤row[i]≤i+1(i=0,1,...,n)。1.输入:nrB6tdbnagrealcholeskyskylinesolveb束:tdb≥nrhs。输出:nrX6tdxnagrealcholeskyskylinesolvex束:tdx≥nrhs。failNAG错误参数,请参见NAGC错误指示和警告NEINTARGLT输入时,n不得小于1:n=value。输入时,row[]不得小于1:rowvaluevalue。输入时,nrhs不得小于1:nrhsvalue2INTARGGTrow[i]=valueivaluerow[i]i+1。2INTARGLT输入时,lal=valuewhilerow[0]+...+row[n。1]=值。这些参数必须满足lalrow[0]row[n1tdbvaluenrhsvaluetdbnrhstdxvaluenrhsvaluetdxnrhs。NEBADPARAM输入时,参数selct具有非法值。d[valueNENOTUNITDIAGL1。第一个非单位元素已位于数组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数值算法组。**1996年4号。*/lude<nag.h>#lude<math.h>#lude<stdio.h>#lude<nag_stdlib.h>#<nagf01.h>#ludeNMAX6NRHSMAX2TDBNRHSMAXTDXNRHSMAXLALMAXx[NMAX][TDX];整数行[NMAX];Nag_SolveSystem选择;静态NagError失败;Vprintf("f04mcc示例程序结果\n");/*跳过数据文件中的标题*/Vscanf("%*[^\n]");Vscanf("%ld",&n);如果(n<1||n>NMAX)Vprintf("\nnn%ld\n",n);退出(EXIT_FAILURE);对于(i=0;i<n;++i)Vscanf("%ld",&row[i]);k

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论