资源描述:
《Modified_Givens_Transformation》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、RestructuringtheBLASLevel1RoutineforComputingtheModiedGivensTransformationTimHopkins(trh@ukc.ac.uk)ComputingLaboratoryUniversityofKentCanterbury,CT27NFKent,UK.November19,1997AbstractWelookathowbothlogicalrestructuringandimprovementsavailablefromsuccessiveversionsofF
2、ortranallowustoreducethecomplexity(measuredbyanumberofthecom-monlyusedsoftwaremetrics)oftheLevel1BLAScodeusedtocomputethemodiedGivenstransformation.Withthesereductionsincomplexityweclaimthatwehaveimprovedboththemaintainabilityandclarityofthecode;inaddition,wereporta
3、xtoaminorproblemwiththeoriginalcode.TheperformanceoftwocommercialFortranrestructuringtoolsisalsoreported.1IntroductionTheLevel1BLAS[LHKK79],originallypublishedinFortran66[ANS66],implementedanumberofcommonvectoroperationsandweredesignedtobeusedasbuildingblocksforline
4、aralgebrasoftware.Hopkins[Hop96]usedknotcounts[WHH79]andpathcounts[Nej88]toidentifyroutinesfromtheLevel1BLASwhichmightbenetfromcoderestructuringTwosetsofroutines,*NRM2,usedtocomputetheEuclideannormofavectorand*ROTMG,forcomputingthemodiedGivenstransformation,wereide
5、ntiedashavingextremelyhighmetricvaluesgiventheirrelativelylownumberofexecutablestatements.Therestructuringofthe*NRM2routines,alongwithadramaticdecreaseinthemetricvalues,wasreportedbyHopkins[Hop96];the*ROTMGroutinesareconsideredhere.Followingabriefdescriptionofthesof
6、twaremetricsusedtocompareversionsofthe*ROTMGroutines,wepresenta
owgraphofthepublishedcodeandlookathowtwoFortrancoderestruc-turingtoolsfaredonthisoriginalsource.Wethencomparethemetricvaluesobtainedfortheoriginalandautomaticallyrestructuredcodewithhand-codedFortran66an
7、dFortran77versions.Section5looksathowthemetricvaluesmaybereducedfurtherbyusingFortran90andweshowhowtheuseofsomeofthenewfacilitiesavailableinFortran90maybeusedtoimprovetheseroutinesfurther.Finallywelookbrie
yatthetestingofthenewroutineandreportaxtoaminorproblemintheo
8、riginalcode.2ModiedGivensRotationMatrixTTheinputvaluesto*ROTMG,d,d,xandy,deneatwo-vector[a;a]inthepartitionedform121112as"#12