您好,欢迎访问三七文档
NISTIR5935TheMatrixMarketExchangeFormats:InitialDesignRonaldF.BoisvertRoldanPozoKarinA.RemingtonU.S.DepartmentofCommerceTechnologyAdministrationNationalInstituteofStandardsandTechnologyComputingandAppliedMathematicsLaboratoryGaithersburg,MD20899USADecember1996TheMatrixMarketExchangeFormats:InitialDesignRonaldF.Boisvert,RoldanPozoandKarinA.Remington AppliedandComputationalMathematicsDivisionNationalInstituteofStandardsandTechnologyGaithersburg,MD20899USA.AbstractWeproposeelementaryASCIIexchangeformatsformatrices.Speci cinstancesoftheformatarede nedfordenseandsparsematriceswithreal,complex,integerandpatternentries,withspecialcasesforsymmetric,skew-symmetricandHer-mitianmatrices.Sparsematricesarerepresentedinacoordinatestorageformat.Theoverall lestructureisdesignedtoallowfuturede nitionofotherspecializedmatrixformats,aswellasforobjectsotherthanmatrices.Contents1Introduction11.1CoordinateFormatforSparseMatrices:::::::::::::::::::::::::::::21.2ArrayFormatforDenseMatrices::::::::::::::::::::::::::::::::52Speci cationoftheBaseMMFileFormat63Speci cationofMMFormatsforMatrices73.1CoordinateFormatsforSparseMatrices::::::::::::::::::::::::::::73.2ArrayFormatsforDenseMatrices:::::::::::::::::::::::::::::::84ExtendingtheBaseMMFormats94.1StructuredComments::::::::::::::::::::::::::::::::::::::94.2FormatSpecializations.:::::::::::::::::::::::::::::::::::::124.3ExtendingtheMMTypeCode:::::::::::::::::::::::::::::::::13 Email:boisvert@nist.gov,kremington@nist.gov,pozo@nist.gov2R.F.Boisvert,R.PozoandK.A.Remington1IntroductionTheMatrixMarket(MM)exchangeformatsprovideasimplemechanismtofacilitatetheexchangeofmatrixdata.Inparticular,theobjectivehasbeentode neaminimalbaseASCII leformatwhichcanbeveryeasilyexplainedandparsed,butcanbeeasilyadaptedtoapplicationswithamorerigidstructure,orextendedtorelateddataobjects.This leformatistheprimaryformatusedbytheMatrixMarket[1],avisualdatabaseofmatrixtestdataavailableontheWorldWideWeb1.TheMMexchangeformatformatricesisreallyacollectionofa liatedformatswhichsharedesignelements.Inourinitialspeci cation,twomatrixformatsarede ned.1.CoordinateFormatA leformatsuitableforrepresentinggeneralsparsematrices.Onlynonzeroentriesareprovided,andthecoordinatesofeachnonzeroentryisgivenexplicitly.ThiswillbeillustratedinExamples1and2.2.ArrayFormatA leformatsuitableforrepresentinggeneraldensematrices.Allentriesarepro-videdinapre-de ned(column-oriented)order.ThiswillbeillustratedinExample3.Severalinstancesofeachofthesebasicformatsarede ned.Theseareobtainedbyspecifyinganarithmetic eldforthematrixentries(i.e.,real,complex,integer,pattern)andasymmetrystructurewhichmayreducethesizeofthedata le(i.e.general,symmetric,skew-symmetric,Hermitian).TheMMdesignovercomessomeofthedi cultieswithexistingschemes.ThemostwellknownistheHarwell-Boeing(HB)SparseMatrixFormat[2].Manymatriceshavebeenencodedusingthisformat,mostnotablythosecomprisingtheHarwell-BoeingSparseMatrixCollection(ReleaseI).Unfortunately,theHBspeci cationissomewhatcomplex,di culttoparsefromlanguagesotherthanFortran,biasedinfavorofcompressedcolumnrepresentation,andnoteasilyextensible.SomeofthesefactorsmayhaveimpededthemorewidespreaduseoftheHBformat.Recently,agroupatNASAAmesproposedanalternateformat(GAMFF)[3].Thiswasmotivatedmainlyduetotheneedtoproducea leformattorepresentgraphs.Aspeci- cationwhichincludedgraphs,sparsematrices,anddensematriceswasdeveloped,andalargevarietyofsuchmatrixandgraph leswereconvertedtothisformat2.AlthoughtheGAMFFformatissomewhatsimplerandmoreextensiblethanHB,itssparsematrixsubsetremainscloselytiedtotheHBcompressedcolumnformat.1://:InitialDesign3Intheremainderofthissection,wedescribethecoordinateandarraymatrixformatsinformally,providingseveralexamples,whileinSection2,wedetailtheformalspeci ca-tionoftheMMfamilyofformats.InSection3,weelaborateonthecoordinateandarraymatrixformats.Finally,inSection4weoutlinesomeoftheguidingprinciplesthatweusedindesigningtheseformats,focusingespeciallyonthefeaturesusedtoassureeasyextensibility.1.1CoordinateFormatforSparseMatricesCoordinateformatissuitableforrepresentingsparsematrices.Onlynonzeroentriesneedbeencoded,andthecoordinatesofeacharegivenexplicitly.Thisisillustratedinthefollowingexampleofarealgeneralsparsematrix.Example1:MMcoordinateformatforarealgeneralsparsematrixConsiderthefollowing5 5matrix.0BBBBBB@10060010:500000:015000250:50 28033:320000121CCCCCCAInMMcoordinateformatthiscouldberepresentedasfollows.%%MatrixMarketmatrixcoordinaterealgeneral%A5x5sparsematrixwith8nonzeros558111.02210.542250.5330.015146.044-280.04533.325512.0The rstlinecontainsthe%%MatrixMarketheaderfollowedbyasequenceofkeywords.Theseindicatethattheobjectbeingrepresentedisamatrixincoordinateformat,andthatthenumericdataisrepresentedinrealgeneralform.(Bygeneralwemeanthatthestorageformatisnottakingadvantageofanysymmetryproperties.)Thesecondlineisacomment.(Zeroormoresuchlinesmayappearatthispointinthe le,eachbeginningwitha%.)Thenextlinecontainst
本文标题:The Matrix Market Exchange Formats Initial Design
链接地址:https://www.777doc.com/doc-3279490 .html