Optionallymayormaynotbecomputedortheymaybepremultipliedbymatricesrespectively0thenhavetheform0thenhavetheform000Inbothcasesthediagonalmatrixhasnonnegativediagonalelementsthediagonalmatrixpositivediag ID: 857572
Download Pdf The PPT/PDF document "NAGLibraryRoutineDocumentF08YEFDTGSJAbef..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1 NAGLibraryRoutineDocumentF08YEF(DTGSJA)b
NAGLibraryRoutineDocumentF08YEF(DTGSJA)beforeusingthisroutine,pleasereadtheUsers'Noteforyourimplementationtochecktheinterpretationofbolditalicisedtermsandotherimplementation-dependentdetails.1Purpose Optionallymayormaynotbecomputed,ortheymaybepremultipliedbymatricesrespectively.ðÞ0thenhavetheform;;;...;;;...;;;0thenhavetheform000;;;...;;;...;;;Inbothcasesthediagonalmatrixhasnon-negativediagonalelements,thediagonalmatrixpositivediagonalelements,sothatisnonsingular,and1.SeeSection2.3.5.3ofAndersonetal.(1999)forfurtherinformation.4ReferencesAndersonE,BaiZ,BischofC,BlackfordS,DemmelJ,DongarraJJ,DuCrozJJ,GreenbaumA,HammarlingS,McKenneyAandSorensenD(1999)LAPACKUsers'Guide(3rdEdition)SIAM,Philadelphiahttp://www.netlib.org/lapack/lugGolubGHandVanLoanCF(1996)MatrixComputations(3rdEdition)JohnsHopkinsUniversityPress,Baltimore5ArgumentsInputOnentry:ifJOBUU,Umustcontainanorthogonalmatrixonentry,andtheproductisreturned.IfJOBUI,Uisinitializedtotheunitmatrix,andtheorthogonalmatrixisreturned.IfJOBUisnotcomputed.:JOBUU,IorN. NA
2 GLibraryManualF08YEF.2Mark26 InputOnentr
GLibraryManualF08YEF.2Mark26 InputOnentry:ifJOBVV,Vmustcontainanorthogonalmatrixonentry,andtheproductisreturned.IfJOBVI,Visinitializedtotheunitmatrix,andtheorthogonalmatrixisreturned.IfJOBVisnotcomputed.:JOBVV,IorN.InputOnentry:ifJOBQQ,Qmustcontainanorthogonalmatrixonentry,andtheproductisreturned.IfJOBQI,Qisinitializedtotheunitmatrix,andtheorthogonalmatrixisreturned.IfJOBQisnotcomputed.:JOBQQ,IorN.InputOnentry,thenumberofrowsofthematrixINTEGERInputOnentry,thenumberofrowsofthematrixINTEGERInputOnentry,thenumberofcolumnsofthematricesInputINTEGERInputOnentry:KandLspecifythesizes,,ofthesubblocksof,whoseGSVDistobecomputedbyF08YEF(DTGSJA).REAL(KIND=nag_wp)arrayInput/Output:theseconddimensionofthearrayAmustbeatleastmax1Onentry:thematrixOnexit:if0,Al;ncontainstheuppertriangularmatrix0,Am;ncontainstherowsoftheuppertriangularmatrix,andthesubmatrixisreturnedinl;n10:InputOnentry:therstdimensionofthearrayAasdeclaredinthe(sub)programfromwhichF08YEF(DTGSJA)iscalled.:LDAmax1 Least-squaresandEigenvalueProblems(LAPACK)Mark26F08YEF.3
3 11:REAL(KIND=nag_wp)arrayInput/Output:th
11:REAL(KIND=nag_wp)arrayInput/Output:theseconddimensionofthearrayBmustbeatleastmax1Onentry:theOnexit:if0,Bl;ncontainsthesubmatrix12:InputOnentry:therstdimensionofthearrayBasdeclaredinthe(sub)programfromwhichF08YEF(DTGSJA)iscalled.:LDBmax113:TOLAREAL(KIND=nag_wp)Input14:TOLBREAL(KIND=nag_wp)InputOnentry:TOLAandTOLBaretheconvergencecriteriafortheJacobiKogbetliantziterationprocedure.Generally,theyshouldbethesameasusedinthepreprocessingstepperformedbyF08VEF(DGGSVP)orF08VGF(DGGSVP3),sayTOLAmaxMmaxPisthemachineprecision15:REAL(KIND=nag_wp)arrayOutputOnexit:seethedescriptionofBETA.16:REAL(KIND=nag_wp)arrayOutputOnexit:ALPHAandBETAcontainthegeneralizedsingularvaluepairsof1,BETA0,for...,and0,ALPHA,BETA,for...,or0,ALPHA,BETA,for...0,BETA1,for...Furthermore,if,ALPHA0,for...17:REAL(KIND=nag_wp)arrayInput/Output:theseconddimensionofthearrayUmustbeatleastmax1ifJOBUUorI,andatleast1otherwise.Onentry:ifJOBUU,Umustcontainan(usuallytheorthogonalmatrixreturnedbyF08VEF(DGGSVP)orF08VGF(DGGSVP3)).Onexit:ifJOBUU,UcontainstheproductIfJOBUI
4 ,UcontainstheorthogonalmatrixIfJOBUN,Uis
,UcontainstheorthogonalmatrixIfJOBUN,Uisnotreferenced.18:InputOnentry:therstdimensionofthearrayUasdeclaredinthe(sub)programfromwhichF08YEF(DTGSJA)iscalled.ifJOBUUorI,LDUmax1otherwiseLDU NAGLibraryManualF08YEF.4Mark26 19:REAL(KIND=nag_wp)arrayInput/Output:theseconddimensionofthearrayVmustbeatleastmax1ifJOBVVorI,andatleast1otherwise.Onentry:ifJOBVV,Vmustcontainan(usuallytheorthogonalmatrixreturnedbyF08VEF(DGGSVP)orF08VGF(DGGSVP3)).Onexit:ifJOBVI,VcontainstheorthogonalmatrixIfJOBVV,VcontainstheproductIfJOBVN,Visnotreferenced.20:InputOnentry:therstdimensionofthearrayVasdeclaredinthe(sub)programfromwhichF08YEF(DTGSJA)iscalled.ifJOBVVorI,LDVmax1otherwiseLDV21:REAL(KIND=nag_wp)arrayInput/Output:theseconddimensionofthearrayQmustbeatleastmax1ifJOBQQorI,andatleast1otherwise.Onentry:ifJOBQQ,Qmustcontainan(usuallytheorthogonalmatrixreturnedbyF08VEF(DGGSVP)orF08VGF(DGGSVP3)).Onexit:ifJOBQI,QcontainstheorthogonalmatrixIfJOBQQ,QcontainstheproductIfJOBQN,Qisnotreferenced.22:InputOnentry:therstdimensionofthearrayQasdeclaredinthe(sub
5 )programfromwhichF08YEF(DTGSJA)iscalled.
)programfromwhichF08YEF(DTGSJA)iscalled.ifJOBQQorI,LDQmax1otherwiseLDQ23:REAL(KIND=nag_wp)arrayWorkspace24:INTEGEROutputOnexit:thenumberofcyclesrequiredforconvergence.25:OutputOnexit:INFO0unlesstheroutinedetectsanerror(seeSection6).6ErrorIndicatorsandWarningsIfINFO,argumenthadanillegalvalue.Anexplanatorymessageisoutput,andexecutionoftheprogramisterminated. Least-squaresandEigenvalueProblems(LAPACK)Mark26F08YEF.5 Theproceduredoesnotconvergeafter40cycles.7AccuracyThecomputedgeneralizedsingularvaluedecompositionisnearlytheexactgeneralizedsingularvaluedecompositionfornearbymatrices,whereandisthemachineprecision.SeeSection4.12ofAndersonetal.(1999)forfurtherdetails.8ParallelismandPerformanceF08YEF(DTGSJA)makescallstoBLASand/orLAPACKroutines,whichmaybethreadedwithinthevendorlibraryusedbythisimplementation.ConsultthedocumentationforthevendorlibraryforfurtherPleaseconsulttheX06ChapterIntroductionforinformationonhowtocontrolandinterrogatetheOpenMPenvironmentusedwithinthisroutine.PleasealsoconsulttheUsers'Noteforyourimplementa
6 tionforanyadditionalimplementation-speci
tionforanyadditionalimplementation-specicinformation.9FurtherCommentsThecomplexanalogueofthisroutineisF08YSF(ZTGSJA).10ExampleThisexamplendsthegeneralizedsingularvaluedecompositionofthematrixpairA;B,where12332145678846510.1ProgramTextProgramf08yefe!F08YEFExampleProgramText!Mark26Release.NAGCopyright2016.!..UseStatements..Usenag_library,Only:dggsvp,dtgsja,f06raf,nag_wp,x02ajf,x04cbf!..ImplicitNoneStatement..ImplicitNone!..Parameters..Integer,Parameter::nin=5,nout=6!..LocalScalars..Real(Kind=nag_wp)::eps,tola,tolbInteger::i,ifail,info,irank,j,k,l,lda,&ldb,ldq,ldu,ldv,m,n,ncycle,p!..LocalArrays..Real(Kind=nag_wp),Allocatable::a(:,:),alpha(:),b(:,:),beta(:),&q(:,:),tau(:),u(:,:),v(:,:),&Integer,Allocatable::iwork(:)Character(1)::clabs(1),rlabs(1)!..IntrinsicProcedures..NAGLibraryManualF08YEF.6Mark26 Intrinsic::max,real!..ExecutableStatements..Write(nout,*)F08YEFExampleProgramResultsWrite(nout,*)Flush(nout)!SkipheadingindatafileRead(nin,*)Read(nin,*)m,n,plda=mldb=pldq=nldu=mldv=pAllocate(a(lda,n),alpha(n),b(ldb,n),beta
7 (n),q(ldq,n),tau(n),u(ldu,m),&v(ldv,p),w
(n),q(ldq,n),tau(n),u(ldu,m),&v(ldv,p),work(m+3*n+p),iwork(n))!ReadthembynmatrixAandpbynmatrixBfromdatafileRead(nin,*)(a(i,1:n),i=1,m)Read(nin,*)(b(i,1:n),i=1,p)!Computetolaandtolbas!tola=max(m,n)*norm(A)*macheps!tolb=max(p,n)*norm(B)*machepseps=x02ajf()tola=real(max(m,n),kind=nag_wp)*f06raf(One-norm,m,n,a,lda,work)*epstolb=real(max(p,n),kind=nag_wp)*f06raf(One-norm,p,n,b,ldb,work)*eps!Computethefactorizationof(A,B)!(A=U1*S*(Q1**T),B=V1*T*(Q1**T))!TheNAGnameequivalentofdggsvpisf08vefCalldggsvp(U,V,Q,m,p,n,a,lda,b,ldb,tola,tolb,k,l,u,ldu,v,ldv,q,&ldq,iwork,tau,work,info)!Computethegeneralizedsingularvaluedecompositionof(A,B)!(A=U*D1*(0R)*(Q**T),B=V*D2*(0R)*(Q**T))!TheNAGnameequivalentofdtgsjaisf08yefCalldtgsja(U,V,Q,m,p,n,k,l,a,lda,b,ldb,tola,tolb,alpha,beta,u,&ldu,v,ldv,q,ldq,work,ncycle,info)If(info==0)Then!PrintsolutionWrite(nout,*)Numberofinfinitegeneralizedsingularvalues(K)Write(nout,99999)kWrite(nout,*)Numberoffinitegeneralizedsingularvalues(L)Write(nout,99999)lWrite(nout,*)EffectiveNumeric
8 alrankof(A**TB**T)**T(K+L)Write(nout,99
alrankof(A**TB**T)**T(K+L)Write(nout,99999)irankWrite(nout,*)Write(nout,*)FinitegeneralizedsingularvaluesWrite(nout,99998)(alpha(j)/beta(j),j=k+1,irank)Write(nout,*)Flush(nout)!ifail:behaviouronerrorexit!=0forhardexit,=1forquiet-soft,=-1fornoisy-softifail=0Callx04cbf(General,,m,m,u,ldu,1P,E12.4,OrthogonalmatrixU,&Integer,rlabs,Integer,clabs,80,0,ifail)Write(nout,*)Flush(nout)Callx04cbf(General,,p,p,v,ldv,1P,E12.4,OrthogonalmatrixV,&Integer,rlabs,Integer,clabs,80,0,ifail)Least-squaresandEigenvalueProblems(LAPACK)Mark26F08YEF.7 Write(nout,*)Flush(nout)Callx04cbf(General,,n,n,q,ldq,1P,E12.4,OrthogonalmatrixQ,&Integer,rlabs,Integer,clabs,80,0,ifail)Write(nout,*)Flush(nout)Callx04cbf(Uppertriangular,Non-unit,irank,irank,a(1,n-irank+1),&lda,1P,E12.4,NonsingularuppertriangularmatrixR,Integer,&rlabs,Integer,clabs,80,0,ifail)Write(nout,*)Write(nout,*)NumberofcyclesoftheKogbetliantzmethodWrite(nout,99999)ncycleWrite(nout,99997)FailureinDTGSJA.INFO=,infoEndIf99999Format(1X
9 ,I5)99998Format(3X,8(1P,E12.4))99997Form
,I5)99998Format(3X,8(1P,E12.4))99997Format(1X,A,I4)EndProgramf08yefe10.2ProgramDataF08YEFExampleProgramData432:ValuesofM,NandP1.02.03.03.02.01.04.05.06.07.08.08.0:EndofmatrixA-2.0-3.03.04.06.05.0:EndofmatrixB10.3ProgramResultsF08YEFExampleProgramResultsNumberofinfinitegeneralizedsingularvalues(K)Numberoffinitegeneralizedsingularvalues(L)EffectiveNumericalrankof(A**TB**T)**T(K+L)Finitegeneralizedsingularvalues1.3151E+008.0185E-02OrthogonalmatrixU12341-1.3484E-015.2524E-01-2.0924E-018.1373E-0126.7420E-01-5.2213E-01-3.8886E-013.4874E-0132.6968E-015.2757E-01-6.5782E-01-4.6499E-0146.7420E-014.1615E-016.1014E-011.5127E-15OrthogonalmatrixV13.5539E-01-9.3472E-0129.3472E-013.5539E-01OrthogonalmatrixQ1-8.3205E-01-9.4633E-02-5.4657E-0125.5470E-01-1.4195E-01-8.1985E-0130.0000E+00-9.8534E-011.7060E-01NAGLibraryManualF08YEF.8Mark26 NonsingularuppertriangularmatrixR1-2.0569E+00-9.0121E+00-9.3705E+002-1.0882E+01-7.2688E+003-6.0405E+00NumberofcyclesoftheKogbetliantzmethodLeast-squaresandEigenvalueProblems(LAPACK)Mark26F08YEF.9(last)