├── .gitattributes ├── .gitignore ├── .project ├── COPYING.txt ├── COPYRIGHT.txt ├── README.txt ├── TEST ├── AssocConstructTEST.m ├── AssocMath01TEST.m ├── AssocSetup.m ├── AssocSetup3.m ├── AssocSubsrefTEST.m ├── CombinerScriptTEST.m ├── D4ManalysisResponse.m ├── D4MqueryGetTrackNames.m ├── D4MqueryJSONformat.m ├── D4MqueryMHtrack.m ├── D4MqueryMultiTrack.m ├── D4MqueryTrackPointDocList.m ├── D4MqueryTrackWindow.m ├── D4MwebAnalysisResponse.m ├── D4MwebQueryResponse.m ├── DBserverDispTEST.m ├── DBsetup.m ├── DBtableColFamilyTEST.m ├── DBtableNnzTEST.m ├── DBtableNumLimitTEST.m ├── DBtablePairSecurityTEST.m ├── DBtablePairSubsrefTEST.m ├── DBtableSecurityTEST.m ├── DBtableSubsrefTEST.m ├── DBtableSubsrefTripleTEST.m ├── IteratorTEST.m ├── MertonTEST.m ├── Reuters3D4MCLIAnalysis.m ├── Reuters3D4ManalysisDefaults.csv ├── Reuters3D4ManalysisTEST.m ├── Reuters3D4MqueryDemoTEST.m ├── Reuters3D4MwebAnalysisTEST.m ├── Reuters3FindTracks.m ├── Reuters3MHtracks.m ├── Reuters3insert.m ├── Reuters3parse.m ├── Reuters3trackInsert.m ├── Reuters3trackParse.m ├── ReutersEntity3Read.m ├── SKSonCloud.m ├── SearchRowAndCol2DTEST.m ├── SemanticPairExtend.m ├── SplitFunTEST.m ├── TableFieldsTEST.m ├── Text2word.tsv ├── Text2wordTEST.m ├── badTEST.m ├── convTEST.m ├── dispTypeStats.m ├── goodTEST.m ├── pBenchmarkTEST.m ├── parseJsonTEST.m ├── reuters_entities3 │ └── mergedfiles │ │ └── output_01.txt └── scidbImportTest.m ├── VERSION.txt ├── build.xml ├── commit-graphulo.sh ├── docs ├── CHANGELOG.txt ├── D4M-Demo.mp4 ├── D4M-Slides.ppt ├── DemoSnaps │ ├── Screen shot 0101.png │ ├── Screen shot 0102.png │ ├── Screen shot 0103.png │ ├── Screen shot 0104.png │ ├── Screen shot 0199.png │ ├── Screen shot 0201.png │ ├── Screen shot 0202.png │ ├── Screen shot 0203.png │ ├── Screen shot 0204.png │ ├── Screen shot 0205.png │ ├── Screen shot 0206.png │ ├── Screen shot 0207.png │ ├── Screen shot 0299.png │ ├── Screen shot 0301.png │ ├── Screen shot 0302.png │ ├── Screen shot 0303.png │ ├── Screen shot 0304.png │ ├── Screen shot 0305.png │ ├── Screen shot 0399.png │ ├── Screen shot 0401.png │ ├── Screen shot 0402.png │ ├── Screen shot 0403.png │ ├── Screen shot 0404.png │ ├── Screen shot 0499.png │ ├── Screen shot 0501.png │ ├── Screen shot 0502.png │ ├── Screen shot 0503.png │ ├── Screen shot 0504.png │ ├── Screen shot 0505.png │ ├── Screen shot 0506.png │ ├── Screen shot 0507.png │ ├── Screen shot 0508.png │ ├── Screen shot 0509.png │ ├── Screen shot 0599.png │ ├── Screen shot 0601.png │ ├── Screen shot 0602.png │ ├── Screen shot 0603.png │ ├── Screen shot 0699.png │ ├── Screen shot 0701.png │ ├── Screen shot 0702.png │ ├── Screen shot 0703.png │ ├── Screen shot 0704.png │ ├── Screen shot 0799.png │ ├── Screen shot 0801.png │ ├── Screen shot 0802.png │ ├── Screen shot 0803.png │ ├── Screen shot 0804.png │ ├── Screen shot 0805.png │ ├── Screen shot 0806.png │ ├── Screen shot 0807.png │ ├── Screen shot 0808.png │ ├── Screen shot 0809.png │ ├── Screen shot 0899.png │ ├── Screen shot 0901.png │ ├── Screen shot 0902.png │ ├── Screen shot 0903.png │ ├── Screen shot 0904.png │ ├── Screen shot 0905.png │ ├── Screen shot 0906.png │ ├── Screen shot 0907.png │ ├── Screen shot 0908.png │ ├── Screen shot 0909.png │ ├── Screen shot 0999.png │ ├── Screen shot 1001.png │ ├── Screen shot 1002.png │ ├── Screen shot 1003.png │ ├── Screen shot 1004.png │ ├── Screen shot 1099.png │ ├── Screen shot 1101.png │ ├── Screen shot 1102.png │ ├── Screen shot 1103.png │ ├── Screen shot 1104.png │ ├── Screen shot 1105.png │ ├── Screen shot 1199.png │ ├── Screen shot 1201.png │ ├── Screen shot 1202.png │ ├── Screen shot 1203.png │ ├── Screen shot 1204.png │ ├── Screen shot 1205.png │ ├── Screen shot 1206.png │ ├── Screen shot 1207.png │ ├── Screen shot 1299.png │ ├── Screen shot 1401.png │ ├── Screen shot 1402.png │ ├── Screen shot 1403.png │ ├── Screen shot 1404.png │ ├── Screen shot 1405.png │ ├── Screen shot 1406.png │ ├── Screen shot 1407.png │ └── Screen shot 1499.png ├── GraphuloFunctions.xlsx ├── Lec00-CourseOverview.pptx ├── Lec01-AssocArrays.pptx ├── Lec02-GroupTheory.pptx ├── Lec03-UnstructuredData.pptx ├── Lec04-StructuredData.pptx ├── Lec05-PerfectPowerLaw.pptx ├── Lec06-BioSequenceCorrelation.pptx ├── Lec07-Performance.pptx └── java.opts ├── examples ├── 0JupyterDemo │ ├── DemoExamplesMat.ipynb │ ├── DemoExamplesOct.ipynb │ ├── SplitSequenceCSV.m │ └── data │ │ ├── A.csv │ │ ├── bacteria.csv │ │ ├── entity.csv │ │ ├── network.csv │ │ └── palm.csv ├── 1Intro │ ├── 1AssocIntro │ │ ├── A.csv │ │ ├── AI1_SetupTEST.m │ │ ├── AI2_SubsrefTEST.m │ │ ├── AI3_MathTEST.m │ │ └── AI4_AdvConstructTEST.m │ ├── 2EdgeArt │ │ ├── EA1_GraphTEST.m │ │ ├── EA2_SubsrefTEST.m │ │ ├── EA3_SubGraphTEST.m │ │ └── Edge.csv │ ├── 3GroupTheory │ │ ├── AfuncEval.m │ │ ├── AnnihilatorTest.m │ │ ├── AssociateTest.m │ │ ├── CommuteTest.m │ │ ├── DistributeTest.m │ │ ├── EqualTest.m │ │ ├── Func │ │ │ ├── AllF.csv │ │ │ ├── CommMonoidF.csv │ │ │ ├── CommSemigroupF.csv │ │ │ ├── CommSemiringF.csv │ │ │ ├── FeldF.csv │ │ │ └── SemigroupF.csv │ │ ├── GT1_TEST.m │ │ ├── IOTest.m │ │ ├── IdentityTest.m │ │ ├── PermuteRange.m │ │ └── Range │ │ │ ├── AssociateRange.csv │ │ │ ├── AssociateRangeFull.csv │ │ │ ├── CommuteRange.csv │ │ │ ├── CommuteRangeFull.csv │ │ │ ├── DistributeRange.csv │ │ │ ├── DistributeRangeFull.csv │ │ │ └── FuncRange.csv │ ├── 4Graphulo │ │ ├── DBsetup.m │ │ ├── ExampleGraph.png │ │ ├── dbTestSetup.m │ │ ├── x01_BFSTEST.m │ │ ├── x02_JaccardTEST.m │ │ ├── x03_kTrussTEST.m │ │ ├── x04_NMFTEST.m │ │ ├── x05_dbBFSTEST.m │ │ ├── x06_dbJaccardTEST.m │ │ ├── x07_dbkTrussTEST.m │ │ └── x08_dbNMFTEST.m │ └── 5mtimesCustom │ │ └── mtc01_Example.m ├── 2Apps │ ├── 1EntityAnalysis │ │ ├── EA1_ReadTEST.m │ │ ├── EA2_StatTEST.m │ │ ├── EA3_FacetTEST.m │ │ ├── EA4_GraphTEST.m │ │ ├── EA5_GraphQueryTEST.m │ │ └── Entity.csv │ ├── 2TrackAnalysis │ │ ├── Entity.mat │ │ ├── FindMHtracks.m │ │ ├── FindTrackGraph.m │ │ ├── FindTracks.m │ │ ├── TA1_BuildTEST.m │ │ ├── TA2_QueryTEST.m │ │ ├── TA3_GraphTEST.m │ │ └── TA4_MultipleHypothesisTEST.m │ ├── 3PerfectPowerLaw │ │ ├── ApplyDegreeCorrection.m │ │ ├── ComputeDegreeCorrection.m │ │ ├── EdgesFromDist.m │ │ ├── OutDegree.m │ │ ├── PPL1_StatTEST.m │ │ ├── PPL2_TransformTEST.m │ │ ├── PPL3_SampleTEST.m │ │ ├── PPL4_FitTransformTEST.m │ │ ├── PowerLawDist.m │ │ ├── PowerLawEst.m │ │ ├── PowerLawExact.m │ │ ├── PowerLawExactMulti.m │ │ ├── PowerLawFit.m │ │ ├── PowerLawRebin.m │ │ └── RandPowerLawMatrix.m │ ├── 4BioBlast │ │ ├── BB1_ShowDataTEST.m │ │ ├── BB2_ShowMatchesTEST.m │ │ ├── SplitSequenceCSV.m │ │ ├── SplitSequenceGram2CSV.m │ │ └── data │ │ │ ├── bacteria.csv │ │ │ └── palm.csv │ └── 5MIMIC │ │ ├── DBsetup.m │ │ ├── README.md │ │ ├── cleanWords.m │ │ ├── data │ │ ├── edge-0-200.mat │ │ ├── edge-0-300.mat │ │ ├── txt-0-200.mat │ │ └── txt-0-300.mat │ │ ├── medDict.txt │ │ ├── medDict.txt.zip │ │ ├── mic01_Ingest.m │ │ ├── mic02_Filter.m │ │ ├── mic03_Tfidf.m │ │ ├── mic04_NMF.m │ │ ├── mic05_Visualize │ │ ├── DBsetup.m │ │ ├── identifyTopTopics.m │ │ ├── identifyTopWords.m │ │ ├── input.json │ │ ├── json2struct.m │ │ ├── makeJson.m │ │ ├── mic05_Visualize.m │ │ ├── parseQuery.m │ │ ├── readFile.m │ │ └── writeFile.m │ │ ├── readFile.m │ │ ├── removeIdentifiers.m │ │ ├── removePunctuation.m │ │ ├── removeStopWords.m │ │ ├── splitCombWords.m │ │ └── writeFile.m ├── 3Scaling │ ├── 1KroneckerGraph │ │ ├── BipartiteIndexTree.m │ │ ├── KG1_BipartKronTEST.m │ │ ├── KG2_BipartIdentKronTEST.m │ │ ├── KG3_BipartDegreeTEST.m │ │ ├── KG4_StochasticKronTEST.m │ │ ├── StochasticKronGraph.m │ │ ├── bipartite.m │ │ ├── bipartite_kron_split.m │ │ └── reorder_matrix.m │ ├── 2ParallelDatabase │ │ ├── DBsetup.m │ │ ├── KronGraph500NoPerm.m │ │ ├── addmatlatex.m │ │ ├── alg │ │ │ ├── .gitignore │ │ │ ├── KronGraph500NoPerm.m │ │ │ ├── MATLAB_scale_3.txt │ │ │ ├── MyDBsetup.m │ │ │ ├── addmatlatex.m │ │ │ ├── alg00_Driver03_kTrussAdj.m │ │ │ ├── alg00_Driver04_triCount.m │ │ │ ├── alg00_Driver04_triCountEdge.m │ │ │ ├── alg01_Gen00_Driver.m │ │ │ ├── alg01_Gen01_File.m │ │ │ ├── alg01_Gen02_Assoc.m │ │ │ ├── alg01_Gen03_PutAdjUU.m │ │ │ ├── alg01_Gen03_PutAdjUUDeg.m │ │ │ ├── alg01_Gen04_ComputeAdjUUDeg.m │ │ │ ├── alg01_Gen05_PlotAdjUUDeg.m │ │ │ ├── alg01_Gen06_PutAdj.m │ │ │ ├── alg01_Gen07_Toy.m │ │ │ ├── alg01_Gen08_CountEntries.m │ │ │ ├── alg02_Jaccard00_Driver.m │ │ │ ├── alg02_Jaccard01_Graphulo.m │ │ │ ├── alg02_Jaccard02_D4M.m │ │ │ ├── alg02_Jaccard03_Verify.m │ │ │ ├── alg02_Jaccard04_Plot.m │ │ │ ├── alg03_kTrussAdj00_Driver.m │ │ │ ├── alg03_kTrussAdj01_Graphulo.m │ │ │ ├── alg03_kTrussAdj02_D4M.m │ │ │ ├── alg03_kTrussAdj03_Verify.m │ │ │ ├── alg03_kTrussAdj04_Plot.m │ │ │ ├── alg03_kTrussAdj05_PlotRate.m │ │ │ ├── alg04_triCount00_Driver.m │ │ │ ├── alg04_triCount01_Graphulo.m │ │ │ ├── alg04_triCount01_GraphuloEdge.m │ │ │ ├── alg04_triCount03_Verify.m │ │ │ ├── alg04_triCount04_Plot.m │ │ │ ├── alg04_triCount05_D4M.m │ │ │ ├── info.tsv │ │ │ ├── info_cluster_tri_final_paper.tsv │ │ │ ├── info_jaccard_ktruss.tsv │ │ │ ├── latexTable.m │ │ │ ├── tryInternet.m │ │ │ ├── tryInternetDegree.m │ │ │ ├── tryInternetEdge.m │ │ │ ├── util_Require.m │ │ │ ├── util_UpdateInfo.m │ │ │ └── util_UpdateInfoAndDB.m │ │ ├── elim0.m │ │ ├── info.csv │ │ ├── latexTable.m │ │ ├── maxdiff.m │ │ ├── num2bank.m │ │ ├── pDB01_DataTEST.m │ │ ├── pDB02_FileTEST.m │ │ ├── pDB03_AssocTEST.m │ │ ├── pDB04_DegreeTEST.m │ │ ├── pDB04cat_DegreeTEST.m │ │ ├── pDB05_SetupTEST.m │ │ ├── pDB06_AdjInsertTEST.m │ │ ├── pDB07_AdjQueryTEST.m │ │ ├── pDB08_AdjQueryItTEST.m │ │ ├── pDB09_AdjJoinTEST.m │ │ ├── pDB10_EdgeInsertTEST.m │ │ ├── pDB11_EdgeQueryTEST.m │ │ ├── pDB12_EdgeQueryItTEST.m │ │ ├── pDB13_EdgeJoinTEST.m │ │ ├── pDB14_AdjBFSTEST.m │ │ ├── pDB15_AdjJaccardTEST.m │ │ ├── pDB16_AdjTrussTEST.m │ │ ├── pDB17_EdgeBFSTEST.m │ │ ├── pDB18_EdgeTrussTEST.m │ │ ├── pDB19_EdgeNMFTEST.m │ │ ├── pDB20_AdjMultTEST.m │ │ ├── pDB_LoadAssoc.m │ │ ├── pt01_PutDB.m │ │ ├── pt02_TableMult.m │ │ ├── pt03_Plot.m │ │ ├── pt04_TableMultMR.m │ │ ├── pt05_PlotMR.m │ │ ├── runner.m │ │ └── saveAll.sh │ ├── 3MatrixPerformance │ │ ├── KronGraph500NoPerm.m │ │ ├── MP1_DenseTEST.m │ │ ├── MP2_KronSparseTEST.m │ │ ├── MP2_SparseTEST.m │ │ ├── MP3_AssocTEST.m │ │ ├── MP4_AssocCatKeyTEST.m │ │ ├── MP5_AssocCatValTEST.m │ │ ├── MP6_AssocMinusTEST.m │ │ ├── MP6_AssocPlusTEST.m │ │ └── MP7_CompareResultsTEST.m │ └── 4Graphulo │ │ ├── DBsetup.m │ │ ├── KronGraph500NoPerm.m │ │ ├── deleteTables.m │ │ ├── x00_ingestForTEST.m │ │ ├── x01_scaleBFSTEST.m │ │ ├── x02_scaleJaccardTEST.m │ │ ├── x03_scalekTrussTEST.m │ │ └── x04_scaleNMFTEST.m └── d4mTestAllExamples.m ├── lib ├── graphulo-3.1.0.jar ├── graphulo-3.1.1.jar └── graphulo-3.1.2.jar └── matlab_src ├── @Assoc ├── Abs0.m ├── Adj.m ├── Assoc.m ├── Assoc2CSV.m ├── Assoc2CSVstr.m ├── Assoc2HTML.m ├── Assoc2JSONCSV.m ├── Col.m ├── Equallike.m ├── Key.m ├── NewSep.m ├── NumLimit.m ├── Pluslike.m ├── Row.m ├── Val.m ├── abs.m ├── and.m ├── catFind.m ├── conv.m ├── dblLogi.m ├── diag.m ├── disp.m ├── display.m ├── displayFull.m ├── double.m ├── eq.m ├── find.m ├── ge.m ├── gt.m ├── isempty.m ├── le.m ├── loadobj.m ├── logical.m ├── lt.m ├── max.m ├── min.m ├── minus.m ├── mtimes.m ├── mtimesCustom.m ├── ne.m ├── nnz.m ├── noCol.m ├── noRow.m ├── noVal.m ├── num2str.m ├── numel.m ├── or.m ├── plot.m ├── plus.m ├── putAdj.m ├── putCol.m ├── putNumLimit.m ├── putRow.m ├── putVal.m ├── randCol.m ├── randRow.m ├── rdivide.m ├── reAssoc.m ├── size.m ├── spy.m ├── spyTicks.m ├── sqIn.m ├── sqOut.m ├── str2num.m ├── strcmp.m ├── subsref.m ├── sum.m ├── times.m ├── transpose.m └── xor.m ├── @DBserver ├── DBSciDBConnect.m ├── DBserver.m ├── DBsqlConnect.m ├── display.m ├── getTable.m ├── ls.m └── subsref.m ├── @DBtable ├── Col.m ├── ColCombiner.m ├── ColumnFamily.m ├── DBtable.m ├── NumLimit.m ├── NumRow.m ├── PutBytes.m ├── Row.m ├── Security.m ├── Splits.m ├── addColCombiner.m ├── addSplits.m ├── close.m ├── createD4mDbQuerySql.m ├── delete.m ├── deleteAssoc.m ├── deleteColCombiner.m ├── deleteForce.m ├── deleteTriple.m ├── designateCombiningColumns.m ├── display.m ├── getName.m ├── getSplits.m ├── insert.m ├── listCombiningColumns.m ├── merge.m ├── mergeSplits.m ├── new.m ├── nnz.m ├── putColumnFamily.m ├── putFile.m ├── putNumLimit.m ├── putNumRow.m ├── putPutBytes.m ├── putSecurity.m ├── putSplits.m ├── putTriple.m ├── querySciDB.m ├── randRow.m ├── rename.m ├── revokeCombiningColumns.m ├── size.m ├── sqlCreateStatement.m └── subsref.m ├── @DBtablePair ├── ColumnFamily.m ├── DBtablePair.m ├── NumLimit.m ├── PutBytes.m ├── Security.m ├── addSplits.m ├── close.m ├── delete.m ├── deleteForce.m ├── getName.m ├── getSplits.m ├── mergeSplits.m ├── new.m ├── nnz.m ├── putColumnFamily.m ├── putNumLimit.m ├── putPutBytes.m ├── putSecurity.m ├── putSplits.m ├── putTriple.m ├── randCol.m ├── randRow.m ├── size.m └── subsref.m ├── Adj2Edge.m ├── Adj2OutInRow.m ├── AdjBFS.m ├── Assoc2KML.m ├── AssocCatStrFunc.m ├── BinDegree.m ├── CSVstr2TSVstr.m ├── CSVstr2assoc.m ├── CatKeyMul.m ├── CatKeySqInNoDiag.m ├── CatStr.m ├── CatTriple.m ├── CatValMul.m ├── CombineCatValMul.m ├── D4M.m ├── DBaddJavaOps.m ├── DBcreate.m ├── DBdelete.m ├── DBinit.m ├── DBinsert.m ├── DBsetupLLGrid.m ├── DBsetupSciDB.m ├── DBsubsrefFind.m ├── DBtableIndexRow.m ├── DBtableRandRow.m ├── EdgeBFS.m ├── EdgeList2Mat.m ├── ExtendPair.m ├── FindCSV.m ├── FindCSVsimple.m ├── HierAdd.m ├── HierAddFinal.m ├── HierAddInit.m ├── IndexAssocFiles.m ├── InsertAssocFiles.m ├── IsClass.m ├── Iterator.m ├── JSONCSV2assoc.m ├── Jaccard.m ├── JavaInnerEnum.m ├── KronCatStr.m ├── Mat2Assoc.m ├── Mat2str.m ├── Mertonize.m ├── MertonizeLatLon.m ├── MyEcho.m ├── NMF.m ├── NoDiag.m ├── NumStr.m ├── OutDegree.m ├── OutInRow2Adj.m ├── PairCheck.m ├── ParseFileCols.m ├── ReadCSV.m ├── ReadCSVfiles.m ├── SplitSciDBstr.m ├── SplitStr.m ├── StartsWith.m ├── Str2mat.m ├── StrFileRead.m ├── StrFileWrite.m ├── StrLS.m ├── StrSearch.m ├── StrSepsame.m ├── StrSubind.m ├── StrSubindFilt.m ├── StrSubsref.m ├── StrUnique.m ├── Struct2Assoc.m ├── Text2word.m ├── TopColPerRow.m ├── TopRowPerCol.m ├── TsqlCol.m ├── TsqlSize.m ├── WriteDBtableIndex.m ├── buildQuery.m ├── col2type.m ├── col2val.m ├── columnNeighbors.m ├── deleteSciDBarray.m ├── genRmatData.m ├── html ├── DBinsert.html └── DBsubsrefFind.html ├── kTrussAdj.m ├── kTrussEdge.m ├── parseJSON.m ├── put.m ├── putAssoc.m ├── randiTmp.m ├── runSciDBQuery.m ├── runTESTdir.m ├── scidb2mtx.m └── val2col.m /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /examples/3Scaling/2ParallelDatabase/data/ 3 | /TEST/*.mat 4 | /TEST/reuters_entities3/mergedfiles/*.mat 5 | examples/2Apps/1EntityAnalysis/Entity.mat 6 | examples/3Scaling/3MatrixPerformance/data/ 7 | examples/3Scaling/2ParallelDatabase/*.eps 8 | examples/3Scaling/2ParallelDatabase/*.fig 9 | examples/3Scaling/2ParallelDatabase/*.png 10 | libext/ 11 | 12 | # Windows default autosave extension 13 | *.asv 14 | 15 | # OSX / *nix default autosave extension 16 | *.m~ 17 | 18 | # Compiled MEX binaries (all platforms) 19 | *.mex* 20 | 21 | # Simulink Code Generation 22 | slprj/ 23 | 24 | # Ignore Mac DS_Store files 25 | .DS_Store 26 | 27 | # Ignore *~ files 28 | *~ -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | d4m_api 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TEST/AssocConstructTEST.m: -------------------------------------------------------------------------------- 1 | % Create assoc array entries. 2 | iStr = '01 02 03 04 21 22 23 24 41 51 61 62 63 64 '; 3 | iVal = [ 1 1 1 1 4 3 2 1 4 5 6 6 6 6 ].'; 4 | 5 | % 0x0 cases. 6 | A01 = Assoc('',iStr,iVal); 7 | A02 = Assoc(iVal,iStr,''); 8 | A03 = Assoc(iVal,[],''); 9 | A04 = Assoc('',[],[]); 10 | A05 = Assoc('','',[]); 11 | A06 = Assoc('',iVal,[]); 12 | 13 | A11 = Assoc('a ',iStr,iVal); 14 | A12 = Assoc(iVal,iStr,'a '); 15 | A13 = Assoc(iVal,1,'a '); 16 | A14 = Assoc('a ',1,1); 17 | A15 = Assoc('a ','a ',1); 18 | A16 = Assoc('a ',iVal,1); 19 | 20 | %save([mfilename '.mat'],'-v6','A01','A02','A03','A04','A05','A06'); 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % (c) <2010> Massachusetts Institute of Technology 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | -------------------------------------------------------------------------------- /TEST/AssocSetup.m: -------------------------------------------------------------------------------- 1 | 2 | % Create assoc array entries. 3 | rowStr = 'a a a a a a a aa aaa b bb bbb a aa aaa b bb bbb '; 4 | colStr = 'a aa aaa b bb bbb a a a a a a a aa aaa b bb bbb '; 5 | valStr = 'a-a a-aa a-aaa a-b a-bb a-bbb a-a aa-a aaa-a b-a bb-a bbb-a a-a aa-aa aaa-aaa b-b bb-bb bbb-bbb '; 6 | 7 | % Create assoc array. 8 | A = Assoc(rowStr,colStr,valStr); 9 | 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | % D4M: Dynamic Distributed Dimensional Data Model 12 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 14 | % MIT Lincoln Laboratory 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % (c) <2010> Massachusetts Institute of Technology 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | -------------------------------------------------------------------------------- /TEST/AssocSetup3.m: -------------------------------------------------------------------------------- 1 | 2 | % Create assoc array entries. 3 | rowStr = 'cat rat bat sat chat fat pat bad baa cap car pat cat bee buzz bee pats pab ' 4 | colStr = 'a aa aaa a b bb bbb abc aab pac abc bong fat peek zing zee bang paa ' 5 | valStr = 'a-a a-aa a-aaa a-b a-bb a-bbb a-a aa-a b-a-a c-a-p c-a-r pat-bong catfat bee-pee buzz-zing bee-zee pats-bang flute ' 6 | 7 | % Create assoc array. 8 | A = Assoc(rowStr,colStr,valStr); 9 | 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | % D4M: Dynamic Distributed Dimensional Data Model 12 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 14 | % MIT Lincoln Laboratory 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % (c) <2010> Massachusetts Institute of Technology 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | -------------------------------------------------------------------------------- /TEST/AssocSubsrefTEST.m: -------------------------------------------------------------------------------- 1 | AssocSetup; % Create assoc array A. 2 | 3 | 4 | % Get subarrays. 5 | A1r = A('a b ',:); 6 | A2r = A('a* ',1:3); 7 | A3r = A('a : b ',:); 8 | A1c = A(:,'a b '); 9 | A2c = A(1:3,'a* '); 10 | A3c = A(:,'a : b '); 11 | A1v = (A < 'b '); 12 | 13 | save([mfilename '.mat'],'-v6','A1r','A2r','A3r','A1c','A2c','A3c','A1v') 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | -------------------------------------------------------------------------------- /TEST/D4MqueryGetTrackNames.m: -------------------------------------------------------------------------------- 1 | function trackNames = D4MqueryGetTrackNames(minLength) 2 | % Returns list of all names in track table (i.e. column labels). 3 | global D4MqueryGlobal 4 | 5 | % trackNames = Col(D4MqueryGlobal.DbTr(:,:)); 6 | trackNames = (sum(double(logical(D4MqueryGlobal.DbTr(:,:))),1) >= minLength); 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /TEST/D4MqueryMHtrack.m: -------------------------------------------------------------------------------- 1 | function MHtrack = D4MqueryMHtrack(p) 2 | % Returns multiple hypothesis track for p. 3 | global D4MqueryGlobal 4 | 5 | % Specify track keys. 6 | nl = char(10); 7 | t=['TIME/*' nl]; l=['NE_LOCATION/*' nl]; 8 | 9 | MHtrack = abs(Reuters3MHtracks(D4MqueryGlobal.DbA,p,t,l)).'; 10 | 11 | end 12 | 13 | -------------------------------------------------------------------------------- /TEST/D4MqueryMultiTrack.m: -------------------------------------------------------------------------------- 1 | function multiTr = D4MqueryMultiTrack(p); 2 | % Returns best tracks for mulitple persons. 3 | global D4MqueryGlobal 4 | 5 | multiTr = D4MqueryGlobal.DbTr(:,p); 6 | 7 | end 8 | 9 | -------------------------------------------------------------------------------- /TEST/D4MqueryTrackPointDocList.m: -------------------------------------------------------------------------------- 1 | function docList = D4MqueryTrackPointDocList(x,t,l); 2 | % Returns docs that support a particular track point. 3 | global D4MqueryGlobal 4 | 5 | DbA = D4MqueryGlobal.DbA; 6 | 7 | % Find docs that have person 8 | DocIDwPer = Row(DbA(:,x)); 9 | 10 | Ax = DbA(DocIDwPer,:); 11 | 12 | % Find docs that have person and location. 13 | DocIDwPerLoc = Row(Ax(DocIDwPer,l)); 14 | 15 | % Find docs that have person, location and time. 16 | DocIDwPerLocTime = Row(Ax(DocIDwPerLoc,t)); 17 | 18 | docList = DocIDwPerLocTime; 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /TEST/D4MqueryTrackWindow.m: -------------------------------------------------------------------------------- 1 | function trackList = D4MqueryTrackWindow(t,l); 2 | % Returns best tracks for mulitple persons. 3 | global D4MqueryGlobal 4 | 5 | trackList = (D4MqueryGlobal.DbTr(t,:) == l); 6 | 7 | end 8 | 9 | -------------------------------------------------------------------------------- /TEST/D4MwebAnalysisResponse.m: -------------------------------------------------------------------------------- 1 | function queryJSONCSV = D4MwebAnalysisResponse(queryJSONCSV) 2 | % D4MwebAnalysisResponse: Framework for interacting with multiple analysis techniques. 3 | % TODO: How to handle different Time/Seed combos (may need Tables with row+col query). 4 | % TODO: Debug Semantic/Seed/Graph/ 5 | 6 | J = parseJSON(queryJSONCSV); 7 | Aq = JSONCSV2assoc(queryJSONCSV); 8 | 9 | Ar = D4ManalysisResponse(Aq); 10 | 11 | queryJSONCSV = Assoc2JSONCSV(Ar,J.rowSeparator,J.columnSeparator,'QueryResponse'); 12 | %queryJSONCSV = Ar; 13 | 14 | end 15 | 16 | -------------------------------------------------------------------------------- /TEST/DBserverDispTEST.m: -------------------------------------------------------------------------------- 1 | DBsetup; 2 | 3 | % List the tables. 4 | DB 5 | 6 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7 | % D4M: Dynamic Distributed Dimensional Data Model 8 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 9 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 10 | % MIT Lincoln Laboratory 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % (c) <2010> Massachusetts Institute of Technology 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | -------------------------------------------------------------------------------- /TEST/DBsetup.m: -------------------------------------------------------------------------------- 1 | if not(exist('DB', 'var')) 2 | global DB; 3 | 4 | % Create a DB. 5 | DB = DBsetupLLGrid('class-db05'); 6 | %DB = DBserver('localhost:2181','Accumulo','instance','root','secret'); 7 | end 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % D4M: Dynamic Distributed Dimensional Data Model 11 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % MIT Lincoln Laboratory 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % (c) <2010> Massachusetts Institute of Technology 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | 18 | -------------------------------------------------------------------------------- /TEST/DBtableNnzTEST.m: -------------------------------------------------------------------------------- 1 | % Test nnz for DBtable 2 | 3 | rowStr = 'cat1 rat2 bat3 sat4 chat5 fat6 pat7 bad8 baa9 cap10 car11 pat12 cat13 bee14 buzz15 bee16 pats17 pab18 '; 4 | colStr = 'a aa aaa a b bb bbb abc aab pac abc bong fat peek zing zee bang paa '; 5 | valStr = 'a-a a-aa a-aaa a-b a-bb a-bbb a-a aa-a b-a-a c-a-p c-a-r pat-bong catfat bee-pee buzz-zing bee-zee pats-bang flute '; 6 | 7 | % Create assoc array. 8 | A = Assoc(rowStr,colStr,valStr); 9 | 10 | DBsetup 11 | 12 | tablename='DbtableNnzTEST'; 13 | T = DB(tablename); 14 | deleteForce(T); 15 | pause(0.5); 16 | T = DB(tablename); 17 | % Insert some data 18 | put(T,A); 19 | pause(1); 20 | num = nnz(T); 21 | T=close(T); 22 | disp([' Num entries = ' num2str(num)]); 23 | assert(num == 18,['BAD!!! Result is not 18, result= ' num2str(num)]); 24 | deleteForce(T); 25 | 26 | 27 | -------------------------------------------------------------------------------- /TEST/DBtablePairSubsrefTEST.m: -------------------------------------------------------------------------------- 1 | AssocSetup; % Create assoc array A. 2 | 3 | DBsetup; % Create DB. 4 | 5 | % Delete and create table. 6 | T = DB('DBtablePairSubsrefTEST','DBtablePairSubsrefTESTt'); 7 | deleteForce(T); 8 | T = DB('DBtablePairSubsrefTEST','DBtablePairSubsrefTESTt'); 9 | 10 | put(T,A); 11 | 12 | % Get subarrays. 13 | T1r = T('a b ',:); 14 | T2r = T('a* ',:); 15 | T3r = T('a : b ',:); 16 | T1c = T(:,'a b '); 17 | T2c = T(:,'a* '); 18 | T3c = T(:,'a : b '); 19 | 20 | save([mfilename '.mat'],'-v6','T1r','T2r','T3r','T1c','T2c','T3c'); 21 | T=close(T); 22 | deleteForce(T); 23 | 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % D4M: Dynamic Distributed Dimensional Data Model 26 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 28 | % MIT Lincoln Laboratory 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % (c) <2010> Massachusetts Institute of Technology 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | -------------------------------------------------------------------------------- /TEST/DBtableSubsrefTEST.m: -------------------------------------------------------------------------------- 1 | AssocSetup; % Create assoc array A. 2 | 3 | DBsetup; % Setup database DB. 4 | 5 | % Delete and create table. 6 | T = DB('DBtableSubsrefTEST'); 7 | deleteForce(T); 8 | T = DB('DBtableSubsrefTEST'); 9 | 10 | put(T,A); 11 | 12 | % Get subarrays. 13 | T1r = T('a b ',:); 14 | T2r = T('a* ',:); 15 | T3r = T('a : b ',:); 16 | T1c = T(:,'a b '); 17 | T2c = T(:,'a* '); 18 | T3c = T(:,'a : b '); 19 | 20 | save([mfilename '.mat'],'-v6','T1r','T2r','T3r','T1c','T2c','T3c'); 21 | T=close(T); 22 | deleteForce(T); 23 | 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % D4M: Dynamic Distributed Dimensional Data Model 26 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 28 | % MIT Lincoln Laboratory 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % (c) <2010> Massachusetts Institute of Technology 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | -------------------------------------------------------------------------------- /TEST/DBtableSubsrefTripleTEST.m: -------------------------------------------------------------------------------- 1 | AssocSetup; % Create assoc array A. 2 | 3 | DBsetup; % Setup database DB. 4 | 5 | % Delete and create table. 6 | T = DB('DBtableSubsrefTripleTEST'); 7 | deleteForce(T); 8 | T = DB('DBtableSubsrefTripleTEST'); 9 | 10 | [r c v] = find(A); 11 | 12 | put(T,r,c,v); 13 | 14 | % Get subarrays. 15 | T1r = T('a b ',:); 16 | T2r = T('a* ',:); 17 | T3r = T('a : b ',:); 18 | T1c = T(:,'a b '); 19 | T2c = T(:,'a* '); 20 | T3c = T(:,'a : b '); 21 | 22 | save([mfilename '.mat'],'-v6','T1r','T2r','T3r','T1c','T2c','T3c'); 23 | T=close(T); 24 | deleteForce(T); 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % D4M: Dynamic Distributed Dimensional Data Model 28 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 29 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 30 | % MIT Lincoln Laboratory 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | % (c) <2010> Massachusetts Institute of Technology 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | -------------------------------------------------------------------------------- /TEST/MertonTEST.m: -------------------------------------------------------------------------------- 1 | % Test coordinate Mertonized search appraoch. 2 | 3 | % Create random coordinates. 4 | N = 10; 5 | irow = (1:N).'; 6 | A = num2str(Assoc(irow,'Lat,',180*(rand(N,1) - 0.5)) + Assoc(irow,'Lon,',360*(rand(N,1) - 0.5))); 7 | 8 | % Unfurl columns. 9 | [r c v] = find(A); 10 | A = Assoc(r,CatStr(c,'/',v),1); 11 | 12 | 13 | 14 | [rLat cLat vLat] = find(A(:,'Lat\/*,')); 15 | [rLon cLon vLlon] = find(A(:,'Lon\/*,')); 16 | 17 | % Mertonize. 18 | %cLatLon = Mertonize(cLat,cLon); 19 | cLatLon = MertonizeLatLon(cLat,cLon); 20 | 21 | -------------------------------------------------------------------------------- /TEST/Reuters3parse.m: -------------------------------------------------------------------------------- 1 | % Read in reuters files and parse into associatie array. 2 | 3 | fdir = 'reuters_entities3/mergedfiles/'; 4 | 5 | fnames = dir([fdir 'output_*.txt']); 6 | 7 | for i = 1:numel(fnames) 8 | fname = fnames(i).name; 9 | [As An]=ReutersEntity3Read([fdir fname]); 10 | [pathstr,name,ext] = fileparts(fname); 11 | save([fdir name '_A.mat'],'As','An','-v6'); 12 | end 13 | 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % D4M: Dynamic Distributed Dimensional Data Model 16 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 17 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % MIT Lincoln Laboratory 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % (c) <2010> Massachusetts Institute of Technology 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | -------------------------------------------------------------------------------- /TEST/Reuters3trackInsert.m: -------------------------------------------------------------------------------- 1 | % Insert Reuters data into database. 2 | 3 | fdir = 'reuters_entities3/mergedfiles/'; 4 | 5 | fnames = dir([fdir 'output_*_Atrack.mat']); 6 | 7 | % Create a DB table. 8 | DbTr = DB('ReutersTracksTEST','ReutersTracksTESTt'); 9 | nl = char(10); 10 | 11 | %for i = 1:1 12 | for i = 1:numel(fnames) 13 | tic; 14 | fname = fnames(i).name; 15 | disp(fname); 16 | load([fdir fname],'Tr'); 17 | tic; 18 | put(DbTr,Tr); 19 | putTime = toc; disp(['DB put time: ' num2str(putTime)]); 20 | putRate = nnz(Tr) / putTime; disp(['DB put rate: ' num2str(putRate)]); 21 | end 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % D4M: Dynamic Distributed Dimensional Data Model 25 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % MIT Lincoln Laboratory 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % (c) <2010> Massachusetts Institute of Technology 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | -------------------------------------------------------------------------------- /TEST/SplitFunTEST.m: -------------------------------------------------------------------------------- 1 | %testSplitFun tests split functions 2 | %DB = DBsetup; 3 | DBsetup; 4 | DBstruct = struct(DB); 5 | 6 | if strcmp(DBstruct.type,'Accumulo') 7 | 8 | T = DB('testSplitDemo'); 9 | try 10 | disp('---adding splits aa;p; ...'); 11 | addSplits(T, 'aa;p;'); 12 | disp('Here are the crurrent splits:'); 13 | disp(getSplits(T)); 14 | 15 | disp('---adding splits b;cde;w2; ...'); 16 | addSplits(T, 'b;cde;w2;'); 17 | disp('Here are the crurrent splits:'); 18 | disp(getSplits(T)); 19 | 20 | disp('---putting splits (replacing old splits with) b;g;w;y;'); 21 | putSplits(T,'b;g;w;y;'); 22 | disp('Here are the crurrent splits:'); 23 | disp(getSplits(T)); 24 | 25 | disp('---putting no splits'); 26 | putSplits(T,''); 27 | %same effect as mergeSplits(T,[],[]); 28 | disp('Here are the crurrent splits:'); 29 | disp(getSplits(T)); 30 | 31 | deleteForce(T); 32 | clear T; 33 | catch E 34 | deleteForce(T); 35 | clear T; 36 | throw(E); 37 | end 38 | 39 | end 40 | -------------------------------------------------------------------------------- /TEST/TableFieldsTEST.m: -------------------------------------------------------------------------------- 1 | DBsetup; % Setup database DB. 2 | 3 | % Delete and create table. 4 | T = DB('DBtableFieldsTEST'); 5 | deleteForce(T); 6 | T = DB('DBtableFieldsTEST'); 7 | 8 | T = putSecurity(T,'FOUO'); 9 | Security(T) 10 | 11 | putColumnFamily(T,'vertexFamily'); 12 | ColumnFamily(T) 13 | 14 | %save([mfilename '.mat'],'-v6','T1r','T2r','T3r','T1c','T2c','T3c'); 15 | 16 | deleteForce(T); 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | -------------------------------------------------------------------------------- /TEST/Text2word.tsv: -------------------------------------------------------------------------------- 1 | document text code of hammurabi she may then marry the man of her heart seventh commandment thou shalt not kill apology they mean the force of truth magna carta no freeman shall be taken or imprisoned declaration of independence that all men are created equal thirteenth amendment neither slavery nor involuntary servitude shall exist nineteenth amendment vote shall not be denied on account of sex united nations charter to save succeeding generations from the scourge of war medecins sans frontieres we find out where the conditions are the worst and that is where we want to be -------------------------------------------------------------------------------- /TEST/Text2wordTEST.m: -------------------------------------------------------------------------------- 1 | % Create assoc array entries. 2 | [rowText colText valText] = FindCSV('Text2word.tsv'); 3 | 4 | Atext = ReadCSV('Text2word.tsv'); 5 | 6 | Aword = Text2word(rowText,valText,' '); 7 | 8 | [rowWord colWord valWord] = Text2word(rowText,valText,' '); 9 | 10 | AwordPos = Assoc(rowWord,colWord,valWord,@min); 11 | 12 | 13 | %save([mfilename '.mat'],'-v6','A01','A02','A03','A04','A05','A06'); 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /TEST/badTEST.m: -------------------------------------------------------------------------------- 1 | a = b; 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % D4M: Dynamic Distributed Dimensional Data Model 5 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 6 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 7 | % MIT Lincoln Laboratory 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | % (c) <2010> Massachusetts Institute of Technology 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | 12 | -------------------------------------------------------------------------------- /TEST/convTEST.m: -------------------------------------------------------------------------------- 1 | % Create assoc array entries. 2 | indexStr = '01 02 03 04 21 22 23 24 41 51 61 62 63 64 '; 3 | val = [ 1 1 1 1 4 3 2 1 4 5 6 6 6 6 ].'; 4 | 5 | win2 = [0.5 0.5]; 6 | win3 = [0.5 1 0.5]; 7 | 8 | % Create assoc arrays. 9 | Acol = Assoc(indexStr,'Col1 ',val); 10 | Arow = Assoc('Row1 ',indexStr,val); 11 | 12 | 13 | Acrow2 = conv(Arow,win2); 14 | Acrow3 = conv(Arow,win3); 15 | Accol2 = conv(Acol,win2); 16 | Accol3 = conv(Acol,win3); 17 | 18 | save([mfilename '.mat'],'-v6','Acrow2','Acrow3','Accol2','Accol3'); 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /TEST/dispTypeStats.m: -------------------------------------------------------------------------------- 1 | function dispTypeStats(A,splitSep) 2 | % DISPTYPESTATS display column type sums and covariance. 3 | [r c v] = find(A); 4 | [cType cVal] = SplitStr(c,splitSep); 5 | AA = Assoc(r,cType,1); 6 | 7 | AAsum = sum(AA,1); 8 | sAA= size(AA); 9 | disp('Type Sums:'); 10 | displayFull(AAsum.'); 11 | 12 | AAcov = (AA.' * AA); 13 | AAcov = putAdj(AAcov,round(Adj(AAcov)./(sAA(1)./100))); 14 | disp('Covariance percentages:'); 15 | displayFull(AAcov); 16 | 17 | end 18 | 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % D4M: Dynamic Distributed Dimensional Data Model 21 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % MIT Lincoln Laboratory 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % (c) <2010> Massachusetts Institute of Technology 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | -------------------------------------------------------------------------------- /TEST/goodTEST.m: -------------------------------------------------------------------------------- 1 | b = 1; 2 | a = b; 3 | 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | % D4M: Dynamic Distributed Dimensional Data Model 6 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 7 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 8 | % MIT Lincoln Laboratory 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % (c) <2010> Massachusetts Institute of Technology 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | 13 | -------------------------------------------------------------------------------- /TEST/parseJsonTEST.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % Excercises the JSON Parser 3 | 4 | D4MqueryJSONformat; 5 | 6 | queryA1 = parseJSON(QueryRequestGetTrackNamesJSON); 7 | queryA2 = parseJSON(QueryRequestMHtrackJSON); 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % D4M: Dynamic Distributed Dimensional Data Model 11 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % MIT Lincoln Laboratory 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % (c) <2010> Massachusetts Institute of Technology 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | -------------------------------------------------------------------------------- /TEST/scidbImportTest.m: -------------------------------------------------------------------------------- 1 | 2 | im = imread('peppers.png'); 3 | [nr, nc, ns] = size(im); 4 | 5 | [ir, ic] = ind2sub([nr nc], 1:nr*nc); 6 | ir = ir(:); 7 | ic = ic(:); 8 | slice = ones(size(ir)); 9 | 10 | dbname = 'txg-scidb01'; 11 | DB = DBsetupSciDB(dbname); 12 | 13 | rowChunkSize = nr; 14 | colChunkSize = nc; 15 | sliceChunkSize = 1; 16 | 17 | ls(DB) 18 | 19 | T = DB( sprintf('D4Mtest_%s [rows=1:%d,%d,0, cols=1:%d,%d,0, slice=1:%d,1,0]', datestr(now, 30), nr, nr, nc, nc, ns) ); 20 | 21 | % import data 22 | putTriple( T, [ir ic slice], double( reshape(im(:,:,1), [nr*nc 1] ) ) ); 23 | putTriple( T, [ir ic slice*2], double( reshape(im(:,:,2), [nr*nc 1] ) ) ); 24 | putTriple( T, [ir ic slice*3], double( reshape(im(:,:,3), [nr*nc 1] ) ) ); 25 | 26 | % extract data 27 | v1 = T(:,:,1); 28 | disp( nnz( v1 - double(im(:,:,1)) ) ); % this should be 0 29 | 30 | v2 = T(:,:,2); 31 | disp( nnz( v2 - double(im(:,:,2)) ) ); % this should be 0 32 | 33 | v3 = T(:,:,3); 34 | disp( nnz( v3 - double(im(:,:,3)) ) ); % this should be 0 35 | 36 | % cleanup 37 | deleteForce(T); 38 | 39 | ls(DB) 40 | 41 | -------------------------------------------------------------------------------- /docs/D4M-Demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/D4M-Demo.mp4 -------------------------------------------------------------------------------- /docs/D4M-Slides.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/D4M-Slides.ppt -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0101.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0102.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0103.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0104.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0199.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0199.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0201.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0202.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0202.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0203.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0203.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0204.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0204.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0205.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0205.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0206.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0206.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0207.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0299.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0301.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0302.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0303.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0303.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0304.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0305.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0305.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0399.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0399.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0401.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0402.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0403.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0404.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0499.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0501.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0502.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0503.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0503.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0504.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0505.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0505.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0506.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0507.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0508.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0508.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0509.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0599.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0599.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0601.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0601.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0602.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0602.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0603.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0603.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0699.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0699.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0701.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0701.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0702.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0702.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0703.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0703.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0704.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0704.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0799.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0799.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0801.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0802.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0802.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0803.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0803.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0804.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0804.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0805.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0805.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0806.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0806.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0807.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0807.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0808.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0808.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0809.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0809.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0899.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0899.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0901.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0901.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0902.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0903.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0903.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0904.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0905.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0905.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0906.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0906.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0907.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0907.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0908.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0908.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0909.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0909.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 0999.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 0999.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1001.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1002.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1003.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1004.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1099.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1101.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1102.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1103.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1104.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1105.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1199.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1199.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1201.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1202.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1202.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1203.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1203.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1204.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1204.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1205.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1205.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1206.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1206.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1207.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1299.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1401.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1402.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1403.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1404.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1405.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1405.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1406.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1407.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1407.png -------------------------------------------------------------------------------- /docs/DemoSnaps/Screen shot 1499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/DemoSnaps/Screen shot 1499.png -------------------------------------------------------------------------------- /docs/GraphuloFunctions.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/GraphuloFunctions.xlsx -------------------------------------------------------------------------------- /docs/Lec00-CourseOverview.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec00-CourseOverview.pptx -------------------------------------------------------------------------------- /docs/Lec01-AssocArrays.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec01-AssocArrays.pptx -------------------------------------------------------------------------------- /docs/Lec02-GroupTheory.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec02-GroupTheory.pptx -------------------------------------------------------------------------------- /docs/Lec03-UnstructuredData.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec03-UnstructuredData.pptx -------------------------------------------------------------------------------- /docs/Lec04-StructuredData.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec04-StructuredData.pptx -------------------------------------------------------------------------------- /docs/Lec05-PerfectPowerLaw.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec05-PerfectPowerLaw.pptx -------------------------------------------------------------------------------- /docs/Lec06-BioSequenceCorrelation.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec06-BioSequenceCorrelation.pptx -------------------------------------------------------------------------------- /docs/Lec07-Performance.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/docs/Lec07-Performance.pptx -------------------------------------------------------------------------------- /docs/java.opts: -------------------------------------------------------------------------------- 1 | -Xmx1024m 2 | -------------------------------------------------------------------------------- /examples/0JupyterDemo/data/A.csv: -------------------------------------------------------------------------------- 1 | ,a,aa,aaa,b,bb,bbb 2 | a,a-a,a-aa,a-aaa,a-b,a-bb,a-bbb 3 | aa,aa-a,aa-aa,,,, 4 | aaa,aaa-a,,aaa-aaa,,, 5 | b,b-a,,,b-b,, 6 | bb,bb-a,,,,bb-bb, 7 | bbb,bbb-a,,,,,bbb-bbb 8 | -------------------------------------------------------------------------------- /examples/1Intro/1AssocIntro/A.csv: -------------------------------------------------------------------------------- 1 | ,a,aa,aaa,b,bb,bbb 2 | a,a-a,a-aa,a-aaa,a-b,a-bb,a-bbb 3 | aa,aa-a,aa-aa,,,, 4 | aaa,aaa-a,,aaa-aaa,,, 5 | b,b-a,,,b-b,, 6 | bb,bb-a,,,,bb-bb, 7 | bbb,bbb-a,,,,,bbb-bbb 8 | -------------------------------------------------------------------------------- /examples/1Intro/2EdgeArt/Edge.csv: -------------------------------------------------------------------------------- 1 | Edge,Color,Order,V01,V02,V03,V04,V05,V06,V07,V08,V09,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,V20 B1,Blue,2,1,1,1,,,,,,,,,,,,,,,,, S1,Silver,2,1,1,1,,,,,,,,,,,,,,,,, G1,Green,2,1,1,1,,,,,,,,,,,,,,,,, O1,Orange,2,1,1,1,,,,,,,,,,,,,,,,, O2,Orange,2,1,1,1,,,,,,,,,,,,,,,,, P1,Pink,2,1,1,1,,,,,,,,,,,,,,,,, B2,Blue,2,,,,1,1,1,1,1,,,,,,,,,,,, S2,Silver,2,,,,1,1,1,1,1,,,,,,,,,,,, G2,Green,2,,,,1,1,1,1,1,,,,,,,,,,,, O3,Orange,2,,,,1,1,1,1,1,,,,,,,,,,,, O4,Orange,2,,,,1,1,1,1,1,,,,,,,,,,,, P2,Pink,2,,,,1,1,1,1,1,,,,,,,,,,,, O5,Orange,1,,1,,,,1,,,1,,1,,,,,1,,,,1 P3,Pink,2,,,,,,,,,,1,1,,1,1,,,,,, P4,Pink,2,,1,,,,,,,,1,,,,,,,,,, P5,Pink,2,,1,,,,,,,,,,1,1,,,,,,, P6,Pink,2,,,,,,,,,,,,,,,1,1,1,,, P7,Pink,3,,,,,1,,,,,,,,,,1,,,1,, P8,Pink,3,,,,,,,1,,,,,,,,,1,,,1, -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/AnnihilatorTest.m: -------------------------------------------------------------------------------- 1 | function AfuncAnnihilator = AnnihilatorTest(Afunc); 2 | % Test functions in Afunc to see if they have an annihilator elemetn. 3 | 4 | v1 = 10; 5 | Aannihilator = Assoc(['NaN,-Inf,+Inf,'],'v2,',[NaN -Inf +Inf]); 6 | Nannihilator = numel(Aannihilator); 7 | 8 | AfuncAnnihilator = Assoc('','',''); 9 | 10 | for irow = 1:Nannihilator 11 | v2 = Val(Aannihilator(irow,'v2,')); 12 | A2 = Assoc(Row(Afunc),'v12,',v2); 13 | A1 = AfuncEval(Afunc,v1,v2); 14 | AfuncAnnihilator = AfuncAnnihilator + putVal(putCol(EqualTest(A1,A2),['O/' Row(Aannihilator(irow,'v2,'))]),'O,'); 15 | end 16 | 17 | return 18 | end 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/AssociateTest.m: -------------------------------------------------------------------------------- 1 | function AfuncAssociate = AssociateTest(Afunc); 2 | % Test functions in Afunc to see if they associate. 3 | 4 | AassociateRange = noRow(ReadCSV('./Range/AssociateRange.csv')); % Read in function ranges. 5 | Aassociate = str2num(PermuteRange(AassociateRange)); 6 | %displayFull(Aassociate) 7 | AassociateSize = size(Aassociate); 8 | Nrow = AassociateSize(1); 9 | 10 | AfuncAssociate = Assoc('','',''); 11 | 12 | for irow = 1:Nrow 13 | v1 = Val(Aassociate(irow,'v1,')); 14 | v2 = Val(Aassociate(irow,'v2,')); 15 | v3 = Val(Aassociate(irow,'v3,')); 16 | 17 | A1 = AfuncEval(Afunc,v1,v2); 18 | A1 = AfuncEval(Afunc,A1,v3); 19 | A2 = AfuncEval(Afunc,v2,v3); 20 | A2 = AfuncEval(Afunc,v1,A2); 21 | 22 | AfuncAssociate = AfuncAssociate + putCol(EqualTest(A1,A2),'associate,'); 23 | end 24 | 25 | AfuncAssociate = (AfuncAssociate == Nrow); 26 | 27 | return 28 | end 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/CommuteTest.m: -------------------------------------------------------------------------------- 1 | function AfuncCommute = CommuteTest(Afunc); 2 | % Test functions in Afunc to see if they commute. 3 | 4 | AcommuteRange = noRow(ReadCSV('./Range/CommuteRange.csv')); % Read in function ranges. 5 | Acommute = str2num(PermuteRange(AcommuteRange)); 6 | AcommuteSize = size(Acommute); 7 | Nrow = AcommuteSize(1); 8 | 9 | % displayFull(Acommute); 10 | 11 | AfuncCommute = Assoc('','',''); 12 | 13 | for irow = 1:Nrow 14 | v1 = Val(Acommute(irow,'v1,')); 15 | v2 = Val(Acommute(irow,'v2,')); 16 | A1 = AfuncEval(Afunc,v1,v2); 17 | A2 = AfuncEval(Afunc,v2,v1); 18 | AfuncCommute = AfuncCommute + putCol(EqualTest(A1,A2),'commute,'); 19 | end 20 | 21 | AfuncCommute = (AfuncCommute == Nrow); 22 | 23 | return 24 | end 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/EqualTest.m: -------------------------------------------------------------------------------- 1 | function Av12 = EqualTest(A1,A2); 2 | % See where A1 and A2 are the same. 3 | 4 | [r c v1] = find(A1); 5 | [r c v2] = find(A2); 6 | 7 | v12 = v1; v12(:) = 0; % Initialize v12. 8 | v12(v1 == v2) = 1; 9 | v12(isnan(v1) & isnan(v2)) = 1; 10 | Av12 = reAssoc(Assoc(r,'same,',v12)); 11 | 12 | return 13 | end 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Func/CommMonoidF.csv: -------------------------------------------------------------------------------- 1 | ,I/+Inf,I/-Inf,I/NaN,KeyFunc,O/+Inf,O/-Inf,O/NaN,v1v2 2 | 00003,,I,I,union,O,,,v2,v1,v1 3 | 00004,,I,,intersect,O,,O,v2,v1,v1 4 | 00041,I,,I,union,,O,,v1,v1,v2 5 | 00042,I,,,intersect,,O,O,v1,v1,v2 6 | 00086,,,,intersect,,,O,NaN,v1,NaN 7 | 00096,,,,intersect,,,O,NaN,NaN,NaN 8 | 00127,,,I,union,,O,,-Inf,v1,-Inf 9 | 00128,,,,intersect,,O,O,-Inf,v1,-Inf 10 | 00147,,,I,union,,O,,-Inf,-Inf,-Inf 11 | 00148,,,,intersect,,O,O,-Inf,-Inf,-Inf 12 | 00169,,,I,union,O,,,+Inf,v1,+Inf 13 | 00170,,,,intersect,O,,O,+Inf,v1,+Inf 14 | 00199,,,I,union,O,,,+Inf,+Inf,+Inf 15 | 00200,,,,intersect,O,,O,+Inf,+Inf,+Inf 16 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Func/CommSemigroupF.csv: -------------------------------------------------------------------------------- 1 | ,KeyFunc,v1v2 2 | 00003,union,v2,v1,v1 3 | 00004,intersect,v2,v1,v1 4 | 00041,union,v1,v1,v2 5 | 00042,intersect,v1,v1,v2 6 | 00086,intersect,NaN,v1,NaN 7 | 00096,intersect,NaN,NaN,NaN 8 | 00127,union,-Inf,v1,-Inf 9 | 00128,intersect,-Inf,v1,-Inf 10 | 00147,union,-Inf,-Inf,-Inf 11 | 00148,intersect,-Inf,-Inf,-Inf 12 | 00169,union,+Inf,v1,+Inf 13 | 00170,intersect,+Inf,v1,+Inf 14 | 00199,union,+Inf,+Inf,+Inf 15 | 00200,intersect,+Inf,+Inf,+Inf 16 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Func/CommSemiringF.csv: -------------------------------------------------------------------------------- 1 | ,00003,00004,00041,00042,00086,00096,00127,00128,00147,00148,00169,00170,00199,00200 2 | 00003,64,64,,64,,64,,,,64,,,64,64 3 | 00004,,64,64,64,,64,,,64,64,,,,64 4 | 00041,,64,64,64,,64,,,64,64,,,,64 5 | 00042,64,64,,64,,64,,,,64,,,64,64 6 | 00086,,,,,64,64,,,,,,,, 7 | 00096,,64,,64,64,64,,64,,64,,64,,64 8 | 00127,,,,,,64,64,64,64,64,,,,64 9 | 00128,,,,,,64,,64,,64,,,,64 10 | 00147,,,,64,,64,,64,,64,,,, 11 | 00148,,,,64,,64,,64,,64,,,, 12 | 00169,,,,,,64,,,,64,64,64,64,64 13 | 00170,,,,,,64,,,,64,,64,,64 14 | 00199,,64,,,,64,,,,,,64,,64 15 | 00200,,64,,,,64,,,,,,64,,64 16 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Func/FeldF.csv: -------------------------------------------------------------------------------- 1 | ,00003,00004,00041,00042,00147,00199 2 | 00003,,O/NaN I/-Inf;,,O/-Inf I/+Inf;O/NaN I/+Inf;,, 3 | 00004,,,O/-Inf I/+Inf;O/-Inf I/NaN;,O/-Inf I/+Inf;,O/-Inf I/NaN;, 4 | 00041,,O/+Inf I/-Inf;O/NaN I/-Inf;,,O/NaN I/+Inf;,, 5 | 00042,O/+Inf I/-Inf;O/+Inf I/NaN;,O/+Inf I/-Inf;,,,,O/+Inf I/NaN; 6 | 00147,,,,O/NaN I/+Inf;,, 7 | 00199,,O/NaN I/-Inf;,,,, 8 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Func/SemigroupF.csv: -------------------------------------------------------------------------------- 1 | ,KeyFunc,v1v2 2 | 00001,union,v1,v1,v1 3 | 00002,intersect,v1,v1,v1 4 | 00003,union,v2,v1,v1 5 | 00004,intersect,v2,v1,v1 6 | 00041,union,v1,v1,v2 7 | 00042,intersect,v1,v1,v2 8 | 00043,union,v2,v1,v2 9 | 00044,intersect,v2,v1,v2 10 | 00086,intersect,NaN,v1,NaN 11 | 00096,intersect,NaN,NaN,NaN 12 | 00127,union,-Inf,v1,-Inf 13 | 00128,intersect,-Inf,v1,-Inf 14 | 00147,union,-Inf,-Inf,-Inf 15 | 00148,intersect,-Inf,-Inf,-Inf 16 | 00169,union,+Inf,v1,+Inf 17 | 00170,intersect,+Inf,v1,+Inf 18 | 00199,union,+Inf,+Inf,+Inf 19 | 00200,intersect,+Inf,+Inf,+Inf 20 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/IOTest.m: -------------------------------------------------------------------------------- 1 | function AfuncIO = IOTest(AfuncI,AfuncO) 2 | 3 | AfuncIsub = AfuncI(Row(AfuncO),:); 4 | AfuncOsub = AfuncO(Row(AfuncI),:); 5 | AfuncIsub = Abs0(putCol(AfuncIsub,strrep(Col(AfuncIsub),'I/',''))); 6 | AfuncOsub = Abs0(putCol(AfuncOsub,strrep(Col(AfuncOsub),'O/',''))); 7 | AfuncIsubSize = size(AfuncIsub); 8 | AfuncOsubSize = size(AfuncOsub); 9 | 10 | 11 | r = ''; c = ''; v= ''; 12 | for iFuncPlus=1:AfuncIsubSize(1) 13 | for iFuncMult=1:AfuncOsubSize(1) 14 | fI = AfuncIsub(iFuncPlus,:); 15 | gI =AfuncIsub(iFuncMult,:); 16 | gO = AfuncOsub(iFuncMult,:); 17 | if (nnz(fI) & nnz(gO) & nnz(gI)) 18 | fIgO = (noRow(fI) & noRow(gO)); 19 | if nnz(fIgO) 20 | for iO=1:nnz(fIgO) 21 | gImO = gI - gI(1,Col(fIgO(1,iO))); 22 | if nnz(gImO) 23 | for iI=1:nnz(gImO) 24 | r = [r Row(fI)]; c = [c Row(gI)]; v = [v CatStr(['O/' Col(fIgO(1,iO))],' ',['I/' Col(gImO(1,iI))])]; 25 | end 26 | end 27 | end 28 | end 29 | end 30 | end 31 | end 32 | 33 | AfuncIO = Assoc(r,c,v,@AssocCatStrFunc); 34 | 35 | return 36 | end 37 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/IdentityTest.m: -------------------------------------------------------------------------------- 1 | function AfuncIdentity = IdentityTest(Afunc); 2 | % Test functions in Afunc to see if they have an identity elemetn. 3 | 4 | v1 = 10; 5 | Aidentity = Assoc(['NaN,-Inf,+Inf,'],'v2,',[NaN -Inf +Inf]); 6 | Nidentity = numel(Aidentity); 7 | 8 | AfuncIdentity = Assoc('','',''); 9 | 10 | for irow = 1:Nidentity 11 | v2 = Val(Aidentity(irow,'v2,')); 12 | A1 = Assoc(Row(Afunc),'v12,',v1); 13 | A2 = AfuncEval(Afunc,v1,v2); 14 | AfuncIdentity = AfuncIdentity + putVal(putCol(EqualTest(A1,A2),['I/' Row(Aidentity(irow,'v2,'))]),'I,'); 15 | end 16 | 17 | return 18 | end 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/AssociateRange.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2,v3 1,10,10,10 5,-Inf,-Inf,-Inf 6,+Inf,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/AssociateRangeFull.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2,v3 1,10,10,10 2,100,100,100 3,1000,1000,1000 4,NaN,NaN,NaN 5,-Inf,-Inf,-Inf 6,+Inf,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/CommuteRange.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2 1,10,100 -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/CommuteRangeFull.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2 1,10,10 2,100,100 3,NaN,NaN 4,-Inf,-Inf 5,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/DistributeRange.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2,v3 1,10,10,10 4,NaN,NaN,NaN 5,-Inf,-Inf,-Inf 6,+Inf,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/DistributeRangeFull.csv: -------------------------------------------------------------------------------- 1 | Row,v1,v2,v3 1,10,10,10 2,100,100,100 3,1000,1000,1000 4,NaN,NaN,NaN 5,-Inf,-Inf,-Inf 6,+Inf,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/3GroupTheory/Range/FuncRange.csv: -------------------------------------------------------------------------------- 1 | Row,KeyFunc,v1v2 1,union,v1,v1,v1 2,intersect,v2,,v2 3,,NaN,NaN,NaN 4,,-Inf,-Inf,-Inf 5,,+Inf,+Inf,+Inf -------------------------------------------------------------------------------- /examples/1Intro/4Graphulo/ExampleGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/1Intro/4Graphulo/ExampleGraph.png -------------------------------------------------------------------------------- /examples/1Intro/4Graphulo/x02_JaccardTEST.m: -------------------------------------------------------------------------------- 1 | % Basic Jaccard Demo 2 | Amat = [0 1 1 1 0; % Input adjacency matrix 3 | 1 0 1 0 1; 4 | 1 1 0 1 0; 5 | 1 0 1 0 0; 6 | 0 1 0 0 0]; 7 | A = Mat2Assoc(Amat,'v'); % Convert to Assoc, use 'v1,v2,...,' as labels. 8 | displayFull(A) 9 | J = Jaccard(A); 10 | displayFull(J) 11 | 12 | % Same result if we pass in the upper triangle of A 13 | AmatUp = triu(Amat,1); 14 | AUp = Mat2Assoc(AmatUp,'v'); % Convert to Assoc, use 'v1,v2,...,' as labels. 15 | JUp = Jaccard(AUp); 16 | assert(isempty(J - JUp)) 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | -------------------------------------------------------------------------------- /examples/1Intro/4Graphulo/x04_NMFTEST.m: -------------------------------------------------------------------------------- 1 | % Basic NMF Demo 2 | Emat = [1 1 0 0 0; 3 | 0 1 1 0 0; 4 | 1 0 0 1 0; 5 | 0 0 1 1 0; 6 | 1 0 1 0 0; 7 | 0 1 0 0 1]; 8 | E = Mat2Assoc(Emat,'e','v'); % Convert to Assoc, use node labels 'v1,v2,...,' 9 | displayFull(E) % Use edge labels 'e1,e2,...,' 10 | k=3; 11 | [W,H] = NMF(E,k); 12 | displayFull(W) 13 | displayFull(H) 14 | 15 | Wmax = TopColPerRow(W,1); % Display the best topic for each edge. 16 | displayFull(Wmax) 17 | 18 | Hmax = TopRowPerCol(H,1); % Display the best topic for each node. 19 | displayFull(Hmax.') 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/1Intro/5mtimesCustom/mtc01_Example.m: -------------------------------------------------------------------------------- 1 | % The mtimesCustom function performs Associative Array multiplication 2 | % with arbitrary, user-defined + and * functions 3 | % and user-defined additive identity. 4 | % Defaults are + as @plus, * as @times, and the additive identity as 0. 5 | % Associative array matrix multiplication over an arbitrary ring. It could use some optimization and generalization to non-numeric rings. 6 | 7 | A = Assoc('r1,r1,r2,r2,','c1,c2,c1,c2,','1,2,3,4,'); 8 | A2collide = A * A.'; 9 | A2normal = mtimesCustom(A,A.',@plus,@times,0); 10 | A2minplus = mtimesCustom(A,A.',@min,@plus,Inf); 11 | 12 | displayFull(A) 13 | %c1,c2, 14 | %r1,1, 2, 15 | %r2,3, 4, 16 | displayFull(A.') 17 | %r1,r2, 18 | %c1,1, 3, 19 | %c2,2, 4, 20 | displayFull(A2collide) 21 | %r1,r2, 22 | %r1,2, 2, 23 | %r2,2, 2, 24 | displayFull(A2normal) 25 | %r1,r2, 26 | %r1,5, 11, 27 | %r2,11,25, 28 | displayFull(A2minplus) 29 | %r1,r2, 30 | %r1,2, 4, 31 | %r2,4, 6, 32 | 33 | -------------------------------------------------------------------------------- /examples/2Apps/2TrackAnalysis/Entity.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/2TrackAnalysis/Entity.mat -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/ApplyDegreeCorrection.m: -------------------------------------------------------------------------------- 1 | function dEst = ApplyDegreeCorrection(dSample,fSample,K) 2 | %ApplyDegreeCorrection: correct sampled degree using K coefficient. 3 | % Usage: 4 | % dEst = ApplyDegreeCorrection(dSample,fSample,K) 5 | % Inputs: 6 | % dSample = degree value(s) of sample to be corrected 7 | % fSample = ratio of sample edges to total edges 8 | % K = correction coefficient 9 | % Outputs: 10 | % dEst = better estimate of true median degree given observation 11 | 12 | dEst = dSample.* ((1./fSample).^(1 - 1./(K.*dSample))); 13 | 14 | return 15 | end -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/EdgesFromDist.m: -------------------------------------------------------------------------------- 1 | function v = EdgesFromDist(di,ni); 2 | %EdgesFromDist: Compute start vertex of edge (half an edge) from a degree distribution. 3 | % Usage: 4 | % v = EdgesFromDist(di,ni) 5 | % Input: 6 | % di = vector of degrees 7 | % ni = vector of counts 8 | % Output: 9 | % v = vector of vertices 10 | 11 | Nd_bar = numel(di); 12 | A1 = sparse(1:Nd_bar,ni,di); 13 | A2 = fliplr(cumsum(fliplr(A1),2)); 14 | [tmp tmp d] = find(A2); 15 | A3 = sparse(1:numel(d),d,1); 16 | A4 = fliplr(cumsum(fliplr(A3),2)); 17 | [v tmp tmp] = find(A4); 18 | 19 | return 20 | end 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % (c) <2010> Massachusetts Institute of Technology 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/OutDegree.m: -------------------------------------------------------------------------------- 1 | function ndout = OutDegree(A); 2 | %OutDegree: Compute out-degree distribution of an adjacency matrix. 3 | % Usage: 4 | % ndout = OutDegree(A); % Compute out-degree 5 | % ndin = OutDegree(A.'); % Compute in-degree 6 | % Input: 7 | % A = adjacency matrix 8 | % Output: 9 | % ndout = sparse vector where ndout(d) is the count of vertices of degree d 10 | 11 | dout = sum(A,2); 12 | [dout_i dout_j dout_v] = find(dout); 13 | ndout = sum(sparse(dout_i,dout_v,1),1); 14 | return 15 | end -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/PowerLawExact.m: -------------------------------------------------------------------------------- 1 | function [N M] = PowerLawExact(alpha,dmax,Nd); 2 | % Estimate N and M from dmax and Nd. 3 | 4 | [di ni] = PowerLawDist(alpha,dmax,Nd); 5 | 6 | N = sum(ni); 7 | M = sum(ni.*di); 8 | 9 | return 10 | end -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/PowerLawExactMulti.m: -------------------------------------------------------------------------------- 1 | function [N M] = PowerLawExactMulti(alpha,dmax,Nd); 2 | % Estimate N and M from dmax and Nd. 3 | 4 | 5 | N = Nd; N(:) = 0; M = N; 6 | 7 | for i=1:numel(dmax(:,1)) 8 | for j=1:numel(Nd(1,:)) 9 | [N(i,j) M(i,j)] = PowerLawExact(alpha,dmax(i,j),Nd(i,j)); 10 | end 11 | end 12 | 13 | return 14 | end -------------------------------------------------------------------------------- /examples/2Apps/3PerfectPowerLaw/PowerLawRebin.m: -------------------------------------------------------------------------------- 1 | function n1d1 = PowerLawRebin(d0,n0,d1) 2 | 3 | d0Mat = repmat(d0,[numel(d1) 1]); 4 | d1Mat = repmat(d1,[numel(d0) 1]); 5 | [tmp imin] = min(abs(d0Mat - d1Mat.')); 6 | n1d1 = sparse(1,d1(imin),n0); 7 | 8 | return 9 | edn -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/DBsetup.m: -------------------------------------------------------------------------------- 1 | % DBsetup.m 2 | 3 | %INSTANCENAME = 'instance-1.7.0'; 4 | %DB = DBserver('localhost:2181','Accumulo',INSTANCENAME,'root','secret'); 5 | %G = DBaddJavaOps('edu.mit.ll.graphulo.MatlabGraphulo',INSTANCENAME,'localhost:2181','root','secret'); 6 | [DB,G] = DBsetupLLGrid('class-db05'); %displays current tables and Graphulo connection 7 | myName = 'note_events_'; 8 | 9 | tnEdge = [myName 'Tedge']; 10 | tnEdgeT = [myName 'TedgeT']; 11 | tnEdgeDeg = [myName 'TedgeDeg']; 12 | tnTxt = [myName 'TedgeTxt']; 13 | 14 | tnFiltered = [myName 'TedgeFiltered']; 15 | tnFilteredT = [myName 'TedgeFilteredT']; 16 | tnFilteredRowDeg = [myName 'TedgeFilteredRowDeg']; 17 | tnTfidf = [myName 'TedgeTfidf']; 18 | tnTfidfT = [myName 'TedgeTfidfT']; 19 | 20 | tnW = [myName 'Tw']; 21 | tnWT = [myName 'TwT']; 22 | tnH = [myName 'Th']; 23 | tnHT = [myName 'ThT']; 24 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/cleanWords.m: -------------------------------------------------------------------------------- 1 | function [Aout] = cleanWords(A) 2 | %cleanWords Runs pre-processing on words to clean them up 3 | % The MIMIC text data is messy, this function calls helper 4 | % functions that will cleat it up, including separating some 5 | % words missing whitespace between them, removing noisy characters 6 | % removing punctuation, and removing stopwords. 7 | 8 | nl = char(10); 9 | Aout=NewSep(A,nl); % Makes sure delimiter is new line character 10 | Awords=Aout(:,StartsWith(['word|' nl])); % Separate out words for cleaning 11 | Aout=Aout-Awords; 12 | Awords=splitCombWords(Awords); % Splits words where whitespace was removed 13 | 14 | % Remove punctuation and noisy characters 15 | [r,c,v]=find(Awords); 16 | c=removeIdentifiers(c); 17 | c=lower(c); 18 | c=strrep(c,'*',''); 19 | c=strrep(c,'%',''); 20 | c=strrep(c,'$',''); 21 | c=regexprep(c,'\d',''); 22 | c=removePunctuation(c); 23 | 24 | % Re-form Awords and remove stopwords 25 | Awords=Assoc(r,c,v); 26 | Awords=Awords-Awords(:,['word|' nl]); 27 | Awords=removeStopWords(Awords); 28 | Aout=Aout+Awords; 29 | 30 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/data/edge-0-200.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/5MIMIC/data/edge-0-200.mat -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/data/edge-0-300.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/5MIMIC/data/edge-0-300.mat -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/data/txt-0-200.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/5MIMIC/data/txt-0-200.mat -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/data/txt-0-300.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/5MIMIC/data/txt-0-300.mat -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/medDict.txt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/examples/2Apps/5MIMIC/medDict.txt.zip -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic03_Tfidf.m: -------------------------------------------------------------------------------- 1 | %% This script performs a TF-IDF on the filtered edge table and writes the result to a new table. 2 | %% TF-IDF is Term frequency - inverse document frequency 3 | 4 | DBsetup; 5 | existingTables = ls(DB); 6 | disp('DBsetup complete.'); 7 | 8 | %% This section is TF-IDF 9 | if isempty(strfind(existingTables,[tnTfidf ' '])) 10 | ne = G.doTfidf(tnFilteredT,tnFilteredRowDeg,-1,... 11 | tnTfidf,tnTfidfT); 12 | fprintf('number of entries in filtered table TF-IDF is %d\n',ne); 13 | else 14 | fprintf('%s already exists; skipping\n',tnTfidf); 15 | end 16 | 17 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/DBsetup.m: -------------------------------------------------------------------------------- 1 | run('../DBsetup') -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/identifyTopTopics.m: -------------------------------------------------------------------------------- 1 | function topTopics = identifyTopTopics(w,nTopTopics) 2 | %% This function accepts w (D4M associative array) and 3 | %% nTopTopics (double), and returns as many topics (struct) 4 | %% as nTopTopics. Each topic has a name (string) and weight (double). 5 | topTopics = cell(1,nTopTopics); 6 | topTopicsAssoc = TopColPerRow(w,nTopTopics); 7 | [r,c,v] = find(topTopicsAssoc); 8 | delimiter = c(end); 9 | topTopicNames = strsplit(c,delimiter); 10 | for iTopic = 1:nTopTopics 11 | topicName = topTopicNames{iTopic}; 12 | topicWeight = v(iTopic); 13 | topTopics{iTopic} = struct('topicName',topicName,'topicWeight',topicWeight); 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/identifyTopWords.m: -------------------------------------------------------------------------------- 1 | function topWords = identifyTopWords(h,nTopWords) 2 | %% This function accepts h (D4M associative array) and 3 | %% nTopWords (double), and returns as many words (struct) 4 | %% as nTopWords. Each word has a name (string) and weight (double). 5 | topWords = cell(1,nTopWords); 6 | topWordsAssoc = TopColPerRow(h,nTopWords); 7 | [r,c,v] = find(topWordsAssoc); 8 | delimiter = c(end); 9 | topWordNames = strsplit(c,{delimiter,'word|'}); % strip 'word|' prefix 10 | topWordNames = topWordNames(2:end-1); % drop empty string on ends 11 | for iWord = 1:nTopWords 12 | wordName = topWordNames{iWord}; 13 | wordWeight = v(iWord); 14 | topWords{iWord} = struct('wordName',wordName,'wordWeight',wordWeight); 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/input.json: -------------------------------------------------------------------------------- 1 | {"numWords": "10", "docID": "00021_recordTime_3138-11-10-00:00:00.0_recordNum_5_recordType_RADIOLOGY_REPORT.txt", "numTopics": "3"} 2 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/json2struct.m: -------------------------------------------------------------------------------- 1 | function [vars,varNames] = json2struct(json) 2 | %json2struct takes json string of key-value pairs and outputs struct with 3 | %variables defined in json 4 | % 5 | 6 | newVars=strsplit(json,','); 7 | varNames=cell(length(newVars),1); 8 | 9 | for i=1:length(newVars) 10 | thisPair=strsplit(newVars{i},':'); 11 | if length(thisPair) > 2 % Correct for any colons in 'value' 12 | thisPair{2} = strjoin(thisPair(2:end),':'); 13 | end 14 | thisVar=strrep(strrep(strrep(thisPair{1},'"',''),'{',''),' ',''); 15 | thisVal=strrep(strrep(strrep(thisPair{2},'"',''),'}',''),' ',''); 16 | 17 | eval(['vars.' thisVar ' = thisVal;']) 18 | varNames{i}=thisVar; 19 | end 20 | 21 | end 22 | 23 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/makeJson.m: -------------------------------------------------------------------------------- 1 | function outputJSON = makeJson(topic,topWords) 2 | %% makeJson accepts a topic and the topWords in that topic 3 | %% and outputs a json object with tuples where each tuple 4 | %% consists of (topicName, topicWeight, wordName, wordWeight) 5 | nTopWords = length(topWords); 6 | topicName = topic.topicName; 7 | topicWeight = topic.topicWeight; 8 | tuples = ''; 9 | for iWord = 1:nTopWords 10 | word = topWords{iWord}; 11 | wordName = word.wordName; 12 | wordWeight = word.wordWeight; 13 | tuple = ['["' topicName '",' num2str(topicWeight) ',"' wordName '",' num2str(wordWeight) ']']; 14 | tuples = [tuples tuple ',']; 15 | end 16 | outputJSON = ['{"schema":["topicName","topicWeight","wordName","wordWeight"],"tuples":[' tuples(1:end-1) ']}']; 17 | % Example: outputJSON = '{"tuples":[["topic|1",0.365,"blue",.781],["topic|2",0.415,"red",.221]],"schema":["topicID","topicWeight","wordString","wordWeight"]} 18 | end 19 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/parseQuery.m: -------------------------------------------------------------------------------- 1 | function [docID,nTopTopics,nTopWords] = parseQuery(query) 2 | %% This function accepts a query (string) 3 | %% and returns the three expected fields 4 | %% as a string (docID) and doubles (nTopTopics, nTopWords) 5 | jsonQuery = json2struct(query); 6 | docID = [jsonQuery.docID ',']; 7 | nTopTopics = str2num(jsonQuery.numTopics); 8 | nTopWords = str2num(jsonQuery.numWords); 9 | end 10 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/readFile.m: -------------------------------------------------------------------------------- 1 | function contents = readFile(fileName) 2 | %% readFile accepts the name of a file 3 | %% and returns a string with the contents 4 | %% of that file 5 | fileID = fopen(fileName,'r'); 6 | formatSpec = '%s'; 7 | contents = fscanf(fileID,formatSpec); 8 | fclose(fileID); 9 | end 10 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/mic05_Visualize/writeFile.m: -------------------------------------------------------------------------------- 1 | function [] = writeFile(data,fileName) 2 | %% writeFile accepts data (string) 3 | %% and writes it to a file with a 4 | %% name provided in fileName (string) 5 | fileID = fopen(fileName,'w'); 6 | formatSpec = '%s'; 7 | fprintf(fileID,formatSpec,data); 8 | fclose(fileID); 9 | end 10 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/readFile.m: -------------------------------------------------------------------------------- 1 | function contents = readFile(fileName) 2 | %% readFile accepts the name of a file 3 | %% and returns a string with the contents 4 | %% of that file 5 | fileID = fopen(fileName,'r'); 6 | formatSpec = '%s'; 7 | contents = fscanf(fileID,formatSpec); 8 | fclose(fileID); 9 | end 10 | -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/removePunctuation.m: -------------------------------------------------------------------------------- 1 | function c = removePunctuation(c) 2 | nl=char(10); 3 | punctuation = '*%$<>,.?!@#&/\:;#{[()]}+=-_`~"'''; % remaining: ^^$%*0123456789 4 | 5 | for i=1:length(punctuation) 6 | c=strrep(c,punctuation(i),''); 7 | end 8 | 9 | end -------------------------------------------------------------------------------- /examples/2Apps/5MIMIC/writeFile.m: -------------------------------------------------------------------------------- 1 | function [] = writeFile(data,fileName) 2 | %% writeFile accepts data (string) 3 | %% and writes it to a file with a 4 | %% name provided in fileName (string) 5 | fileID = fopen(fileName,'w'); 6 | formatSpec = '%s'; 7 | fprintf(fileID,formatSpec,data); 8 | fclose(fileID); 9 | end 10 | -------------------------------------------------------------------------------- /examples/3Scaling/1KroneckerGraph/BipartiteIndexTree.m: -------------------------------------------------------------------------------- 1 | function[nu mu] = BipartiteIndexTree(k) 2 | % Compute the index permuation required to 3 | % seperate the result of the Kronecker product 4 | % of two bipartite matrices. 5 | 6 | nu = complex(zeros(k,2^(k-1))); 7 | mu = nu; 8 | 9 | im1 = complex(0,1); 10 | 11 | nu(1,1) = 1; 12 | mu(1,1) = im1; 13 | 14 | for kk = 2:k 15 | for i = 1:2^(kk-2) 16 | nu(kk,2*i-1) = nu(kk-1,i) + 1; 17 | nu(kk,2*i) = mu(kk-1,i) + 1; 18 | mu(kk,2*i-1) = mu(kk-1,i) + im1; 19 | mu(kk,2*i) = nu(kk-1,i) + im1; 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /examples/3Scaling/1KroneckerGraph/bipartite.m: -------------------------------------------------------------------------------- 1 | function[result] = bipartite(n,m) 2 | % Create an adjacency matrix for a bipartite graph. 3 | 4 | % Compute total vertices. 5 | Nv = n + m; 6 | 7 | result = spalloc(Nv,Nv,2*n*m); 8 | 9 | result((n+1):Nv,1:n) = 1; 10 | result(1:n,(n+1):Nv) = 1; 11 | -------------------------------------------------------------------------------- /examples/3Scaling/1KroneckerGraph/bipartite_kron_split.m: -------------------------------------------------------------------------------- 1 | function[result] = bipartite_krons_split(n1,m1,n2,m2) 2 | % Compute the index permuation required to 3 | % seperate the result of the Kronecker product 4 | % of two bipartite matrices. 5 | 6 | result = zeros(1,(n1+m1)*(n2+m2)); 7 | 8 | 9 | for i=0:(n1-1) 10 | for j=1:n2 11 | ii = i*(n2+m2) + j; 12 | jj = i*n2 + j; 13 | result( ii ) = jj; 14 | end 15 | end 16 | 17 | for i=0:(n1-1) 18 | for j=1:m2 19 | ii = i*(n2+m2) + n2 + j; 20 | jj = (n1*n2 + m1*m2) + n2*m1 + i*m2 + j; 21 | result( ii ) = jj; 22 | end 23 | end 24 | 25 | for i=0:(m1-1) 26 | for j=1:n2 27 | ii = (n1+i)*(n2+m2) + j; 28 | jj = (n1*n2 + m1*m2) + i*n2 + j; 29 | result( ii ) = jj; 30 | end 31 | end 32 | 33 | for i=0:(m1-1) 34 | for j=1:m2 35 | ii = (n1+i)*(n2+m2) + n2 + j; 36 | jj = n1*n2 + i*m2 + j; 37 | result( ii ) = jj; 38 | end 39 | end 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/3Scaling/1KroneckerGraph/reorder_matrix.m: -------------------------------------------------------------------------------- 1 | function[result] = reorder_matrix(A,iv) 2 | % Reorder matrix. 3 | 4 | [i j v] = find(A); 5 | 6 | result = sparse(iv(i),iv(j),v); 7 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/addmatlatex.m: -------------------------------------------------------------------------------- 1 | function s=addmatlatex(s) 2 | if s == 0 3 | s = ''; 4 | elseif ceil(s)-s == 0 && s >= 10 && s <= 20 5 | s = num2str(s); 6 | else 7 | s = ['\num{' num2str(s,'%.3f') '}']; 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/.gitignore: -------------------------------------------------------------------------------- 1 | DH_pg*/ -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/addmatlatex.m: -------------------------------------------------------------------------------- 1 | function s=addmatlatex(s) 2 | if s == 0 3 | s = ''; 4 | elseif s < 1 5 | s = num2str(s,'%.2f'); 6 | elseif ceil(s)-s == 0 && s >= 10 && s <= 20 7 | s = num2str(s); 8 | else 9 | s = ['\num{' num2str(s,'%.3f') '}']; 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg00_Driver03_kTrussAdj.m: -------------------------------------------------------------------------------- 1 | DELETE_TABLE_TRIGGER = true; 2 | 3 | SPLITS_RATE_LINEAR = 0.75; 4 | SPLITS_RATE_EXP = 1.2; 5 | javaMethod('setIntEncodeValueAndDropEmpty', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', false); 6 | javaMethod('setIntEncodeKeyAndPrependLastByteRev', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', false); 7 | 8 | 9 | for SCALE=12; %10:15 10 | alg01_Gen00_Driver; 11 | for NUMTAB=2; %8:8:40 12 | alg03_kTrussAdj00_Driver 13 | pause(5) 14 | end 15 | deleteForce(TadjUU); 16 | pause(5) 17 | end 18 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg00_Driver04_triCount.m: -------------------------------------------------------------------------------- 1 | DELETE_TABLE_TRIGGER = true; 2 | 3 | javaMethod('setIntEncodeValueAndDropEmpty', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', false); 4 | javaMethod('setIntEncodeKeyAndPrependLastByteRev', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', false); 5 | 6 | EdgesPerVertex = 16; 7 | myPrefix = 'DH_'; 8 | Nfile = 8; 9 | infoFunc = @util_UpdateInfoAndDB; %@util_UpdateInfo 10 | SEED = 20160331; 11 | 12 | 13 | for SCALE=10; %10:20 14 | if SCALE > 17 15 | Nfile = 8*(2^min(SCALE-17,4)); 16 | end 17 | 18 | % alg01_Gen00_Driver; 19 | tname = [myPrefix 'pg' num2str(SCALE,'%02d') '_' num2str(SEED)]; 20 | alg01_Gen01_File; 21 | MyDBsetup; 22 | TNadjUU = [tname '_TgraphAdjUU']; 23 | 24 | TI = DBaddJavaOps('edu.mit.ll.graphulo.tricount.TriangleIngestor',INSTANCENAME,ZKHOSTS,'root','secret'); 25 | TI.ingestDirectory([pwd filesep tname], TNadjUU, [], true, true); %upper triangle 26 | 27 | 28 | for NUMTAB=4; %8:8:40 29 | 30 | SPLITS_RATE_LINEAR = 1; 31 | SPLITS_RATE_EXP = 1; 32 | SPLITS_RATE_EXP_INV = 1; 33 | 34 | 35 | 36 | 37 | alg04_triCount00_Driver 38 | 39 | deleteForce(DB(tnameTmp)); 40 | deleteForce(TadjUU); 41 | pause(3) 42 | 43 | end 44 | end -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg01_Gen05_PlotAdjUUDeg.m: -------------------------------------------------------------------------------- 1 | %function alg01_Gen05_PlotAdjUUDeg(DB, TNadjUUDeg); 2 | % Plot degree distribution from the degree table. 3 | util_Require('DB, TNadjUUDeg') 4 | 5 | TadjUUDeg = DB(TNadjUUDeg); 6 | Adeg = TadjUUDeg(:,:); 7 | [~,~,v] = find(str2num(Adeg)); % v contains the list of degrees - need to collect and sort them 8 | 9 | x = 1:max(v); 10 | y = zeros(1,length(x)); 11 | for deg = x 12 | y(deg) = nnz(v == deg); 13 | end 14 | keyboard 15 | % plot(x,y); 16 | figure; loglog(x,y,'^k'); 17 | xlabel('Degree'); ylabel('Count'); 18 | title('Degree distribution of Abs0($A+A^T$), SCALE=10','interpreter','latex'); 19 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg01_Gen07_Toy.m: -------------------------------------------------------------------------------- 1 | % toy data for testing 2 | 3 | Amat = [0 1 1 1 0; % Input adjacency matrix 4 | 1 0 1 0 1; 5 | 1 1 0 1 0; 6 | 1 0 1 0 0; 7 | 0 1 0 0 0]; 8 | A = Mat2Assoc(Amat,'v'); 9 | Ttoy = DB('toy_TgraphAdj','toy_TgraphAdjT'); 10 | As = num2str(A); 11 | put(Ttoy,As) 12 | 13 | TtoyDeg = DB('toy_TgraphAdjDeg'); 14 | Asout = putCol(num2str(sum(A,2)),'OutDeg,'); 15 | Asin = putCol(num2str(sum(A,1)).','InDeg,'); 16 | put(TtoyDeg, Asout); 17 | put(TtoyDeg, Asin); 18 | 19 | %numpp = G.Jaccard('toy_TgraphAdj', 'toy_TgraphAdjDeg', 'toy_TJ', [], [], []) 20 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg01_Gen08_CountEntries.m: -------------------------------------------------------------------------------- 1 | 2 | MyDBsetup; 3 | myPrefix = 'DH_'; 4 | infoFunc = @util_UpdateInfoAndDB; 5 | 6 | nl = char(10); 7 | Ainfo = Assoc('','',''); 8 | 9 | for SCALE = 10:17 10 | for SEED = 20160331 11 | tname = [myPrefix 'pg' num2str(SCALE,'%02d') '_' num2str(SEED)]; 12 | TNadjUU = [tname '_TgraphAdjUU']; 13 | ne = G.countEntries(TNadjUU); 14 | fprintf('nnz %s = %d\n',TNadjUU,ne); 15 | Ainfo = Ainfo + Assoc([tname nl],['nnz' nl],[num2str(ne) nl]); 16 | end 17 | end 18 | infoFunc(Ainfo); 19 | 20 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg02_Jaccard00_Driver.m: -------------------------------------------------------------------------------- 1 | 2 | MyDBsetup; 3 | myPrefix = 'DH_'; 4 | infoFunc = @util_UpdateInfoAndDB; 5 | 6 | %DELETE_TABLE_TRIGGER = true; 7 | 8 | for doClient = false 9 | for SCALE = 14 10 | for SEED = 20160331 11 | for NUMTAB = 1:2 12 | 13 | tname = [myPrefix 'pg' num2str(SCALE,'%02d') '_' num2str(SEED)]; 14 | TNadjUU = [tname '_TgraphAdjUU']; 15 | TNadjUUDeg = [tname '_TgraphAdjUUDeg']; 16 | TNadjJaccard = [tname '_TgraphAdjJaccard']; 17 | TNadjJaccardD4M = [tname '_TgraphAdjJaccardD4M']; 18 | 19 | alg02_Jaccard01_Graphulo; 20 | pause(3); 21 | 22 | % if SCALE <= 15 && ~doClient 23 | % Hybrid = false; 24 | % alg02_Jaccard02_D4M; 25 | % pause(3); 26 | % % Hybrid = true; 27 | % % alg02_Jaccard02_D4M; 28 | % end 29 | 30 | 31 | % Verification runs out of Java heap memory at SCALE 12 and larger 32 | % if SCALE < 12 33 | % TadjJaccard = DB(TNadjJaccard); TadjJaccardD4M = DB(TNadjJaccardD4M); 34 | % alg02_Jaccard03_Verify; 35 | % end 36 | 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg02_Jaccard03_Verify.m: -------------------------------------------------------------------------------- 1 | %function alg02_Jaccard_Verify(DB, G, TNadjJaccard, TNadjJaccardD4M) 2 | util_Require('DB, G, TNadjJaccard, TNadjJaccardD4M'); 3 | 4 | LSDB = ls(DB); 5 | if StrSearch(LSDB,[TNadjJaccard ' ']) < 1 || StrSearch(LSDB,[TNadjJaccardD4M ' ']) < 1 6 | error(['Please do experiments for D4M and Graphulo first: ' TNadjJaccardD4M ' and ' TNadjJaccard]); 7 | end 8 | TadjJaccard = DB(TNadjJaccard); 9 | TadjJaccardD4M = DB(TNadjJaccardD4M); 10 | 11 | JG = str2num(TadjJaccard(:,:)); 12 | JD = str2num(TadjJaccardD4M(:,:)); 13 | incorrect = abs(JG-JD) > 1e-6; % TOLERANCE 14 | 15 | if ~isempty(incorrect) 16 | error('NOT EQUAL RESULTS LOCAL AND DB VERSION'); 17 | end 18 | clear JG JD 19 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg03_kTrussAdj03_Verify.m: -------------------------------------------------------------------------------- 1 | %function alg02_Jaccard_Verify(DB, G, TNadjkTruss, TNadjkTrussD4M) 2 | util_Require('DB, G, TNadjkTruss, TNadjkTrussD4M'); 3 | 4 | LSDB = ls(DB); 5 | if StrSearch(LSDB,[TNadjkTruss ' ']) < 1 || StrSearch(LSDB,[TNadjkTrussD4M ' ']) < 1 6 | error(['Please do experiments for D4M and Graphulo first: ' TNadjkTrussD4M ' and ' TNadjkTruss]); 7 | end 8 | TadjkTruss = DB(TNadjkTruss); 9 | TadjkTrussD4M = DB(TNadjkTrussD4M); 10 | 11 | JG = str2num(TadjkTruss(:,:)); 12 | JD = str2num(TadjkTrussD4M(:,:)); 13 | incorrect = abs(JG-JD) > 1e-6; % TOLERANCE 14 | 15 | if ~isempty(incorrect) 16 | error('NOT EQUAL RESULTS LOCAL AND DB VERSION'); 17 | end 18 | clear JD JG 19 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg03_kTrussAdj05_PlotRate.m: -------------------------------------------------------------------------------- 1 | % Run this file after running alg02_Jaccard04_plot and alg03_kTrussAdj04_Plot 2 | util_Require('KTR JAC'); 3 | 4 | JAC.linespec = '-'; 5 | KTR.linespec = '--'; 6 | 7 | figure; 8 | legendarr = {}; 9 | legendarri = 1; 10 | 11 | structs = {JAC, KTR}; 12 | lbls = {'Jaccard','3-Truss'}; 13 | for idx = 1:length(structs); 14 | d = structs{idx}; 15 | for ntidx = 1:numel(d.nt) 16 | nt = d.nt(ntidx); 17 | legendarr{legendarri} = [lbls{idx} ' ' num2str(nt) ' Tablet']; 18 | legendarri = legendarri + 1; 19 | % sort 20 | [d.scale{ntidx},sortidx] = sort(d.scale{ntidx}); 21 | d.rate{ntidx} = d.rate{ntidx}(sortidx); 22 | % plot 23 | x = d.scale{ntidx}; 24 | y = d.rate{ntidx}; 25 | plot(x, y, d.linespec, 'LineWidth', 0.5+(nt-1)*1); 26 | hold on; 27 | end 28 | end 29 | 30 | hold off; 31 | xlabel('SCALE'); 32 | ylabel('Rate (partial products per sec.)'); 33 | title('Graphulo Rate Scaling'); 34 | axis([-inf,+inf,0,+inf]) 35 | legend(legendarr, 'Location', 'southeast'); 36 | fileName = ['img/GraphuloRate-' timeSaveStr]; 37 | savefig(fileName); 38 | %print('JaccardTime','-depsc') 39 | print(fileName,'-dpng') 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/alg04_triCount03_Verify.m: -------------------------------------------------------------------------------- 1 | util_Require('DB, G, TNadjUU, triangles'); 2 | 3 | LSDB = ls(DB); 4 | if StrSearch(LSDB,[TNadjUU ' ']) < 1 5 | error(['Lost the original table: ' TadjUU]); 6 | end 7 | TadjUU = DB(TNadjUU); 8 | 9 | %%%%% Verification 10 | % The following script can verify the output of Graphulo. 11 | % It must be run *before* Graphulo runs, because Graphulo filters entries to the upper triangle. 12 | 13 | A = str2num(TadjUU(:,:)); 14 | As = Adj(Abs0(A+A.')); 15 | As(logical(speye(size(A)))) = 0; % NoDiag. 16 | L = tril(As,-1); 17 | U = triu(As,1); 18 | B = tril(L * U); 19 | C = B .* As; 20 | trianglesD4M = full(sum(sum(C,1),2)); 21 | fprintf('Triangles : %d\n', triangles) 22 | fprintf('Triangles D4M: %d\n', trianglesD4M) 23 | 24 | 25 | if trianglesD4M ~= triangles 26 | error('NOT EQUAL RESULTS LOCAL AND DB VERSION'); 27 | end 28 | clear A As L U B C 29 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/tryInternetDegree.m: -------------------------------------------------------------------------------- 1 | % See http://webdatacommons.org/hyperlinkgraph/ 2 | % Counts degrees. 3 | 4 | myPrefix = 'DH_'; 5 | durability = 'log'; 6 | 7 | % wget http://data.dws.informatik.uni-mannheim.de/hyperlinkgraph/2012-08/pld-arc.gz 8 | fname = 'example_arcs'; 9 | filepath = [pwd filesep fname]; 10 | tname = [myPrefix '2012_pld_arc']; 11 | MyDBsetup; 12 | TNadjUU = [tname '_TgraphAdjUU']; 13 | TNadjUUDeg = [tname '_TgraphAdjUU_Deg']; 14 | nl = char(10); 15 | 16 | TI = DBaddJavaOps('edu.mit.ll.graphulo.tricount.TriangleIngestor',INSTANCENAME,ZKHOSTS,'root','secret'); 17 | %TI.ingestDirectory(filepath, TNadjUU, [], true, true); %upper triangle 18 | TI.doCountDegree(TNadjUUDeg); 19 | TI.ingestCombinedFile(filepath, [], [], false, true); 20 | 21 | Tdeg = DB(TNadjUUDeg); 22 | A = Tdeg(:,:); 23 | A = str2num(A); 24 | Assoc2CSV(A, char(10), char(9), [fname '_deg.tsv']); 25 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/util_Require.m: -------------------------------------------------------------------------------- 1 | function util_Require( varargin ) 2 | %util_Require: Require all the variable names to be present in the calling script 3 | str = 'all(['; 4 | for i = 1:nargin 5 | ss = strsplit(varargin{i},{' ', ','}); 6 | for j = 1:numel(ss) 7 | str = [str 'exist(''' ss{j} ''',''var'') ']; 8 | end 9 | end 10 | str = [str ']);']; 11 | if ~evalin('caller', str) 12 | s = ''; 13 | for i = 1:nargin 14 | s = [s varargin{i} ' ']; 15 | end 16 | error(['caller does not have all the variables: ' s]); 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/util_UpdateInfo.m: -------------------------------------------------------------------------------- 1 | function Ainfo = util_UpdateInfo(AinfoNew) 2 | % Save info to a file and return all the info. 3 | if (nargin < 1) 4 | AinfoNew = Assoc('','',''); 5 | end 6 | finfo = [pwd filesep 'infoInternet.tsv']; 7 | if exist(finfo, 'file') == 2 8 | Ainfo = ReadCSV(finfo); 9 | else 10 | Ainfo = Assoc('','',''); 11 | end 12 | Ainfo = Ainfo + AinfoNew; 13 | if ~isempty(AinfoNew) 14 | Assoc2CSV(Ainfo, char(10), char(9), finfo); 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/alg/util_UpdateInfoAndDB.m: -------------------------------------------------------------------------------- 1 | function Ainfo = util_UpdateInfoAndDB(AinfoNew) 2 | % Save info to a file and return all the info. 3 | if (nargin < 1) 4 | AinfoNew = Assoc('','',''); 5 | end 6 | finfo = [pwd filesep 'info.tsv']; 7 | if exist(finfo, 'file') == 2 8 | Ainfo = ReadCSV(finfo); 9 | else 10 | Ainfo = Assoc('','',''); 11 | end 12 | Ainfo = Ainfo + AinfoNew; 13 | if ~isempty(AinfoNew) 14 | Assoc2CSV(Ainfo, char(10), char(9), finfo); 15 | end 16 | 17 | if ~isempty(AinfoNew) 18 | MyDBsetup; 19 | 20 | switchBack = false; 21 | if javaMethod('isIntEncodeValueAndDropEmpty', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert') 22 | switchBack = true; 23 | javaMethod('setIntEncodeValueAndDropEmpty', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', false); 24 | end 25 | 26 | Tinfo = DB('Tinfo'); 27 | put(Tinfo,AinfoNew); 28 | 29 | if switchBack 30 | javaMethod('setIntEncodeValueAndDropEmpty', 'edu.mit.ll.d4m.db.cloud.D4mDbInsert', true); 31 | end 32 | 33 | end 34 | 35 | end 36 | 37 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/elim0.m: -------------------------------------------------------------------------------- 1 | function s=elim0(s) 2 | if isequal(s,'0') 3 | s = ''; 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/maxdiff.m: -------------------------------------------------------------------------------- 1 | function md = maxdiff(d4mstr) 2 | % Compute maximum difference of numbers in D4M string format like '3,8,2,2,' (which is 6) 3 | if isempty(d4mstr) 4 | md = 0; 5 | return 6 | end 7 | nums = str2num(d4mstr); 8 | md = 0; 9 | for i = 1:numel(nums)-1 10 | for j = i+1:numel(nums) 11 | md = max(md,abs(nums(i)-nums(j))); 12 | end 13 | end 14 | 15 | end -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/num2bank.m: -------------------------------------------------------------------------------- 1 | function [str]=num2bank(num) 2 | str = arrayfun(@(x) num2bankScalar(x) , num, 'UniformOutput', false); 3 | end 4 | function [str]=num2bankScalar(num) 5 | num=floor(num*100)/100; 6 | str = num2str(num); 7 | k=find(str == '.', 1); 8 | %if(isempty(k)) 9 | % str=[str,'.00']; 10 | %end 11 | if isempty(k) 12 | FIN = length(str); 13 | else 14 | if k == numel(str)-1 15 | str = [str '0']; 16 | end 17 | FIN = min(length(str),find(str == '.')-1); 18 | end 19 | for i = FIN-2:-3:2 20 | str(i+1:end+1) = str(i:end); 21 | str(i) = ','; 22 | end 23 | end -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/pDB_LoadAssoc.m: -------------------------------------------------------------------------------- 1 | % Use to load Nfiles of the saved adjacency and incidence Assocs 2 | % from pDB03_AssocTEST. Useful for testing in-memory algorithm scaling. 3 | 4 | Nfile = 8; 5 | 6 | Eall = Assoc('','',''); 7 | for fi = 1:Nfile 8 | fname = ['data/' num2str(fi)]; disp(fname); % Filename. 9 | load([fname '.E.mat']); % Load Incidence Assoc. 10 | Eall = E + Eall; 11 | end 12 | E = Eall; 13 | Edeg = sum(E,1).'; 14 | 15 | Aall = Assoc('','',''); 16 | for fi = 1:Nfile 17 | fname = ['data/' num2str(fi)]; disp(fname); % Filename. 18 | load([fname '.A.mat']); 19 | Aall = Aall + A; 20 | end 21 | A = Aall; 22 | Adeg = sum(A,2); 23 | -------------------------------------------------------------------------------- /examples/3Scaling/2ParallelDatabase/saveAll.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DA=`date +"%y%m%d%H%M"` 3 | cp TableMultRate.eps TableMultRate_${DA}.eps 4 | cp TableMultRate.fig TableMultRate_${DA}.fig 5 | cp TableMultRate.png TableMultRate_${DA}.png 6 | cp TableMultTime.eps TableMultTime_${DA}.eps 7 | cp TableMultTime.fig TableMultTime_${DA}.fig 8 | cp TableMultTime.png TableMultTime_${DA}.png 9 | -------------------------------------------------------------------------------- /examples/3Scaling/4Graphulo/deleteTables.m: -------------------------------------------------------------------------------- 1 | 2 | % Delete All Data Tables for Scaling Tests 3 | 4 | allTables=strsplit(ls(DB),' '); 5 | 6 | tablesToDelete={TadjName, [TadjName 'T'], [TadjName 'Deg'],... 7 | TedgeName, [TedgeName 'T'], [TedgeName 'Deg'], TsingleName,... 8 | [TadjName 'BFS'], [TadjName 'BFST'], [TedgeName 'BFS'], [TedgeName 'BFST'], [TsingleName 'BFS'],... 9 | [TadjName 'Jaccard'],[TedgeName 'kTruss'],[TedgeName 'kTrussT'],[TadjName 'kTruss'],... 10 | [TedgeName 'NMF_H'],[TedgeName 'NMF_HT'],[TedgeName 'NMF_W'],[TedgeName 'NMF_WT']}; 11 | 12 | for i=1:length(tablesToDelete) 13 | if sum(~cellfun(@isempty,strfind(allTables,tablesToDelete{i}))) 14 | deleteForce(DB(tablesToDelete{i})); 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/graphulo-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/lib/graphulo-3.1.0.jar -------------------------------------------------------------------------------- /lib/graphulo-3.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/lib/graphulo-3.1.1.jar -------------------------------------------------------------------------------- /lib/graphulo-3.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/lib/graphulo-3.1.2.jar -------------------------------------------------------------------------------- /matlab_src/@Assoc/Abs0.m: -------------------------------------------------------------------------------- 1 | function A = Abs0(A) 2 | %Abs0: Converts associative array adjacency matrix to a double of ones and zeros. 3 | %Equivalent to the zero norm. 4 | %Associative array user function. 5 | % Usage: 6 | % A = Abs0(A) 7 | % Inputs: 8 | % A = associative array 9 | % Outputs: 10 | % A = associative array with numeric values of 1 or 0. 11 | 12 | A = double(logical(A)); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Adj.m: -------------------------------------------------------------------------------- 1 | function Amat = Adj(A) 2 | %Adj: Returns associative array adjacency matrix that connect row, columns, and values. 3 | %Associative array user function. 4 | % Usage: 5 | % Amat = Adj(A) 6 | % Inputs: 7 | % A = associative array with numeric values 8 | % Outputs: 9 | % Amat = sparse adjacency matrix 10 | Amat = A.A; 11 | end 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % D4M: Dynamic Distributed Dimensional Data Model 15 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 16 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 17 | % MIT Lincoln Laboratory 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % (c) <2010> Massachusetts Institute of Technology 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Assoc2CSV.m: -------------------------------------------------------------------------------- 1 | function Assoc2CSV(A,rowSep,colSep,fileName) 2 | %Assoc2CSV: Writes an associative array to a CSV file. 3 | %IO user function. 4 | % Usage: 5 | % Assoc2CSV(A,rowSep,colSep,fileName) 6 | % Inputs: 7 | % A = associative array 8 | % rowSep = character used to separate rows; usually newline (char(10)) 9 | % colSep = character used to separate columns; usually comma (',') 10 | % fnameName = CSV file name 11 | % Outputs: 12 | % 13 | 14 | CsvStr = Assoc2CSVstr(A,rowSep,colSep); 15 | 16 | fid = fopen(fileName,'w+'); 17 | fwrite(fid,CsvStr); 18 | fclose(fid); 19 | 20 | end 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % (c) <2010> Massachusetts Institute of Technology 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Assoc2HTML.m: -------------------------------------------------------------------------------- 1 | function Assoc2HTML(A,fileName) 2 | %Assoc2CSV: Writes an associative array to an HTML table file. 3 | %IO user function. 4 | % Usage: 5 | % Assoc2HTML(A,fileName) 6 | % Inputs: 7 | % A = associative array 8 | % fnameName = HTML file name 9 | % Outputs: 10 | % 11 | 12 | TAB = char(9); NL = char(10); 13 | tsvStr = Assoc2CSVstr(A,NL,TAB); 14 | 15 | htmlStr = ['' NL '
' strrep(strrep(tsvStr,NL,['
']),TAB,'')]; 16 | htmlStr = [htmlStr(1:end-9) '
']; 17 | 18 | fid = fopen(fileName,'w+'); 19 | fwrite(fid,htmlStr); 20 | fclose(fid); 21 | 22 | end 23 | 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % D4M: Dynamic Distributed Dimensional Data Model 26 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 28 | % MIT Lincoln Laboratory 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % (c) <2010> Massachusetts Institute of Technology 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | 33 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Col.m: -------------------------------------------------------------------------------- 1 | function c = Col(A) 2 | %Col: Returns column keys of an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % c = Col(A) 6 | % Inputs: 7 | % A = NxM associative array 8 | % Outputs: 9 | % col = length M string list or index column vector 10 | 11 | [N M] = size(A.A); 12 | if not(isempty(A.col)) 13 | c = A.col; 14 | else 15 | c = 1:M; 16 | end 17 | end 18 | 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % D4M: Dynamic Distributed Dimensional Data Model 21 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % MIT Lincoln Laboratory 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % (c) <2010> Massachusetts Institute of Technology 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Key.m: -------------------------------------------------------------------------------- 1 | function k = Key(A) 2 | %Key: Returns concatenated row and column keys of an associative array. 3 | %Associative array utility function. 4 | % Usage: 5 | % k = Key(A) 6 | % Inputs: 7 | % A = NxM associative array with string and row and column keys 8 | % Outputs: 9 | % col = length N+M string list or index column vector 10 | 11 | k = [Row(A) Col(A)]; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/NumLimit.m: -------------------------------------------------------------------------------- 1 | function numLimit = NumLimit(A); 2 | %STUB for compatibility with tables. 3 | 4 | numLimit = 0; 5 | 6 | end 7 | 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | % D4M: Dynamic Distributed Dimensional Data Model 10 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 11 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % MIT Lincoln Laboratory 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % (c) <2010> Massachusetts Institute of Technology 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | 17 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Row.m: -------------------------------------------------------------------------------- 1 | function r = Row(A) 2 | %Row: Returns row keys of an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % c = Row(A) 6 | % Inputs: 7 | % A = NxM associative array 8 | % Outputs: 9 | % Row = length N string list or index column vector 10 | 11 | [N M] = size(A.A); 12 | if not(isempty(A.row)) 13 | r = A.row; 14 | else 15 | r = 1:N; 16 | end 17 | 18 | end 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/Val.m: -------------------------------------------------------------------------------- 1 | function v = Val(A) 2 | %Val: Returns the unique column values of an associative array in sorted order. 3 | %Associative array user function. 4 | % Usage: 5 | % v = Val(A) 6 | % Inputs: 7 | % A = associative array with M unique values 8 | % Outputs: 9 | % v = length M string list or numeric column vector 10 | 11 | %VAL returns unique values of associative array. 12 | if not(isempty(A.val)) 13 | v = A.val; 14 | else 15 | v = full(unique(A.A)); 16 | v = v(1:end); 17 | end 18 | end 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/abs.m: -------------------------------------------------------------------------------- 1 | function AT = abs(A) 2 | %abs: Absolute value of matrix of the adjacency matrix of an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % AT = abs(A) 6 | % Inputs: 7 | % A = associative array with numeric values 8 | % Outputs: 9 | % AT = associative array with absolute value numeric values 10 | 11 | AT = A; 12 | AT.A = abs(A.A); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/dblLogi.m: -------------------------------------------------------------------------------- 1 | function A = dblLogi(A) 2 | %dblLogi: Converts associative array adjacency matrix to a double of ones and zeros. 3 | %Associative array user function. 4 | % Usage: 5 | % A = dblLogi(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with numeric values of 1 or 0. 10 | 11 | A = double(logical(A)); 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/disp.m: -------------------------------------------------------------------------------- 1 | function disp(A) 2 | %disp: Display the internal structure of an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % disp(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % 10 | 11 | disp('Associative Array'); 12 | disp(struct(A)); 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/display.m: -------------------------------------------------------------------------------- 1 | function display(A) 2 | %display: Display an associative array as a list of triples. 3 | %Associative array user function. 4 | % Usage: 5 | % display(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % 10 | 11 | [row col val] = find(A); 12 | 13 | if ischar(row) 14 | row = Str2mat(row); 15 | end 16 | 17 | if ischar(col) 18 | col = Str2mat(col); 19 | end 20 | 21 | if ischar(val) 22 | val = Str2mat(val); 23 | end 24 | 25 | [N M] = size(row); 26 | 27 | for i = 1:N 28 | disp(['(' deblank(num2str(row(i,:))) ',' deblank(num2str(col(i,:))) ') ' deblank(num2str(val(i,:)))]); 29 | end 30 | 31 | end 32 | 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | % D4M: Dynamic Distributed Dimensional Data Model 35 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 36 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 37 | % MIT Lincoln Laboratory 38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | % (c) <2010> Massachusetts Institute of Technology 40 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41 | 42 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/double.m: -------------------------------------------------------------------------------- 1 | function A = double(A) 2 | %double: Converts associative array adjacency matrix to a double. 3 | %Associative array user function. 4 | % Usage: 5 | % A = double(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with numeric values 10 | 11 | if isempty(A.val) 12 | A.A = double(A.A); 13 | else 14 | A.val = ''; 15 | A.A = double(A.A); 16 | % [r c v] = find(A); 17 | % v(v == v(end)) = ' '; 18 | % A = Assoc(r,c,str2num(v)); 19 | end 20 | 21 | end 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % D4M: Dynamic Distributed Dimensional Data Model 25 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % MIT Lincoln Laboratory 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % (c) <2010> Massachusetts Institute of Technology 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/eq.m: -------------------------------------------------------------------------------- 1 | function B = eq(arg1,arg2) 2 | %==,eq: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 == arg2 6 | % B = eq(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are equal to the scalar value 12 | 13 | B = Equallike(arg1,arg2,@eq); 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/ge.m: -------------------------------------------------------------------------------- 1 | function B = ge(arg1,arg2) 2 | %>=,ge: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 >= arg2 6 | % B = ge(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are greater than or equal to the scalar value 12 | 13 | B = Equallike(arg1,arg2,@ge); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/gt.m: -------------------------------------------------------------------------------- 1 | function B = gt(arg1,arg2) 2 | %>,gt: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 > arg2 6 | % B = gt(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are greater than the scalar value 12 | 13 | B = Equallike(arg1,arg2,@gt); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/isempty.m: -------------------------------------------------------------------------------- 1 | function y = isempty(A) 2 | %isempty: Checks if an associative array is empty. 3 | %Associative array user function. 4 | % Usage: 5 | % y = isempty(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % y = true if the the associative array is empty 10 | 11 | y = isempty(A.A); 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/le.m: -------------------------------------------------------------------------------- 1 | function B = le(arg1,arg2) 2 | %<=,le: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 >= arg2 6 | % B = ge(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are less than or equal to the scalar value 12 | 13 | B = Equallike(arg1,arg2,@le); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/loadobj.m: -------------------------------------------------------------------------------- 1 | function b = loadobj(a) 2 | %loadobj: Used to load associative array from a file. 3 | %Associative internal function used by load. 4 | % Usage: 5 | % b = loadobj(a) 6 | % Inputs: 7 | % a = saved associative array data 8 | % Outputs: 9 | % b = associative array object 10 | 11 | b = Assoc(1,1,1); 12 | b.row = a.row; b.col = a.col; b.val = a.val; b.A = a.A; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/logical.m: -------------------------------------------------------------------------------- 1 | function A = logical(A) 2 | %logical: Converts associative array adjacency matrix to a logical of ones and zeros. 3 | %Associative array user function. 4 | % Usage: 5 | % A = logical(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with logical values of 1 or 0. 10 | 11 | A.val = ''; 12 | A.A = logical(A.A); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/lt.m: -------------------------------------------------------------------------------- 1 | function B = lt(arg1,arg2) 2 | %<,lt: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 < arg2 6 | % B = lt(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are less than the scalar value 12 | 13 | B = Equallike(arg1,arg2,@lt); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/ne.m: -------------------------------------------------------------------------------- 1 | function B = ne(arg1,arg2) 2 | %~=,ne: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = arg1 ~= arg2 6 | % B = ne(arg1,arg2) 7 | % Inputs: 8 | % arg1 = associative array or scalar numeric or string value 9 | % arg2 = associative array or scalar numeric or string value 10 | % Outputs: 11 | % B = associative array of all values that are not equal to the scalar value 12 | 13 | %NE runs ~= operator on an associative array and a scalar. 14 | B = Equallike(arg1,arg2,@ne); 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/nnz.m: -------------------------------------------------------------------------------- 1 | function n = nnz(A) 2 | %nnz: Returns number of non-zeros in an associative array or database table. 3 | %Associative array or database table user function. 4 | % Usage: 5 | % n = nnz(A) 6 | % Inputs: 7 | % A = associative array or database table 8 | % Outputs: 9 | % n = number of non-zero (or non-empty) entries in an associative array or database table; same as the number of triples 10 | 11 | n = nnz(A.A); 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/noCol.m: -------------------------------------------------------------------------------- 1 | function A = noCol(A) 2 | %noCol: Eliminates the column keys of an associative array. 3 | %Associative array utility function. 4 | % Usage: 5 | % A = noCol(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with column keys eliminated 10 | 11 | A.col = ''; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/noRow.m: -------------------------------------------------------------------------------- 1 | function A = noRow(A) 2 | %noRow: Eliminates the row keys of an associative array. 3 | %Associative array utility function. 4 | % Usage: 5 | % A = noRow(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with row keys eliminated 10 | 11 | A.row = ''; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/noVal.m: -------------------------------------------------------------------------------- 1 | function A = noVal(A) 2 | %noVal: Eliminates the values strings of an associative array. 3 | %Associative array utility function. 4 | % Usage: 5 | % A = noVal(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with values strings eliminated 10 | 11 | A.val = ''; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/num2str.m: -------------------------------------------------------------------------------- 1 | function A = num2str(A) 2 | %num2str: Converts numeric values in an associative array to string values. 3 | %Associative array user function. 4 | % Usage: 5 | % A = num2str(A) 6 | % Inputs: 7 | % A = associative array with numeric values 8 | % Outputs: 9 | % A = associative array with string values 10 | % Example: 11 | % T = put(T,num2str(A)); % Convert numerical values for inserting into a database table. 12 | 13 | if isempty(A.val) 14 | [r, c, v] = find(A); 15 | A = Assoc(r,c,sprintf('%g,',v)); 16 | else 17 | % A.A = double(A.A); 18 | end 19 | 20 | end 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % (c) <2010> Massachusetts Institute of Technology 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/numel.m: -------------------------------------------------------------------------------- 1 | function s = numel(A) 2 | %numel: Returns the number of row times the number of columns in an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % s = numel(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % s = number of row times the number of columns in an associative array 10 | 11 | s = numel(A.A); 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/putAdj.m: -------------------------------------------------------------------------------- 1 | function A = putAdj(A,AA) 2 | %putAdj: Replaces the adjacency matrix in an associative array; does no consistency checking. 3 | %Associative array user function. 4 | % Usage: 5 | % A = putAdj(A,AA) 6 | % Inputs: 7 | % A = associative array 8 | % AA = sparse matrix connecting rows, columns, and values 9 | % Outputs: 10 | % A = associative array with a new adjacency matrix 11 | % Example: 12 | % A = putAdj(A,2.*Adj(A)); % Multiply each entry in adjacency matrix by 2. 13 | 14 | A.A = AA; 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/putCol.m: -------------------------------------------------------------------------------- 1 | function A = putCol(A,col) 2 | %putCol: Replaces the column keys in an associative array; does no consistency checking. 3 | %Associative array user function. 4 | % Usage: 5 | % A = putCol(A,col) 6 | % Inputs: 7 | % A = NxM associative array 8 | % col = string list of length M 9 | % Outputs: 10 | % A = associative array with new column keys 11 | % Example: 12 | % A = putCol(A,CatStr('Name,','|',Col(A))); % Prepend 'Name|' to each column key. 13 | 14 | A.col = col; 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/putNumLimit.m: -------------------------------------------------------------------------------- 1 | function A = putNumLimit(A,nlimit); 2 | %STUB for compatibility with tables. 3 | 4 | disp('putNumLimit for Assoc is always 0.'); 5 | 6 | end 7 | 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % D4M: Dynamic Distributed Dimensional Data Model 11 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % MIT Lincoln Laboratory 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % (c) <2010> Massachusetts Institute of Technology 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | 18 | 19 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/putRow.m: -------------------------------------------------------------------------------- 1 | function A = putRow(A,row) 2 | %putRow: Replaces the row keys in an associative array; does no consistency checking. 3 | %Associative array user function. 4 | % Usage: 5 | % A = putRow(A,row) 6 | % Inputs: 7 | % A = NxM associative array 8 | % row = string list of length N 9 | % Outputs: 10 | % A = associative array with new row keys 11 | % Example: 12 | % A = putRow(A,CatStr('Name,','|',Row(A))); % Prepend 'Name|' to each row key. 13 | 14 | A.row = row; 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/putVal.m: -------------------------------------------------------------------------------- 1 | function A = putVal(A,val) 2 | %putVal: Replaces the string values in an associative array; does no consistency checking. 3 | %Associative array user function. 4 | % Usage: 5 | % A = putVal(A,val) 6 | % Inputs: 7 | % A = associative array with M unique string values 8 | % val = string list of length M 9 | % Outputs: 10 | % A = associative array with new string values 11 | % Example: 12 | % A = putVal(A,CatStr('Name,','|',Val(A))); % Prepend 'Name|' to each value. 13 | 14 | A.val = val; 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/reAssoc.m: -------------------------------------------------------------------------------- 1 | function A = reAssoc(A) 2 | %reAssoc: Rebuilds an associative array so that all keys are in their correct sorted order. 3 | %Associative array user function. 4 | % Usage: 5 | % A = reAssoc(A) 6 | % Inputs: 7 | % A = associative array 8 | % Outputs: 9 | % A = associative array with all keys in correct order 10 | % Example: 11 | % A = reAssoc(putRow(A,CatStr(Row(A),'|','Name,')))); % Append '|Name' to each row key. 12 | 13 | % Rebuild A. 14 | [r c v] = find(A); 15 | A = Assoc(r,c,v); 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/size.m: -------------------------------------------------------------------------------- 1 | function s = size(A,varargin) 2 | %size: Returns the dimensions of an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % s = size(A) 6 | % s = size(A,dim) 7 | % Inputs: 8 | % A = associative array 9 | % dim = dimension to get the size of; 1 = rows, 2 = columns 10 | % Outputs: 11 | % s = 1 or 2 element vector containing the size of the dimensions 12 | 13 | if nargin == 1 14 | s = size(A.A); 15 | end 16 | if nargin == 2 17 | s = size(A.A,varargin{1}); 18 | end 19 | end 20 | 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % D4M: Dynamic Distributed Dimensional Data Model 23 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % MIT Lincoln Laboratory 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % (c) <2010> Massachusetts Institute of Technology 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | 30 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/sqIn.m: -------------------------------------------------------------------------------- 1 | function AtA = sqIn(A) 2 | %sqIn: Computes A.' * A efficiently. 3 | %Associative array user function. 4 | % Usage: 5 | % AtA = sqIn(A) 6 | % Inputs: 7 | % A = associative array with numeric values 8 | % Outputs: 9 | % AtA = associative array that is the matrix multiply of A.' and A. 10 | 11 | % Convert to numeric. 12 | if isempty(A.val) 13 | AtA = A; 14 | else 15 | AtA = double(logical(A)); 16 | end 17 | 18 | % Square numeric matrix. 19 | AA = Adj(AtA); 20 | AAtAA = AA.' * AA; 21 | 22 | % Insert back in associative array. 23 | AtA = putAdj(AtA,AAtAA); 24 | AtA = putRow(AtA,Col(AtA)); 25 | 26 | end 27 | 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % D4M: Dynamic Distributed Dimensional Data Model 30 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 31 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % MIT Lincoln Laboratory 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | % (c) <2010> Massachusetts Institute of Technology 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | 37 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/sqOut.m: -------------------------------------------------------------------------------- 1 | function AAt = sqOut(A) 2 | %sqOut: Computes A * A.' efficiently. 3 | %Associative array user function. 4 | % Usage: 5 | % AAt = sqOut(A) 6 | % Inputs: 7 | % A = associative array with numeric values 8 | % Outputs: 9 | % AAt = associative array that is the matrix multiply of A and A.'. 10 | 11 | % Convert to numeric. 12 | if isempty(A.val) 13 | AAt = A; 14 | else 15 | AAt = double(logical(A)); 16 | end 17 | 18 | 19 | % Square numeric matric. 20 | AA = Adj(AAt); 21 | AAAAt = AA * AA.'; 22 | 23 | % Insert back in associative array. 24 | AAt = putAdj(AAt,AAAAt); 25 | AAt = putCol(AAt,Row(AAt)); 26 | 27 | end 28 | 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % D4M: Dynamic Distributed Dimensional Data Model 31 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 33 | % MIT Lincoln Laboratory 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % (c) <2010> Massachusetts Institute of Technology 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/str2num.m: -------------------------------------------------------------------------------- 1 | function A = str2num(A) 2 | %str2num: Converts string values in an associative array to numeric values. 3 | %Associative array user function. 4 | % Usage: 5 | % A = str2num(A) 6 | % Inputs: 7 | % A = associative array with string values 8 | % Outputs: 9 | % A = associative array with numeric values 10 | % Example: 11 | % A = str2num(T(:,:)); % Convert to numerical values after retrieving strings from a database table. 12 | 13 | if isempty(A.val) 14 | % A.A = double(A.A); 15 | else 16 | [r, c, v] = find(A); 17 | v(v == v(end)) = ' '; 18 | A = Assoc(r,c,str2num(v)); 19 | end 20 | 21 | end 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % D4M: Dynamic Distributed Dimensional Data Model 25 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % MIT Lincoln Laboratory 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % (c) <2010> Massachusetts Institute of Technology 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/strcmp.m: -------------------------------------------------------------------------------- 1 | function B = strcmp(arg1,arg2) 2 | %strcmp: Compares the values of an associative array with a scalar. 3 | %Associative array user function. 4 | % Usage: 5 | % B = strcmp(arg1,arg2) 6 | % Inputs: 7 | % arg1 = associative array or scalar with string value(s) 8 | % arg2 = associative array or scalar with string value(s) 9 | % Outputs: 10 | % B = associative array of all values that are equal to the scalar string 11 | 12 | B = Equallike(arg1,arg2,@strcmp); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/sum.m: -------------------------------------------------------------------------------- 1 | function B = sum(A,dim) 2 | %sum: Performs sum along the dimension of an associative array with numeric values. 3 | %Associative array user function. 4 | % Usage: 5 | % B = sum(A,dim) 6 | % Inputs: 7 | % A = associative array 8 | % dim = dimension to sum along; 1 = rows, 2 = columns 9 | % Outputs: 10 | % B = Vector associative array holding the sum along the specified dimension. 11 | 12 | B = A; 13 | if not(isempty(B.val)) 14 | B.val = ''; 15 | B.A = logical(B.A); 16 | end 17 | 18 | B.A = sum(B.A,dim); 19 | 20 | if (dim == 1); 21 | B.row = ''; 22 | end 23 | if (dim == 2); 24 | B.col = ''; 25 | end 26 | 27 | end 28 | 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % D4M: Dynamic Distributed Dimensional Data Model 31 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 33 | % MIT Lincoln Laboratory 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % (c) <2010> Massachusetts Institute of Technology 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | -------------------------------------------------------------------------------- /matlab_src/@Assoc/transpose.m: -------------------------------------------------------------------------------- 1 | function AT = transpose(A) 2 | %.',transpose: Performs a matrix transpose on an associative array. 3 | %Associative array user function. 4 | % Usage: 5 | % AT = A.' 6 | % AT = transpose(A) 7 | % Inputs: 8 | % A = NxM associative array 9 | % Outputs: 10 | % A = MxN associative array 11 | 12 | % Transpose A. 13 | AT = A; 14 | AT.col = A.row; 15 | AT.row = A.col; 16 | AT.A = transpose(A.A); 17 | 18 | end 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /matlab_src/@DBserver/DBSciDBConnect.m: -------------------------------------------------------------------------------- 1 | %DBsciDBConnect: Connects to a SciDB instance 2 | %Database internal function used by ls. 3 | % Usage: 4 | % conn = DBSciDBConnect(DB) 5 | % Inputs: 6 | % DB = database object with a binding to a specific database 7 | % Outputs: 8 | % conn = SQL connector object 9 | 10 | function [stat, sessionID] = DBSciDBConnect(DB) 11 | 12 | cmd = ['wget -q -O - "' DB.host 'new_session" --http-user=' DB.user ' --http-password=' DB.pass]; 13 | 14 | [stat, sessionID] = system(cmd); 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu), 20 | % Dr. Siddharth Samsi (sid@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2015> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/ColCombiner.m: -------------------------------------------------------------------------------- 1 | function colNames = ColCombiner(T) 2 | %ColCombiner: List the columns in the table with combiners. 3 | %Database table user function. 4 | % Usage: 5 | % retString = ColCombiner(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % colNames = string list of column names 10 | 11 | if nargin < 1 12 | error('1 input argument required') 13 | end 14 | T_s = struct(T); 15 | DB_s = struct(T_s.DB); 16 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 17 | colNames = javaOp.listCombiningColumns(T_s.name); 18 | 19 | end -------------------------------------------------------------------------------- /matlab_src/@DBtable/ColumnFamily.m: -------------------------------------------------------------------------------- 1 | function colFam = ColumnFamily(T) 2 | %ColumnFamily: Retrieve the column family currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % colFam = ColumnFamily(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % colFam = string containing current column family use for inserts and queries; default is empty 10 | 11 | colFam = T.columnfamily; 12 | 13 | % Need to make NoOp stub for Assoc. 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/NumLimit.m: -------------------------------------------------------------------------------- 1 | function numLimit = NumLimit(T) 2 | %NumLimit: Gets the maximum number of items to return from a single query. 3 | %Database table internal function for Iterator. 4 | % Usage: 5 | % numLimit = NumLimit(T) 6 | % Inputs: 7 | % T = database table binding 8 | % Outputs: 9 | % numLimit = maximum number items to return in a single query 10 | 11 | numLimit = T.numLimit; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/NumRow.m: -------------------------------------------------------------------------------- 1 | function numLimit = NumRow(T); 2 | %NUMROW gets the maximum number of rows to return from a query. 3 | 4 | 5 | numLimit = T.numRow; 6 | 7 | end 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % D4M: Dynamic Distributed Dimensional Data Model 11 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % MIT Lincoln Laboratory 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % (c) <2010> Massachusetts Institute of Technology 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | 18 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/PutBytes.m: -------------------------------------------------------------------------------- 1 | function putBytes = PutBytes(T) 2 | %PutBytes: Get the chunk size for table inserts used by the put function. 3 | %Database table internal function. 4 | % Usage: 5 | % putBytes = PutBytes(T) 6 | % Inputs: 7 | % T = database table binding 8 | % Outputs: 9 | % putBytes = approximate number of bytes to insert at one time 10 | 11 | putBytes = T.putBytes; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/Security.m: -------------------------------------------------------------------------------- 1 | function secStr = Security(T) 2 | %Security: Get the security label currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % secStr = Security(T) 6 | % Inputs: 7 | % T = database table object 8 | % Outputs: 9 | % secStr = string containing security string to used for inserts and queries; default is empty 10 | 11 | secStr = T.security; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/Splits.m: -------------------------------------------------------------------------------- 1 | function A = Splits(T) 2 | %Splits: List the splits and entries for each split. 3 | %Database table utility function. 4 | % Usage: 5 | % A = Splits(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % A = associative array of splits and the entries after each split. 10 | 11 | T_s = struct(T); 12 | DB_s = struct(T_s.DB); 13 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 14 | %splitString = javaOp.getSplits(T_s.name); 15 | % User wants the count in each tablet 16 | retArray = javaOp.getSplits(T_s.name, true); 17 | %splitString = cell2mat(cell(retArray(1))); 18 | %splitCounts = cell(retArray(2)); 19 | 20 | nl = char(10); 21 | 22 | A = Assoc([char(retArray(1)) '~,'],['SplitCount' nl],str2num(char(retArray(2)))); 23 | 24 | end 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/addColCombiner.m: -------------------------------------------------------------------------------- 1 | function T = addColCombiner(T,colNames,combineType) 2 | %addColCombiner: Adds combiners to specific column names. 3 | %Database table user function. 4 | % Usage: 5 | % T = addColCombiner(T,colNames,combineType) 6 | % Inputs: 7 | % T = database table object 8 | % colNames = string list of column names. If ':,' then sets all columns 9 | % to combining. 10 | % combineType = combiner name "min", "max", or "sum"; 11 | % IF D4M_API_JAVA.jar is installed on the Accumulo instance, you can 12 | % specify "min_decimal", "max_decimal", or "sum_decimal" 13 | % to obtain the ability to combine on decimals 14 | % Outputs: 15 | % T = database table object with combiners 16 | 17 | if nargin < 3 18 | error('3 input arguments required') 19 | end 20 | T_s = struct(T); 21 | DB_s = struct(T_s.DB); 22 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 23 | javaOp.designateCombiningColumns(T_s.name, colNames, combineType, T_s.columnfamily) 24 | 25 | end -------------------------------------------------------------------------------- /matlab_src/@DBtable/addSplits.m: -------------------------------------------------------------------------------- 1 | function T = addSplits(T,splitString) 2 | %addSplits: Adds row splits to a table for better load balancing across multiple servers. 3 | %Database table utility function. 4 | % Usage: 5 | % T = addSplits(T,splitString) 6 | % Inputs: 7 | % T = database table object 8 | % splitString = string list row splits 9 | % Outputs: 10 | % T = database table object with additional row splits 11 | 12 | T_s = struct(T); 13 | DB_s = struct(T_s.DB); 14 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 15 | javaOp.addSplits(T_s.name, splitString); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/close.m: -------------------------------------------------------------------------------- 1 | function TD = close(T) 2 | %close: Reset iterator in a table object. 3 | %Database table utility function. 4 | % Usage: 5 | % TD = close(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % TD = database table or table pair object 10 | 11 | T.d4mQuery.reset(); 12 | TD= T; 13 | 14 | end 15 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/deleteColCombiner.m: -------------------------------------------------------------------------------- 1 | function T = deleteColCombiner(T,colNames) 2 | %deleteColCombiner: Deletes the combiners for specific column names. 3 | %Database table user function. 4 | % Usage: 5 | % T = deleteColCombiner(T,colNames) 6 | % Inputs: 7 | % T = database table object with combiners 8 | % colNames = string list of column names 9 | % Outputs: 10 | % T = database table object with fewer column combiners 11 | 12 | if nargin < 2 13 | error('2 input arguments required') 14 | end 15 | T_s = struct(T); 16 | DB_s = struct(T_s.DB); 17 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 18 | javaOp.revokeCombiningColumns(T_s.name, colNames, T_s.columnfamily) 19 | 20 | end -------------------------------------------------------------------------------- /matlab_src/@DBtable/deleteTriple.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Accla/d4m/3df082158f229f46840365dee52d7fb4c2a9aa1d/matlab_src/@DBtable/deleteTriple.m -------------------------------------------------------------------------------- /matlab_src/@DBtable/designateCombiningColumns.m: -------------------------------------------------------------------------------- 1 | function designateCombiningColumns(T, colNames, combineType) 2 | %DESIGNATECOMBININGCOLUMNS designates columns with a combiner 3 | % T table 4 | % colNames A list of column names in the format "colName1,colName2," 5 | % where ',' is an arbitrary seperator. TODO: also accept an array of 6 | % column names. 7 | % combineType One of the strings "min", "max", or "sum" 8 | % IF D4M_API_JAVA.jar is installed on the Accumulo instance, you can 9 | % specify "min_decimal", "max_decimal", or "sum_decimal" 10 | % to obtain the ability to combine on decimals 11 | %The column names do not have to exist when designated. Only one combiner 12 | %allowed per column. 13 | %Note this will take into account the current column family. 14 | if nargin < 3 15 | error('3 input arguments required') 16 | end 17 | T_s = struct(T); 18 | DB_s = struct(T_s.DB); 19 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 20 | javaOp.designateCombiningColumns(T_s.name, colNames, combineType, T_s.columnfamily) 21 | 22 | end -------------------------------------------------------------------------------- /matlab_src/@DBtable/display.m: -------------------------------------------------------------------------------- 1 | function display(obj) 2 | 3 | t = struct(obj); 4 | db = struct(t.DB); 5 | disp('DBTable object'); 6 | disp(['Type : ' db.type]); 7 | disp(['Schema : ' t.name]); 8 | 9 | 10 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/getName.m: -------------------------------------------------------------------------------- 1 | function name = getName(T) 2 | %getName: Retrieve the name of the table. 3 | %Database table utility function. 4 | % Usage: 5 | % name = getName(T) 6 | % Inputs: 7 | % T = database table object 8 | % Outputs: 9 | % name = string containing the table name 10 | 11 | name = T.name; 12 | 13 | end 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % D4M: Dynamic Distributed Dimensional Data Model 16 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 17 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % MIT Lincoln Laboratory 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % (c) <2010> Massachusetts Institute of Technology 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/getSplits.m: -------------------------------------------------------------------------------- 1 | function [splitString, varargout] = getSplits(T) 2 | %GETSPLITS gets the current splits for a table 3 | % OUTPUT splitString: the splits of T in the format f,p,r2,w, 4 | % OPTIONAL 2nd OUTPUT: a comma-delimited string that holds N+1 numbers 5 | % where N is the number of splits and the (i)th number is the number of 6 | % entries in tablet holding the (i-1)st split and the (i)th split. 7 | T_s = struct(T); 8 | DB_s = struct(T_s.DB); 9 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 10 | retArray = javaOp.getSplits(T_s.name); 11 | 12 | % splitString = cell2mat(cell(retArray(1))); 13 | % splitCount = cell2mat(cell(retArray(2))); 14 | % splitServer = cell2mat(cell(retArray(3))); 15 | 16 | splitString = char(retArray(1)); 17 | splitCount = char(retArray(2)); 18 | splitServer = char(retArray(3)); 19 | 20 | if nargout > 1 21 | varargout{1} = splitCount; 22 | end 23 | if nargout > 2 24 | varargout{2} = splitServer; 25 | end 26 | 27 | return 28 | end 29 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/listCombiningColumns.m: -------------------------------------------------------------------------------- 1 | function retString = listCombiningColumns(T) 2 | %LISTCOMBININGCOLUMNS lists the columns in table T with attached combiners 3 | % T table 4 | if nargin < 1 5 | error('1 input argument required') 6 | end 7 | T_s = struct(T); 8 | DB_s = struct(T_s.DB); 9 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 10 | retString = javaOp.listCombiningColumns(T_s.name); 11 | 12 | end -------------------------------------------------------------------------------- /matlab_src/@DBtable/mergeSplits.m: -------------------------------------------------------------------------------- 1 | function mergeSplits(T, startRow, endRow) 2 | %MERGESPLITS merges tablets together between the given rows 3 | % startRow is the starting row to merge exclusive, or the empty string or 4 | % [] to start at the first tablet 5 | % endRow is the last row to merge inclusive, or the empty string or [] to 6 | % end at the last tablet 7 | T_s = struct(T); 8 | DB_s = struct(T_s.DB); 9 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 10 | javaOp.mergeSplits(T_s.name, startRow, endRow); -------------------------------------------------------------------------------- /matlab_src/@DBtable/new.m: -------------------------------------------------------------------------------- 1 | function T1 = new(T0) 2 | %new: Creates a new table object based on an old table. 3 | %Database table internal function. 4 | % Usage: 5 | % T1 = new(T0) 6 | % Inputs: 7 | % T0 = original database table object 8 | % Outputs: 9 | % T1 = new database table object 10 | 11 | Ts = struct(T0); 12 | T1 = DBtable(Ts.DB,Ts.name); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putColumnFamily.m: -------------------------------------------------------------------------------- 1 | function T = putColumnFamily(T,colFam) 2 | %putColumnFamily: Set the column family currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % T = putColumnFamily(T,colFam) 6 | % Inputs: 7 | % T = database table object 8 | % colFam = string containing new column family to be used for inserts and queries; default is empty 9 | % Outputs: 10 | % T = database table object with a new column family string 11 | 12 | T.columnfamily = colFam; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putFile.m: -------------------------------------------------------------------------------- 1 | function T = putFile(T,bulkfile); 2 | %STUB for inserting a native DB file into the table. 3 | 4 | DB = struct(T.DB); 5 | 6 | if strcmp(DB.type,'BigTableLike') || strcmp(DB.type, 'Accumulo') 7 | 8 | % DBinsertFile(DB.instanceName, DB.host, T.name, DB.user, DB.pass, bulkfile ); 9 | 10 | end 11 | 12 | end 13 | 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % D4M: Dynamic Distributed Dimensional Data Model 16 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 17 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % MIT Lincoln Laboratory 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % (c) <2010> Massachusetts Institute of Technology 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putNumLimit.m: -------------------------------------------------------------------------------- 1 | function T1 = putNumLimit(T0,nlimit); 2 | %putNumLimit: Set the maximum number of items to return from a single query. 3 | %Database table internal function for Iterator. 4 | % Usage: 5 | % T1 = putNumLimit(T0,nlimit) 6 | % Inputs: 7 | % T0 = database table binding 8 | % nlimit = maximum number items to return in a single query 9 | % Outputs: 10 | % T1 = new database table binding with new limit 11 | 12 | T1 = new(T0); 13 | T1.numLimit = nlimit; 14 | 15 | end 16 | 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | 28 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putNumRow.m: -------------------------------------------------------------------------------- 1 | function T1 = putNumRow(T0,nlimit); 2 | %putNumRow: STUB. Set the maximum number of rows to return from a single query. 3 | %Database internal function for Iterator. 4 | % Usage: 5 | % T1 = putNumRow(T0,nlimit) 6 | % Inputs: 7 | % T0 = database table binding 8 | % nlimit = maximum number rows to return in a single query 9 | % Outputs: 10 | % T1 = new database table binding with new limit 11 | 12 | T1 = new(T0); 13 | T1.numRow = nlimit; 14 | 15 | end 16 | 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | 28 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putPutBytes.m: -------------------------------------------------------------------------------- 1 | function T = putPutBytes(T,chunksize) 2 | %putPutBytes: Set the chunk size for table inserts used by the put function. 3 | %Database table internal function. 4 | % Usage: 5 | % T = putPutBytes(T,chunksize) 6 | % Inputs: 7 | % T = database table binding 8 | % chunksize = approximate number of bytes to insert at one time 9 | % Outputs: 10 | % T = database table binding with a new chunk size 11 | 12 | T.putBytes = chunksize; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putSecurity.m: -------------------------------------------------------------------------------- 1 | function T = putSecurity(T,secStr) 2 | %putSecurity: Set the security label currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % T = putSecurity(T,secStr) 6 | % Inputs: 7 | % T = database table object 8 | % secStr = string containing new security string to used for inserts and queries; default is empty 9 | % Outputs: 10 | % T = database table object with a new security string 11 | 12 | T.security = secStr; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/putSplits.m: -------------------------------------------------------------------------------- 1 | function T = putSplits(T,splitString) 2 | %putSplits: Replaces all row splits in a table; used for better load balancing across multiple servers. 3 | %Database table utility function. 4 | % Usage: 5 | % T = addSplits(T,splitString) 6 | % Inputs: 7 | % T = database table object 8 | % splitString = string list row splits 9 | % Outputs: 10 | % T = database table object with new row splits 11 | 12 | T_s = struct(T); 13 | DB_s = struct(T_s.DB); 14 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 15 | javaOp.putSplits(T_s.name, splitString); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /matlab_src/@DBtable/revokeCombiningColumns.m: -------------------------------------------------------------------------------- 1 | function revokeCombiningColumns(T, colNames) 2 | %REVOKECOMBININGCOLUMNS revokes columns' combiner designations 3 | % T table 4 | % colNames A list of column names in the format 'colName1,colName2,' 5 | % where ',' is an arbitrary seperator. If ':,', then all combiners 6 | % removed. TODO: also accept an array of column names. 7 | %As there is only 1 combiner per column, there is no need to specify the 8 | %type of the combiner to remove. 9 | %Note this affects only the currently set column family of T. 10 | if nargin < 2 11 | error('2 input arguments required') 12 | end 13 | T_s = struct(T); 14 | DB_s = struct(T_s.DB); 15 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 16 | javaOp.revokeCombiningColumns(T_s.name, colNames, T_s.columnfamily) 17 | 18 | end 19 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/ColumnFamily.m: -------------------------------------------------------------------------------- 1 | function [colFam1 colFam2] = ColumnFamily(T) 2 | %ColumnFamily: Retrieve the column family currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % [colFam1 colFam2] = ColumnFamily(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % colFam1 = string containing current column family use for inserts and queries; default is empty 10 | % colFam2 = string containing current column family use for inserts and queries; default is empty 11 | 12 | colFam1 = T.columnfamily1; 13 | colFam2 = T.columnfamily2; 14 | 15 | % Need to make NoOp stub for Assoc. 16 | 17 | end 18 | 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % D4M: Dynamic Distributed Dimensional Data Model 21 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % MIT Lincoln Laboratory 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % (c) <2010> Massachusetts Institute of Technology 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/NumLimit.m: -------------------------------------------------------------------------------- 1 | function numLimit = NumLimit(T) 2 | %NumLimit: Gets the maximum number of items to return from a single query. 3 | %Database table internal function for Iterator. 4 | % Usage: 5 | % numLimit = NumLimit(T) 6 | % Inputs: 7 | % T = database table binding 8 | % Outputs: 9 | % numLimit = maximum number items to return in a single query 10 | 11 | numLimit = T.numLimit; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/PutBytes.m: -------------------------------------------------------------------------------- 1 | function putBytes = PutBytes(T); 2 | %PutBytes: Get the chunk size for table inserts used by the put function. 3 | %Database table internal function. 4 | % Usage: 5 | % putBytes = PutBytes(T) 6 | % Inputs: 7 | % T = database table binding 8 | % Outputs: 9 | % putBytes = approximate number of bytes to insert at one time 10 | 11 | putBytes = T.putBytes; 12 | 13 | end 14 | 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % D4M: Dynamic Distributed Dimensional Data Model 17 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % MIT Lincoln Laboratory 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % (c) <2010> Massachusetts Institute of Technology 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/Security.m: -------------------------------------------------------------------------------- 1 | function secStr = Security(T) 2 | %SECURITY gets security label for a table. 3 | % This is the label used for all inserts and retrieves 4 | % for this pointer to the table. Different pointers can 5 | % have different security labels. 6 | 7 | secStr = T.security; 8 | 9 | end 10 | 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | % D4M: Dynamic Distributed Dimensional Data Model 13 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 14 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 15 | % MIT Lincoln Laboratory 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % (c) <2010> Massachusetts Institute of Technology 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | 20 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/addSplits.m: -------------------------------------------------------------------------------- 1 | function addSplits(T, splitString, splitStringTranspose) 2 | %ADDSPLITS adds splits for a table. 3 | % splitString In the format: "row1,row2,row3," where ',' can be any separator 4 | % splitStringTranspose acts the same for the transpose table 5 | %Note that the added splits are in addition to any splits already present 6 | %in the table. 7 | %Use putSplits() to merge away splits present but not in splitString. 8 | T_s = struct(T); 9 | DB_s = struct(T_s.DB); 10 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 11 | javaOp.addSplits(T_s.name1, splitString); 12 | javaOp.addSplits(T_s.name2, splitStringTranspose); 13 | 14 | end 15 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/close.m: -------------------------------------------------------------------------------- 1 | function TD = close(T) 2 | %close: Reset iterator in a table object. 3 | %Database table utility function. 4 | % Usage: 5 | % TD = close(T) 6 | % Inputs: 7 | % T = database table or table pair object 8 | % Outputs: 9 | % TD = database table or table pair object 10 | 11 | T.d4mQuery.reset(); 12 | TD= T; 13 | end 14 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/delete.m: -------------------------------------------------------------------------------- 1 | function TD = delete(T) 2 | %delete: Deletes a table from a database; prompts user before proceeding. 3 | %Database table user function. 4 | % Usage: 5 | % delete(T) 6 | % TD = delete(T) 7 | % Inputs: 8 | % T = database table or table pair object 9 | % Outputs: 10 | % TD = empty database table or table pair object 11 | 12 | DB = struct(T.DB); 13 | 14 | TD = T; 15 | r = input(['Delete ' T.name1 ' & ' T.name2 ' from ' DB.host ' ' DB.type '? (y/n) [n]: '],'s'); 16 | if strcmp(r,'y') 17 | DBdelete(DB.instanceName,DB.host,T.name1,DB.user,DB.pass,DB.type); 18 | TD.name1 = ''; 19 | DBdelete(DB.instanceName,DB.host,T.name2,DB.user,DB.pass, DB.type); 20 | TD.name2 = ''; 21 | end 22 | 23 | end 24 | 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % D4M: Dynamic Distributed Dimensional Data Model 27 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 28 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 29 | % MIT Lincoln Laboratory 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | % (c) <2010> Massachusetts Institute of Technology 32 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 33 | 34 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/deleteForce.m: -------------------------------------------------------------------------------- 1 | function TD = deleteForce(T) 2 | %deleteForce: Deletes a table from a database; does *not* prompt user before proceeding. 3 | %Database table user function. 4 | % Usage: 5 | % deleteForce(T) 6 | % TD = deleteForce(T) 7 | % Inputs: 8 | % T = database table or table pair object 9 | % Outputs: 10 | % TD = empty database table or table pair object 11 | 12 | DB = struct(T.DB); 13 | 14 | TD = T; 15 | DBdelete(DB.instanceName,DB.host,T.name1,DB.user,DB.pass,DB.type); 16 | TD.name1 = ''; 17 | DBdelete(DB.instanceName,DB.host,T.name2,DB.user,DB.pass, DB.type); 18 | TD.name2 = ''; 19 | 20 | end 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Mr. William Smith (william.smith@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/getName.m: -------------------------------------------------------------------------------- 1 | function [name1,name2] = getName(T) 2 | %getName: Retrieve the names of the table. 3 | %Database table utility function. 4 | % Usage: 5 | % [name1,name2] = getName(T) 6 | % Inputs: 7 | % T = database table pair object 8 | % Outputs: 9 | % name1 = string containing the table name 10 | % name1 = string containing the table transpose name 11 | 12 | name1 = T.name1; 13 | name2 = T.name2; 14 | 15 | end 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/getSplits.m: -------------------------------------------------------------------------------- 1 | function [splitString, varargout] = getSplits(T, whichTable) 2 | %GETSPLITS gets the current splits for a table 3 | % OUTPUT splitString: the splits of T in the format f,p,r2,w, 4 | % OPTIONAL 2nd OUTPUT: a comma-delimited string that holds N+1 numbers 5 | % where N is the number of splits and the (i)th number is the number of 6 | % entries in tablet holding the (i-1)st split and the (i)th split. 7 | %whichTable is either 'first' or 'transpose' 8 | T_s = struct(T); 9 | DB_s = struct(T_s.DB); 10 | if strcmpi(whichTable,'first') 11 | Table = T_s.name1; 12 | elseif strcmpi(whichTable,'transpose') 13 | Table = T_s.name2; 14 | else 15 | error('Please specify whichTable correctly'); 16 | end 17 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 18 | if nargout <= 1 19 | splitString = javaOp.getSplits(Table); 20 | else 21 | %user wants the count in each tablet 22 | retArray = javaOp.getSplits(Table, true); 23 | splitString = cell2mat(cell(retArray(1))); 24 | varargout(1) = cell(retArray(2)); 25 | end 26 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/mergeSplits.m: -------------------------------------------------------------------------------- 1 | function mergeSplits(T, startRow, endRow, whichTable) 2 | %MERGESPLITS merges tablets together between the given rows 3 | % startRow is the starting row to merge exclusive, or the empty string or 4 | % [] to start at the first tablet 5 | % endRow is the last row to merge inclusive, or the empty string or [] to 6 | % end at the last tablet 7 | % whichTable is either 'first', 'transpose', or 'both' 8 | T_s = struct(T); 9 | DB_s = struct(T_s.DB); 10 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 11 | if strcmpi(whichTable,'first') 12 | javaOp.mergeSplits(T_s.name1, startRow, endRow); 13 | elseif strcmpi(whichTable,'transpose') 14 | javaOp.mergeSplits(T_s.name2, startRow, endRow); 15 | elseif strcmpi(whichTable,'both') 16 | javaOp.mergeSplits(T_s.name1, startRow, endRow); 17 | javaOp.mergeSplits(T_s.name2, startRow, endRow); 18 | else 19 | error('Please specify whichTable correctly'); 20 | end -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/new.m: -------------------------------------------------------------------------------- 1 | function T1 = new(T0) 2 | %new: Creates a new table object based on an old table. 3 | %Database table internal function. 4 | % Usage: 5 | % T1 = new(T0) 6 | % Inputs: 7 | % T0 = original database table object 8 | % Outputs: 9 | % T1 = new database table object 10 | 11 | Ts = struct(T0); 12 | T1 = DBtablePair(Ts.DB,Ts.name1,Ts.name2); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/putNumLimit.m: -------------------------------------------------------------------------------- 1 | function T1 = putNumLimit(T0,nlimit); 2 | %putNumLimit: Set the maximum number of items to return from a single query. 3 | %Database table internal function for Iterator. 4 | % Usage: 5 | % T1 = putNumLimit(T0,nlimit) 6 | % Inputs: 7 | % T0 = database table binding 8 | % nlimit = maximum number items to return in a single query 9 | % Outputs: 10 | % T1 = new database table binding with new limit 11 | 12 | T1 = new(T0); 13 | T1.numLimit = nlimit; 14 | 15 | end 16 | 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | 28 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/putPutBytes.m: -------------------------------------------------------------------------------- 1 | function T = putPutBytes(T,chunksize); 2 | %putPutBytes: Set the chunk size for table inserts used by the put function. 3 | %Database table internal function. 4 | % Usage: 5 | % T = putPutBytes(T,chunksize) 6 | % Inputs: 7 | % T = database table binding 8 | % chunksize = approximate number of bytes to insert at one time 9 | % Outputs: 10 | % T = database table binding with a new chunk size 11 | 12 | T.putBytes = chunksize; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/putSecurity.m: -------------------------------------------------------------------------------- 1 | function T = putSecurity(T,secStr); 2 | %putSecurity: Set the security label currently used by a table. 3 | %Database table utility function. 4 | % Usage: 5 | % T = putSecurity(T,secStr) 6 | % Inputs: 7 | % T = database table object 8 | % secStr = string containing new security string to used for inserts and queries; default is empty 9 | % Outputs: 10 | % T = database table object with a new security string 11 | 12 | T.security = secStr; 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/putSplits.m: -------------------------------------------------------------------------------- 1 | function putSplits(T, splitString, splitStringTranspose) 2 | %PUTSPLITS replaces the split state of a table. 3 | % splitString In the format: "row1,row2,row3," where ',' can be any separator 4 | % Use "" to take away all splits 5 | % splitStringTranspose acts the same for the transpose table 6 | %Splits in the table not present in splitString will be merged together. 7 | % Remember, merging is an expensive operation! 8 | %Use addSplits() to avoid merging already present splits. 9 | % 10 | T_s = struct(T); 11 | DB_s = struct(T_s.DB); 12 | javaOp = DBaddJavaOps('edu.mit.ll.d4m.db.cloud.D4mDbTableOperations',DB_s.instanceName, DB_s.host, DB_s.user, DB_s.pass, 'Accumulo'); 13 | javaOp.putSplits(T_s.name1, splitString); 14 | javaOp.putSplits(T_s.name2, splitStringTranspose); 15 | end 16 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/randCol.m: -------------------------------------------------------------------------------- 1 | function Asub = randCol(T,Msub) 2 | %RANDCOL returns up to Msub random subcols of a table. 3 | % NOTE: Currently unimplemented 4 | 5 | % Placeholder. 6 | 7 | end 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % D4M: Dynamic Distributed Dimensional Data Model 11 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 12 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % MIT Lincoln Laboratory 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % (c) <2010> Massachusetts Institute of Technology 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | 18 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/randRow.m: -------------------------------------------------------------------------------- 1 | function Asub = randRow(T,Ti,Nsub) 2 | %RANDROW returns up to Nsub random subrows of a table. 3 | % NOTE: For the moment this doesn't work 4 | 5 | % Get Ti parameters. 6 | ATiPar = double(Ti('IndexParameters,',:)); 7 | N = Val(ATiPar(:,'length,')); 8 | w = Val(ATiPar(:,'width,')); 9 | 10 | % Generate random row index. 11 | % rowIndStr = sprintf('%d,',randi(N,Nsub,1)); 12 | rowIndStr = sprintf('%d,',randiTmp(N,Nsub,1)); 13 | 14 | % Get the rows from T via Ti. 15 | % DOESN'T work because can't use () inside a method. 16 | Asub = T(Col(Ti(rowIndStr,:)),:); 17 | 18 | end 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /matlab_src/@DBtablePair/size.m: -------------------------------------------------------------------------------- 1 | function s = size(T) 2 | %SIZE returns size of table. 3 | 4 | s = [1 1]; 5 | 6 | % s = TBD 7 | 8 | end 9 | 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | % D4M: Dynamic Distributed Dimensional Data Model 12 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 13 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 14 | % MIT Lincoln Laboratory 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | % (c) <2010> Massachusetts Institute of Technology 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | 19 | -------------------------------------------------------------------------------- /matlab_src/BinDegree.m: -------------------------------------------------------------------------------- 1 | function ndbin = BinDegree(nd,dstep); 2 | %OutDegree: Compute out-degree distribution of an adjacency matrix. 3 | % Usage: 4 | % ndbin = BinDegree(nd,bin_step); % Compute out-degree 5 | % Input: 6 | % nd = degree distribution matrix 7 | % dstep = logarithmic bin step size. 8 | % Output: 9 | % ndbin = sparse vector where ndbin(d) is the count of vertices of degree d 10 | 11 | dMax = length(nd); 12 | dMaxBin = round(dstep.^(ceil(log(dMax)./log(dstep)))); 13 | ndbinNNZ = round(log(dMaxBin)./log(dstep)); 14 | ndbin = spalloc(dMaxBin,1,ndbinNNZ); 15 | ndbin(1) = nd(1); 16 | 17 | if (ndbinNNZ > 1) 18 | for i = 1:ndbinNNZ 19 | di0 = dstep.^(i-1); 20 | di1 = dstep.^i; 21 | ndbin(di1) = sum(nd((di0+1):min(di1,dMax))); 22 | end 23 | end 24 | 25 | 26 | return 27 | end 28 | -------------------------------------------------------------------------------- /matlab_src/CSVstr2TSVstr.m: -------------------------------------------------------------------------------- 1 | function TsvStr = CSVstr2TSVstr(CsvStr) 2 | %CSVstr2TSVstr: Converts a CSV formatted string to TSV formatted str. 3 | %IO user function. 4 | % Usage: 5 | % TsvStr = CSVstr2assoc(CsvStr) 6 | % Inputs: 7 | % CsvStr = CSV formatted string 8 | % Outputs: 9 | % TsvStr = TSV formatted string 10 | 11 | 12 | nl = char(10); 13 | comma = ','; 14 | quote = char(34); 15 | tab = char(9); 16 | 17 | xcomma = double(CsvStr == comma); 18 | xquote = double(CsvStr == quote); 19 | iquote = find(xquote); 20 | xquote(iquote(2:2:end)) = -1; 21 | Xquote = cumsum(xquote); 22 | 23 | TsvStr = CsvStr; 24 | 25 | TsvStr(not(Xquote) & xcomma) = tab; 26 | 27 | end 28 | 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % D4M: Dynamic Distributed Dimensional Data Model 31 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 33 | % MIT Lincoln Laboratory 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % (c) <2010> Massachusetts Institute of Technology 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | -------------------------------------------------------------------------------- /matlab_src/HierAdd.m: -------------------------------------------------------------------------------- 1 | function Ahier = HierAdd(Ahier,A,nnzCut); 2 | %HierAdd: Hierachicall add associative arrays in way that is more memory friendly. 3 | % Usage: 4 | % Ahier = HierAdd(Ahier,A,nnzCut); % Add new associative array 5 | % Input: 6 | % Ahier = Cell array of associtative arrays 7 | % A = new associative array to add. 8 | % nnzCut = nnz thresholds for each level of the hierarchy 9 | % Output: 10 | % Ahier = Updated cell array. 11 | 12 | Ahier{1} = Ahier{1} + A; 13 | for i=1:length(nnzCut) 14 | if (nnz(Ahier{i}) > nnzCut(i)) 15 | Ahier{i+1} = Ahier{i+1} + Ahier{i}; 16 | Ahier{i} = Assoc('','',''); 17 | end 18 | end 19 | 20 | return 21 | end 22 | -------------------------------------------------------------------------------- /matlab_src/HierAddFinal.m: -------------------------------------------------------------------------------- 1 | function A = HierAddFinal(Ahier); 2 | %HierAddFinal: Finalize hierachical add of associative arrays. 3 | % Usage: 4 | % A = HierAddFinal(Ahier); % Finalize add. 5 | % Input: 6 | % Ahier = Cell array of associtative arrays 7 | % Output: 8 | % A = final sum of Ahier. 9 | 10 | A = Assoc('','',''); 11 | for i=1:length(Ahier) 12 | A = A + Ahier{i}; 13 | end 14 | 15 | return 16 | end 17 | -------------------------------------------------------------------------------- /matlab_src/HierAddInit.m: -------------------------------------------------------------------------------- 1 | function Ahier = HierAddInit(nnzCut); 2 | %HierAddInit: Initialize hierachical add of associative arrays. 3 | % Usage: 4 | % Ahier = HierAddInit(nnzCut); % Initialize add. 5 | % Input: 6 | % nnzCut = vector of nnz cut thresholds. 7 | % Output: 8 | % Ahier = Cell array of associtative arrays 9 | 10 | for i=1:(length(nnzCut)+1) 11 | Ahier{i} = Assoc('','',''); 12 | end 13 | 14 | return 15 | end 16 | -------------------------------------------------------------------------------- /matlab_src/InsertAssocFiles.m: -------------------------------------------------------------------------------- 1 | function A = InsertAssocFiles(T,filesStr) 2 | %InsertAssocFiles: Inserts Assoc array files into a database table. 3 | %Database utility function. 4 | % Usage: 5 | % A = InsertAssocFiles(T,filesStr) 6 | % Inputs: 7 | % T = table to insert into 8 | % fileStr = string list of filenames 9 | % Outputs: 10 | % A = associative array of the last file read 11 | 12 | filesMat = Str2mat(filesStr); % Put files into array. 13 | 14 | 15 | for i = 1:NumStr(filesStr) % Loop through all files. 16 | 17 | ifile = Mat2str(filesMat(i,:)); 18 | ifile = ifile(1:end-1); % Extract file name. 19 | 20 | load(ifile); % Read in .mat file. 21 | 22 | if (nnz(A) > 0) 23 | put(T,A); % Insert into DB table. 24 | end 25 | 26 | end 27 | 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % D4M: Dynamic Distributed Dimensional Data Model 30 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 31 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % MIT Lincoln Laboratory 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | % (c) <2010> Massachusetts Institute of Technology 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | -------------------------------------------------------------------------------- /matlab_src/IsClass.m: -------------------------------------------------------------------------------- 1 | function y = IsClass(A,name) 2 | %IsClass: Tests if an object is a specific classname. 3 | %Associative array utility function. 4 | % Usage: 5 | % y = IsClass(A,name) 6 | % Inputs: 7 | % A = variable to test 8 | % name = class name to compare with 9 | % Outputs: 10 | % y = returns 1 if variable class and name are the same 11 | 12 | y = strcmp(class(A),name); 13 | 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/JSONCSV2assoc.m: -------------------------------------------------------------------------------- 1 | function A = JSONCSV2assoc(JSONCSVstr) 2 | %JSONCSV2assoc: Converts a CSV string stored inside a JSON data structure to an associative array. 3 | %IO user function. 4 | % Usage: 5 | % A = JSONCSV2assoc(JSONCSVstr) 6 | % Inputs: 7 | % JSONCSVstr = JSON data structure containing a CSV formatted string 8 | % Outputs: 9 | % A = associative array formed from JSON CSV formatted string 10 | 11 | % Convert str to a matlab structure. 12 | J = parseJSON(JSONCSVstr); 13 | 14 | A = CSVstr2assoc(J.CSVstring,J.rowSeparator,J.columnSeparator); 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/JavaInnerEnum.m: -------------------------------------------------------------------------------- 1 | function enumobj = JavaInnerEnum(topobj, icname, enumname) 2 | % Returns an enum object buried within an inner enum member of a class. 3 | % Params: 4 | % topobj is a Java object for the parent class holding the enum. We get a class loader from it. 5 | % icname is the name of the inner enum class 6 | % enumname is the name of the particular enum object 7 | % Examples: 8 | % JavaInnerEnum(edu.mit.ll.graphulo.reducer.GatherReducer(), 'KeyPart', 'ROW') 9 | % JavaInnerEnum(edu.mit.ll.graphulo.simplemult.MathTwoScalar(), 'ScalarType', 'LONG') 10 | 11 | 12 | aclass = topobj.getClass(); 13 | aclassname = char(aclass.getName()); 14 | classloader = aclass.getClassLoader(); 15 | ic = java.lang.Class.forName([aclassname '$' icname], true, classloader); 16 | 17 | classArray = javaArray('java.lang.Class',1); 18 | classArray(1) = java.lang.String().getClass(); 19 | stringArray = javaArray('java.lang.String',1); 20 | stringArray(1) = java.lang.String(enumname); 21 | enumobj = ic.getMethod(java.lang.String('valueOf'),classArray).invoke([],stringArray); 22 | 23 | end -------------------------------------------------------------------------------- /matlab_src/KronCatStr.m: -------------------------------------------------------------------------------- 1 | function s12 = KronCatStr(s1,sep,s2); 2 | %KronCatStr: Concatenates the pairwise permutations of two string lists with a separator. 3 | %String array user function. 4 | % Usage: 5 | % s12 = KronCatStr(s1,sep,s2) 6 | % Inputs: 7 | % s1 = string list of length n1 8 | % sep = single character separator 9 | % s2 = string list of length n2 10 | % Outputs: 11 | % s12 = string list of length n1*n2 12 | 13 | Ns1 = NumStr(s1); Ns2 = NumStr(s2); 14 | s1mat = Str2mat(s1); 15 | 16 | s12 = char(zeros(1,Ns1*Ns2)); 17 | istart = 1; 18 | for i=1:Ns1 19 | s12i = CatStr(Mat2str(s1mat(i,:)),sep,s2); 20 | iend = istart + numel(s12i) - 1; 21 | s12(istart:iend) = s12i; 22 | istart = iend + 1; 23 | end 24 | 25 | end 26 | 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % D4M: Dynamic Distributed Dimensional Data Model 29 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 30 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 31 | % MIT Lincoln Laboratory 32 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 33 | % (c) <2010> Massachusetts Institute of Technology 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | 36 | -------------------------------------------------------------------------------- /matlab_src/Mat2str.m: -------------------------------------------------------------------------------- 1 | function str = Mat2str(mat); 2 | %Mat2str: Converts char matrix to a list of strings; inverse of Str2mat. 3 | %String array user function. 4 | % Usage: 5 | % str = Mat2str(mat) 6 | % Inputs: 7 | % mat = char matrix 8 | % Outputs: 9 | % str = string list of the non-zero entries in mat 10 | 11 | if size(mat,2) == 1 %Check for nx1 matrix 12 | str = mat.'; 13 | else 14 | [i j v] = find(transpose(mat)); 15 | str = char(transpose(v)); 16 | end 17 | 18 | end 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % D4M: Dynamic Distributed Dimensional Data Model 22 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 23 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % MIT Lincoln Laboratory 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % (c) <2010> Massachusetts Institute of Technology 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | -------------------------------------------------------------------------------- /matlab_src/MyEcho.m: -------------------------------------------------------------------------------- 1 | function command = MyEcho(command) 2 | %MyEcho: Echo back the given command. Use $ for quoting strings. Useful for demos. 3 | %Associative array utility function internal. 4 | % Usage: 5 | % command = MyEcho(command) 6 | % Inputs: 7 | % command = set of commands to echo 8 | % Outputs: 9 | % command = same as input 10 | % Example: 11 | % eval(MyEcho('A($Bob,Alice,$,:); % Show rows Bob and Alice.')); 12 | 13 | Q = ''''; 14 | command(command == '$') = Q; 15 | disp(command); 16 | end 17 | -------------------------------------------------------------------------------- /matlab_src/NumStr.m: -------------------------------------------------------------------------------- 1 | function n = NumStr(s); 2 | %NumStr: Counts the number of strings in a string list. 3 | %String list user function. 4 | % Usage: 5 | % n = NumStr(s) 6 | % Inputs: 7 | % s = string list 8 | % Outputs: 9 | % n = number of strings in string list 10 | 11 | n = nnz(s == s(end)); 12 | end 13 | 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % D4M: Dynamic Distributed Dimensional Data Model 16 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 17 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 18 | % MIT Lincoln Laboratory 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | % (c) <2010> Massachusetts Institute of Technology 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | 23 | -------------------------------------------------------------------------------- /matlab_src/OutDegree.m: -------------------------------------------------------------------------------- 1 | function ndout = OutDegree(A); 2 | %OutDegree: Compute out-degree distribution of an adjacency matrix. 3 | % Usage: 4 | % ndout = OutDegree(A); % Compute out-degree 5 | % ndin = OutDegree(A.'); % Compute in-degree 6 | % Input: 7 | % A = adjacency matrix 8 | % Output: 9 | % ndout = sparse vector where ndout(d) is the count of vertices of degree d 10 | 11 | dout = sum(A,2); 12 | [dout_i dout_j dout_v] = find(dout); 13 | ndout = sum(sparse(dout_i,dout_v,1),1); 14 | return 15 | end -------------------------------------------------------------------------------- /matlab_src/OutInRow2Adj.m: -------------------------------------------------------------------------------- 1 | function A = OutInRow2Adj(A1,rowSep,weightCol) 2 | % Convert Single-Table format Assoc to Adjacency Assoc. 3 | % Throws away degree information, if present in A1. 4 | % Input: 5 | % A - Adjacency Assoc 6 | % rowSep - Character to separate nodes in row, e.g. '|' 7 | % weightCol - Name of the column to put weights in, e.g. 'Weight,' 8 | % Output: 9 | % A1 - Single-Table Assoc 10 | % Ex: Assoc('v1|v2,v1,v2,', 'Weight,OutDegree,InDegree,', [3 1 1]) 11 | % ==> Assoc('v1,','v2,',3) 12 | 13 | if isempty(A1) 14 | A = Assoc('','',''); 15 | return 16 | end 17 | [r,~,v] = find(A1(:,weightCol)); 18 | [r,c] = SplitStr(r,rowSep); 19 | A = Assoc(r,c,v); 20 | end 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % D4M: Dynamic Distributed Dimensional Data Model 23 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 24 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % MIT Lincoln Laboratory 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % (c) <2010> Massachusetts Institute of Technology 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /matlab_src/ReadCSV.m: -------------------------------------------------------------------------------- 1 | function A = ReadCSV(fname); 2 | %ReadCSV: Reads a CSV (or TSV) file into an associative array. 3 | %IO user function. 4 | % Usage: 5 | % A = ReadCSV(fname) 6 | % Inputs: 7 | % fname = CSV or TSV formatted file; TSV format is determined from a '.tsv' file extension 8 | % Outputs: 9 | % A = associative array of file, with 1st column as row keys, and 1st row as column keys 10 | 11 | [row col val] = FindCSV(fname); 12 | 13 | A = Assoc(row,col,val); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/StrFileRead.m: -------------------------------------------------------------------------------- 1 | function s = StrFileRead(file) 2 | %StrFileRead: Reads a file into a string array. 3 | %String utility function. 4 | % Usage: 5 | % s = StrFileRead(file) 6 | % Inputs: 7 | % file = filename 8 | % Outputs: 9 | % s = string 10 | 11 | fid=fopen(file,'r+'); 12 | s = fread(fid,inf,'uint8=>char').'; 13 | fclose(fid); 14 | 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | -------------------------------------------------------------------------------- /matlab_src/StrFileWrite.m: -------------------------------------------------------------------------------- 1 | function StrFileWrite(s,file) 2 | %StrFileWrite: Writes a string array to a file. 3 | %String utility function. 4 | % Usage: 5 | % StrFileWrite(s,file) 6 | % Inputs: 7 | % file = filename 8 | % s = string 9 | % Outputs: 10 | % 11 | 12 | fid=fopen(file,'w'); 13 | fwrite(fid,s); 14 | fclose(fid); 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | -------------------------------------------------------------------------------- /matlab_src/StrLS.m: -------------------------------------------------------------------------------- 1 | function str = StrLS(pathname) 2 | %StrLS: Returns list of files in a directory formatted as a string list. 3 | %IO user function. 4 | % Usage: 5 | % str = StrLS(pathname) 6 | % Inputs: 7 | % pathname = directory path 8 | % Outputs: 9 | % str = list of files in a directory formatted as a string list 10 | 11 | % Returns list of files formatted as string array. 12 | 13 | if exist('OCTAVE_VERSION','builtin') 14 | str = ls(pathname); 15 | str(:,end+1) = char(10); 16 | str = reshape(str.',1,numel(str)); 17 | str = str(str ~= 0); 18 | else 19 | str = strrep([strtrim(ls(pathname)) char(10)],char(9),char(10)); 20 | end 21 | 22 | end 23 | 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % D4M: Dynamic Distributed Dimensional Data Model 26 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 28 | % MIT Lincoln Laboratory 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % (c) <2010> Massachusetts Institute of Technology 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | 33 | -------------------------------------------------------------------------------- /matlab_src/StrSepsame.m: -------------------------------------------------------------------------------- 1 | function [s1 s2] = StrSepsame(s1,s2) 2 | %StrSepsame: Makes separators in two lists of strings the same. 3 | %String utility function. 4 | % Usage: 5 | % [s1 s2] = StrSepsame(s1,s2) 6 | % Inputs: 7 | % s1 = list of strings 8 | % s2 = list of strings 9 | % Outputs: 10 | % s1 = list of strings 11 | % s2 = list of strings where separator is the same as s1 12 | 13 | s1sep = s1(end); % Assume last entry is separator. 14 | s2sep = s2(end); 15 | 16 | if (s1sep ~= s2sep); 17 | s2(s2 == s2sep) = s1sep; 18 | end 19 | 20 | end 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % D4M: Dynamic Distributed Dimensional Data Model 24 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 25 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % MIT Lincoln Laboratory 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | % (c) <2010> Massachusetts Institute of Technology 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | 31 | -------------------------------------------------------------------------------- /matlab_src/StrSubind.m: -------------------------------------------------------------------------------- 1 | function si = StrSubind(s,i) 2 | %StrSubind: Returns sub-strings i found in string list s. 3 | %String utility function. 4 | % Usage: 5 | % si = StrSubind(s,i) 6 | % Inputs: 7 | % s = list of strings 8 | % i = indices of strings to get from list 9 | % Outputs: 10 | % si = list of sub-strings from s (in the order i). 11 | 12 | smat = Str2mat(s); 13 | si = Mat2str(smat(i,:)); 14 | end 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % D4M: Dynamic Distributed Dimensional Data Model 18 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 19 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % MIT Lincoln Laboratory 21 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % (c) <2010> Massachusetts Institute of Technology 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | -------------------------------------------------------------------------------- /matlab_src/Struct2Assoc.m: -------------------------------------------------------------------------------- 1 | function A = Struct2Assoc(S, splitSep) 2 | % Function Struct2Assoc converts a struct to associative array 3 | % Associative array utility funciton 4 | % Usage: 5 | % A = StrFileWrite(S,varargin) 6 | % Inputs: 7 | % S = struct to convert 8 | % splitSep = single character separator 9 | % Outputs: 10 | % A = Associative Array output. Row key corresponds with struct id (for 11 | % structs greater than 1 dimension) 12 | % 13 | 14 | structfields=fields(S); 15 | A=Assoc('','',''); 16 | 17 | for i=1:size(S,2) 18 | Stmp=S(i); 19 | for j=1:numel(structfields) 20 | A = A+Assoc(['StructIdx|' num2str(i) ','], [structfields{j} splitSep num2str(eval(['Stmp.' structfields{j}])) ','], '1,'); 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /matlab_src/col2type.m: -------------------------------------------------------------------------------- 1 | function AA =col2type(A,splitSep) 2 | %col2type: Splits column keys of associative array and stores first part as column key and second part as value; inverse of val2col. 3 | %Associative array user function. 4 | % Usage: 5 | % AA =col2type(A,splitSep) 6 | % Inputs: 7 | % A = associative array with string column keys 8 | % splitSep = single character separator 9 | % Outputs: 10 | % A = associative array with string column keys and string values 11 | 12 | [r c v] = find(A); 13 | [cType cVal] = SplitStr(c,splitSep); 14 | AA = Assoc(r,cType,cVal); 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | -------------------------------------------------------------------------------- /matlab_src/col2val.m: -------------------------------------------------------------------------------- 1 | function AA =col2val(A,splitSep) 2 | %col2val: Splits column keys of associative array and stores second part as column key and first part as value. 3 | %Associative array user function. 4 | % Usage: 5 | % AA = col2val(A,splitSep) 6 | % Inputs: 7 | % A = associative array with string column keys 8 | % splitSep = single character separator 9 | % Outputs: 10 | % A = associative array with string column keys and string values 11 | 12 | [r c v] = find(A); 13 | [cType cVal] = SplitStr(c,splitSep); 14 | AA = Assoc(r,cVal,cType); 15 | 16 | end 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % D4M: Dynamic Distributed Dimensional Data Model 20 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 22 | % MIT Lincoln Laboratory 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % (c) <2010> Massachusetts Institute of Technology 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | -------------------------------------------------------------------------------- /matlab_src/deleteSciDBarray.m: -------------------------------------------------------------------------------- 1 | %Delete SciDB Array 2 | function DB = deleteSciDBarray(DB, tablename) 3 | 4 | DBstruct = struct(DB); 5 | 6 | urlport = DBstruct.host; 7 | 8 | [stat, sessionID] = system(['wget -q -O - "' urlport 'new_session" --http-user=' ... 9 | DBstruct.user ' --http-password=' DBstruct.pass]); 10 | 11 | sessionID = deblank(sessionID); 12 | 13 | [stat, queryID] = system(['wget -q -O - "' urlport 'execute_query?id=' sessionID ... 14 | '&query=remove(' tablename ')&release=1" --http-user=' DBstruct.user ' --http-password=' ... 15 | DBstruct.pass]); 16 | 17 | end -------------------------------------------------------------------------------- /matlab_src/parseJSON.m: -------------------------------------------------------------------------------- 1 | function data = parseJSON(string) 2 | %parseJSON: Converts a JSON formatted string into a data structure. 3 | %IO user function. 4 | % Usage: 5 | % data = parseJSON(string) 6 | % Inputs: 7 | % string = JSON formatted string 8 | % Outputs: 9 | % data = data structure 10 | 11 | 12 | if exist('OCTAVE_VERSION','builtin') 13 | % Check if java is working. 14 | str = javaObject('java.lang.String', string); 15 | jsonObj = javaObject('org.json.JSONObject', str); 16 | else 17 | jsonObj = org.json.JSONObject(java.lang.String(string)); 18 | end 19 | 20 | iter = jsonObj.keys; 21 | 22 | while(iter.hasNext) 23 | key = iter.next; 24 | val = jsonObj.get(key); 25 | eval(sprintf('data.%s = val;', key)); 26 | end 27 | 28 | end % if 29 | -------------------------------------------------------------------------------- /matlab_src/put.m: -------------------------------------------------------------------------------- 1 | function T = put(T,varargin); 2 | %put: Inserts data into a database table. 3 | %Database user function. 4 | % Usage: 5 | % T = put(T,A) 6 | % T = put(T,r,c,v) 7 | % Inputs: 8 | % T = database table binding 9 | % A = Associative array to insert into table (normally has string rows, columns, and values). 10 | % r = string list of n row keys 11 | % c = string list of n column keys 12 | % v = string list of n values 13 | % Outputs: 14 | % T = database table binding 15 | 16 | if nargin == 2 17 | [row col val] = find(varargin{1}); 18 | end 19 | if nargin == 4 20 | row = varargin{1}; 21 | col = varargin{2}; 22 | val = varargin{3}; 23 | end 24 | 25 | T = putTriple(T,row,col,val); 26 | 27 | end 28 | 29 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 | % D4M: Dynamic Distributed Dimensional Data Model 31 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 32 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 33 | % MIT Lincoln Laboratory 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % (c) <2010> Massachusetts Institute of Technology 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | -------------------------------------------------------------------------------- /matlab_src/putAssoc.m: -------------------------------------------------------------------------------- 1 | function A = putAssoc(row,col,val,AdjA) 2 | %putAssoc: Constructs all elements of an associative array from its components. 3 | %Associative array utility function. 4 | % Usage: 5 | % A = putAssoc(row,col,val,AdjA)) 6 | % Inputs: 7 | % row = string list of N row keys (or empty) 8 | % col = string list of M col keys (or empty) 9 | % val = string list of nnz(AdjA) values (or empty) 10 | % AdjA = sparse matrix connecting rows, columns, and values 11 | % Outputs: 12 | % A = associative array 13 | % Example: 14 | % A = putAssoc('r1,r2,','c1,c2,c3,','v1,',ones(2,3)) 15 | 16 | A = Assoc('','',''); 17 | A = putRow(A,row); 18 | A = putCol(A,col); 19 | A = putVal(A,val); 20 | A = putAdj(A,AdjA); 21 | end 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % D4M: Dynamic Distributed Dimensional Data Model 25 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 26 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 27 | % MIT Lincoln Laboratory 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | % (c) <2010> Massachusetts Institute of Technology 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | 32 | -------------------------------------------------------------------------------- /matlab_src/randiTmp.m: -------------------------------------------------------------------------------- 1 | function A = randiTmp(imax,varargin) 2 | %randiTmp: DEPRECATED. Stub for randi if it isn't available. 3 | %Associative array internal function. 4 | % Usage: 5 | % A = randiTmp(imax,varargin) 6 | % Inputs: 7 | % imax = max random integer to generate 8 | % varargin = optional arguments into rand() 9 | % Outputs: 10 | % A = random integers in the range [1,imax] 11 | 12 | % Stub for randi if it isn't available. 13 | 14 | A = rand(varargin{:}); 15 | 16 | if numel(imax) == 1 17 | A = ceil(imax .* A); 18 | end 19 | if numel(imax) == 2 20 | A = ceil((imax(2) - (imax(1)-1)) .* A) + (imax(1)-1); 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /matlab_src/scidb2mtx.m: -------------------------------------------------------------------------------- 1 | % SCIDB2MTX Convert output of SciDB query to matrix 2 | % assumes that the data is all numeric 3 | function y = scidb2mtx(rows, cols, slice, vals) 4 | 5 | if isempty(rows) || isempty(cols) || isempty(slice) 6 | y = []; 7 | else 8 | %{ 9 | % implementation below was for cell array of strings returned 10 | % by [r,c,z,v] = T()... command. str2double() was EXTREMELY 11 | % slow : 1 hour for 4096x4096 matrix conversion 12 | % querySciDB() has been changed so that it returns doubles 13 | rows = cat(1, str2double(rows(:))); 14 | rows = rows-min(rows)+1; 15 | cols = cat(1, str2double(cols(:))); 16 | cols = cols-min(cols)+1; 17 | slice = cat(1, str2double(slice(:))); 18 | slice = slice-min(slice)+1; 19 | vals = cat(1, str2double(vals(:))); 20 | %} 21 | 22 | nr = range(rows)+1; 23 | nc = range(cols)+1; 24 | ns = range(slice)+1; 25 | 26 | %idx = sub2ind([nr nc ns], rows, cols, slice); 27 | idx = sub2ind([nr nc ns], rows-min(rows)+1, cols-min(cols)+1, slice-min(slice)+1); 28 | y = zeros(nr, nc, ns); 29 | y(idx) = vals; 30 | end 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /matlab_src/val2col.m: -------------------------------------------------------------------------------- 1 | function AA = val2col(A,splitSep) 2 | %val2col: Append associative array values to column keys; inverse of col2type. 3 | %Associative array user function. 4 | % Usage: 5 | % AA = val2col(A,splitSep) 6 | % Inputs: 7 | % A = associative array with string column keys 8 | % splitSep = single character separator 9 | % Outputs: 10 | % A = associative array with string column keys and numeric values 11 | 12 | [r cType cVal] = find(A); 13 | c = CatStr(cType,splitSep, cVal); 14 | AA = Assoc(r,c,1); 15 | end 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % D4M: Dynamic Distributed Dimensional Data Model 19 | % Architect: Dr. Jeremy Kepner (kepner@ll.mit.edu) 20 | % Software Engineer: Dr. Jeremy Kepner (kepner@ll.mit.edu) 21 | % MIT Lincoln Laboratory 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % (c) <2010> Massachusetts Institute of Technology 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | --------------------------------------------------------------------------------