SUBROUTINECHER2F(UPLO,N,ALPHA,X,INCX,Y,INCY,A,LDA)*..ScalarArguments..COMPLEXALPHAINTEGERINCX,INCY,LDA,NCHARACTER*1UPLO*..ArrayArguments..COMPLEXA(LDA,*),X(*),Y(*)*..**Purpose*=======**CHER2performsthehermitianrank2operation**A:=alpha*x*conjg(y' ) + conjg( alpha )*y*conjg( x')+A,**wherealphaisascalar,xandyarenelementvectorsandAisann*bynhermitianmatrix.**Parameters*==========**UPLO-CHARACTER*1.*Onentry,UPLOspecifieswhethertheupperorlower*triangularpartofthearrayAistobereferencedas*follows:**UPLO='U'or'u'OnlytheuppertriangularpartofA*istobereferenced.**UPLO='L'or'l'OnlythelowertriangularpartofA*istobereferenced.**Unchangedonexit.**N-INTEGER.*Onentry,NspecifiestheorderofthematrixA.*Nmustbeatleastzero.*Unchangedonexit.**ALPHA-COMPLEX.*Onentry,ALPHAspecifiesthescalaralpha.*Unchangedonexit.**X-COMPLEXarrayofdimensionatleast*(1+(n-1)*abs(INCX)).*Beforeentry,theincrementedarrayXmustcontainthen*elementvectorx.*Unchangedonexit.**INCX-INTEGER.*Onentry,INCXspecifiestheincrementfortheelementsof*X.INCXmustnotbezero.*Unchangedonexit.**Y-COMPLEXarrayofdimensionatleast*(1+(n-1)*abs(INCY)).*Beforeentry,theincrementedarrayYmustcontainthen*elementvectory.*Unchangedonexit.**INCY-INTEGER.*Onentry,INCYspecifiestheincrementfortheelementsof*Y.INCYmustnotbezero.*Unchangedonexit.**A-COMPLEXarrayofDIMENSION(LDA,n).*BeforeentrywithUPLO='U'or'u',theleadingnbyn*uppertriangularpartofthearrayAmustcontaintheupper*triangularpartofthehermitianmatrixandthestrictly*lowertriangularpartofAisnotreferenced.Onexit,the*uppertriangularpartofthearrayAisoverwrittenbythe*uppertriangularpartoftheupdatedmatrix.*BeforeentrywithUPLO='L'or'l',theleadingnbyn*lowertriangularpartofthearrayAmustcontainthelower*triangularpartofthehermitianmatrixandthestrictly*uppertriangularpartofAisnotreferenced.Onexit,the*lowertriangularpartofthearrayAisoverwrittenbythe*lowertriangularpartoftheupdatedmatrix.*Notethattheimaginarypartsofthediagonalelementsneed*notbeset,theyareassumedtobezero,andonexitthey*aresettozero.**LDA-INTEGER.*Onentry,LDAspecifiesthefirstdimensionofAasdeclared*inthecalling(sub)program.LDAmustbeatleast*max(1,n).*Unchangedonexit.***Level2Blasroutine.**--Writtenon22-October-1986.*JackDongarra,ArgonneNationalLab.*JeremyDuCroz,NagCentralOffice.*SvenHammarling,NagCentralOffice.*RichardHanson,SandiaNationalLabs.***..Parameters..COMPLEXZEROPARAMETER(ZERO=(0.0E+0,0.0E+0))*..LocalScalars..COMPLEXTEMP1,TEMP2INTEGERI,INFO,IX,IY,J,JX,JY,KX,KY*..ExternalFunctions..LOGICALLSAMEEXTERNALLSAME*..ExternalSubroutines..EXTERNALXERBLA*..IntrinsicFunctions..INTRINSICCONJG,MAX,REAL*..*..ExecutableStatements..**Testtheinputparameters.*INFO=0IF(.NOT.LSAME(UPLO,'U').AND.$.NOT.LSAME(UPLO,'L'))THENINFO=1ELSEIF(N.LT.0)THENINFO=2ELSEIF(INCX.EQ.0)THENINFO=5ELSEIF(INCY.EQ.0)THENINFO=7ELSEIF(LDA.LT.MAX(1,N))THENINFO=9ENDIFIF(INFO.NE.0)THENCALLXERBLA('CHER2 ',INFO)RETURNENDIF**Quickreturnifpossible.*IF((N.EQ.0).OR.(ALPHA.EQ.ZERO))$RETURN**SetupthestartpointsinXandYiftheincrementsarenotboth*unity.*IF((INCX.NE.1).OR.(INCY.NE.1))THENIF(INCX.GT.0)THENKX=1ELSEKX=1-(N-1)*INCXENDIFIF(INCY.GT.0)THENKY=1ELSEKY=1-(N-1)*INCYENDIFJX=KXJY=KYENDIF**Starttheoperations.InthisversiontheelementsofAare*accessedsequentiallywithonepassthroughthetriangularpart*ofA.*IF(LSAME(UPLO,'U'))THEN**FormAwhenAisstoredintheuppertriangle.*IF((INCX.EQ.1).AND.(INCY.EQ.1))THENDO20,J=1,NIF((X(J).NE.ZERO).OR.(Y(J).NE.ZERO))THENTEMP1=ALPHA*CONJG(Y(J))TEMP2=CONJG(ALPHA*X(J))DO10,I=1,J-1A(I,J)=A(I,J)+X(I)*TEMP1+Y(I)*TEMP210CONTINUEA(J,J)=REAL(A(J,J))+$REAL(X(J)*TEMP1+Y(J)*TEMP2)ELSEA(J,J)=REAL(A(J,J))ENDIF20CONTINUEELSEDO40,J=1,NIF((X(JX).NE.ZERO).OR.(Y(JY).NE.ZERO))THENTEMP1=ALPHA*CONJG(Y(JY))TEMP2=CONJG(ALPHA*X(JX))IX=KXIY=KYDO30,I=1,J-1A(I,J)=A(I,J)+X(IX)*TEMP1$+Y(IY)*TEMP2IX=IX+INCXIY=IY+INCY30CONTINUEA(J,J)=REAL(A(J,J))+$REAL(X(JX)*TEMP1+Y(JY)*TEMP2)ELSEA(J,J)=REAL(A(J,J))ENDIFJX=JX+INCXJY=JY+INCY40CONTINUEENDIFELSE**FormAwhenAisstoredinthelowertriangle.*IF((INCX.EQ.1).AND.(INCY.EQ.1))THENDO60,J=1,NIF((X(J).NE.ZERO).OR.(Y(J).NE.ZERO))THENTEMP1=ALPHA*CONJG(Y(J))TEMP2=CONJG(ALPHA*X(J))A(J,J)=REAL(A(J,J))+$REAL(X(J)*TEMP1+Y(J)*TEMP2)DO50,I=J+1,NA(I,J)=A(I,J)+X(I)*TEMP1+Y(I)*TEMP250CONTINUEELSEA(J,J)=REAL(A(J,J))ENDIF60CONTINUEELSEDO80,J=1,NIF((X(JX).NE.ZERO).OR.(Y(JY).NE.ZERO))THENTEMP1=ALPHA*CONJG(Y(JY))TEMP2=CONJG(ALPHA*X(JX))A(J,J)=REAL(A(J,J))+$REAL(X(JX)*TEMP1+Y(JY)*TEMP2)IX=JXIY=JYDO70,I=J+1,NIX=IX+INCXIY=IY+INCYA(I,J)=A(I,J)+X(IX)*TEMP1$+Y(IY)*TEMP270CONTINUEELSEA(J,J)=REAL(A(J,J))ENDIFJX=JX+INCXJY=JY+INCY80CONTINUEENDIFENDIF*RETURN**EndofCHER2.*END
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。