@ladybugmem/icebug 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/binding.gyp +54 -0
- package/build/Release/.deps/Release/icebug.node.d +1 -0
- package/build/Release/.deps/Release/obj.target/icebug/src/addon.o.d +291 -0
- package/build/Release/icebug.node +0 -0
- package/build/Release/obj.target/icebug/src/addon.o +0 -0
- package/lib/index.d.ts +361 -0
- package/lib/index.js +102 -0
- package/package.json +42 -0
- package/src/addon.cpp +1253 -0
- package/vendor/include/networkit/GlobalState.hpp +86 -0
- package/vendor/include/networkit/Globals.hpp +41 -0
- package/vendor/include/networkit/algebraic/AlgebraicGlobals.hpp +27 -0
- package/vendor/include/networkit/algebraic/CSRGeneralMatrix.hpp +1292 -0
- package/vendor/include/networkit/algebraic/CSRMatrix.hpp +11 -0
- package/vendor/include/networkit/algebraic/DenseMatrix.hpp +537 -0
- package/vendor/include/networkit/algebraic/DynamicMatrix.hpp +514 -0
- package/vendor/include/networkit/algebraic/GraphBLAS.hpp +323 -0
- package/vendor/include/networkit/algebraic/MatrixTools.hpp +156 -0
- package/vendor/include/networkit/algebraic/Semirings.hpp +171 -0
- package/vendor/include/networkit/algebraic/SparseAccumulator.hpp +111 -0
- package/vendor/include/networkit/algebraic/Vector.hpp +371 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicBFS.hpp +72 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicBellmanFord.hpp +88 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicMatchingCoarsening.hpp +96 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicPageRank.hpp +145 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicSpanningEdgeCentrality.hpp +122 -0
- package/vendor/include/networkit/algebraic/algorithms/AlgebraicTriangleCounting.hpp +76 -0
- package/vendor/include/networkit/auxiliary/AlignedAllocator.hpp +113 -0
- package/vendor/include/networkit/auxiliary/ArrayTools.hpp +85 -0
- package/vendor/include/networkit/auxiliary/BloomFilter.hpp +70 -0
- package/vendor/include/networkit/auxiliary/BucketPQ.hpp +142 -0
- package/vendor/include/networkit/auxiliary/Enforce.hpp +117 -0
- package/vendor/include/networkit/auxiliary/FunctionTraits.hpp +74 -0
- package/vendor/include/networkit/auxiliary/HashUtils.hpp +28 -0
- package/vendor/include/networkit/auxiliary/IncrementalUniformRandomSelector.hpp +52 -0
- package/vendor/include/networkit/auxiliary/Log.hpp +119 -0
- package/vendor/include/networkit/auxiliary/MissingMath.hpp +48 -0
- package/vendor/include/networkit/auxiliary/Multiprecision.hpp +17 -0
- package/vendor/include/networkit/auxiliary/NumberParsing.hpp +307 -0
- package/vendor/include/networkit/auxiliary/NumericTools.hpp +57 -0
- package/vendor/include/networkit/auxiliary/Parallel.hpp +56 -0
- package/vendor/include/networkit/auxiliary/Parallelism.hpp +33 -0
- package/vendor/include/networkit/auxiliary/PrioQueue.hpp +252 -0
- package/vendor/include/networkit/auxiliary/Random.hpp +122 -0
- package/vendor/include/networkit/auxiliary/SetIntersector.hpp +72 -0
- package/vendor/include/networkit/auxiliary/SignalHandling.hpp +39 -0
- package/vendor/include/networkit/auxiliary/SortedList.hpp +128 -0
- package/vendor/include/networkit/auxiliary/SparseVector.hpp +215 -0
- package/vendor/include/networkit/auxiliary/SpinLock.hpp +23 -0
- package/vendor/include/networkit/auxiliary/StringBuilder.hpp +322 -0
- package/vendor/include/networkit/auxiliary/StringTools.hpp +76 -0
- package/vendor/include/networkit/auxiliary/TemplateUtils.hpp +76 -0
- package/vendor/include/networkit/auxiliary/Timer.hpp +145 -0
- package/vendor/include/networkit/auxiliary/VectorComparator.hpp +32 -0
- package/vendor/include/networkit/base/Algorithm.hpp +41 -0
- package/vendor/include/networkit/base/DynAlgorithm.hpp +31 -0
- package/vendor/include/networkit/centrality/ApproxBetweenness.hpp +62 -0
- package/vendor/include/networkit/centrality/ApproxCloseness.hpp +136 -0
- package/vendor/include/networkit/centrality/ApproxElectricalCloseness.hpp +156 -0
- package/vendor/include/networkit/centrality/ApproxGroupBetweenness.hpp +124 -0
- package/vendor/include/networkit/centrality/ApproxSpanningEdge.hpp +84 -0
- package/vendor/include/networkit/centrality/Betweenness.hpp +47 -0
- package/vendor/include/networkit/centrality/Centrality.hpp +98 -0
- package/vendor/include/networkit/centrality/Closeness.hpp +107 -0
- package/vendor/include/networkit/centrality/ComplexPaths.hpp +113 -0
- package/vendor/include/networkit/centrality/CoreDecomposition.hpp +161 -0
- package/vendor/include/networkit/centrality/DegreeCentrality.hpp +55 -0
- package/vendor/include/networkit/centrality/DynApproxBetweenness.hpp +95 -0
- package/vendor/include/networkit/centrality/DynBetweenness.hpp +99 -0
- package/vendor/include/networkit/centrality/DynBetweennessOneNode.hpp +98 -0
- package/vendor/include/networkit/centrality/DynKatzCentrality.hpp +115 -0
- package/vendor/include/networkit/centrality/DynTopHarmonicCloseness.hpp +223 -0
- package/vendor/include/networkit/centrality/EigenvectorCentrality.hpp +41 -0
- package/vendor/include/networkit/centrality/EstimateBetweenness.hpp +51 -0
- package/vendor/include/networkit/centrality/ForestCentrality.hpp +112 -0
- package/vendor/include/networkit/centrality/GedWalk.hpp +225 -0
- package/vendor/include/networkit/centrality/GroupCloseness.hpp +115 -0
- package/vendor/include/networkit/centrality/GroupClosenessGrowShrink.hpp +78 -0
- package/vendor/include/networkit/centrality/GroupClosenessLocalSearch.hpp +77 -0
- package/vendor/include/networkit/centrality/GroupClosenessLocalSwaps.hpp +106 -0
- package/vendor/include/networkit/centrality/GroupDegree.hpp +155 -0
- package/vendor/include/networkit/centrality/GroupHarmonicCloseness.hpp +83 -0
- package/vendor/include/networkit/centrality/HarmonicCloseness.hpp +48 -0
- package/vendor/include/networkit/centrality/KPathCentrality.hpp +52 -0
- package/vendor/include/networkit/centrality/KadabraBetweenness.hpp +242 -0
- package/vendor/include/networkit/centrality/KatzCentrality.hpp +62 -0
- package/vendor/include/networkit/centrality/LaplacianCentrality.hpp +44 -0
- package/vendor/include/networkit/centrality/LocalClusteringCoefficient.hpp +60 -0
- package/vendor/include/networkit/centrality/LocalPartitionCoverage.hpp +43 -0
- package/vendor/include/networkit/centrality/LocalSquareClusteringCoefficient.hpp +42 -0
- package/vendor/include/networkit/centrality/PageRank.hpp +101 -0
- package/vendor/include/networkit/centrality/PermanenceCentrality.hpp +48 -0
- package/vendor/include/networkit/centrality/Sfigality.hpp +45 -0
- package/vendor/include/networkit/centrality/SpanningEdgeCentrality.hpp +86 -0
- package/vendor/include/networkit/centrality/TopCloseness.hpp +136 -0
- package/vendor/include/networkit/centrality/TopHarmonicCloseness.hpp +151 -0
- package/vendor/include/networkit/clique/MaximalCliques.hpp +83 -0
- package/vendor/include/networkit/coarsening/ClusteringProjector.hpp +59 -0
- package/vendor/include/networkit/coarsening/CoarsenedGraphView.hpp +156 -0
- package/vendor/include/networkit/coarsening/GraphCoarsening.hpp +57 -0
- package/vendor/include/networkit/coarsening/MatchingCoarsening.hpp +43 -0
- package/vendor/include/networkit/coarsening/ParallelPartitionCoarsening.hpp +33 -0
- package/vendor/include/networkit/coarsening/ParallelPartitionCoarseningView.hpp +62 -0
- package/vendor/include/networkit/community/AdjustedRandMeasure.hpp +31 -0
- package/vendor/include/networkit/community/ClusteringGenerator.hpp +75 -0
- package/vendor/include/networkit/community/CommunityDetectionAlgorithm.hpp +58 -0
- package/vendor/include/networkit/community/Conductance.hpp +32 -0
- package/vendor/include/networkit/community/CoverF1Similarity.hpp +53 -0
- package/vendor/include/networkit/community/CoverHubDominance.hpp +38 -0
- package/vendor/include/networkit/community/Coverage.hpp +25 -0
- package/vendor/include/networkit/community/CutClustering.hpp +62 -0
- package/vendor/include/networkit/community/DissimilarityMeasure.hpp +31 -0
- package/vendor/include/networkit/community/DynamicNMIDistance.hpp +44 -0
- package/vendor/include/networkit/community/EdgeCut.hpp +24 -0
- package/vendor/include/networkit/community/GraphClusteringTools.hpp +103 -0
- package/vendor/include/networkit/community/GraphStructuralRandMeasure.hpp +28 -0
- package/vendor/include/networkit/community/HubDominance.hpp +46 -0
- package/vendor/include/networkit/community/IntrapartitionDensity.hpp +44 -0
- package/vendor/include/networkit/community/IsolatedInterpartitionConductance.hpp +40 -0
- package/vendor/include/networkit/community/IsolatedInterpartitionExpansion.hpp +40 -0
- package/vendor/include/networkit/community/JaccardMeasure.hpp +25 -0
- package/vendor/include/networkit/community/LFM.hpp +49 -0
- package/vendor/include/networkit/community/LPDegreeOrdered.hpp +48 -0
- package/vendor/include/networkit/community/LocalCommunityEvaluation.hpp +100 -0
- package/vendor/include/networkit/community/LocalCoverEvaluation.hpp +31 -0
- package/vendor/include/networkit/community/LocalPartitionEvaluation.hpp +31 -0
- package/vendor/include/networkit/community/LouvainMapEquation.hpp +135 -0
- package/vendor/include/networkit/community/Modularity.hpp +54 -0
- package/vendor/include/networkit/community/NMIDistance.hpp +28 -0
- package/vendor/include/networkit/community/NodeStructuralRandMeasure.hpp +27 -0
- package/vendor/include/networkit/community/OverlappingCommunityDetectionAlgorithm.hpp +51 -0
- package/vendor/include/networkit/community/OverlappingNMIDistance.hpp +175 -0
- package/vendor/include/networkit/community/PLM.hpp +89 -0
- package/vendor/include/networkit/community/PLP.hpp +83 -0
- package/vendor/include/networkit/community/ParallelAgglomerativeClusterer.hpp +37 -0
- package/vendor/include/networkit/community/ParallelLeiden.hpp +96 -0
- package/vendor/include/networkit/community/ParallelLeidenView.hpp +138 -0
- package/vendor/include/networkit/community/PartitionFragmentation.hpp +30 -0
- package/vendor/include/networkit/community/PartitionHubDominance.hpp +37 -0
- package/vendor/include/networkit/community/PartitionIntersection.hpp +25 -0
- package/vendor/include/networkit/community/QualityMeasure.hpp +27 -0
- package/vendor/include/networkit/community/SampledGraphStructuralRandMeasure.hpp +40 -0
- package/vendor/include/networkit/community/SampledNodeStructuralRandMeasure.hpp +40 -0
- package/vendor/include/networkit/community/StablePartitionNodes.hpp +48 -0
- package/vendor/include/networkit/components/BiconnectedComponents.hpp +116 -0
- package/vendor/include/networkit/components/ComponentDecomposition.hpp +72 -0
- package/vendor/include/networkit/components/ConnectedComponents.hpp +55 -0
- package/vendor/include/networkit/components/DynConnectedComponents.hpp +71 -0
- package/vendor/include/networkit/components/DynWeaklyConnectedComponents.hpp +73 -0
- package/vendor/include/networkit/components/ParallelConnectedComponents.hpp +44 -0
- package/vendor/include/networkit/components/RandomSpanningForest.hpp +36 -0
- package/vendor/include/networkit/components/StronglyConnectedComponents.hpp +50 -0
- package/vendor/include/networkit/components/WeaklyConnectedComponents.hpp +59 -0
- package/vendor/include/networkit/correlation/Assortativity.hpp +64 -0
- package/vendor/include/networkit/distance/APSP.hpp +70 -0
- package/vendor/include/networkit/distance/AStar.hpp +68 -0
- package/vendor/include/networkit/distance/AStarGeneral.hpp +110 -0
- package/vendor/include/networkit/distance/AdamicAdarDistance.hpp +52 -0
- package/vendor/include/networkit/distance/AffectedNodes.hpp +130 -0
- package/vendor/include/networkit/distance/AlgebraicDistance.hpp +63 -0
- package/vendor/include/networkit/distance/BFS.hpp +43 -0
- package/vendor/include/networkit/distance/BidirectionalBFS.hpp +51 -0
- package/vendor/include/networkit/distance/BidirectionalDijkstra.hpp +69 -0
- package/vendor/include/networkit/distance/CommuteTimeDistance.hpp +89 -0
- package/vendor/include/networkit/distance/Diameter.hpp +97 -0
- package/vendor/include/networkit/distance/Dijkstra.hpp +50 -0
- package/vendor/include/networkit/distance/DynAPSP.hpp +67 -0
- package/vendor/include/networkit/distance/DynBFS.hpp +56 -0
- package/vendor/include/networkit/distance/DynDijkstra.hpp +57 -0
- package/vendor/include/networkit/distance/DynPrunedLandmarkLabeling.hpp +67 -0
- package/vendor/include/networkit/distance/DynSSSP.hpp +87 -0
- package/vendor/include/networkit/distance/Eccentricity.hpp +32 -0
- package/vendor/include/networkit/distance/EffectiveDiameter.hpp +47 -0
- package/vendor/include/networkit/distance/EffectiveDiameterApproximation.hpp +57 -0
- package/vendor/include/networkit/distance/FloydWarshall.hpp +93 -0
- package/vendor/include/networkit/distance/GraphDistance.hpp +49 -0
- package/vendor/include/networkit/distance/HopPlotApproximation.hpp +62 -0
- package/vendor/include/networkit/distance/IncompleteDijkstra.hpp +66 -0
- package/vendor/include/networkit/distance/IncompleteSSSP.hpp +41 -0
- package/vendor/include/networkit/distance/JaccardDistance.hpp +57 -0
- package/vendor/include/networkit/distance/MultiTargetBFS.hpp +32 -0
- package/vendor/include/networkit/distance/MultiTargetDijkstra.hpp +40 -0
- package/vendor/include/networkit/distance/NeighborhoodFunction.hpp +47 -0
- package/vendor/include/networkit/distance/NeighborhoodFunctionApproximation.hpp +56 -0
- package/vendor/include/networkit/distance/NeighborhoodFunctionHeuristic.hpp +56 -0
- package/vendor/include/networkit/distance/NodeDistance.hpp +54 -0
- package/vendor/include/networkit/distance/PrunedLandmarkLabeling.hpp +76 -0
- package/vendor/include/networkit/distance/ReverseBFS.hpp +46 -0
- package/vendor/include/networkit/distance/SPSP.hpp +143 -0
- package/vendor/include/networkit/distance/SSSP.hpp +216 -0
- package/vendor/include/networkit/distance/STSP.hpp +193 -0
- package/vendor/include/networkit/distance/Volume.hpp +66 -0
- package/vendor/include/networkit/dynamics/DGSStreamParser.hpp +40 -0
- package/vendor/include/networkit/dynamics/DGSWriter.hpp +30 -0
- package/vendor/include/networkit/dynamics/GraphDifference.hpp +110 -0
- package/vendor/include/networkit/dynamics/GraphEvent.hpp +55 -0
- package/vendor/include/networkit/dynamics/GraphEventHandler.hpp +39 -0
- package/vendor/include/networkit/dynamics/GraphEventProxy.hpp +55 -0
- package/vendor/include/networkit/dynamics/GraphUpdater.hpp +38 -0
- package/vendor/include/networkit/edgescores/ChibaNishizekiQuadrangleEdgeScore.hpp +26 -0
- package/vendor/include/networkit/edgescores/ChibaNishizekiTriangleEdgeScore.hpp +33 -0
- package/vendor/include/networkit/edgescores/EdgeScore.hpp +50 -0
- package/vendor/include/networkit/edgescores/EdgeScoreAsWeight.hpp +33 -0
- package/vendor/include/networkit/edgescores/EdgeScoreBlender.hpp +33 -0
- package/vendor/include/networkit/edgescores/EdgeScoreLinearizer.hpp +32 -0
- package/vendor/include/networkit/edgescores/EdgeScoreNormalizer.hpp +35 -0
- package/vendor/include/networkit/edgescores/GeometricMeanScore.hpp +29 -0
- package/vendor/include/networkit/edgescores/PrefixJaccardScore.hpp +23 -0
- package/vendor/include/networkit/edgescores/TriangleEdgeScore.hpp +39 -0
- package/vendor/include/networkit/embedding/Node2Vec.hpp +83 -0
- package/vendor/include/networkit/flow/EdmondsKarp.hpp +112 -0
- package/vendor/include/networkit/generators/BarabasiAlbertGenerator.hpp +87 -0
- package/vendor/include/networkit/generators/ChungLuGenerator.hpp +46 -0
- package/vendor/include/networkit/generators/ChungLuGeneratorAlamEtAl.hpp +63 -0
- package/vendor/include/networkit/generators/ClusteredRandomGraphGenerator.hpp +56 -0
- package/vendor/include/networkit/generators/ConfigurationModel.hpp +36 -0
- package/vendor/include/networkit/generators/DorogovtsevMendesGenerator.hpp +33 -0
- package/vendor/include/networkit/generators/DynamicBarabasiAlbertGenerator.hpp +33 -0
- package/vendor/include/networkit/generators/DynamicDGSParser.hpp +51 -0
- package/vendor/include/networkit/generators/DynamicDorogovtsevMendesGenerator.hpp +34 -0
- package/vendor/include/networkit/generators/DynamicForestFireGenerator.hpp +55 -0
- package/vendor/include/networkit/generators/DynamicGraphGenerator.hpp +40 -0
- package/vendor/include/networkit/generators/DynamicGraphSource.hpp +79 -0
- package/vendor/include/networkit/generators/DynamicHyperbolicGenerator.hpp +143 -0
- package/vendor/include/networkit/generators/DynamicPathGenerator.hpp +26 -0
- package/vendor/include/networkit/generators/DynamicPubWebGenerator.hpp +54 -0
- package/vendor/include/networkit/generators/EdgeSwitchingMarkovChainGenerator.hpp +65 -0
- package/vendor/include/networkit/generators/ErdosRenyiEnumerator.hpp +318 -0
- package/vendor/include/networkit/generators/ErdosRenyiGenerator.hpp +56 -0
- package/vendor/include/networkit/generators/HavelHakimiGenerator.hpp +48 -0
- package/vendor/include/networkit/generators/HyperbolicGenerator.hpp +236 -0
- package/vendor/include/networkit/generators/LFRGenerator.hpp +175 -0
- package/vendor/include/networkit/generators/MocnikGenerator.hpp +147 -0
- package/vendor/include/networkit/generators/MocnikGeneratorBasic.hpp +58 -0
- package/vendor/include/networkit/generators/PowerlawDegreeSequence.hpp +128 -0
- package/vendor/include/networkit/generators/PubWebGenerator.hpp +94 -0
- package/vendor/include/networkit/generators/RegularRingLatticeGenerator.hpp +37 -0
- package/vendor/include/networkit/generators/RmatGenerator.hpp +67 -0
- package/vendor/include/networkit/generators/StaticDegreeSequenceGenerator.hpp +42 -0
- package/vendor/include/networkit/generators/StaticGraphGenerator.hpp +30 -0
- package/vendor/include/networkit/generators/StochasticBlockmodel.hpp +41 -0
- package/vendor/include/networkit/generators/WattsStrogatzGenerator.hpp +43 -0
- package/vendor/include/networkit/generators/quadtree/QuadNode.hpp +857 -0
- package/vendor/include/networkit/generators/quadtree/QuadNodeCartesianEuclid.hpp +587 -0
- package/vendor/include/networkit/generators/quadtree/QuadNodePolarEuclid.hpp +726 -0
- package/vendor/include/networkit/generators/quadtree/Quadtree.hpp +232 -0
- package/vendor/include/networkit/generators/quadtree/QuadtreeCartesianEuclid.hpp +149 -0
- package/vendor/include/networkit/generators/quadtree/QuadtreePolarEuclid.hpp +143 -0
- package/vendor/include/networkit/geometric/HyperbolicSpace.hpp +248 -0
- package/vendor/include/networkit/geometric/Point2DWithIndex.hpp +145 -0
- package/vendor/include/networkit/global/ClusteringCoefficient.hpp +42 -0
- package/vendor/include/networkit/global/GlobalClusteringCoefficient.hpp +24 -0
- package/vendor/include/networkit/graph/Attributes.hpp +568 -0
- package/vendor/include/networkit/graph/BFS.hpp +111 -0
- package/vendor/include/networkit/graph/DFS.hpp +71 -0
- package/vendor/include/networkit/graph/Dijkstra.hpp +83 -0
- package/vendor/include/networkit/graph/EdgeIterators.hpp +171 -0
- package/vendor/include/networkit/graph/Graph.hpp +2083 -0
- package/vendor/include/networkit/graph/GraphBuilder.hpp +289 -0
- package/vendor/include/networkit/graph/GraphR.hpp +133 -0
- package/vendor/include/networkit/graph/GraphTools.hpp +589 -0
- package/vendor/include/networkit/graph/GraphW.hpp +1236 -0
- package/vendor/include/networkit/graph/KruskalMSF.hpp +50 -0
- package/vendor/include/networkit/graph/NeighborIterators.hpp +163 -0
- package/vendor/include/networkit/graph/NodeIterators.hpp +127 -0
- package/vendor/include/networkit/graph/PrimMSF.hpp +66 -0
- package/vendor/include/networkit/graph/RandomMaximumSpanningForest.hpp +133 -0
- package/vendor/include/networkit/graph/SpanningForest.hpp +41 -0
- package/vendor/include/networkit/graph/TopologicalSort.hpp +87 -0
- package/vendor/include/networkit/graph/UnionMaximumSpanningForest.hpp +126 -0
- package/vendor/include/networkit/graph/test/GraphBuilderBenchmark.hpp +68 -0
- package/vendor/include/networkit/independentset/IndependentSetFinder.hpp +44 -0
- package/vendor/include/networkit/independentset/Luby.hpp +27 -0
- package/vendor/include/networkit/io/BinaryEdgeListPartitionReader.hpp +45 -0
- package/vendor/include/networkit/io/BinaryEdgeListPartitionWriter.hpp +47 -0
- package/vendor/include/networkit/io/BinaryPartitionReader.hpp +41 -0
- package/vendor/include/networkit/io/BinaryPartitionWriter.hpp +44 -0
- package/vendor/include/networkit/io/CoverReader.hpp +27 -0
- package/vendor/include/networkit/io/CoverWriter.hpp +21 -0
- package/vendor/include/networkit/io/DGSReader.hpp +39 -0
- package/vendor/include/networkit/io/DibapGraphReader.hpp +43 -0
- package/vendor/include/networkit/io/DotGraphWriter.hpp +39 -0
- package/vendor/include/networkit/io/DotPartitionWriter.hpp +23 -0
- package/vendor/include/networkit/io/DynamicGraphReader.hpp +29 -0
- package/vendor/include/networkit/io/EdgeListCoverReader.hpp +35 -0
- package/vendor/include/networkit/io/EdgeListPartitionReader.hpp +43 -0
- package/vendor/include/networkit/io/EdgeListReader.hpp +61 -0
- package/vendor/include/networkit/io/EdgeListWriter.hpp +48 -0
- package/vendor/include/networkit/io/GMLGraphReader.hpp +33 -0
- package/vendor/include/networkit/io/GMLGraphWriter.hpp +33 -0
- package/vendor/include/networkit/io/GraphIO.hpp +52 -0
- package/vendor/include/networkit/io/GraphReader.hpp +40 -0
- package/vendor/include/networkit/io/GraphToolBinaryReader.hpp +71 -0
- package/vendor/include/networkit/io/GraphToolBinaryWriter.hpp +61 -0
- package/vendor/include/networkit/io/GraphWriter.hpp +27 -0
- package/vendor/include/networkit/io/KONECTGraphReader.hpp +44 -0
- package/vendor/include/networkit/io/LineFileReader.hpp +42 -0
- package/vendor/include/networkit/io/METISGraphReader.hpp +36 -0
- package/vendor/include/networkit/io/METISGraphWriter.hpp +29 -0
- package/vendor/include/networkit/io/METISParser.hpp +63 -0
- package/vendor/include/networkit/io/MTXGraphReader.hpp +31 -0
- package/vendor/include/networkit/io/MTXParser.hpp +87 -0
- package/vendor/include/networkit/io/MatrixMarketReader.hpp +33 -0
- package/vendor/include/networkit/io/MatrixReader.hpp +33 -0
- package/vendor/include/networkit/io/MemoryMappedFile.hpp +80 -0
- package/vendor/include/networkit/io/NetworkitBinaryGraph.hpp +144 -0
- package/vendor/include/networkit/io/NetworkitBinaryReader.hpp +50 -0
- package/vendor/include/networkit/io/NetworkitBinaryWriter.hpp +71 -0
- package/vendor/include/networkit/io/PartitionReader.hpp +34 -0
- package/vendor/include/networkit/io/PartitionWriter.hpp +31 -0
- package/vendor/include/networkit/io/RBGraphReader.hpp +37 -0
- package/vendor/include/networkit/io/RBMatrixReader.hpp +49 -0
- package/vendor/include/networkit/io/RasterReader.hpp +40 -0
- package/vendor/include/networkit/io/SNAPEdgeListPartitionReader.hpp +28 -0
- package/vendor/include/networkit/io/SNAPGraphReader.hpp +53 -0
- package/vendor/include/networkit/io/SNAPGraphWriter.hpp +53 -0
- package/vendor/include/networkit/io/ThrillGraphBinaryReader.hpp +44 -0
- package/vendor/include/networkit/io/ThrillGraphBinaryWriter.hpp +27 -0
- package/vendor/include/networkit/layout/LayoutAlgorithm.hpp +39 -0
- package/vendor/include/networkit/linkprediction/AdamicAdarIndex.hpp +37 -0
- package/vendor/include/networkit/linkprediction/AdjustedRandIndex.hpp +36 -0
- package/vendor/include/networkit/linkprediction/AlgebraicDistanceIndex.hpp +70 -0
- package/vendor/include/networkit/linkprediction/CommonNeighborsIndex.hpp +39 -0
- package/vendor/include/networkit/linkprediction/EvaluationMetric.hpp +135 -0
- package/vendor/include/networkit/linkprediction/JaccardIndex.hpp +44 -0
- package/vendor/include/networkit/linkprediction/KatzIndex.hpp +84 -0
- package/vendor/include/networkit/linkprediction/LinkPredictor.hpp +98 -0
- package/vendor/include/networkit/linkprediction/LinkThresholder.hpp +56 -0
- package/vendor/include/networkit/linkprediction/MissingLinksFinder.hpp +60 -0
- package/vendor/include/networkit/linkprediction/NeighborhoodDistanceIndex.hpp +42 -0
- package/vendor/include/networkit/linkprediction/NeighborhoodUtility.hpp +54 -0
- package/vendor/include/networkit/linkprediction/NeighborsMeasureIndex.hpp +48 -0
- package/vendor/include/networkit/linkprediction/PrecisionRecallMetric.hpp +40 -0
- package/vendor/include/networkit/linkprediction/PredictionsSorter.hpp +66 -0
- package/vendor/include/networkit/linkprediction/PreferentialAttachmentIndex.hpp +37 -0
- package/vendor/include/networkit/linkprediction/ROCMetric.hpp +39 -0
- package/vendor/include/networkit/linkprediction/RandomLinkSampler.hpp +47 -0
- package/vendor/include/networkit/linkprediction/ResourceAllocationIndex.hpp +38 -0
- package/vendor/include/networkit/linkprediction/SameCommunityIndex.hpp +50 -0
- package/vendor/include/networkit/linkprediction/TotalNeighborsIndex.hpp +39 -0
- package/vendor/include/networkit/linkprediction/UDegreeIndex.hpp +35 -0
- package/vendor/include/networkit/linkprediction/VDegreeIndex.hpp +35 -0
- package/vendor/include/networkit/matching/BMatcher.hpp +52 -0
- package/vendor/include/networkit/matching/BMatching.hpp +115 -0
- package/vendor/include/networkit/matching/BSuitorMatcher.hpp +170 -0
- package/vendor/include/networkit/matching/DynamicBSuitorMatcher.hpp +78 -0
- package/vendor/include/networkit/matching/LocalMaxMatcher.hpp +35 -0
- package/vendor/include/networkit/matching/Matcher.hpp +55 -0
- package/vendor/include/networkit/matching/Matching.hpp +111 -0
- package/vendor/include/networkit/matching/PathGrowingMatcher.hpp +46 -0
- package/vendor/include/networkit/matching/SuitorMatcher.hpp +62 -0
- package/vendor/include/networkit/numerics/ConjugateGradient.hpp +163 -0
- package/vendor/include/networkit/numerics/GaussSeidelRelaxation.hpp +99 -0
- package/vendor/include/networkit/numerics/LAMG/LAMGSettings.hpp +70 -0
- package/vendor/include/networkit/numerics/LAMG/Lamg.hpp +460 -0
- package/vendor/include/networkit/numerics/LAMG/Level/EliminationStage.hpp +47 -0
- package/vendor/include/networkit/numerics/LAMG/Level/Level.hpp +56 -0
- package/vendor/include/networkit/numerics/LAMG/Level/LevelAggregation.hpp +52 -0
- package/vendor/include/networkit/numerics/LAMG/Level/LevelElimination.hpp +133 -0
- package/vendor/include/networkit/numerics/LAMG/Level/LevelFinest.hpp +28 -0
- package/vendor/include/networkit/numerics/LAMG/LevelHierarchy.hpp +165 -0
- package/vendor/include/networkit/numerics/LAMG/MultiLevelSetup.hpp +1090 -0
- package/vendor/include/networkit/numerics/LAMG/SolverLamg.hpp +316 -0
- package/vendor/include/networkit/numerics/LinearSolver.hpp +151 -0
- package/vendor/include/networkit/numerics/Preconditioner/DiagonalPreconditioner.hpp +61 -0
- package/vendor/include/networkit/numerics/Preconditioner/IdentityPreconditioner.hpp +36 -0
- package/vendor/include/networkit/numerics/Smoother.hpp +37 -0
- package/vendor/include/networkit/overlap/HashingOverlapper.hpp +28 -0
- package/vendor/include/networkit/overlap/Overlapper.hpp +27 -0
- package/vendor/include/networkit/planarity/LeftRightPlanarityCheck.hpp +113 -0
- package/vendor/include/networkit/randomization/Curveball.hpp +49 -0
- package/vendor/include/networkit/randomization/CurveballGlobalTradeGenerator.hpp +39 -0
- package/vendor/include/networkit/randomization/CurveballUniformTradeGenerator.hpp +39 -0
- package/vendor/include/networkit/randomization/DegreePreservingShuffle.hpp +82 -0
- package/vendor/include/networkit/randomization/EdgeSwitching.hpp +157 -0
- package/vendor/include/networkit/randomization/GlobalCurveball.hpp +69 -0
- package/vendor/include/networkit/randomization/GlobalTradeSequence.hpp +303 -0
- package/vendor/include/networkit/reachability/AllSimplePaths.hpp +122 -0
- package/vendor/include/networkit/reachability/ReachableNodes.hpp +83 -0
- package/vendor/include/networkit/scd/ApproximatePageRank.hpp +51 -0
- package/vendor/include/networkit/scd/CliqueDetect.hpp +55 -0
- package/vendor/include/networkit/scd/CombinedSCD.hpp +51 -0
- package/vendor/include/networkit/scd/GCE.hpp +42 -0
- package/vendor/include/networkit/scd/LFMLocal.hpp +54 -0
- package/vendor/include/networkit/scd/LocalT.hpp +40 -0
- package/vendor/include/networkit/scd/LocalTightnessExpansion.hpp +46 -0
- package/vendor/include/networkit/scd/PageRankNibble.hpp +55 -0
- package/vendor/include/networkit/scd/RandomBFS.hpp +33 -0
- package/vendor/include/networkit/scd/SCDGroundTruthComparison.hpp +121 -0
- package/vendor/include/networkit/scd/SelectiveCommunityDetector.hpp +76 -0
- package/vendor/include/networkit/scd/SetConductance.hpp +47 -0
- package/vendor/include/networkit/scd/TCE.hpp +41 -0
- package/vendor/include/networkit/scd/TwoPhaseL.hpp +40 -0
- package/vendor/include/networkit/scoring/EdgeScoring.hpp +44 -0
- package/vendor/include/networkit/scoring/ModularityScoring.hpp +79 -0
- package/vendor/include/networkit/simulation/EpidemicSimulationSEIR.hpp +59 -0
- package/vendor/include/networkit/sparsification/ChanceCorrectedTriangleScore.hpp +28 -0
- package/vendor/include/networkit/sparsification/ForestFireScore.hpp +34 -0
- package/vendor/include/networkit/sparsification/GlobalThresholdFilter.hpp +40 -0
- package/vendor/include/networkit/sparsification/LocalDegreeScore.hpp +30 -0
- package/vendor/include/networkit/sparsification/LocalFilterScore.hpp +124 -0
- package/vendor/include/networkit/sparsification/LocalSimilarityScore.hpp +63 -0
- package/vendor/include/networkit/sparsification/MultiscaleScore.hpp +38 -0
- package/vendor/include/networkit/sparsification/RandomEdgeScore.hpp +33 -0
- package/vendor/include/networkit/sparsification/RandomNodeEdgeScore.hpp +29 -0
- package/vendor/include/networkit/sparsification/SCANStructuralSimilarityScore.hpp +23 -0
- package/vendor/include/networkit/sparsification/SimmelianOverlapScore.hpp +35 -0
- package/vendor/include/networkit/sparsification/SimmelianScore.hpp +92 -0
- package/vendor/include/networkit/sparsification/Sparsifiers.hpp +166 -0
- package/vendor/include/networkit/structures/Cover.hpp +248 -0
- package/vendor/include/networkit/structures/LocalCommunity.hpp +363 -0
- package/vendor/include/networkit/structures/Partition.hpp +335 -0
- package/vendor/include/networkit/structures/UnionFind.hpp +66 -0
- package/vendor/include/networkit/viz/GraphLayoutAlgorithm.hpp +157 -0
- package/vendor/include/networkit/viz/MaxentStress.hpp +346 -0
- package/vendor/include/networkit/viz/Octree.hpp +428 -0
- package/vendor/include/networkit/viz/PivotMDS.hpp +63 -0
- package/vendor/include/networkit/viz/Point.hpp +415 -0
- package/vendor/include/networkit/viz/PostscriptWriter.hpp +78 -0
- package/vendor/include/tlx/algorithm/exclusive_scan.hpp +56 -0
- package/vendor/include/tlx/algorithm/is_sorted_cmp.hpp +56 -0
- package/vendor/include/tlx/algorithm/merge_advance.hpp +177 -0
- package/vendor/include/tlx/algorithm/merge_combine.hpp +76 -0
- package/vendor/include/tlx/algorithm/multisequence_partition.hpp +346 -0
- package/vendor/include/tlx/algorithm/multisequence_selection.hpp +351 -0
- package/vendor/include/tlx/algorithm/multiway_merge.hpp +1385 -0
- package/vendor/include/tlx/algorithm/multiway_merge_splitting.hpp +257 -0
- package/vendor/include/tlx/algorithm/parallel_multiway_merge.hpp +408 -0
- package/vendor/include/tlx/algorithm/random_bipartition_shuffle.hpp +116 -0
- package/vendor/include/tlx/algorithm.hpp +36 -0
- package/vendor/include/tlx/allocator_base.hpp +100 -0
- package/vendor/include/tlx/backtrace.hpp +54 -0
- package/vendor/include/tlx/cmdline_parser.hpp +498 -0
- package/vendor/include/tlx/container/btree.hpp +3977 -0
- package/vendor/include/tlx/container/btree_map.hpp +634 -0
- package/vendor/include/tlx/container/btree_multimap.hpp +627 -0
- package/vendor/include/tlx/container/btree_multiset.hpp +612 -0
- package/vendor/include/tlx/container/btree_set.hpp +612 -0
- package/vendor/include/tlx/container/d_ary_addressable_int_heap.hpp +416 -0
- package/vendor/include/tlx/container/d_ary_heap.hpp +311 -0
- package/vendor/include/tlx/container/loser_tree.hpp +1009 -0
- package/vendor/include/tlx/container/lru_cache.hpp +319 -0
- package/vendor/include/tlx/container/radix_heap.hpp +735 -0
- package/vendor/include/tlx/container/ring_buffer.hpp +428 -0
- package/vendor/include/tlx/container/simple_vector.hpp +304 -0
- package/vendor/include/tlx/container/splay_tree.hpp +399 -0
- package/vendor/include/tlx/container/string_view.hpp +805 -0
- package/vendor/include/tlx/container.hpp +40 -0
- package/vendor/include/tlx/counting_ptr.hpp +522 -0
- package/vendor/include/tlx/define/attribute_always_inline.hpp +34 -0
- package/vendor/include/tlx/define/attribute_fallthrough.hpp +36 -0
- package/vendor/include/tlx/define/attribute_format_printf.hpp +34 -0
- package/vendor/include/tlx/define/attribute_packed.hpp +34 -0
- package/vendor/include/tlx/define/attribute_warn_unused_result.hpp +34 -0
- package/vendor/include/tlx/define/constexpr.hpp +31 -0
- package/vendor/include/tlx/define/deprecated.hpp +39 -0
- package/vendor/include/tlx/define/endian.hpp +49 -0
- package/vendor/include/tlx/define/likely.hpp +33 -0
- package/vendor/include/tlx/define/visibility_hidden.hpp +34 -0
- package/vendor/include/tlx/define.hpp +36 -0
- package/vendor/include/tlx/delegate.hpp +524 -0
- package/vendor/include/tlx/die/core.hpp +311 -0
- package/vendor/include/tlx/die.hpp +106 -0
- package/vendor/include/tlx/digest/md5.hpp +81 -0
- package/vendor/include/tlx/digest/sha1.hpp +81 -0
- package/vendor/include/tlx/digest/sha256.hpp +81 -0
- package/vendor/include/tlx/digest/sha512.hpp +81 -0
- package/vendor/include/tlx/digest.hpp +30 -0
- package/vendor/include/tlx/logger/all.hpp +33 -0
- package/vendor/include/tlx/logger/array.hpp +43 -0
- package/vendor/include/tlx/logger/core.hpp +287 -0
- package/vendor/include/tlx/logger/deque.hpp +42 -0
- package/vendor/include/tlx/logger/map.hpp +65 -0
- package/vendor/include/tlx/logger/set.hpp +60 -0
- package/vendor/include/tlx/logger/tuple.hpp +66 -0
- package/vendor/include/tlx/logger/unordered_map.hpp +68 -0
- package/vendor/include/tlx/logger/unordered_set.hpp +64 -0
- package/vendor/include/tlx/logger/wrap_unprintable.hpp +75 -0
- package/vendor/include/tlx/logger.hpp +44 -0
- package/vendor/include/tlx/math/abs_diff.hpp +35 -0
- package/vendor/include/tlx/math/aggregate.hpp +231 -0
- package/vendor/include/tlx/math/aggregate_min_max.hpp +116 -0
- package/vendor/include/tlx/math/bswap.hpp +148 -0
- package/vendor/include/tlx/math/bswap_be.hpp +79 -0
- package/vendor/include/tlx/math/bswap_le.hpp +79 -0
- package/vendor/include/tlx/math/clz.hpp +174 -0
- package/vendor/include/tlx/math/ctz.hpp +174 -0
- package/vendor/include/tlx/math/div_ceil.hpp +36 -0
- package/vendor/include/tlx/math/ffs.hpp +123 -0
- package/vendor/include/tlx/math/integer_log2.hpp +189 -0
- package/vendor/include/tlx/math/is_power_of_two.hpp +74 -0
- package/vendor/include/tlx/math/polynomial_regression.hpp +243 -0
- package/vendor/include/tlx/math/popcount.hpp +173 -0
- package/vendor/include/tlx/math/power_to_the.hpp +44 -0
- package/vendor/include/tlx/math/rol.hpp +112 -0
- package/vendor/include/tlx/math/ror.hpp +112 -0
- package/vendor/include/tlx/math/round_to_power_of_two.hpp +121 -0
- package/vendor/include/tlx/math/round_up.hpp +36 -0
- package/vendor/include/tlx/math/sgn.hpp +38 -0
- package/vendor/include/tlx/math.hpp +46 -0
- package/vendor/include/tlx/meta/apply_tuple.hpp +55 -0
- package/vendor/include/tlx/meta/call_for_range.hpp +78 -0
- package/vendor/include/tlx/meta/call_foreach.hpp +60 -0
- package/vendor/include/tlx/meta/call_foreach_tuple.hpp +60 -0
- package/vendor/include/tlx/meta/call_foreach_tuple_with_index.hpp +61 -0
- package/vendor/include/tlx/meta/call_foreach_with_index.hpp +64 -0
- package/vendor/include/tlx/meta/enable_if.hpp +37 -0
- package/vendor/include/tlx/meta/fold_left.hpp +63 -0
- package/vendor/include/tlx/meta/fold_left_tuple.hpp +60 -0
- package/vendor/include/tlx/meta/fold_right.hpp +63 -0
- package/vendor/include/tlx/meta/fold_right_tuple.hpp +60 -0
- package/vendor/include/tlx/meta/function_chain.hpp +197 -0
- package/vendor/include/tlx/meta/function_stack.hpp +189 -0
- package/vendor/include/tlx/meta/has_member.hpp +80 -0
- package/vendor/include/tlx/meta/has_method.hpp +117 -0
- package/vendor/include/tlx/meta/index_sequence.hpp +66 -0
- package/vendor/include/tlx/meta/is_std_array.hpp +40 -0
- package/vendor/include/tlx/meta/is_std_pair.hpp +39 -0
- package/vendor/include/tlx/meta/is_std_tuple.hpp +39 -0
- package/vendor/include/tlx/meta/is_std_vector.hpp +39 -0
- package/vendor/include/tlx/meta/log2.hpp +101 -0
- package/vendor/include/tlx/meta/no_operation.hpp +55 -0
- package/vendor/include/tlx/meta/static_index.hpp +42 -0
- package/vendor/include/tlx/meta/vexpand.hpp +34 -0
- package/vendor/include/tlx/meta/vmap_for_range.hpp +84 -0
- package/vendor/include/tlx/meta/vmap_foreach.hpp +63 -0
- package/vendor/include/tlx/meta/vmap_foreach_tuple.hpp +59 -0
- package/vendor/include/tlx/meta/vmap_foreach_tuple_with_index.hpp +62 -0
- package/vendor/include/tlx/meta/vmap_foreach_with_index.hpp +70 -0
- package/vendor/include/tlx/meta.hpp +55 -0
- package/vendor/include/tlx/multi_timer.hpp +148 -0
- package/vendor/include/tlx/port/setenv.hpp +31 -0
- package/vendor/include/tlx/port.hpp +27 -0
- package/vendor/include/tlx/semaphore.hpp +119 -0
- package/vendor/include/tlx/simple_vector.hpp +20 -0
- package/vendor/include/tlx/siphash.hpp +282 -0
- package/vendor/include/tlx/sort/networks/best.hpp +611 -0
- package/vendor/include/tlx/sort/networks/bose_nelson.hpp +412 -0
- package/vendor/include/tlx/sort/networks/bose_nelson_parameter.hpp +507 -0
- package/vendor/include/tlx/sort/networks/cswap.hpp +60 -0
- package/vendor/include/tlx/sort/parallel_mergesort.hpp +398 -0
- package/vendor/include/tlx/sort/strings/insertion_sort.hpp +232 -0
- package/vendor/include/tlx/sort/strings/multikey_quicksort.hpp +185 -0
- package/vendor/include/tlx/sort/strings/parallel_sample_sort.hpp +1647 -0
- package/vendor/include/tlx/sort/strings/radix_sort.hpp +934 -0
- package/vendor/include/tlx/sort/strings/sample_sort_tools.hpp +756 -0
- package/vendor/include/tlx/sort/strings/string_ptr.hpp +426 -0
- package/vendor/include/tlx/sort/strings/string_set.hpp +800 -0
- package/vendor/include/tlx/sort/strings.hpp +329 -0
- package/vendor/include/tlx/sort/strings_parallel.hpp +325 -0
- package/vendor/include/tlx/sort.hpp +29 -0
- package/vendor/include/tlx/stack_allocator.hpp +226 -0
- package/vendor/include/tlx/string/appendline.hpp +35 -0
- package/vendor/include/tlx/string/base64.hpp +87 -0
- package/vendor/include/tlx/string/bitdump.hpp +139 -0
- package/vendor/include/tlx/string/compare_icase.hpp +42 -0
- package/vendor/include/tlx/string/contains.hpp +36 -0
- package/vendor/include/tlx/string/contains_word.hpp +42 -0
- package/vendor/include/tlx/string/ends_with.hpp +79 -0
- package/vendor/include/tlx/string/equal_icase.hpp +42 -0
- package/vendor/include/tlx/string/erase_all.hpp +70 -0
- package/vendor/include/tlx/string/escape_html.hpp +34 -0
- package/vendor/include/tlx/string/escape_uri.hpp +34 -0
- package/vendor/include/tlx/string/expand_environment_variables.hpp +49 -0
- package/vendor/include/tlx/string/extract_between.hpp +40 -0
- package/vendor/include/tlx/string/format_iec_units.hpp +32 -0
- package/vendor/include/tlx/string/format_si_iec_units.hpp +19 -0
- package/vendor/include/tlx/string/format_si_units.hpp +32 -0
- package/vendor/include/tlx/string/hash_djb2.hpp +87 -0
- package/vendor/include/tlx/string/hash_sdbm.hpp +86 -0
- package/vendor/include/tlx/string/hexdump.hpp +154 -0
- package/vendor/include/tlx/string/index_of.hpp +56 -0
- package/vendor/include/tlx/string/join.hpp +65 -0
- package/vendor/include/tlx/string/join_generic.hpp +89 -0
- package/vendor/include/tlx/string/join_quoted.hpp +46 -0
- package/vendor/include/tlx/string/less_icase.hpp +64 -0
- package/vendor/include/tlx/string/levenshtein.hpp +193 -0
- package/vendor/include/tlx/string/pad.hpp +39 -0
- package/vendor/include/tlx/string/parse_si_iec_units.hpp +46 -0
- package/vendor/include/tlx/string/parse_uri.hpp +66 -0
- package/vendor/include/tlx/string/parse_uri_form_data.hpp +136 -0
- package/vendor/include/tlx/string/replace.hpp +141 -0
- package/vendor/include/tlx/string/split.hpp +170 -0
- package/vendor/include/tlx/string/split_quoted.hpp +49 -0
- package/vendor/include/tlx/string/split_view.hpp +218 -0
- package/vendor/include/tlx/string/split_words.hpp +53 -0
- package/vendor/include/tlx/string/ssprintf.hpp +45 -0
- package/vendor/include/tlx/string/ssprintf_generic.hpp +95 -0
- package/vendor/include/tlx/string/starts_with.hpp +44 -0
- package/vendor/include/tlx/string/to_lower.hpp +47 -0
- package/vendor/include/tlx/string/to_upper.hpp +47 -0
- package/vendor/include/tlx/string/trim.hpp +298 -0
- package/vendor/include/tlx/string/union_words.hpp +33 -0
- package/vendor/include/tlx/string/word_wrap.hpp +35 -0
- package/vendor/include/tlx/string.hpp +68 -0
- package/vendor/include/tlx/thread_barrier_mutex.hpp +109 -0
- package/vendor/include/tlx/thread_barrier_spin.hpp +127 -0
- package/vendor/include/tlx/thread_pool.hpp +151 -0
- package/vendor/include/tlx/timestamp.hpp +23 -0
- package/vendor/include/tlx/unused.hpp +28 -0
- package/vendor/include/tlx/vector_free.hpp +30 -0
- package/vendor/include/tlx/version.hpp +49 -0
- package/vendor/include/ttmath/ttmath.h +2881 -0
- package/vendor/include/ttmath/ttmathbig.h +6111 -0
- package/vendor/include/ttmath/ttmathdec.h +419 -0
- package/vendor/include/ttmath/ttmathint.h +1923 -0
- package/vendor/include/ttmath/ttmathmisc.h +250 -0
- package/vendor/include/ttmath/ttmathobjects.h +812 -0
- package/vendor/include/ttmath/ttmathparser.h +2791 -0
- package/vendor/include/ttmath/ttmaththreads.h +252 -0
- package/vendor/include/ttmath/ttmathtypes.h +707 -0
- package/vendor/include/ttmath/ttmathuint.h +4190 -0
- package/vendor/include/ttmath/ttmathuint_noasm.h +1038 -0
- package/vendor/include/ttmath/ttmathuint_x86.h +1620 -0
- package/vendor/include/ttmath/ttmathuint_x86_64.h +1177 -0
- package/vendor/lib/cmake/tlx/tlx-config.cmake +51 -0
- package/vendor/lib/cmake/tlx/tlx-targets-release.cmake +19 -0
- package/vendor/lib/cmake/tlx/tlx-targets.cmake +106 -0
- package/vendor/lib/cmake/tlx/tlx-version.cmake +11 -0
- package/vendor/lib/libnetworkit.dylib +0 -0
- package/vendor/lib/libtlx.a +0 -0
- package/vendor/lib/pkgconfig/networkit.pc +11 -0
- package/vendor/lib/pkgconfig/tlx.pc +11 -0
|
@@ -0,0 +1,1292 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* CSRGeneralMatrix.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: May 6, 2015
|
|
5
|
+
* Authors: Michael Wegner <michael.wegner@student.kit.edu>
|
|
6
|
+
* Eugenio Angriman <angrimae@hu-berlin.de>
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#ifndef NETWORKIT_ALGEBRAIC_CSR_GENERAL_MATRIX_HPP_
|
|
10
|
+
#define NETWORKIT_ALGEBRAIC_CSR_GENERAL_MATRIX_HPP_
|
|
11
|
+
|
|
12
|
+
#include <algorithm>
|
|
13
|
+
#include <cassert>
|
|
14
|
+
#include <cmath>
|
|
15
|
+
#include <iostream>
|
|
16
|
+
#include <numeric>
|
|
17
|
+
#include <omp.h>
|
|
18
|
+
#include <ranges>
|
|
19
|
+
#include <stdexcept>
|
|
20
|
+
#include <vector>
|
|
21
|
+
|
|
22
|
+
#include <networkit/Globals.hpp>
|
|
23
|
+
#include <networkit/algebraic/AlgebraicGlobals.hpp>
|
|
24
|
+
#include <networkit/algebraic/Vector.hpp>
|
|
25
|
+
#include <networkit/graph/Graph.hpp>
|
|
26
|
+
|
|
27
|
+
#include <tlx/unused.hpp>
|
|
28
|
+
|
|
29
|
+
namespace NetworKit {
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @ingroup algebraic
|
|
33
|
+
* The CSRGeneralMatrix class represents a sparse matrix stored in CSR-Format
|
|
34
|
+
* (i.e. compressed sparse row).
|
|
35
|
+
* If speed is important, use this CSRGeneralMatrix instead of the Matrix class.
|
|
36
|
+
*/
|
|
37
|
+
template <class ValueType>
|
|
38
|
+
class CSRGeneralMatrix {
|
|
39
|
+
std::vector<index> rowIdx, columnIdx;
|
|
40
|
+
std::vector<ValueType> nonZeros;
|
|
41
|
+
|
|
42
|
+
count nRows, nCols;
|
|
43
|
+
bool isSorted;
|
|
44
|
+
ValueType zero;
|
|
45
|
+
|
|
46
|
+
class IndexProxy {
|
|
47
|
+
public:
|
|
48
|
+
IndexProxy(CSRGeneralMatrix &mat, index i, index j) : Matrix{mat}, i{i}, j{j} {}
|
|
49
|
+
|
|
50
|
+
operator const ValueType &() const {
|
|
51
|
+
return const_cast<const CSRGeneralMatrix &>(Matrix)(i, j);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
void operator=(double rhs) { Matrix.setValue(i, j, rhs); }
|
|
55
|
+
|
|
56
|
+
private:
|
|
57
|
+
CSRGeneralMatrix &Matrix;
|
|
58
|
+
index i;
|
|
59
|
+
index j;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
/** Default constructor */
|
|
64
|
+
CSRGeneralMatrix()
|
|
65
|
+
: rowIdx(0), columnIdx(0), nonZeros(0), nRows(0), nCols(0), isSorted(true), zero(0) {}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Constructs the CSRGeneralMatrix with size @a dimension x @a dimension.
|
|
69
|
+
* @param dimension Defines how many rows and columns this matrix has.
|
|
70
|
+
* @param zero The zero element (default = 0).
|
|
71
|
+
*/
|
|
72
|
+
CSRGeneralMatrix(count dimension, ValueType zero = 0)
|
|
73
|
+
: rowIdx(dimension + 1), columnIdx(0), nonZeros(0), nRows(dimension), nCols(dimension),
|
|
74
|
+
isSorted(true), zero(zero) {}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Constructs the CSRGeneralMatrix with size @a nRows x @a nCols.
|
|
78
|
+
* @param nRows Number of rows.
|
|
79
|
+
* @param nCols Number of columns.
|
|
80
|
+
* @param zero The zero element (default = 0).
|
|
81
|
+
*/
|
|
82
|
+
CSRGeneralMatrix(count nRows, count nCols, ValueType zero = 0)
|
|
83
|
+
: rowIdx(nRows + 1), columnIdx(0), nonZeros(0), nRows(nRows), nCols(nCols), isSorted(true),
|
|
84
|
+
zero(zero) {}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Constructs the @a dimension x @a dimension Matrix from the elements at
|
|
88
|
+
* position @a positions with values @values.
|
|
89
|
+
* @param dimension Defines how many rows and columns this matrix has.
|
|
90
|
+
* @param triplets The nonzero elements.
|
|
91
|
+
* @param zero The zero element (default is 0).
|
|
92
|
+
* @param isSorted True, if the triplets are sorted per row. Default is false.
|
|
93
|
+
*/
|
|
94
|
+
CSRGeneralMatrix(count dimension, const std::vector<Triplet> &triplets, ValueType zero = 0,
|
|
95
|
+
bool isSorted = false)
|
|
96
|
+
: CSRGeneralMatrix(dimension, dimension, triplets, zero, isSorted) {}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Constructs the @a nRows x @a nCols Matrix from the elements at position @a
|
|
100
|
+
* positions with values @values.
|
|
101
|
+
* @param nRows Defines how many rows this matrix has.
|
|
102
|
+
* @param nCols Defines how many columns this matrix has.
|
|
103
|
+
* @param triplets The nonzero elements.
|
|
104
|
+
* @param zero The zero element (default is 0).
|
|
105
|
+
* @param isSorted True, if the triplets are sorted per row. Default is false.
|
|
106
|
+
*/
|
|
107
|
+
CSRGeneralMatrix(count nRows, count nCols, const std::vector<Triplet> &triplets,
|
|
108
|
+
ValueType zero = 0, bool isSorted = false)
|
|
109
|
+
: rowIdx(nRows + 1), columnIdx(triplets.size()), nonZeros(triplets.size()), nRows(nRows),
|
|
110
|
+
nCols(nCols), isSorted(isSorted), zero(zero) {
|
|
111
|
+
|
|
112
|
+
const count nnz = triplets.size();
|
|
113
|
+
|
|
114
|
+
for (index i = 0; i < nnz; ++i)
|
|
115
|
+
rowIdx[triplets[i].row]++;
|
|
116
|
+
|
|
117
|
+
for (index i = 0, prefixSum = 0; i < nRows; ++i) {
|
|
118
|
+
count nnzInRow = rowIdx[i];
|
|
119
|
+
rowIdx[i] = prefixSum;
|
|
120
|
+
prefixSum += nnzInRow;
|
|
121
|
+
}
|
|
122
|
+
rowIdx[nRows] = nnz;
|
|
123
|
+
|
|
124
|
+
for (index i = 0; i < nnz; ++i) {
|
|
125
|
+
index row = triplets[i].row;
|
|
126
|
+
index dest = rowIdx[row];
|
|
127
|
+
|
|
128
|
+
columnIdx[dest] = triplets[i].column;
|
|
129
|
+
nonZeros[dest] = triplets[i].value;
|
|
130
|
+
|
|
131
|
+
rowIdx[row]++;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
rowIdx.back() = 0;
|
|
135
|
+
std::rotate(rowIdx.rbegin(), rowIdx.rbegin() + 1, rowIdx.rend());
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Constructs the @a nRows x @a nCols Matrix from the elements stored in @a
|
|
140
|
+
* columnIdx and @a values. @a columnIdx and @a values store the colums and
|
|
141
|
+
* values by row.
|
|
142
|
+
* @param nRows
|
|
143
|
+
* @param nCols
|
|
144
|
+
* @param columnIdx
|
|
145
|
+
* @param values
|
|
146
|
+
* @param zero The zero element (default is 0).
|
|
147
|
+
* @param isSorted True if the column indices in @a columnIdx are sorted in
|
|
148
|
+
* every row.
|
|
149
|
+
*/
|
|
150
|
+
CSRGeneralMatrix(count nRows, count nCols, const std::vector<std::vector<index>> &columnIdx,
|
|
151
|
+
const std::vector<std::vector<ValueType>> &values, ValueType zero = 0,
|
|
152
|
+
bool isSorted = false)
|
|
153
|
+
: rowIdx(nRows + 1), nRows(nRows), nCols(nCols), isSorted(isSorted), zero(zero) {
|
|
154
|
+
|
|
155
|
+
count nnz = columnIdx[0].size();
|
|
156
|
+
for (index i = 1; i < columnIdx.size(); ++i) {
|
|
157
|
+
rowIdx[i] = rowIdx[i - 1] + columnIdx[i - 1].size();
|
|
158
|
+
nnz += columnIdx[i].size();
|
|
159
|
+
}
|
|
160
|
+
rowIdx[nRows] = nnz;
|
|
161
|
+
|
|
162
|
+
this->columnIdx = std::vector<index>(nnz);
|
|
163
|
+
this->nonZeros = std::vector<double>(nnz);
|
|
164
|
+
|
|
165
|
+
#pragma omp parallel for
|
|
166
|
+
for (omp_index i = 0; i < static_cast<omp_index>(nRows); ++i) {
|
|
167
|
+
for (index k = 0; k < columnIdx[i].size(); ++k) {
|
|
168
|
+
this->columnIdx[rowIdx[i] + k] = columnIdx[i][k];
|
|
169
|
+
nonZeros[rowIdx[i] + k] = values[i][k];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Constructs the @a nRows x @a nCols Matrix from the elements at position @a
|
|
176
|
+
* positions with values @values.
|
|
177
|
+
* @param nRows Defines how many rows this matrix has.
|
|
178
|
+
* @param nCols Defines how many columns this matrix has.
|
|
179
|
+
* @param rowIdx The rowIdx vector of the CSR format.
|
|
180
|
+
* @param columnIdx The columnIdx vector of the CSR format.
|
|
181
|
+
* @param nonZeros The nonZero vector of the CSR format. Should be as long as
|
|
182
|
+
* the @a columnIdx vector.
|
|
183
|
+
* @param zero The zero element (default is 0).
|
|
184
|
+
* @param isSorted True, if the triplets are sorted per row. Default is false.
|
|
185
|
+
*/
|
|
186
|
+
CSRGeneralMatrix(count nRows, count nCols, const std::vector<index> &rowIdx,
|
|
187
|
+
const std::vector<index> &columnIdx, const std::vector<ValueType> &nonZeros,
|
|
188
|
+
ValueType zero = 0, bool isSorted = false)
|
|
189
|
+
: rowIdx(rowIdx), columnIdx(columnIdx), nonZeros(nonZeros), nRows(nRows), nCols(nCols),
|
|
190
|
+
isSorted(isSorted), zero(zero) {}
|
|
191
|
+
|
|
192
|
+
/** Default copy constructor */
|
|
193
|
+
CSRGeneralMatrix(const CSRGeneralMatrix &other) = default;
|
|
194
|
+
|
|
195
|
+
/** Default move constructor */
|
|
196
|
+
CSRGeneralMatrix(CSRGeneralMatrix &&other) noexcept = default;
|
|
197
|
+
|
|
198
|
+
/** Default destructor */
|
|
199
|
+
~CSRGeneralMatrix() = default;
|
|
200
|
+
|
|
201
|
+
/** Default move assignment operator */
|
|
202
|
+
CSRGeneralMatrix &operator=(CSRGeneralMatrix &&other) noexcept = default;
|
|
203
|
+
|
|
204
|
+
/** Default copy assignment operator */
|
|
205
|
+
CSRGeneralMatrix &operator=(const CSRGeneralMatrix &other) = default;
|
|
206
|
+
|
|
207
|
+
IndexProxy operator()(index i, index j) { return IndexProxy(*this, i, j); }
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Compares this matrix to @a other and returns true if the shape and zero
|
|
211
|
+
* element are the same as well as
|
|
212
|
+
* all entries, otherwise returns false.
|
|
213
|
+
* @param other
|
|
214
|
+
*/
|
|
215
|
+
bool operator==(const CSRGeneralMatrix &other) const {
|
|
216
|
+
bool equal = nRows == other.nRows && nCols == other.nCols && zero == other.zero
|
|
217
|
+
&& nnz() == other.nnz();
|
|
218
|
+
if (equal)
|
|
219
|
+
forNonZeroElementsInRowOrder([&](index i, index j, ValueType value) {
|
|
220
|
+
if (other(i, j) != value) {
|
|
221
|
+
equal = false;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
return equal;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Compares this matrix to @a other and returns true if the shape and zero
|
|
231
|
+
* element are the same as well as
|
|
232
|
+
* all entries are the same (within the absolute error range of @a eps), otherwise returns
|
|
233
|
+
* false.
|
|
234
|
+
* @param other
|
|
235
|
+
* @param eps
|
|
236
|
+
*/
|
|
237
|
+
bool isApprox(const CSRGeneralMatrix &other, const double eps = 0.01) const {
|
|
238
|
+
bool equal = nRows == other.nRows && nCols == other.nCols && zero == other.zero
|
|
239
|
+
&& nnz() == other.nnz();
|
|
240
|
+
if (equal)
|
|
241
|
+
forNonZeroElementsInRowOrder([&](index i, index j, ValueType value) {
|
|
242
|
+
if (std::abs(other(i, j) - value) > eps) {
|
|
243
|
+
equal = false;
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
return equal;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Compares this matrix to @a other and returns false if the shape and zero
|
|
253
|
+
* element are the same as well as
|
|
254
|
+
* all entries, otherwise returns true.
|
|
255
|
+
* @param other
|
|
256
|
+
*/
|
|
257
|
+
bool operator!=(const CSRGeneralMatrix &other) const { return !((*this) == other); }
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @return Number of rows.
|
|
261
|
+
*/
|
|
262
|
+
count numberOfRows() const noexcept { return nRows; }
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @return Number of columns.
|
|
266
|
+
*/
|
|
267
|
+
count numberOfColumns() const noexcept { return nCols; }
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Returns the zero element of the matrix.
|
|
271
|
+
*/
|
|
272
|
+
ValueType getZero() const noexcept { return zero; }
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @param i The row index.
|
|
276
|
+
* @return Number of non-zeros in row @a i.
|
|
277
|
+
*/
|
|
278
|
+
count nnzInRow(const index i) const {
|
|
279
|
+
assert(i < nRows);
|
|
280
|
+
return rowIdx[i + 1] - rowIdx[i];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @return Number of non-zeros in this matrix.
|
|
285
|
+
*/
|
|
286
|
+
count nnz() const noexcept { return nonZeros.size(); }
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @return Value at matrix position (i,j).
|
|
290
|
+
*/
|
|
291
|
+
const ValueType &operator()(index i, index j) const {
|
|
292
|
+
assert(i < nRows);
|
|
293
|
+
assert(j < nCols);
|
|
294
|
+
|
|
295
|
+
if (rowIdx[i] == rowIdx[i + 1])
|
|
296
|
+
return zero; // no non-zero value is present in this row
|
|
297
|
+
|
|
298
|
+
if (!sorted()) {
|
|
299
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k) {
|
|
300
|
+
if (columnIdx[k] == j) {
|
|
301
|
+
return nonZeros[k];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
// finding the correct index where j should be inserted
|
|
306
|
+
auto it = std::lower_bound(columnIdx.begin() + rowIdx[i],
|
|
307
|
+
columnIdx.begin() + rowIdx[i + 1], j);
|
|
308
|
+
index colIdx = static_cast<index>(it - columnIdx.begin());
|
|
309
|
+
|
|
310
|
+
if (it == columnIdx.end())
|
|
311
|
+
return zero;
|
|
312
|
+
else if (*it == j) {
|
|
313
|
+
return nonZeros[colIdx];
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return zero;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Set the matrix at position (@a i, @a j) to @a value.
|
|
321
|
+
* @note This operation can be linear in the number of non-zeros due to vector
|
|
322
|
+
* element movements
|
|
323
|
+
*/
|
|
324
|
+
void setValue(index i, index j, ValueType value) {
|
|
325
|
+
assert(i < nRows);
|
|
326
|
+
assert(j < nCols);
|
|
327
|
+
|
|
328
|
+
index colIdx = none;
|
|
329
|
+
|
|
330
|
+
if (!isSorted) {
|
|
331
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k) {
|
|
332
|
+
if (columnIdx[k] == j) {
|
|
333
|
+
colIdx = k;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (colIdx != none) {
|
|
337
|
+
if (value != zero) { // update existing value
|
|
338
|
+
nonZeros[colIdx] = value;
|
|
339
|
+
} else { // remove value if set to zero
|
|
340
|
+
columnIdx.erase(columnIdx.begin() + colIdx);
|
|
341
|
+
nonZeros.erase(nonZeros.begin() + colIdx);
|
|
342
|
+
|
|
343
|
+
for (index k = i + 1; k < rowIdx.size(); ++k) {
|
|
344
|
+
--rowIdx[k];
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} else if (value != zero) { // don't add zero values
|
|
348
|
+
columnIdx.emplace(std::next(columnIdx.begin(), rowIdx[i + 1]), j);
|
|
349
|
+
nonZeros.emplace(std::next(nonZeros.begin(), rowIdx[i + 1]), value);
|
|
350
|
+
|
|
351
|
+
// update rowIdx
|
|
352
|
+
for (index k = i + 1; k < rowIdx.size(); ++k) {
|
|
353
|
+
++rowIdx[k];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
// finding the correct index where j should be inserted
|
|
358
|
+
auto it = std::lower_bound(columnIdx.begin() + rowIdx[i],
|
|
359
|
+
columnIdx.begin() + rowIdx[i + 1], j);
|
|
360
|
+
colIdx = static_cast<index>(it - columnIdx.begin());
|
|
361
|
+
|
|
362
|
+
if (colIdx < rowIdx[i + 1] && columnIdx[colIdx] == j) {
|
|
363
|
+
if (value != zero) { // update existing value
|
|
364
|
+
nonZeros[colIdx] = value;
|
|
365
|
+
} else { // remove value if set to zero
|
|
366
|
+
columnIdx.erase(columnIdx.begin() + colIdx);
|
|
367
|
+
nonZeros.erase(nonZeros.begin() + colIdx);
|
|
368
|
+
|
|
369
|
+
for (index k = i + 1; k < rowIdx.size(); ++k) {
|
|
370
|
+
--rowIdx[k];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
} else if (value != zero) { // don't add zero values
|
|
374
|
+
columnIdx.emplace(std::next(columnIdx.begin(), colIdx), j);
|
|
375
|
+
nonZeros.emplace(std::next(nonZeros.begin(), colIdx), value);
|
|
376
|
+
|
|
377
|
+
// update rowIdx
|
|
378
|
+
for (index k = i + 1; k < rowIdx.size(); ++k) {
|
|
379
|
+
++rowIdx[k];
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
assert(this->operator()(i, j) == value);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Sorts the column indices in each row for faster access.
|
|
388
|
+
*/
|
|
389
|
+
void sort() {
|
|
390
|
+
#pragma omp parallel
|
|
391
|
+
{
|
|
392
|
+
std::vector<index> permutation(nCols);
|
|
393
|
+
#pragma omp for schedule(guided)
|
|
394
|
+
for (omp_index i = 0; i < static_cast<omp_index>(nRows); ++i) {
|
|
395
|
+
const index startOfRow = rowIdx[i], endOfRow = rowIdx[i + 1];
|
|
396
|
+
const count nonZerosInRow = endOfRow - startOfRow;
|
|
397
|
+
if (nonZerosInRow <= 1
|
|
398
|
+
|| std::is_sorted(columnIdx.begin() + startOfRow, columnIdx.begin() + endOfRow))
|
|
399
|
+
continue;
|
|
400
|
+
|
|
401
|
+
permutation.resize(nonZerosInRow);
|
|
402
|
+
std::iota(permutation.begin(), permutation.end(), index{0});
|
|
403
|
+
std::ranges::sort(permutation, [&](index x, index y) {
|
|
404
|
+
return columnIdx[startOfRow + x] < columnIdx[startOfRow + y];
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
Aux::ArrayTools::applyPermutation(columnIdx.begin() + startOfRow,
|
|
408
|
+
columnIdx.begin() + endOfRow,
|
|
409
|
+
permutation.begin());
|
|
410
|
+
|
|
411
|
+
Aux::ArrayTools::applyPermutation(nonZeros.begin() + startOfRow,
|
|
412
|
+
nonZeros.begin() + endOfRow, permutation.begin());
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
isSorted = true;
|
|
416
|
+
|
|
417
|
+
#ifdef NETWORKIT_SANITY_CHECKS
|
|
418
|
+
#pragma omp parallel for
|
|
419
|
+
for (omp_index i = 0; i < static_cast<omp_index>(nRows); ++i)
|
|
420
|
+
assert(
|
|
421
|
+
std::is_sorted(columnIdx.begin() + rowIdx[i], columnIdx.begin() + rowIdx[i + 1]));
|
|
422
|
+
#endif // NETWORKIT_SANITY_CHECKS
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @return True if the matrix is sorted, otherwise false.
|
|
427
|
+
*/
|
|
428
|
+
bool sorted() const noexcept { return isSorted; }
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @return Row @a i of this matrix as vector.
|
|
432
|
+
*/
|
|
433
|
+
Vector row(index i) const {
|
|
434
|
+
assert(i < nRows);
|
|
435
|
+
|
|
436
|
+
Vector row(numberOfColumns(), zero, true);
|
|
437
|
+
parallelForNonZeroElementsInRow(i, [&row](index j, double value) { row[j] = value; });
|
|
438
|
+
|
|
439
|
+
return row;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @return Column @a j of this matrix as vector.
|
|
444
|
+
*/
|
|
445
|
+
Vector column(index j) const {
|
|
446
|
+
assert(j < nCols);
|
|
447
|
+
|
|
448
|
+
Vector column(numberOfRows(), getZero());
|
|
449
|
+
#pragma omp parallel for
|
|
450
|
+
for (omp_index i = 0; i < static_cast<omp_index>(numberOfRows()); ++i)
|
|
451
|
+
column[i] = (*this)(i, j);
|
|
452
|
+
|
|
453
|
+
return column;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* @return The main diagonal of this matrix.
|
|
458
|
+
*/
|
|
459
|
+
Vector diagonal() const {
|
|
460
|
+
Vector diag(std::min(nRows, nCols), zero);
|
|
461
|
+
|
|
462
|
+
if (sorted()) {
|
|
463
|
+
#pragma omp parallel for
|
|
464
|
+
for (omp_index i = 0; i < static_cast<omp_index>(diag.getDimension()); ++i) {
|
|
465
|
+
|
|
466
|
+
const auto it = std::lower_bound(columnIdx.begin() + rowIdx[i],
|
|
467
|
+
columnIdx.begin() + rowIdx[i + 1], i);
|
|
468
|
+
|
|
469
|
+
if (it != columnIdx.end() && *it == static_cast<index>(i))
|
|
470
|
+
diag[i] = nonZeros[it - columnIdx.begin()];
|
|
471
|
+
}
|
|
472
|
+
} else {
|
|
473
|
+
#pragma omp parallel for
|
|
474
|
+
for (omp_index i = 0; i < static_cast<omp_index>(diag.getDimension()); ++i) {
|
|
475
|
+
diag[i] = (*this)(i, i);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return diag;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Adds this matrix to @a other and returns the result.
|
|
484
|
+
* @return The sum of this matrix and @a other.
|
|
485
|
+
*/
|
|
486
|
+
CSRGeneralMatrix operator+(const CSRGeneralMatrix &other) const {
|
|
487
|
+
assert(nRows == other.nRows && nCols == other.nCols);
|
|
488
|
+
return CSRGeneralMatrix<ValueType>::binaryOperator(
|
|
489
|
+
*this, other, [](double val1, double val2) { return val1 + val2; });
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Adds @a other to this matrix.
|
|
494
|
+
* @return Reference to this matrix.
|
|
495
|
+
*/
|
|
496
|
+
CSRGeneralMatrix &operator+=(const CSRGeneralMatrix &other) {
|
|
497
|
+
assert(nRows == other.nRows && nCols == other.nCols);
|
|
498
|
+
*this = CSRGeneralMatrix<ValueType>::binaryOperator(
|
|
499
|
+
*this, other, [](double val1, double val2) { return val1 + val2; });
|
|
500
|
+
return *this;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Subtracts @a other from this matrix and returns the result.
|
|
505
|
+
* @return The difference of this matrix and @a other.
|
|
506
|
+
*
|
|
507
|
+
*/
|
|
508
|
+
CSRGeneralMatrix operator-(const CSRGeneralMatrix &other) const {
|
|
509
|
+
assert(nRows == other.nRows && nCols == other.nCols);
|
|
510
|
+
return CSRGeneralMatrix<ValueType>::binaryOperator(
|
|
511
|
+
*this, other, [](double val1, double val2) { return val1 - val2; });
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Subtracts @a other from this matrix.
|
|
516
|
+
* @return Reference to this matrix.
|
|
517
|
+
*/
|
|
518
|
+
CSRGeneralMatrix &operator-=(const CSRGeneralMatrix &other) {
|
|
519
|
+
assert(nRows == other.nRows && nCols == other.nCols);
|
|
520
|
+
*this = CSRGeneralMatrix<ValueType>::binaryOperator(
|
|
521
|
+
*this, other, [](double val1, double val2) { return val1 - val2; });
|
|
522
|
+
return *this;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Multiplies this matrix with a scalar specified in @a scalar and returns the
|
|
527
|
+
* result.
|
|
528
|
+
* @return The result of multiplying this matrix with @a scalar.
|
|
529
|
+
*/
|
|
530
|
+
CSRGeneralMatrix operator*(const ValueType &scalar) const {
|
|
531
|
+
return CSRGeneralMatrix(*this) *= scalar;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Multiplies this matrix with a scalar specified in @a scalar.
|
|
536
|
+
* @return Reference to this matrix.
|
|
537
|
+
*/
|
|
538
|
+
CSRGeneralMatrix &operator*=(const ValueType &scalar) {
|
|
539
|
+
#pragma omp parallel for
|
|
540
|
+
for (omp_index k = 0; k < static_cast<omp_index>(nonZeros.size()); ++k)
|
|
541
|
+
nonZeros[k] *= scalar;
|
|
542
|
+
|
|
543
|
+
return *this;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Multiplies this matrix with @a vector and returns the result.
|
|
548
|
+
* @return The result of multiplying this matrix with @a vector.
|
|
549
|
+
*/
|
|
550
|
+
Vector operator*(const Vector &vector) const {
|
|
551
|
+
assert(!vector.isTransposed());
|
|
552
|
+
assert(nCols == vector.getDimension());
|
|
553
|
+
|
|
554
|
+
Vector result(nRows, zero);
|
|
555
|
+
#pragma omp parallel for
|
|
556
|
+
for (omp_index i = 0; i < static_cast<omp_index>(numberOfRows()); ++i) {
|
|
557
|
+
double sum = zero;
|
|
558
|
+
for (index cIdx = rowIdx[i]; cIdx < rowIdx[i + 1]; ++cIdx) {
|
|
559
|
+
sum += nonZeros[cIdx] * vector[columnIdx[cIdx]];
|
|
560
|
+
}
|
|
561
|
+
result[i] = sum;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return result;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Multiplies this matrix with @a other and returns the result in a new
|
|
569
|
+
* matrix.
|
|
570
|
+
* @return The result of multiplying this matrix with @a other.
|
|
571
|
+
*/
|
|
572
|
+
CSRGeneralMatrix operator*(const CSRGeneralMatrix &other) const {
|
|
573
|
+
assert(nCols == other.nRows);
|
|
574
|
+
|
|
575
|
+
std::vector<index> rowIdx(numberOfRows() + 1, 0);
|
|
576
|
+
std::vector<index> columnIdx;
|
|
577
|
+
std::vector<double> nonZeros;
|
|
578
|
+
|
|
579
|
+
#pragma omp parallel
|
|
580
|
+
{
|
|
581
|
+
std::vector<int64_t> marker(other.numberOfColumns(), -1);
|
|
582
|
+
count numThreads = omp_get_num_threads();
|
|
583
|
+
index threadId = omp_get_thread_num();
|
|
584
|
+
|
|
585
|
+
count chunkSize = (numberOfRows() + numThreads - 1) / numThreads;
|
|
586
|
+
index chunkStart = threadId * chunkSize;
|
|
587
|
+
index chunkEnd = std::min(numberOfRows(), chunkStart + chunkSize);
|
|
588
|
+
|
|
589
|
+
for (index i = chunkStart; i < chunkEnd; ++i) {
|
|
590
|
+
for (index jA = this->rowIdx[i]; jA < this->rowIdx[i + 1]; ++jA) {
|
|
591
|
+
index k = this->columnIdx[jA];
|
|
592
|
+
for (index jB = other.rowIdx[k]; jB < other.rowIdx[k + 1]; ++jB) {
|
|
593
|
+
index j = other.columnIdx[jB];
|
|
594
|
+
if (marker[j] != (int64_t)i) {
|
|
595
|
+
marker[j] = i;
|
|
596
|
+
++rowIdx[i + 1];
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
std::ranges::fill(marker, -1);
|
|
603
|
+
|
|
604
|
+
#pragma omp barrier
|
|
605
|
+
#pragma omp single
|
|
606
|
+
{
|
|
607
|
+
for (index i = 0; i < numberOfRows(); ++i)
|
|
608
|
+
rowIdx[i + 1] += rowIdx[i];
|
|
609
|
+
|
|
610
|
+
columnIdx = std::vector<index>(rowIdx[numberOfRows()]);
|
|
611
|
+
nonZeros = std::vector<double>(rowIdx[numberOfRows()]);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
for (index i = chunkStart; i < chunkEnd; ++i) {
|
|
615
|
+
index rowBegin = rowIdx[i];
|
|
616
|
+
index rowEnd = rowBegin;
|
|
617
|
+
|
|
618
|
+
for (index jA = this->rowIdx[i]; jA < this->rowIdx[i + 1]; ++jA) {
|
|
619
|
+
index k = this->columnIdx[jA];
|
|
620
|
+
double valA = this->nonZeros[jA];
|
|
621
|
+
|
|
622
|
+
for (index jB = other.rowIdx[k]; jB < other.rowIdx[k + 1]; ++jB) {
|
|
623
|
+
index j = other.columnIdx[jB];
|
|
624
|
+
double valB = other.nonZeros[jB];
|
|
625
|
+
|
|
626
|
+
if (marker[j] < (int64_t)rowBegin) {
|
|
627
|
+
marker[j] = rowEnd;
|
|
628
|
+
columnIdx[rowEnd] = j;
|
|
629
|
+
nonZeros[rowEnd] = valA * valB;
|
|
630
|
+
++rowEnd;
|
|
631
|
+
} else {
|
|
632
|
+
nonZeros[marker[j]] += valA * valB;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
CSRGeneralMatrix result(numberOfRows(), other.numberOfColumns(), rowIdx, columnIdx,
|
|
640
|
+
nonZeros);
|
|
641
|
+
if (sorted() && other.sorted())
|
|
642
|
+
result.sort();
|
|
643
|
+
return result;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Divides this matrix by a divisor specified in @a divisor and returns the
|
|
648
|
+
* result in a new matrix.
|
|
649
|
+
* @return The result of dividing this matrix by @a divisor.
|
|
650
|
+
*/
|
|
651
|
+
CSRGeneralMatrix operator/(const ValueType &divisor) const {
|
|
652
|
+
return CSRGeneralMatrix(*this) /= divisor;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Divides this matrix by a divisor specified in @a divisor.
|
|
657
|
+
* @return Reference to this matrix.
|
|
658
|
+
*/
|
|
659
|
+
CSRGeneralMatrix &operator/=(const ValueType &divisor) { return *this *= 1.0 / divisor; }
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Computes @a A @a binaryOp @a B on the elements of matrix @a A and matrix @a
|
|
663
|
+
* B.
|
|
664
|
+
* @param A Sorted CSRGeneralMatrix.
|
|
665
|
+
* @param B Sorted CSRGeneralMatrix.
|
|
666
|
+
* @param binaryOp Function handling (ValueType, ValueType) -> ValueType
|
|
667
|
+
* @return @a A @a binaryOp @a B.
|
|
668
|
+
* @note @a A and @a B must have the same dimensions and must be sorted.
|
|
669
|
+
*/
|
|
670
|
+
template <typename L>
|
|
671
|
+
static CSRGeneralMatrix binaryOperator(const CSRGeneralMatrix &A, const CSRGeneralMatrix &B,
|
|
672
|
+
L binaryOp);
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Computes @a A^T * @a B.
|
|
676
|
+
* @param A
|
|
677
|
+
* @param B
|
|
678
|
+
* @return @a A^T * @a B.
|
|
679
|
+
* @note The number of rows of @a A must be equal to the number of rows of @a
|
|
680
|
+
* B.
|
|
681
|
+
*/
|
|
682
|
+
static CSRGeneralMatrix mTmMultiply(const CSRGeneralMatrix &A, const CSRGeneralMatrix &B) {
|
|
683
|
+
assert(A.nRows == B.nRows);
|
|
684
|
+
|
|
685
|
+
std::vector<std::vector<index>> columnIdx(A.numberOfColumns());
|
|
686
|
+
std::vector<std::vector<double>> values(A.numberOfColumns());
|
|
687
|
+
|
|
688
|
+
for (index k = 0; k < A.numberOfRows(); ++k) {
|
|
689
|
+
A.forNonZeroElementsInRow(k, [&](index i, double vA) {
|
|
690
|
+
B.forNonZeroElementsInRow(k, [&](index j, double vB) {
|
|
691
|
+
bool found = false;
|
|
692
|
+
for (index l = 0; l < columnIdx[i].size(); ++l) {
|
|
693
|
+
if (columnIdx[i][l] == j) {
|
|
694
|
+
values[i][l] += vA * vB;
|
|
695
|
+
found = true;
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
if (!found) {
|
|
701
|
+
columnIdx[i].push_back(j);
|
|
702
|
+
values[i].push_back(vA * vB);
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
return CSRGeneralMatrix(A.nCols, B.nCols, columnIdx, values);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Computes @a A * @a B^T.
|
|
713
|
+
* @param A
|
|
714
|
+
* @param B
|
|
715
|
+
* @return @a A * @a B^T.
|
|
716
|
+
* @note The number of columns of @a A must be equal to the number of columns
|
|
717
|
+
* of @a B.
|
|
718
|
+
*/
|
|
719
|
+
static CSRGeneralMatrix mmTMultiply(const CSRGeneralMatrix &A, const CSRGeneralMatrix &B) {
|
|
720
|
+
assert(A.nCols == B.nCols);
|
|
721
|
+
|
|
722
|
+
std::vector<std::vector<index>> columnIdx(A.numberOfRows());
|
|
723
|
+
std::vector<std::vector<double>> values(A.numberOfRows());
|
|
724
|
+
|
|
725
|
+
for (index i = 0; i < A.numberOfRows(); ++i) {
|
|
726
|
+
A.forNonZeroElementsInRow(i, [&](index k, double vA) {
|
|
727
|
+
for (index j = 0; j < B.numberOfRows(); ++j) {
|
|
728
|
+
double vB = B(j, k);
|
|
729
|
+
if (vB != A.zero) {
|
|
730
|
+
bool found = false;
|
|
731
|
+
for (index l = 0; l < columnIdx[i].size(); ++l) {
|
|
732
|
+
if (columnIdx[i][l] == j) {
|
|
733
|
+
values[i][l] += vA * vB;
|
|
734
|
+
found = true;
|
|
735
|
+
break;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (!found) {
|
|
740
|
+
columnIdx[i].push_back(j);
|
|
741
|
+
values[i].push_back(vA * vB);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return CSRGeneralMatrix(A.nRows, B.nRows, columnIdx, values);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Computes @a matrix^T * @a vector.
|
|
753
|
+
* @param matrix
|
|
754
|
+
* @param vector
|
|
755
|
+
* @return @a matrix^T * @a vector.
|
|
756
|
+
* @note The number of rows of @a matrix must be equal to the dimension of @a
|
|
757
|
+
* vector.
|
|
758
|
+
*/
|
|
759
|
+
static Vector mTvMultiply(const CSRGeneralMatrix &matrix, const Vector &vector) {
|
|
760
|
+
assert(matrix.nRows == vector.getDimension() && !vector.isTransposed());
|
|
761
|
+
|
|
762
|
+
Vector result(matrix.numberOfColumns(), 0);
|
|
763
|
+
for (index k = 0; k < matrix.numberOfRows(); ++k) {
|
|
764
|
+
matrix.forNonZeroElementsInRow(
|
|
765
|
+
k, [&](index j, double value) { result[j] += value * vector[k]; });
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
return result;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Transposes this matrix and returns it.
|
|
773
|
+
*/
|
|
774
|
+
CSRGeneralMatrix transpose() const {
|
|
775
|
+
std::vector<index> rowIdx(numberOfColumns() + 1);
|
|
776
|
+
for (index i = 0; i < nnz(); ++i)
|
|
777
|
+
++rowIdx[columnIdx[i] + 1];
|
|
778
|
+
|
|
779
|
+
for (index i = 0; i < numberOfColumns(); ++i)
|
|
780
|
+
rowIdx[i + 1] += rowIdx[i];
|
|
781
|
+
|
|
782
|
+
std::vector<index> columnIdx(rowIdx[numberOfColumns()]);
|
|
783
|
+
std::vector<double> nonZeros(rowIdx[numberOfColumns()]);
|
|
784
|
+
|
|
785
|
+
for (index i = 0; i < numberOfRows(); ++i) {
|
|
786
|
+
for (index j = this->rowIdx[i]; j < this->rowIdx[i + 1]; ++j) {
|
|
787
|
+
index colIdx = this->columnIdx[j];
|
|
788
|
+
columnIdx[rowIdx[colIdx]] = i;
|
|
789
|
+
nonZeros[rowIdx[colIdx]] = this->nonZeros[j];
|
|
790
|
+
++rowIdx[colIdx];
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
index shift = 0;
|
|
794
|
+
for (index i = 0; i < numberOfColumns(); ++i) {
|
|
795
|
+
index temp = rowIdx[i];
|
|
796
|
+
rowIdx[i] = shift;
|
|
797
|
+
shift = temp;
|
|
798
|
+
}
|
|
799
|
+
rowIdx[numberOfColumns()] = nonZeros.size();
|
|
800
|
+
|
|
801
|
+
return CSRGeneralMatrix(nCols, nRows, rowIdx, columnIdx, nonZeros, getZero());
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Extracts a matrix with rows and columns specified by @a rowIndices and @a
|
|
806
|
+
* columnIndices from this matrix.
|
|
807
|
+
* The order of rows and columns is equal to the order in @a rowIndices and @a
|
|
808
|
+
* columnIndices. It is also
|
|
809
|
+
* possible to specify a row or column more than once to get duplicates.
|
|
810
|
+
* @param rowIndices
|
|
811
|
+
* @param columnIndices
|
|
812
|
+
*/
|
|
813
|
+
CSRGeneralMatrix extract(const std::vector<index> &rowIndices,
|
|
814
|
+
const std::vector<index> &columnIndices) const {
|
|
815
|
+
std::vector<Triplet> triplets;
|
|
816
|
+
std::vector<std::vector<index>> columnMapping(numberOfColumns());
|
|
817
|
+
for (index j = 0; j < columnIndices.size(); ++j)
|
|
818
|
+
columnMapping[columnIndices[j]].push_back(j);
|
|
819
|
+
|
|
820
|
+
bool sorted = true;
|
|
821
|
+
for (index i = 0; i < rowIndices.size(); ++i) {
|
|
822
|
+
Triplet last = {i, 0, 0};
|
|
823
|
+
(*this).forNonZeroElementsInRow(rowIndices[i], [&](index k, double value) {
|
|
824
|
+
if (!columnMapping[k].empty()) {
|
|
825
|
+
for (index j : columnMapping[k]) {
|
|
826
|
+
if (last.row == i && last.column > j)
|
|
827
|
+
sorted = false;
|
|
828
|
+
last = {i, j, value};
|
|
829
|
+
triplets.push_back(last);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
return CSRGeneralMatrix(rowIndices.size(), columnIndices.size(), triplets, getZero(),
|
|
836
|
+
sorted);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Assign the contents of the matrix @a source to this matrix at rows and
|
|
841
|
+
* columns specified by @a rowIndices and
|
|
842
|
+
* @a columnIndices. That is, entry (i,j) of @a source is assigned to entry
|
|
843
|
+
* (rowIndices[i], columnIndices[j]) of
|
|
844
|
+
* this matrix. Note that the dimensions of @rowIndices and @a columnIndices
|
|
845
|
+
* must coincide with the number of rows
|
|
846
|
+
* and columns of @a source.
|
|
847
|
+
* @param rowIndices
|
|
848
|
+
* @param columnIndices
|
|
849
|
+
* @param source
|
|
850
|
+
*/
|
|
851
|
+
void assign(const std::vector<index> &rowIndices, const std::vector<index> &columnIndices,
|
|
852
|
+
const CSRGeneralMatrix &source) {
|
|
853
|
+
assert(rowIndices.size() == source.numberOfRows());
|
|
854
|
+
assert(columnIndices.size() == source.numberOfColumns());
|
|
855
|
+
|
|
856
|
+
for (index i = 0; i < rowIndices.size(); ++i)
|
|
857
|
+
source.forElementsInRow(i, [&](index j, double value) {
|
|
858
|
+
setValue(rowIndices[i], columnIndices[j], value);
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Applies the unary function @a unaryElementFunction to each value in the
|
|
864
|
+
* matrix. Note that it must hold that the
|
|
865
|
+
* function applied to the zero element of this matrix returns the zero
|
|
866
|
+
* element.
|
|
867
|
+
* @param unaryElementFunction
|
|
868
|
+
*/
|
|
869
|
+
template <typename F>
|
|
870
|
+
void apply(F unaryElementFunction);
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Compute the (weighted) adjacency matrix of the (weighted) Graph @a graph.
|
|
874
|
+
* @param graph
|
|
875
|
+
*/
|
|
876
|
+
static CSRGeneralMatrix adjacencyMatrix(const Graph &graph, ValueType zero = 0) {
|
|
877
|
+
count nonZeros = graph.isDirected() ? graph.numberOfEdges() : graph.numberOfEdges() * 2;
|
|
878
|
+
std::vector<Triplet> triplets(nonZeros);
|
|
879
|
+
index idx = 0;
|
|
880
|
+
graph.forEdges([&](node i, node j, double val) {
|
|
881
|
+
triplets[idx++] = {i, j, val};
|
|
882
|
+
if (!graph.isDirected() && i != j)
|
|
883
|
+
triplets[idx++] = {j, i, val};
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
return CSRGeneralMatrix(graph.upperNodeIdBound(), triplets, zero);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Creates a diagonal matrix with dimension equal to the dimension of the
|
|
891
|
+
* Vector @a diagonalElements. The values on
|
|
892
|
+
* the diagonal are the ones stored in @a diagonalElements (i.e. D(i,i) =
|
|
893
|
+
* diagonalElements[i]).
|
|
894
|
+
* @param diagonalElements
|
|
895
|
+
*/
|
|
896
|
+
static CSRGeneralMatrix diagonalMatrix(const Vector &diagonalElements, ValueType zero = 0) {
|
|
897
|
+
count nRows = diagonalElements.getDimension();
|
|
898
|
+
count nCols = diagonalElements.getDimension();
|
|
899
|
+
std::vector<index> rowIdx(nRows + 1, 0);
|
|
900
|
+
std::iota(rowIdx.begin(), rowIdx.end(), 0);
|
|
901
|
+
std::vector<index> columnIdx(nCols);
|
|
902
|
+
std::vector<double> nonZeros(nCols);
|
|
903
|
+
|
|
904
|
+
#pragma omp parallel for
|
|
905
|
+
for (omp_index j = 0; j < static_cast<omp_index>(nCols); ++j) {
|
|
906
|
+
columnIdx[j] = j;
|
|
907
|
+
nonZeros[j] = diagonalElements[j];
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
return CSRGeneralMatrix(nRows, nCols, rowIdx, columnIdx, nonZeros, zero);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Returns the (weighted) incidence matrix of the (weighted) Graph @a graph.
|
|
915
|
+
* @param graph
|
|
916
|
+
*/
|
|
917
|
+
static CSRGeneralMatrix incidenceMatrix(const Graph &graph, ValueType zero = 0) {
|
|
918
|
+
if (!graph.hasEdgeIds())
|
|
919
|
+
throw std::runtime_error("Graph has no edge Ids. Index edges first by "
|
|
920
|
+
"calling graph.indexEdges()");
|
|
921
|
+
std::vector<Triplet> triplets;
|
|
922
|
+
|
|
923
|
+
if (graph.isDirected()) {
|
|
924
|
+
graph.forEdges([&](node u, node v, edgeweight weight, edgeid edgeId) {
|
|
925
|
+
if (u != v) {
|
|
926
|
+
edgeweight w = std::sqrt(weight);
|
|
927
|
+
triplets.push_back({u, edgeId, w});
|
|
928
|
+
triplets.push_back({v, edgeId, -w});
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
} else {
|
|
932
|
+
graph.forEdges([&](node u, node v, edgeweight weight, edgeid edgeId) {
|
|
933
|
+
if (u != v) {
|
|
934
|
+
edgeweight w = std::sqrt(weight);
|
|
935
|
+
if (u < v) { // orientation: small node number -> great node number
|
|
936
|
+
triplets.push_back({u, edgeId, w});
|
|
937
|
+
triplets.push_back({v, edgeId, -w});
|
|
938
|
+
} else {
|
|
939
|
+
triplets.push_back({u, edgeId, -w});
|
|
940
|
+
triplets.push_back({v, edgeId, w});
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return CSRGeneralMatrix(graph.upperNodeIdBound(), graph.upperEdgeIdBound(), triplets, zero);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Compute the (weighted) Laplacian of the (weighted) Graph @a graph.
|
|
951
|
+
* @param graph
|
|
952
|
+
*/
|
|
953
|
+
static CSRGeneralMatrix laplacianMatrix(const Graph &graph, ValueType zero = 0) {
|
|
954
|
+
std::vector<Triplet> triples;
|
|
955
|
+
|
|
956
|
+
graph.forNodes([&](const index i) {
|
|
957
|
+
double weightedDegree = 0;
|
|
958
|
+
graph.forNeighborsOf(i, [&](const index j, double weight) { // - adjacency matrix
|
|
959
|
+
if (i != j) // exclude diagonal since this would be subtracted by
|
|
960
|
+
// the adjacency weight
|
|
961
|
+
weightedDegree += weight;
|
|
962
|
+
|
|
963
|
+
triples.push_back({i, j, -weight});
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
if (weightedDegree != 0)
|
|
967
|
+
triples.push_back({i, i, weightedDegree}); // degree matrix
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
return CSRGeneralMatrix(graph.numberOfNodes(), triples, zero);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Returns the (weighted) normalized Laplacian matrix of the (weighted) Graph
|
|
975
|
+
* @a graph
|
|
976
|
+
* @param graph
|
|
977
|
+
*/
|
|
978
|
+
static CSRGeneralMatrix normalizedLaplacianMatrix(const Graph &graph, ValueType zero = 0) {
|
|
979
|
+
std::vector<Triplet> triples;
|
|
980
|
+
|
|
981
|
+
std::vector<double> weightedDegrees(graph.upperNodeIdBound(), 0);
|
|
982
|
+
graph.parallelForNodes([&](const node u) { weightedDegrees[u] = graph.weightedDegree(u); });
|
|
983
|
+
|
|
984
|
+
graph.forNodes([&](const node i) {
|
|
985
|
+
graph.forNeighborsOf(i, [&](const node j, double weight) {
|
|
986
|
+
if (i != j)
|
|
987
|
+
triples.push_back(
|
|
988
|
+
{i, j, -weight / std::sqrt(weightedDegrees[i] * weightedDegrees[j])});
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
if (weightedDegrees[i] != 0) {
|
|
992
|
+
if (graph.isWeighted())
|
|
993
|
+
triples.push_back({i, i, 1 - (graph.weight(i, i)) / weightedDegrees[i]});
|
|
994
|
+
else
|
|
995
|
+
triples.push_back({i, i, 1});
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
return CSRGeneralMatrix(graph.upperNodeIdBound(), triples, zero);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Iterate over all non-zero elements of row @a row in the matrix and call
|
|
1004
|
+
* handler(index column, ValueType value)
|
|
1005
|
+
*/
|
|
1006
|
+
template <typename L>
|
|
1007
|
+
void forNonZeroElementsInRow(index row, L handle) const {
|
|
1008
|
+
for (index k = rowIdx[row]; k < rowIdx[row + 1]; ++k)
|
|
1009
|
+
handle(columnIdx[k], nonZeros[k]);
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Iterate in parallel over all non-zero elements of row @a row in the matrix
|
|
1014
|
+
* and call handler(index column, ValueType value)
|
|
1015
|
+
*/
|
|
1016
|
+
template <typename L>
|
|
1017
|
+
void parallelForNonZeroElementsInRow(index row, L handle) const;
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Iterate over all elements in row @a i in the matrix and call handle(index
|
|
1021
|
+
* column, ValueType value)
|
|
1022
|
+
*/
|
|
1023
|
+
template <typename L>
|
|
1024
|
+
void forElementsInRow(index i, L handle) const;
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Iterate in parallel over all elements (including zeros) of row @a row in the matrix and call
|
|
1028
|
+
* handler(index column, double value)
|
|
1029
|
+
*/
|
|
1030
|
+
template <typename L>
|
|
1031
|
+
void parallelForElementsInRow(index row, L handle) const;
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Iterate over all elements of the matrix in row order and call handler (lambda
|
|
1035
|
+
* closure).
|
|
1036
|
+
*/
|
|
1037
|
+
template <typename L>
|
|
1038
|
+
void forElementsInRowOrder(L handle) const;
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Iterate in parallel over all rows and call handler (lambda closure) on elements of
|
|
1042
|
+
* the matrix.
|
|
1043
|
+
*/
|
|
1044
|
+
template <typename L>
|
|
1045
|
+
void parallelForElementsInRowOrder(L handle) const;
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Iterate over all non-zero elements of the matrix in row order and call
|
|
1049
|
+
* handler (lambda closure).
|
|
1050
|
+
*/
|
|
1051
|
+
template <typename L>
|
|
1052
|
+
void forNonZeroElementsInRowOrder(L handle) const;
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Iterate in parallel over all rows and call handler (lambda closure) on
|
|
1056
|
+
* non-zero elements of the matrix.
|
|
1057
|
+
*/
|
|
1058
|
+
template <typename L>
|
|
1059
|
+
void parallelForNonZeroElementsInRowOrder(L handle) const;
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
template <typename ValueType>
|
|
1063
|
+
template <typename L>
|
|
1064
|
+
inline CSRGeneralMatrix<ValueType>
|
|
1065
|
+
CSRGeneralMatrix<ValueType>::binaryOperator(const CSRGeneralMatrix<ValueType> &A,
|
|
1066
|
+
const CSRGeneralMatrix<ValueType> &B, L binaryOp) {
|
|
1067
|
+
assert(A.nRows == B.nRows && A.nCols == B.nCols);
|
|
1068
|
+
|
|
1069
|
+
if (A.sorted() && B.sorted()) {
|
|
1070
|
+
std::vector<index> rowIdx(A.nRows + 1);
|
|
1071
|
+
std::vector<std::vector<index>> columns(A.nRows);
|
|
1072
|
+
rowIdx[0] = 0;
|
|
1073
|
+
|
|
1074
|
+
#pragma omp parallel for
|
|
1075
|
+
for (omp_index i = 0; i < static_cast<omp_index>(A.nRows); ++i) {
|
|
1076
|
+
index k = A.rowIdx[i];
|
|
1077
|
+
index l = B.rowIdx[i];
|
|
1078
|
+
while (k < A.rowIdx[i + 1] && l < B.rowIdx[i + 1]) {
|
|
1079
|
+
if (A.columnIdx[k] < B.columnIdx[l]) {
|
|
1080
|
+
columns[i].push_back(A.columnIdx[k]);
|
|
1081
|
+
++k;
|
|
1082
|
+
} else if (A.columnIdx[k] > B.columnIdx[l]) {
|
|
1083
|
+
columns[i].push_back(B.columnIdx[l]);
|
|
1084
|
+
++l;
|
|
1085
|
+
} else { // A.columnIdx[k] == B.columnIdx[l]
|
|
1086
|
+
columns[i].push_back(A.columnIdx[k]);
|
|
1087
|
+
++k;
|
|
1088
|
+
++l;
|
|
1089
|
+
}
|
|
1090
|
+
++rowIdx[i + 1];
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
while (k < A.rowIdx[i + 1]) {
|
|
1094
|
+
columns[i].push_back(A.columnIdx[k]);
|
|
1095
|
+
++k;
|
|
1096
|
+
++rowIdx[i + 1];
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
while (l < B.rowIdx[i + 1]) {
|
|
1100
|
+
columns[i].push_back(B.columnIdx[l]);
|
|
1101
|
+
++l;
|
|
1102
|
+
++rowIdx[i + 1];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
for (index i = 0; i < A.nRows; ++i)
|
|
1107
|
+
rowIdx[i + 1] += rowIdx[i];
|
|
1108
|
+
|
|
1109
|
+
count nnz = rowIdx[A.nRows];
|
|
1110
|
+
std::vector<index> columnIdx(nnz);
|
|
1111
|
+
std::vector<ValueType> nonZeros(nnz, A.zero);
|
|
1112
|
+
|
|
1113
|
+
#pragma omp parallel for
|
|
1114
|
+
for (omp_index i = 0; i < static_cast<omp_index>(A.nRows); ++i) {
|
|
1115
|
+
for (index cIdx = rowIdx[i], j = 0; cIdx < rowIdx[i + 1]; ++cIdx, ++j)
|
|
1116
|
+
columnIdx[cIdx] = columns[i][j];
|
|
1117
|
+
|
|
1118
|
+
columns[i].clear();
|
|
1119
|
+
columns[i].resize(0);
|
|
1120
|
+
columns[i].shrink_to_fit();
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
#pragma omp parallel for
|
|
1124
|
+
for (omp_index i = 0; i < static_cast<omp_index>(A.nRows); ++i) {
|
|
1125
|
+
index k = A.rowIdx[i];
|
|
1126
|
+
index l = B.rowIdx[i];
|
|
1127
|
+
for (index cIdx = rowIdx[i]; cIdx < rowIdx[i + 1]; ++cIdx) {
|
|
1128
|
+
if (k < A.rowIdx[i + 1] && columnIdx[cIdx] == A.columnIdx[k]) {
|
|
1129
|
+
nonZeros[cIdx] = A.nonZeros[k];
|
|
1130
|
+
++k;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
if (l < B.rowIdx[i + 1] && columnIdx[cIdx] == B.columnIdx[l]) {
|
|
1134
|
+
nonZeros[cIdx] = binaryOp(nonZeros[cIdx], B.nonZeros[l]);
|
|
1135
|
+
++l;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
return CSRGeneralMatrix(A.nRows, A.nCols, rowIdx, columnIdx, nonZeros, A.zero, true);
|
|
1141
|
+
} else { // A or B not sorted
|
|
1142
|
+
std::vector<int64_t> columnPointer(A.nCols, -1);
|
|
1143
|
+
std::vector<ValueType> Arow(A.nCols, A.zero);
|
|
1144
|
+
std::vector<ValueType> Brow(A.nCols, B.zero);
|
|
1145
|
+
|
|
1146
|
+
std::vector<Triplet> triplets;
|
|
1147
|
+
|
|
1148
|
+
for (index i = 0; i < A.nRows; ++i) {
|
|
1149
|
+
index listHead = 0;
|
|
1150
|
+
count nnz = 0;
|
|
1151
|
+
|
|
1152
|
+
// search for nonZeros in our own matrix
|
|
1153
|
+
for (index k = A.rowIdx[i]; k < A.rowIdx[i + 1]; ++k) {
|
|
1154
|
+
index j = A.columnIdx[k];
|
|
1155
|
+
Arow[j] = A.nonZeros[k];
|
|
1156
|
+
|
|
1157
|
+
columnPointer[j] = listHead;
|
|
1158
|
+
listHead = j;
|
|
1159
|
+
nnz++;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// search for nonZeros in the other matrix
|
|
1163
|
+
for (index k = B.rowIdx[i]; k < B.rowIdx[i + 1]; ++k) {
|
|
1164
|
+
index j = B.columnIdx[k];
|
|
1165
|
+
Brow[j] = B.nonZeros[k];
|
|
1166
|
+
|
|
1167
|
+
if (columnPointer[j]
|
|
1168
|
+
== -1) { // our own matrix does not have a nonZero entry in column j
|
|
1169
|
+
columnPointer[j] = listHead;
|
|
1170
|
+
listHead = j;
|
|
1171
|
+
nnz++;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// apply operator on the found nonZeros in A and B
|
|
1176
|
+
for (count k = 0; k < nnz; ++k) {
|
|
1177
|
+
ValueType value = binaryOp(Arow[listHead], Brow[listHead]);
|
|
1178
|
+
if (value != A.zero)
|
|
1179
|
+
triplets.push_back({i, listHead, value});
|
|
1180
|
+
|
|
1181
|
+
index temp = listHead;
|
|
1182
|
+
listHead = columnPointer[listHead];
|
|
1183
|
+
|
|
1184
|
+
// reset for next row
|
|
1185
|
+
columnPointer[temp] = -1;
|
|
1186
|
+
Arow[temp] = A.zero;
|
|
1187
|
+
Brow[temp] = B.zero;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
nnz = 0;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
return CSRGeneralMatrix(A.numberOfRows(), A.numberOfColumns(), triplets);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
template <typename ValueType>
|
|
1198
|
+
template <typename F>
|
|
1199
|
+
void CSRGeneralMatrix<ValueType>::apply(const F unaryElementFunction) {
|
|
1200
|
+
#pragma omp parallel for
|
|
1201
|
+
for (omp_index k = 0; k < static_cast<omp_index>(nonZeros.size()); ++k)
|
|
1202
|
+
nonZeros[k] = unaryElementFunction(nonZeros[k]);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
template <typename ValueType>
|
|
1206
|
+
template <typename L>
|
|
1207
|
+
inline void CSRGeneralMatrix<ValueType>::parallelForNonZeroElementsInRow(index i, L handle) const {
|
|
1208
|
+
#pragma omp parallel for
|
|
1209
|
+
for (omp_index k = rowIdx[i]; k < static_cast<omp_index>(rowIdx[i + 1]); ++k)
|
|
1210
|
+
handle(columnIdx[k], nonZeros[k]);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
template <typename ValueType>
|
|
1214
|
+
template <typename L>
|
|
1215
|
+
inline void CSRGeneralMatrix<ValueType>::forElementsInRow(index i, L handle) const {
|
|
1216
|
+
Vector rowVector = row(i);
|
|
1217
|
+
index j = 0;
|
|
1218
|
+
rowVector.forElements([&](ValueType val) { handle(j++, val); });
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
template <typename ValueType>
|
|
1222
|
+
template <typename L>
|
|
1223
|
+
inline void CSRGeneralMatrix<ValueType>::parallelForElementsInRow(index i, L handle) const {
|
|
1224
|
+
row(i).parallelForElements(handle);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
template <typename ValueType>
|
|
1228
|
+
template <typename L>
|
|
1229
|
+
inline void CSRGeneralMatrix<ValueType>::forElementsInRowOrder(L handle) const {
|
|
1230
|
+
for (index i = 0; i < nRows; ++i) {
|
|
1231
|
+
index col = 0;
|
|
1232
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k) {
|
|
1233
|
+
while (col < columnIdx[k]) {
|
|
1234
|
+
handle(i, col, getZero());
|
|
1235
|
+
++col;
|
|
1236
|
+
}
|
|
1237
|
+
handle(i, col, nonZeros[k]);
|
|
1238
|
+
++col;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
template <typename ValueType>
|
|
1244
|
+
template <typename L>
|
|
1245
|
+
inline void CSRGeneralMatrix<ValueType>::parallelForElementsInRowOrder(L handle) const {
|
|
1246
|
+
#pragma omp parallel for
|
|
1247
|
+
for (omp_index i = 0; i < static_cast<omp_index>(nRows); ++i) {
|
|
1248
|
+
index col = 0;
|
|
1249
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k) {
|
|
1250
|
+
while (col < columnIdx[k]) {
|
|
1251
|
+
handle(i, col, getZero());
|
|
1252
|
+
++col;
|
|
1253
|
+
}
|
|
1254
|
+
handle(i, col, nonZeros[k]);
|
|
1255
|
+
++col;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
template <typename ValueType>
|
|
1261
|
+
template <typename L>
|
|
1262
|
+
inline void CSRGeneralMatrix<ValueType>::forNonZeroElementsInRowOrder(L handle) const {
|
|
1263
|
+
for (index i = 0; i < nRows; ++i)
|
|
1264
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k)
|
|
1265
|
+
handle(i, columnIdx[k], nonZeros[k]);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
template <typename ValueType>
|
|
1269
|
+
template <typename L>
|
|
1270
|
+
inline void CSRGeneralMatrix<ValueType>::parallelForNonZeroElementsInRowOrder(L handle) const {
|
|
1271
|
+
for (omp_index i = 0; i < static_cast<omp_index>(nRows); ++i)
|
|
1272
|
+
for (index k = rowIdx[i]; k < rowIdx[i + 1]; ++k)
|
|
1273
|
+
handle(i, columnIdx[k], nonZeros[k]);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
// print functions for test debugging / output
|
|
1277
|
+
template <typename T>
|
|
1278
|
+
inline std::ostream &operator<<(std::ostream &os, const CSRGeneralMatrix<T> &M) {
|
|
1279
|
+
for (index row = 0; row < M.numberOfRows(); ++row) {
|
|
1280
|
+
if (row != 0)
|
|
1281
|
+
os << std::endl;
|
|
1282
|
+
for (index col = 0; col < M.numberOfColumns(); ++col) {
|
|
1283
|
+
if (col != 0)
|
|
1284
|
+
os << ", ";
|
|
1285
|
+
os << M(row, col);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
return os;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
} /* namespace NetworKit */
|
|
1292
|
+
#endif // NETWORKIT_ALGEBRAIC_CSR_GENERAL_MATRIX_HPP_
|