SUBROUTINEZSYMMF(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,$BETA,C,LDC)*..ScalarArguments..CHARACTER*1SIDE,UPLOINTEGERM,N,LDA,LDB,LDCCOMPLEX*16ALPHA,BETA*..ArrayArguments..COMPLEX*16A(LDA,*),B(LDB,*),C(LDC,*)*..**Purpose*=======**ZSYMMperformsoneofthematrix-matrixoperations**C:=alpha*A*B+beta*C,**or**C:=alpha*B*A+beta*C,**wherealphaandbetaarescalars,AisasymmetricmatrixandBand*Carembynmatrices.**Parameters*==========**SIDE-CHARACTER*1.*Onentry,SIDEspecifieswhetherthesymmetricmatrixA*appearsontheleftorrightintheoperationasfollows:**SIDE='L'or'l'C:=alpha*A*B+beta*C,**SIDE='R'or'r'C:=alpha*B*A+beta*C,**Unchangedonexit.**UPLO-CHARACTER*1.*Onentry,UPLOspecifieswhethertheupperorlower*triangularpartofthesymmetricmatrixAistobe*referencedasfollows:**UPLO='U'or'u'Onlytheuppertriangularpartofthe*symmetricmatrixistobereferenced.**UPLO='L'or'l'Onlythelowertriangularpartofthe*symmetricmatrixistobereferenced.**Unchangedonexit.**M-INTEGER.*Onentry,MspecifiesthenumberofrowsofthematrixC.*Mmustbeatleastzero.*Unchangedonexit.**N-INTEGER.*Onentry,NspecifiesthenumberofcolumnsofthematrixC.*Nmustbeatleastzero.*Unchangedonexit.**ALPHA-COMPLEX*16.*Onentry,ALPHAspecifiesthescalaralpha.*Unchangedonexit.**A-COMPLEX*16arrayofDIMENSION(LDA,ka),wherekais*mwhenSIDE='L'or'l'andisnotherwise.*BeforeentrywithSIDE='L'or'l',thembympartof*thearrayAmustcontainthesymmetricmatrix,suchthat*whenUPLO='U'or'u',theleadingmbymuppertriangular*partofthearrayAmustcontaintheuppertriangularpart*ofthesymmetricmatrixandthestrictlylowertriangular*partofAisnotreferenced,andwhenUPLO='L'or'l',*theleadingmbymlowertriangularpartofthearrayA*mustcontainthelowertriangularpartofthesymmetric*matrixandthestrictlyuppertriangularpartofAisnot*referenced.*BeforeentrywithSIDE='R'or'r',thenbynpartof*thearrayAmustcontainthesymmetricmatrix,suchthat*whenUPLO='U'or'u',theleadingnbynuppertriangular*partofthearrayAmustcontaintheuppertriangularpart*ofthesymmetricmatrixandthestrictlylowertriangular*partofAisnotreferenced,andwhenUPLO='L'or'l',*theleadingnbynlowertriangularpartofthearrayA*mustcontainthelowertriangularpartofthesymmetric*matrixandthestrictlyuppertriangularpartofAisnot*referenced.*Unchangedonexit.**LDA-INTEGER.*Onentry,LDAspecifiesthefirstdimensionofAasdeclared*inthecalling(sub)program.WhenSIDE='L'or'l'then*LDAmustbeatleastmax(1,m),otherwiseLDAmustbeat*leastmax(1,n).*Unchangedonexit.**B-COMPLEX*16arrayofDIMENSION(LDB,n).*Beforeentry,theleadingmbynpartofthearrayBmust*containthematrixB.*Unchangedonexit.**LDB-INTEGER.*Onentry,LDBspecifiesthefirstdimensionofBasdeclared*inthecalling(sub)program.LDBmustbeatleast*max(1,m).*Unchangedonexit.**BETA-COMPLEX*16.*Onentry,BETAspecifiesthescalarbeta.WhenBETAis*suppliedaszerothenCneednotbesetoninput.*Unchangedonexit.**C-COMPLEX*16arrayofDIMENSION(LDC,n).*Beforeentry,theleadingmbynpartofthearrayCmust*containthematrixC,exceptwhenbetaiszero,inwhich*caseCneednotbesetonentry.*Onexit,thearrayCisoverwrittenbythembynupdated*matrix.**LDC-INTEGER.*Onentry,LDCspecifiesthefirstdimensionofCasdeclared*inthecalling(sub)program.LDCmustbeatleast*max(1,m).*Unchangedonexit.***Level3Blasroutine.**--Writtenon8-February-1989.*JackDongarra,ArgonneNationalLaboratory.*IainDuff,AEREHarwell.*JeremyDuCroz,NumericalAlgorithmsGroupLtd.*SvenHammarling,NumericalAlgorithmsGroupLtd.***..ExternalFunctions..LOGICALLSAMEEXTERNALLSAME*..ExternalSubroutines..EXTERNALXERBLA*..IntrinsicFunctions..INTRINSICMAX*..LocalScalars..LOGICALUPPERINTEGERI,INFO,J,K,NROWACOMPLEX*16TEMP1,TEMP2*..Parameters..COMPLEX*16ONEPARAMETER(ONE=(1.0D+0,0.0D+0))COMPLEX*16ZEROPARAMETER(ZERO=(0.0D+0,0.0D+0))*..*..ExecutableStatements..**SetNROWAasthenumberofrowsofA.*IF(LSAME(SIDE,'L'))THENNROWA=MELSENROWA=NENDIFUPPER=LSAME(UPLO,'U')**Testtheinputparameters.*INFO=0IF((.NOT.LSAME(SIDE,'L')).AND.$(.NOT.LSAME(SIDE,'R')))THENINFO=1ELSEIF((.NOT.UPPER).AND.$(.NOT.LSAME(UPLO,'L')))THENINFO=2ELSEIF(M.LT.0)THENINFO=3ELSEIF(N.LT.0)THENINFO=4ELSEIF(LDA.LT.MAX(1,NROWA))THENINFO=7ELSEIF(LDB.LT.MAX(1,M))THENINFO=9ELSEIF(LDC.LT.MAX(1,M))THENINFO=12ENDIFIF(INFO.NE.0)THENCALLXERBLA('ZSYMM ',INFO)RETURNENDIF**Quickreturnifpossible.*IF((M.EQ.0).OR.(N.EQ.0).OR.$((ALPHA.EQ.ZERO).AND.(BETA.EQ.ONE)))$RETURN**Andwhenalpha.eq.zero.*IF(ALPHA.EQ.ZERO)THENIF(BETA.EQ.ZERO)THENDO20,J=1,NDO10,I=1,MC(I,J)=ZERO10CONTINUE20CONTINUEELSEDO40,J=1,NDO30,I=1,MC(I,J)=BETA*C(I,J)30CONTINUE40CONTINUEENDIFRETURNENDIF**Starttheoperations.*IF(LSAME(SIDE,'L'))THEN**FormC:=alpha*A*B+beta*C.*IF(UPPER)THENDO70,J=1,NDO60,I=1,MTEMP1=ALPHA*B(I,J)TEMP2=ZERODO50,K=1,I-1C(K,J)=C(K,J)+TEMP1*A(K,I)TEMP2=TEMP2+B(K,J)*A(K,I)50CONTINUEIF(BETA.EQ.ZERO)THENC(I,J)=TEMP1*A(I,I)+ALPHA*TEMP2ELSEC(I,J)=BETA*C(I,J)+$TEMP1*A(I,I)+ALPHA*TEMP2ENDIF60CONTINUE70CONTINUEELSEDO100,J=1,NDO90,I=M,1,-1TEMP1=ALPHA*B(I,J)TEMP2=ZERODO80,K=I+1,MC(K,J)=C(K,J)+TEMP1*A(K,I)TEMP2=TEMP2+B(K,J)*A(K,I)80CONTINUEIF(BETA.EQ.ZERO)THENC(I,J)=TEMP1*A(I,I)+ALPHA*TEMP2ELSEC(I,J)=BETA*C(I,J)+$TEMP1*A(I,I)+ALPHA*TEMP2ENDIF90CONTINUE100CONTINUEENDIFELSE**FormC:=alpha*B*A+beta*C.*DO170,J=1,NTEMP1=ALPHA*A(J,J)IF(BETA.EQ.ZERO)THENDO110,I=1,MC(I,J)=TEMP1*B(I,J)110CONTINUEELSEDO120,I=1,MC(I,J)=BETA*C(I,J)+TEMP1*B(I,J)120CONTINUEENDIFDO140,K=1,J-1IF(UPPER)THENTEMP1=ALPHA*A(K,J)ELSETEMP1=ALPHA*A(J,K)ENDIFDO130,I=1,MC(I,J)=C(I,J)+TEMP1*B(I,K)130CONTINUE140CONTINUEDO160,K=J+1,NIF(UPPER)THENTEMP1=ALPHA*A(J,K)ELSETEMP1=ALPHA*A(K,J)ENDIFDO150,I=1,MC(I,J)=C(I,J)+TEMP1*B(I,K)150CONTINUE160CONTINUE170CONTINUEENDIF*RETURN**EndofZSYMM.*END
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。