@ladybugmem/icebug 0.1.0 → 0.1.1

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.
Files changed (625) hide show
  1. package/binding.gyp +32 -10
  2. package/lib/index.js +23 -11
  3. package/package.json +8 -13
  4. package/prebuilds/darwin-arm64/icebug.node +0 -0
  5. package/{vendor/lib → prebuilds/darwin-arm64}/libnetworkit.dylib +0 -0
  6. package/prebuilds/linux-x64/icebug.node +0 -0
  7. package/prebuilds/linux-x64/libnetworkit.so +0 -0
  8. package/scripts/download-icebug.sh +92 -0
  9. package/build/Release/.deps/Release/icebug.node.d +0 -1
  10. package/build/Release/.deps/Release/obj.target/icebug/src/addon.o.d +0 -291
  11. package/build/Release/icebug.node +0 -0
  12. package/build/Release/obj.target/icebug/src/addon.o +0 -0
  13. package/vendor/include/networkit/GlobalState.hpp +0 -86
  14. package/vendor/include/networkit/Globals.hpp +0 -41
  15. package/vendor/include/networkit/algebraic/AlgebraicGlobals.hpp +0 -27
  16. package/vendor/include/networkit/algebraic/CSRGeneralMatrix.hpp +0 -1292
  17. package/vendor/include/networkit/algebraic/CSRMatrix.hpp +0 -11
  18. package/vendor/include/networkit/algebraic/DenseMatrix.hpp +0 -537
  19. package/vendor/include/networkit/algebraic/DynamicMatrix.hpp +0 -514
  20. package/vendor/include/networkit/algebraic/GraphBLAS.hpp +0 -323
  21. package/vendor/include/networkit/algebraic/MatrixTools.hpp +0 -156
  22. package/vendor/include/networkit/algebraic/Semirings.hpp +0 -171
  23. package/vendor/include/networkit/algebraic/SparseAccumulator.hpp +0 -111
  24. package/vendor/include/networkit/algebraic/Vector.hpp +0 -371
  25. package/vendor/include/networkit/algebraic/algorithms/AlgebraicBFS.hpp +0 -72
  26. package/vendor/include/networkit/algebraic/algorithms/AlgebraicBellmanFord.hpp +0 -88
  27. package/vendor/include/networkit/algebraic/algorithms/AlgebraicMatchingCoarsening.hpp +0 -96
  28. package/vendor/include/networkit/algebraic/algorithms/AlgebraicPageRank.hpp +0 -145
  29. package/vendor/include/networkit/algebraic/algorithms/AlgebraicSpanningEdgeCentrality.hpp +0 -122
  30. package/vendor/include/networkit/algebraic/algorithms/AlgebraicTriangleCounting.hpp +0 -76
  31. package/vendor/include/networkit/auxiliary/AlignedAllocator.hpp +0 -113
  32. package/vendor/include/networkit/auxiliary/ArrayTools.hpp +0 -85
  33. package/vendor/include/networkit/auxiliary/BloomFilter.hpp +0 -70
  34. package/vendor/include/networkit/auxiliary/BucketPQ.hpp +0 -142
  35. package/vendor/include/networkit/auxiliary/Enforce.hpp +0 -117
  36. package/vendor/include/networkit/auxiliary/FunctionTraits.hpp +0 -74
  37. package/vendor/include/networkit/auxiliary/HashUtils.hpp +0 -28
  38. package/vendor/include/networkit/auxiliary/IncrementalUniformRandomSelector.hpp +0 -52
  39. package/vendor/include/networkit/auxiliary/Log.hpp +0 -119
  40. package/vendor/include/networkit/auxiliary/MissingMath.hpp +0 -48
  41. package/vendor/include/networkit/auxiliary/Multiprecision.hpp +0 -17
  42. package/vendor/include/networkit/auxiliary/NumberParsing.hpp +0 -307
  43. package/vendor/include/networkit/auxiliary/NumericTools.hpp +0 -57
  44. package/vendor/include/networkit/auxiliary/Parallel.hpp +0 -56
  45. package/vendor/include/networkit/auxiliary/Parallelism.hpp +0 -33
  46. package/vendor/include/networkit/auxiliary/PrioQueue.hpp +0 -252
  47. package/vendor/include/networkit/auxiliary/Random.hpp +0 -122
  48. package/vendor/include/networkit/auxiliary/SetIntersector.hpp +0 -72
  49. package/vendor/include/networkit/auxiliary/SignalHandling.hpp +0 -39
  50. package/vendor/include/networkit/auxiliary/SortedList.hpp +0 -128
  51. package/vendor/include/networkit/auxiliary/SparseVector.hpp +0 -215
  52. package/vendor/include/networkit/auxiliary/SpinLock.hpp +0 -23
  53. package/vendor/include/networkit/auxiliary/StringBuilder.hpp +0 -322
  54. package/vendor/include/networkit/auxiliary/StringTools.hpp +0 -76
  55. package/vendor/include/networkit/auxiliary/TemplateUtils.hpp +0 -76
  56. package/vendor/include/networkit/auxiliary/Timer.hpp +0 -145
  57. package/vendor/include/networkit/auxiliary/VectorComparator.hpp +0 -32
  58. package/vendor/include/networkit/base/Algorithm.hpp +0 -41
  59. package/vendor/include/networkit/base/DynAlgorithm.hpp +0 -31
  60. package/vendor/include/networkit/centrality/ApproxBetweenness.hpp +0 -62
  61. package/vendor/include/networkit/centrality/ApproxCloseness.hpp +0 -136
  62. package/vendor/include/networkit/centrality/ApproxElectricalCloseness.hpp +0 -156
  63. package/vendor/include/networkit/centrality/ApproxGroupBetweenness.hpp +0 -124
  64. package/vendor/include/networkit/centrality/ApproxSpanningEdge.hpp +0 -84
  65. package/vendor/include/networkit/centrality/Betweenness.hpp +0 -47
  66. package/vendor/include/networkit/centrality/Centrality.hpp +0 -98
  67. package/vendor/include/networkit/centrality/Closeness.hpp +0 -107
  68. package/vendor/include/networkit/centrality/ComplexPaths.hpp +0 -113
  69. package/vendor/include/networkit/centrality/CoreDecomposition.hpp +0 -161
  70. package/vendor/include/networkit/centrality/DegreeCentrality.hpp +0 -55
  71. package/vendor/include/networkit/centrality/DynApproxBetweenness.hpp +0 -95
  72. package/vendor/include/networkit/centrality/DynBetweenness.hpp +0 -99
  73. package/vendor/include/networkit/centrality/DynBetweennessOneNode.hpp +0 -98
  74. package/vendor/include/networkit/centrality/DynKatzCentrality.hpp +0 -115
  75. package/vendor/include/networkit/centrality/DynTopHarmonicCloseness.hpp +0 -223
  76. package/vendor/include/networkit/centrality/EigenvectorCentrality.hpp +0 -41
  77. package/vendor/include/networkit/centrality/EstimateBetweenness.hpp +0 -51
  78. package/vendor/include/networkit/centrality/ForestCentrality.hpp +0 -112
  79. package/vendor/include/networkit/centrality/GedWalk.hpp +0 -225
  80. package/vendor/include/networkit/centrality/GroupCloseness.hpp +0 -115
  81. package/vendor/include/networkit/centrality/GroupClosenessGrowShrink.hpp +0 -78
  82. package/vendor/include/networkit/centrality/GroupClosenessLocalSearch.hpp +0 -77
  83. package/vendor/include/networkit/centrality/GroupClosenessLocalSwaps.hpp +0 -106
  84. package/vendor/include/networkit/centrality/GroupDegree.hpp +0 -155
  85. package/vendor/include/networkit/centrality/GroupHarmonicCloseness.hpp +0 -83
  86. package/vendor/include/networkit/centrality/HarmonicCloseness.hpp +0 -48
  87. package/vendor/include/networkit/centrality/KPathCentrality.hpp +0 -52
  88. package/vendor/include/networkit/centrality/KadabraBetweenness.hpp +0 -242
  89. package/vendor/include/networkit/centrality/KatzCentrality.hpp +0 -62
  90. package/vendor/include/networkit/centrality/LaplacianCentrality.hpp +0 -44
  91. package/vendor/include/networkit/centrality/LocalClusteringCoefficient.hpp +0 -60
  92. package/vendor/include/networkit/centrality/LocalPartitionCoverage.hpp +0 -43
  93. package/vendor/include/networkit/centrality/LocalSquareClusteringCoefficient.hpp +0 -42
  94. package/vendor/include/networkit/centrality/PageRank.hpp +0 -101
  95. package/vendor/include/networkit/centrality/PermanenceCentrality.hpp +0 -48
  96. package/vendor/include/networkit/centrality/Sfigality.hpp +0 -45
  97. package/vendor/include/networkit/centrality/SpanningEdgeCentrality.hpp +0 -86
  98. package/vendor/include/networkit/centrality/TopCloseness.hpp +0 -136
  99. package/vendor/include/networkit/centrality/TopHarmonicCloseness.hpp +0 -151
  100. package/vendor/include/networkit/clique/MaximalCliques.hpp +0 -83
  101. package/vendor/include/networkit/coarsening/ClusteringProjector.hpp +0 -59
  102. package/vendor/include/networkit/coarsening/CoarsenedGraphView.hpp +0 -156
  103. package/vendor/include/networkit/coarsening/GraphCoarsening.hpp +0 -57
  104. package/vendor/include/networkit/coarsening/MatchingCoarsening.hpp +0 -43
  105. package/vendor/include/networkit/coarsening/ParallelPartitionCoarsening.hpp +0 -33
  106. package/vendor/include/networkit/coarsening/ParallelPartitionCoarseningView.hpp +0 -62
  107. package/vendor/include/networkit/community/AdjustedRandMeasure.hpp +0 -31
  108. package/vendor/include/networkit/community/ClusteringGenerator.hpp +0 -75
  109. package/vendor/include/networkit/community/CommunityDetectionAlgorithm.hpp +0 -58
  110. package/vendor/include/networkit/community/Conductance.hpp +0 -32
  111. package/vendor/include/networkit/community/CoverF1Similarity.hpp +0 -53
  112. package/vendor/include/networkit/community/CoverHubDominance.hpp +0 -38
  113. package/vendor/include/networkit/community/Coverage.hpp +0 -25
  114. package/vendor/include/networkit/community/CutClustering.hpp +0 -62
  115. package/vendor/include/networkit/community/DissimilarityMeasure.hpp +0 -31
  116. package/vendor/include/networkit/community/DynamicNMIDistance.hpp +0 -44
  117. package/vendor/include/networkit/community/EdgeCut.hpp +0 -24
  118. package/vendor/include/networkit/community/GraphClusteringTools.hpp +0 -103
  119. package/vendor/include/networkit/community/GraphStructuralRandMeasure.hpp +0 -28
  120. package/vendor/include/networkit/community/HubDominance.hpp +0 -46
  121. package/vendor/include/networkit/community/IntrapartitionDensity.hpp +0 -44
  122. package/vendor/include/networkit/community/IsolatedInterpartitionConductance.hpp +0 -40
  123. package/vendor/include/networkit/community/IsolatedInterpartitionExpansion.hpp +0 -40
  124. package/vendor/include/networkit/community/JaccardMeasure.hpp +0 -25
  125. package/vendor/include/networkit/community/LFM.hpp +0 -49
  126. package/vendor/include/networkit/community/LPDegreeOrdered.hpp +0 -48
  127. package/vendor/include/networkit/community/LocalCommunityEvaluation.hpp +0 -100
  128. package/vendor/include/networkit/community/LocalCoverEvaluation.hpp +0 -31
  129. package/vendor/include/networkit/community/LocalPartitionEvaluation.hpp +0 -31
  130. package/vendor/include/networkit/community/LouvainMapEquation.hpp +0 -135
  131. package/vendor/include/networkit/community/Modularity.hpp +0 -54
  132. package/vendor/include/networkit/community/NMIDistance.hpp +0 -28
  133. package/vendor/include/networkit/community/NodeStructuralRandMeasure.hpp +0 -27
  134. package/vendor/include/networkit/community/OverlappingCommunityDetectionAlgorithm.hpp +0 -51
  135. package/vendor/include/networkit/community/OverlappingNMIDistance.hpp +0 -175
  136. package/vendor/include/networkit/community/PLM.hpp +0 -89
  137. package/vendor/include/networkit/community/PLP.hpp +0 -83
  138. package/vendor/include/networkit/community/ParallelAgglomerativeClusterer.hpp +0 -37
  139. package/vendor/include/networkit/community/ParallelLeiden.hpp +0 -96
  140. package/vendor/include/networkit/community/ParallelLeidenView.hpp +0 -138
  141. package/vendor/include/networkit/community/PartitionFragmentation.hpp +0 -30
  142. package/vendor/include/networkit/community/PartitionHubDominance.hpp +0 -37
  143. package/vendor/include/networkit/community/PartitionIntersection.hpp +0 -25
  144. package/vendor/include/networkit/community/QualityMeasure.hpp +0 -27
  145. package/vendor/include/networkit/community/SampledGraphStructuralRandMeasure.hpp +0 -40
  146. package/vendor/include/networkit/community/SampledNodeStructuralRandMeasure.hpp +0 -40
  147. package/vendor/include/networkit/community/StablePartitionNodes.hpp +0 -48
  148. package/vendor/include/networkit/components/BiconnectedComponents.hpp +0 -116
  149. package/vendor/include/networkit/components/ComponentDecomposition.hpp +0 -72
  150. package/vendor/include/networkit/components/ConnectedComponents.hpp +0 -55
  151. package/vendor/include/networkit/components/DynConnectedComponents.hpp +0 -71
  152. package/vendor/include/networkit/components/DynWeaklyConnectedComponents.hpp +0 -73
  153. package/vendor/include/networkit/components/ParallelConnectedComponents.hpp +0 -44
  154. package/vendor/include/networkit/components/RandomSpanningForest.hpp +0 -36
  155. package/vendor/include/networkit/components/StronglyConnectedComponents.hpp +0 -50
  156. package/vendor/include/networkit/components/WeaklyConnectedComponents.hpp +0 -59
  157. package/vendor/include/networkit/correlation/Assortativity.hpp +0 -64
  158. package/vendor/include/networkit/distance/APSP.hpp +0 -70
  159. package/vendor/include/networkit/distance/AStar.hpp +0 -68
  160. package/vendor/include/networkit/distance/AStarGeneral.hpp +0 -110
  161. package/vendor/include/networkit/distance/AdamicAdarDistance.hpp +0 -52
  162. package/vendor/include/networkit/distance/AffectedNodes.hpp +0 -130
  163. package/vendor/include/networkit/distance/AlgebraicDistance.hpp +0 -63
  164. package/vendor/include/networkit/distance/BFS.hpp +0 -43
  165. package/vendor/include/networkit/distance/BidirectionalBFS.hpp +0 -51
  166. package/vendor/include/networkit/distance/BidirectionalDijkstra.hpp +0 -69
  167. package/vendor/include/networkit/distance/CommuteTimeDistance.hpp +0 -89
  168. package/vendor/include/networkit/distance/Diameter.hpp +0 -97
  169. package/vendor/include/networkit/distance/Dijkstra.hpp +0 -50
  170. package/vendor/include/networkit/distance/DynAPSP.hpp +0 -67
  171. package/vendor/include/networkit/distance/DynBFS.hpp +0 -56
  172. package/vendor/include/networkit/distance/DynDijkstra.hpp +0 -57
  173. package/vendor/include/networkit/distance/DynPrunedLandmarkLabeling.hpp +0 -67
  174. package/vendor/include/networkit/distance/DynSSSP.hpp +0 -87
  175. package/vendor/include/networkit/distance/Eccentricity.hpp +0 -32
  176. package/vendor/include/networkit/distance/EffectiveDiameter.hpp +0 -47
  177. package/vendor/include/networkit/distance/EffectiveDiameterApproximation.hpp +0 -57
  178. package/vendor/include/networkit/distance/FloydWarshall.hpp +0 -93
  179. package/vendor/include/networkit/distance/GraphDistance.hpp +0 -49
  180. package/vendor/include/networkit/distance/HopPlotApproximation.hpp +0 -62
  181. package/vendor/include/networkit/distance/IncompleteDijkstra.hpp +0 -66
  182. package/vendor/include/networkit/distance/IncompleteSSSP.hpp +0 -41
  183. package/vendor/include/networkit/distance/JaccardDistance.hpp +0 -57
  184. package/vendor/include/networkit/distance/MultiTargetBFS.hpp +0 -32
  185. package/vendor/include/networkit/distance/MultiTargetDijkstra.hpp +0 -40
  186. package/vendor/include/networkit/distance/NeighborhoodFunction.hpp +0 -47
  187. package/vendor/include/networkit/distance/NeighborhoodFunctionApproximation.hpp +0 -56
  188. package/vendor/include/networkit/distance/NeighborhoodFunctionHeuristic.hpp +0 -56
  189. package/vendor/include/networkit/distance/NodeDistance.hpp +0 -54
  190. package/vendor/include/networkit/distance/PrunedLandmarkLabeling.hpp +0 -76
  191. package/vendor/include/networkit/distance/ReverseBFS.hpp +0 -46
  192. package/vendor/include/networkit/distance/SPSP.hpp +0 -143
  193. package/vendor/include/networkit/distance/SSSP.hpp +0 -216
  194. package/vendor/include/networkit/distance/STSP.hpp +0 -193
  195. package/vendor/include/networkit/distance/Volume.hpp +0 -66
  196. package/vendor/include/networkit/dynamics/DGSStreamParser.hpp +0 -40
  197. package/vendor/include/networkit/dynamics/DGSWriter.hpp +0 -30
  198. package/vendor/include/networkit/dynamics/GraphDifference.hpp +0 -110
  199. package/vendor/include/networkit/dynamics/GraphEvent.hpp +0 -55
  200. package/vendor/include/networkit/dynamics/GraphEventHandler.hpp +0 -39
  201. package/vendor/include/networkit/dynamics/GraphEventProxy.hpp +0 -55
  202. package/vendor/include/networkit/dynamics/GraphUpdater.hpp +0 -38
  203. package/vendor/include/networkit/edgescores/ChibaNishizekiQuadrangleEdgeScore.hpp +0 -26
  204. package/vendor/include/networkit/edgescores/ChibaNishizekiTriangleEdgeScore.hpp +0 -33
  205. package/vendor/include/networkit/edgescores/EdgeScore.hpp +0 -50
  206. package/vendor/include/networkit/edgescores/EdgeScoreAsWeight.hpp +0 -33
  207. package/vendor/include/networkit/edgescores/EdgeScoreBlender.hpp +0 -33
  208. package/vendor/include/networkit/edgescores/EdgeScoreLinearizer.hpp +0 -32
  209. package/vendor/include/networkit/edgescores/EdgeScoreNormalizer.hpp +0 -35
  210. package/vendor/include/networkit/edgescores/GeometricMeanScore.hpp +0 -29
  211. package/vendor/include/networkit/edgescores/PrefixJaccardScore.hpp +0 -23
  212. package/vendor/include/networkit/edgescores/TriangleEdgeScore.hpp +0 -39
  213. package/vendor/include/networkit/embedding/Node2Vec.hpp +0 -83
  214. package/vendor/include/networkit/flow/EdmondsKarp.hpp +0 -112
  215. package/vendor/include/networkit/generators/BarabasiAlbertGenerator.hpp +0 -87
  216. package/vendor/include/networkit/generators/ChungLuGenerator.hpp +0 -46
  217. package/vendor/include/networkit/generators/ChungLuGeneratorAlamEtAl.hpp +0 -63
  218. package/vendor/include/networkit/generators/ClusteredRandomGraphGenerator.hpp +0 -56
  219. package/vendor/include/networkit/generators/ConfigurationModel.hpp +0 -36
  220. package/vendor/include/networkit/generators/DorogovtsevMendesGenerator.hpp +0 -33
  221. package/vendor/include/networkit/generators/DynamicBarabasiAlbertGenerator.hpp +0 -33
  222. package/vendor/include/networkit/generators/DynamicDGSParser.hpp +0 -51
  223. package/vendor/include/networkit/generators/DynamicDorogovtsevMendesGenerator.hpp +0 -34
  224. package/vendor/include/networkit/generators/DynamicForestFireGenerator.hpp +0 -55
  225. package/vendor/include/networkit/generators/DynamicGraphGenerator.hpp +0 -40
  226. package/vendor/include/networkit/generators/DynamicGraphSource.hpp +0 -79
  227. package/vendor/include/networkit/generators/DynamicHyperbolicGenerator.hpp +0 -143
  228. package/vendor/include/networkit/generators/DynamicPathGenerator.hpp +0 -26
  229. package/vendor/include/networkit/generators/DynamicPubWebGenerator.hpp +0 -54
  230. package/vendor/include/networkit/generators/EdgeSwitchingMarkovChainGenerator.hpp +0 -65
  231. package/vendor/include/networkit/generators/ErdosRenyiEnumerator.hpp +0 -318
  232. package/vendor/include/networkit/generators/ErdosRenyiGenerator.hpp +0 -56
  233. package/vendor/include/networkit/generators/HavelHakimiGenerator.hpp +0 -48
  234. package/vendor/include/networkit/generators/HyperbolicGenerator.hpp +0 -236
  235. package/vendor/include/networkit/generators/LFRGenerator.hpp +0 -175
  236. package/vendor/include/networkit/generators/MocnikGenerator.hpp +0 -147
  237. package/vendor/include/networkit/generators/MocnikGeneratorBasic.hpp +0 -58
  238. package/vendor/include/networkit/generators/PowerlawDegreeSequence.hpp +0 -128
  239. package/vendor/include/networkit/generators/PubWebGenerator.hpp +0 -94
  240. package/vendor/include/networkit/generators/RegularRingLatticeGenerator.hpp +0 -37
  241. package/vendor/include/networkit/generators/RmatGenerator.hpp +0 -67
  242. package/vendor/include/networkit/generators/StaticDegreeSequenceGenerator.hpp +0 -42
  243. package/vendor/include/networkit/generators/StaticGraphGenerator.hpp +0 -30
  244. package/vendor/include/networkit/generators/StochasticBlockmodel.hpp +0 -41
  245. package/vendor/include/networkit/generators/WattsStrogatzGenerator.hpp +0 -43
  246. package/vendor/include/networkit/generators/quadtree/QuadNode.hpp +0 -857
  247. package/vendor/include/networkit/generators/quadtree/QuadNodeCartesianEuclid.hpp +0 -587
  248. package/vendor/include/networkit/generators/quadtree/QuadNodePolarEuclid.hpp +0 -726
  249. package/vendor/include/networkit/generators/quadtree/Quadtree.hpp +0 -232
  250. package/vendor/include/networkit/generators/quadtree/QuadtreeCartesianEuclid.hpp +0 -149
  251. package/vendor/include/networkit/generators/quadtree/QuadtreePolarEuclid.hpp +0 -143
  252. package/vendor/include/networkit/geometric/HyperbolicSpace.hpp +0 -248
  253. package/vendor/include/networkit/geometric/Point2DWithIndex.hpp +0 -145
  254. package/vendor/include/networkit/global/ClusteringCoefficient.hpp +0 -42
  255. package/vendor/include/networkit/global/GlobalClusteringCoefficient.hpp +0 -24
  256. package/vendor/include/networkit/graph/Attributes.hpp +0 -568
  257. package/vendor/include/networkit/graph/BFS.hpp +0 -111
  258. package/vendor/include/networkit/graph/DFS.hpp +0 -71
  259. package/vendor/include/networkit/graph/Dijkstra.hpp +0 -83
  260. package/vendor/include/networkit/graph/EdgeIterators.hpp +0 -171
  261. package/vendor/include/networkit/graph/Graph.hpp +0 -2083
  262. package/vendor/include/networkit/graph/GraphBuilder.hpp +0 -289
  263. package/vendor/include/networkit/graph/GraphR.hpp +0 -133
  264. package/vendor/include/networkit/graph/GraphTools.hpp +0 -589
  265. package/vendor/include/networkit/graph/GraphW.hpp +0 -1236
  266. package/vendor/include/networkit/graph/KruskalMSF.hpp +0 -50
  267. package/vendor/include/networkit/graph/NeighborIterators.hpp +0 -163
  268. package/vendor/include/networkit/graph/NodeIterators.hpp +0 -127
  269. package/vendor/include/networkit/graph/PrimMSF.hpp +0 -66
  270. package/vendor/include/networkit/graph/RandomMaximumSpanningForest.hpp +0 -133
  271. package/vendor/include/networkit/graph/SpanningForest.hpp +0 -41
  272. package/vendor/include/networkit/graph/TopologicalSort.hpp +0 -87
  273. package/vendor/include/networkit/graph/UnionMaximumSpanningForest.hpp +0 -126
  274. package/vendor/include/networkit/graph/test/GraphBuilderBenchmark.hpp +0 -68
  275. package/vendor/include/networkit/independentset/IndependentSetFinder.hpp +0 -44
  276. package/vendor/include/networkit/independentset/Luby.hpp +0 -27
  277. package/vendor/include/networkit/io/BinaryEdgeListPartitionReader.hpp +0 -45
  278. package/vendor/include/networkit/io/BinaryEdgeListPartitionWriter.hpp +0 -47
  279. package/vendor/include/networkit/io/BinaryPartitionReader.hpp +0 -41
  280. package/vendor/include/networkit/io/BinaryPartitionWriter.hpp +0 -44
  281. package/vendor/include/networkit/io/CoverReader.hpp +0 -27
  282. package/vendor/include/networkit/io/CoverWriter.hpp +0 -21
  283. package/vendor/include/networkit/io/DGSReader.hpp +0 -39
  284. package/vendor/include/networkit/io/DibapGraphReader.hpp +0 -43
  285. package/vendor/include/networkit/io/DotGraphWriter.hpp +0 -39
  286. package/vendor/include/networkit/io/DotPartitionWriter.hpp +0 -23
  287. package/vendor/include/networkit/io/DynamicGraphReader.hpp +0 -29
  288. package/vendor/include/networkit/io/EdgeListCoverReader.hpp +0 -35
  289. package/vendor/include/networkit/io/EdgeListPartitionReader.hpp +0 -43
  290. package/vendor/include/networkit/io/EdgeListReader.hpp +0 -61
  291. package/vendor/include/networkit/io/EdgeListWriter.hpp +0 -48
  292. package/vendor/include/networkit/io/GMLGraphReader.hpp +0 -33
  293. package/vendor/include/networkit/io/GMLGraphWriter.hpp +0 -33
  294. package/vendor/include/networkit/io/GraphIO.hpp +0 -52
  295. package/vendor/include/networkit/io/GraphReader.hpp +0 -40
  296. package/vendor/include/networkit/io/GraphToolBinaryReader.hpp +0 -71
  297. package/vendor/include/networkit/io/GraphToolBinaryWriter.hpp +0 -61
  298. package/vendor/include/networkit/io/GraphWriter.hpp +0 -27
  299. package/vendor/include/networkit/io/KONECTGraphReader.hpp +0 -44
  300. package/vendor/include/networkit/io/LineFileReader.hpp +0 -42
  301. package/vendor/include/networkit/io/METISGraphReader.hpp +0 -36
  302. package/vendor/include/networkit/io/METISGraphWriter.hpp +0 -29
  303. package/vendor/include/networkit/io/METISParser.hpp +0 -63
  304. package/vendor/include/networkit/io/MTXGraphReader.hpp +0 -31
  305. package/vendor/include/networkit/io/MTXParser.hpp +0 -87
  306. package/vendor/include/networkit/io/MatrixMarketReader.hpp +0 -33
  307. package/vendor/include/networkit/io/MatrixReader.hpp +0 -33
  308. package/vendor/include/networkit/io/MemoryMappedFile.hpp +0 -80
  309. package/vendor/include/networkit/io/NetworkitBinaryGraph.hpp +0 -144
  310. package/vendor/include/networkit/io/NetworkitBinaryReader.hpp +0 -50
  311. package/vendor/include/networkit/io/NetworkitBinaryWriter.hpp +0 -71
  312. package/vendor/include/networkit/io/PartitionReader.hpp +0 -34
  313. package/vendor/include/networkit/io/PartitionWriter.hpp +0 -31
  314. package/vendor/include/networkit/io/RBGraphReader.hpp +0 -37
  315. package/vendor/include/networkit/io/RBMatrixReader.hpp +0 -49
  316. package/vendor/include/networkit/io/RasterReader.hpp +0 -40
  317. package/vendor/include/networkit/io/SNAPEdgeListPartitionReader.hpp +0 -28
  318. package/vendor/include/networkit/io/SNAPGraphReader.hpp +0 -53
  319. package/vendor/include/networkit/io/SNAPGraphWriter.hpp +0 -53
  320. package/vendor/include/networkit/io/ThrillGraphBinaryReader.hpp +0 -44
  321. package/vendor/include/networkit/io/ThrillGraphBinaryWriter.hpp +0 -27
  322. package/vendor/include/networkit/layout/LayoutAlgorithm.hpp +0 -39
  323. package/vendor/include/networkit/linkprediction/AdamicAdarIndex.hpp +0 -37
  324. package/vendor/include/networkit/linkprediction/AdjustedRandIndex.hpp +0 -36
  325. package/vendor/include/networkit/linkprediction/AlgebraicDistanceIndex.hpp +0 -70
  326. package/vendor/include/networkit/linkprediction/CommonNeighborsIndex.hpp +0 -39
  327. package/vendor/include/networkit/linkprediction/EvaluationMetric.hpp +0 -135
  328. package/vendor/include/networkit/linkprediction/JaccardIndex.hpp +0 -44
  329. package/vendor/include/networkit/linkprediction/KatzIndex.hpp +0 -84
  330. package/vendor/include/networkit/linkprediction/LinkPredictor.hpp +0 -98
  331. package/vendor/include/networkit/linkprediction/LinkThresholder.hpp +0 -56
  332. package/vendor/include/networkit/linkprediction/MissingLinksFinder.hpp +0 -60
  333. package/vendor/include/networkit/linkprediction/NeighborhoodDistanceIndex.hpp +0 -42
  334. package/vendor/include/networkit/linkprediction/NeighborhoodUtility.hpp +0 -54
  335. package/vendor/include/networkit/linkprediction/NeighborsMeasureIndex.hpp +0 -48
  336. package/vendor/include/networkit/linkprediction/PrecisionRecallMetric.hpp +0 -40
  337. package/vendor/include/networkit/linkprediction/PredictionsSorter.hpp +0 -66
  338. package/vendor/include/networkit/linkprediction/PreferentialAttachmentIndex.hpp +0 -37
  339. package/vendor/include/networkit/linkprediction/ROCMetric.hpp +0 -39
  340. package/vendor/include/networkit/linkprediction/RandomLinkSampler.hpp +0 -47
  341. package/vendor/include/networkit/linkprediction/ResourceAllocationIndex.hpp +0 -38
  342. package/vendor/include/networkit/linkprediction/SameCommunityIndex.hpp +0 -50
  343. package/vendor/include/networkit/linkprediction/TotalNeighborsIndex.hpp +0 -39
  344. package/vendor/include/networkit/linkprediction/UDegreeIndex.hpp +0 -35
  345. package/vendor/include/networkit/linkprediction/VDegreeIndex.hpp +0 -35
  346. package/vendor/include/networkit/matching/BMatcher.hpp +0 -52
  347. package/vendor/include/networkit/matching/BMatching.hpp +0 -115
  348. package/vendor/include/networkit/matching/BSuitorMatcher.hpp +0 -170
  349. package/vendor/include/networkit/matching/DynamicBSuitorMatcher.hpp +0 -78
  350. package/vendor/include/networkit/matching/LocalMaxMatcher.hpp +0 -35
  351. package/vendor/include/networkit/matching/Matcher.hpp +0 -55
  352. package/vendor/include/networkit/matching/Matching.hpp +0 -111
  353. package/vendor/include/networkit/matching/PathGrowingMatcher.hpp +0 -46
  354. package/vendor/include/networkit/matching/SuitorMatcher.hpp +0 -62
  355. package/vendor/include/networkit/numerics/ConjugateGradient.hpp +0 -163
  356. package/vendor/include/networkit/numerics/GaussSeidelRelaxation.hpp +0 -99
  357. package/vendor/include/networkit/numerics/LAMG/LAMGSettings.hpp +0 -70
  358. package/vendor/include/networkit/numerics/LAMG/Lamg.hpp +0 -460
  359. package/vendor/include/networkit/numerics/LAMG/Level/EliminationStage.hpp +0 -47
  360. package/vendor/include/networkit/numerics/LAMG/Level/Level.hpp +0 -56
  361. package/vendor/include/networkit/numerics/LAMG/Level/LevelAggregation.hpp +0 -52
  362. package/vendor/include/networkit/numerics/LAMG/Level/LevelElimination.hpp +0 -133
  363. package/vendor/include/networkit/numerics/LAMG/Level/LevelFinest.hpp +0 -28
  364. package/vendor/include/networkit/numerics/LAMG/LevelHierarchy.hpp +0 -165
  365. package/vendor/include/networkit/numerics/LAMG/MultiLevelSetup.hpp +0 -1090
  366. package/vendor/include/networkit/numerics/LAMG/SolverLamg.hpp +0 -316
  367. package/vendor/include/networkit/numerics/LinearSolver.hpp +0 -151
  368. package/vendor/include/networkit/numerics/Preconditioner/DiagonalPreconditioner.hpp +0 -61
  369. package/vendor/include/networkit/numerics/Preconditioner/IdentityPreconditioner.hpp +0 -36
  370. package/vendor/include/networkit/numerics/Smoother.hpp +0 -37
  371. package/vendor/include/networkit/overlap/HashingOverlapper.hpp +0 -28
  372. package/vendor/include/networkit/overlap/Overlapper.hpp +0 -27
  373. package/vendor/include/networkit/planarity/LeftRightPlanarityCheck.hpp +0 -113
  374. package/vendor/include/networkit/randomization/Curveball.hpp +0 -49
  375. package/vendor/include/networkit/randomization/CurveballGlobalTradeGenerator.hpp +0 -39
  376. package/vendor/include/networkit/randomization/CurveballUniformTradeGenerator.hpp +0 -39
  377. package/vendor/include/networkit/randomization/DegreePreservingShuffle.hpp +0 -82
  378. package/vendor/include/networkit/randomization/EdgeSwitching.hpp +0 -157
  379. package/vendor/include/networkit/randomization/GlobalCurveball.hpp +0 -69
  380. package/vendor/include/networkit/randomization/GlobalTradeSequence.hpp +0 -303
  381. package/vendor/include/networkit/reachability/AllSimplePaths.hpp +0 -122
  382. package/vendor/include/networkit/reachability/ReachableNodes.hpp +0 -83
  383. package/vendor/include/networkit/scd/ApproximatePageRank.hpp +0 -51
  384. package/vendor/include/networkit/scd/CliqueDetect.hpp +0 -55
  385. package/vendor/include/networkit/scd/CombinedSCD.hpp +0 -51
  386. package/vendor/include/networkit/scd/GCE.hpp +0 -42
  387. package/vendor/include/networkit/scd/LFMLocal.hpp +0 -54
  388. package/vendor/include/networkit/scd/LocalT.hpp +0 -40
  389. package/vendor/include/networkit/scd/LocalTightnessExpansion.hpp +0 -46
  390. package/vendor/include/networkit/scd/PageRankNibble.hpp +0 -55
  391. package/vendor/include/networkit/scd/RandomBFS.hpp +0 -33
  392. package/vendor/include/networkit/scd/SCDGroundTruthComparison.hpp +0 -121
  393. package/vendor/include/networkit/scd/SelectiveCommunityDetector.hpp +0 -76
  394. package/vendor/include/networkit/scd/SetConductance.hpp +0 -47
  395. package/vendor/include/networkit/scd/TCE.hpp +0 -41
  396. package/vendor/include/networkit/scd/TwoPhaseL.hpp +0 -40
  397. package/vendor/include/networkit/scoring/EdgeScoring.hpp +0 -44
  398. package/vendor/include/networkit/scoring/ModularityScoring.hpp +0 -79
  399. package/vendor/include/networkit/simulation/EpidemicSimulationSEIR.hpp +0 -59
  400. package/vendor/include/networkit/sparsification/ChanceCorrectedTriangleScore.hpp +0 -28
  401. package/vendor/include/networkit/sparsification/ForestFireScore.hpp +0 -34
  402. package/vendor/include/networkit/sparsification/GlobalThresholdFilter.hpp +0 -40
  403. package/vendor/include/networkit/sparsification/LocalDegreeScore.hpp +0 -30
  404. package/vendor/include/networkit/sparsification/LocalFilterScore.hpp +0 -124
  405. package/vendor/include/networkit/sparsification/LocalSimilarityScore.hpp +0 -63
  406. package/vendor/include/networkit/sparsification/MultiscaleScore.hpp +0 -38
  407. package/vendor/include/networkit/sparsification/RandomEdgeScore.hpp +0 -33
  408. package/vendor/include/networkit/sparsification/RandomNodeEdgeScore.hpp +0 -29
  409. package/vendor/include/networkit/sparsification/SCANStructuralSimilarityScore.hpp +0 -23
  410. package/vendor/include/networkit/sparsification/SimmelianOverlapScore.hpp +0 -35
  411. package/vendor/include/networkit/sparsification/SimmelianScore.hpp +0 -92
  412. package/vendor/include/networkit/sparsification/Sparsifiers.hpp +0 -166
  413. package/vendor/include/networkit/structures/Cover.hpp +0 -248
  414. package/vendor/include/networkit/structures/LocalCommunity.hpp +0 -363
  415. package/vendor/include/networkit/structures/Partition.hpp +0 -335
  416. package/vendor/include/networkit/structures/UnionFind.hpp +0 -66
  417. package/vendor/include/networkit/viz/GraphLayoutAlgorithm.hpp +0 -157
  418. package/vendor/include/networkit/viz/MaxentStress.hpp +0 -346
  419. package/vendor/include/networkit/viz/Octree.hpp +0 -428
  420. package/vendor/include/networkit/viz/PivotMDS.hpp +0 -63
  421. package/vendor/include/networkit/viz/Point.hpp +0 -415
  422. package/vendor/include/networkit/viz/PostscriptWriter.hpp +0 -78
  423. package/vendor/include/tlx/algorithm/exclusive_scan.hpp +0 -56
  424. package/vendor/include/tlx/algorithm/is_sorted_cmp.hpp +0 -56
  425. package/vendor/include/tlx/algorithm/merge_advance.hpp +0 -177
  426. package/vendor/include/tlx/algorithm/merge_combine.hpp +0 -76
  427. package/vendor/include/tlx/algorithm/multisequence_partition.hpp +0 -346
  428. package/vendor/include/tlx/algorithm/multisequence_selection.hpp +0 -351
  429. package/vendor/include/tlx/algorithm/multiway_merge.hpp +0 -1385
  430. package/vendor/include/tlx/algorithm/multiway_merge_splitting.hpp +0 -257
  431. package/vendor/include/tlx/algorithm/parallel_multiway_merge.hpp +0 -408
  432. package/vendor/include/tlx/algorithm/random_bipartition_shuffle.hpp +0 -116
  433. package/vendor/include/tlx/algorithm.hpp +0 -36
  434. package/vendor/include/tlx/allocator_base.hpp +0 -100
  435. package/vendor/include/tlx/backtrace.hpp +0 -54
  436. package/vendor/include/tlx/cmdline_parser.hpp +0 -498
  437. package/vendor/include/tlx/container/btree.hpp +0 -3977
  438. package/vendor/include/tlx/container/btree_map.hpp +0 -634
  439. package/vendor/include/tlx/container/btree_multimap.hpp +0 -627
  440. package/vendor/include/tlx/container/btree_multiset.hpp +0 -612
  441. package/vendor/include/tlx/container/btree_set.hpp +0 -612
  442. package/vendor/include/tlx/container/d_ary_addressable_int_heap.hpp +0 -416
  443. package/vendor/include/tlx/container/d_ary_heap.hpp +0 -311
  444. package/vendor/include/tlx/container/loser_tree.hpp +0 -1009
  445. package/vendor/include/tlx/container/lru_cache.hpp +0 -319
  446. package/vendor/include/tlx/container/radix_heap.hpp +0 -735
  447. package/vendor/include/tlx/container/ring_buffer.hpp +0 -428
  448. package/vendor/include/tlx/container/simple_vector.hpp +0 -304
  449. package/vendor/include/tlx/container/splay_tree.hpp +0 -399
  450. package/vendor/include/tlx/container/string_view.hpp +0 -805
  451. package/vendor/include/tlx/container.hpp +0 -40
  452. package/vendor/include/tlx/counting_ptr.hpp +0 -522
  453. package/vendor/include/tlx/define/attribute_always_inline.hpp +0 -34
  454. package/vendor/include/tlx/define/attribute_fallthrough.hpp +0 -36
  455. package/vendor/include/tlx/define/attribute_format_printf.hpp +0 -34
  456. package/vendor/include/tlx/define/attribute_packed.hpp +0 -34
  457. package/vendor/include/tlx/define/attribute_warn_unused_result.hpp +0 -34
  458. package/vendor/include/tlx/define/constexpr.hpp +0 -31
  459. package/vendor/include/tlx/define/deprecated.hpp +0 -39
  460. package/vendor/include/tlx/define/endian.hpp +0 -49
  461. package/vendor/include/tlx/define/likely.hpp +0 -33
  462. package/vendor/include/tlx/define/visibility_hidden.hpp +0 -34
  463. package/vendor/include/tlx/define.hpp +0 -36
  464. package/vendor/include/tlx/delegate.hpp +0 -524
  465. package/vendor/include/tlx/die/core.hpp +0 -311
  466. package/vendor/include/tlx/die.hpp +0 -106
  467. package/vendor/include/tlx/digest/md5.hpp +0 -81
  468. package/vendor/include/tlx/digest/sha1.hpp +0 -81
  469. package/vendor/include/tlx/digest/sha256.hpp +0 -81
  470. package/vendor/include/tlx/digest/sha512.hpp +0 -81
  471. package/vendor/include/tlx/digest.hpp +0 -30
  472. package/vendor/include/tlx/logger/all.hpp +0 -33
  473. package/vendor/include/tlx/logger/array.hpp +0 -43
  474. package/vendor/include/tlx/logger/core.hpp +0 -287
  475. package/vendor/include/tlx/logger/deque.hpp +0 -42
  476. package/vendor/include/tlx/logger/map.hpp +0 -65
  477. package/vendor/include/tlx/logger/set.hpp +0 -60
  478. package/vendor/include/tlx/logger/tuple.hpp +0 -66
  479. package/vendor/include/tlx/logger/unordered_map.hpp +0 -68
  480. package/vendor/include/tlx/logger/unordered_set.hpp +0 -64
  481. package/vendor/include/tlx/logger/wrap_unprintable.hpp +0 -75
  482. package/vendor/include/tlx/logger.hpp +0 -44
  483. package/vendor/include/tlx/math/abs_diff.hpp +0 -35
  484. package/vendor/include/tlx/math/aggregate.hpp +0 -231
  485. package/vendor/include/tlx/math/aggregate_min_max.hpp +0 -116
  486. package/vendor/include/tlx/math/bswap.hpp +0 -148
  487. package/vendor/include/tlx/math/bswap_be.hpp +0 -79
  488. package/vendor/include/tlx/math/bswap_le.hpp +0 -79
  489. package/vendor/include/tlx/math/clz.hpp +0 -174
  490. package/vendor/include/tlx/math/ctz.hpp +0 -174
  491. package/vendor/include/tlx/math/div_ceil.hpp +0 -36
  492. package/vendor/include/tlx/math/ffs.hpp +0 -123
  493. package/vendor/include/tlx/math/integer_log2.hpp +0 -189
  494. package/vendor/include/tlx/math/is_power_of_two.hpp +0 -74
  495. package/vendor/include/tlx/math/polynomial_regression.hpp +0 -243
  496. package/vendor/include/tlx/math/popcount.hpp +0 -173
  497. package/vendor/include/tlx/math/power_to_the.hpp +0 -44
  498. package/vendor/include/tlx/math/rol.hpp +0 -112
  499. package/vendor/include/tlx/math/ror.hpp +0 -112
  500. package/vendor/include/tlx/math/round_to_power_of_two.hpp +0 -121
  501. package/vendor/include/tlx/math/round_up.hpp +0 -36
  502. package/vendor/include/tlx/math/sgn.hpp +0 -38
  503. package/vendor/include/tlx/math.hpp +0 -46
  504. package/vendor/include/tlx/meta/apply_tuple.hpp +0 -55
  505. package/vendor/include/tlx/meta/call_for_range.hpp +0 -78
  506. package/vendor/include/tlx/meta/call_foreach.hpp +0 -60
  507. package/vendor/include/tlx/meta/call_foreach_tuple.hpp +0 -60
  508. package/vendor/include/tlx/meta/call_foreach_tuple_with_index.hpp +0 -61
  509. package/vendor/include/tlx/meta/call_foreach_with_index.hpp +0 -64
  510. package/vendor/include/tlx/meta/enable_if.hpp +0 -37
  511. package/vendor/include/tlx/meta/fold_left.hpp +0 -63
  512. package/vendor/include/tlx/meta/fold_left_tuple.hpp +0 -60
  513. package/vendor/include/tlx/meta/fold_right.hpp +0 -63
  514. package/vendor/include/tlx/meta/fold_right_tuple.hpp +0 -60
  515. package/vendor/include/tlx/meta/function_chain.hpp +0 -197
  516. package/vendor/include/tlx/meta/function_stack.hpp +0 -189
  517. package/vendor/include/tlx/meta/has_member.hpp +0 -80
  518. package/vendor/include/tlx/meta/has_method.hpp +0 -117
  519. package/vendor/include/tlx/meta/index_sequence.hpp +0 -66
  520. package/vendor/include/tlx/meta/is_std_array.hpp +0 -40
  521. package/vendor/include/tlx/meta/is_std_pair.hpp +0 -39
  522. package/vendor/include/tlx/meta/is_std_tuple.hpp +0 -39
  523. package/vendor/include/tlx/meta/is_std_vector.hpp +0 -39
  524. package/vendor/include/tlx/meta/log2.hpp +0 -101
  525. package/vendor/include/tlx/meta/no_operation.hpp +0 -55
  526. package/vendor/include/tlx/meta/static_index.hpp +0 -42
  527. package/vendor/include/tlx/meta/vexpand.hpp +0 -34
  528. package/vendor/include/tlx/meta/vmap_for_range.hpp +0 -84
  529. package/vendor/include/tlx/meta/vmap_foreach.hpp +0 -63
  530. package/vendor/include/tlx/meta/vmap_foreach_tuple.hpp +0 -59
  531. package/vendor/include/tlx/meta/vmap_foreach_tuple_with_index.hpp +0 -62
  532. package/vendor/include/tlx/meta/vmap_foreach_with_index.hpp +0 -70
  533. package/vendor/include/tlx/meta.hpp +0 -55
  534. package/vendor/include/tlx/multi_timer.hpp +0 -148
  535. package/vendor/include/tlx/port/setenv.hpp +0 -31
  536. package/vendor/include/tlx/port.hpp +0 -27
  537. package/vendor/include/tlx/semaphore.hpp +0 -119
  538. package/vendor/include/tlx/simple_vector.hpp +0 -20
  539. package/vendor/include/tlx/siphash.hpp +0 -282
  540. package/vendor/include/tlx/sort/networks/best.hpp +0 -611
  541. package/vendor/include/tlx/sort/networks/bose_nelson.hpp +0 -412
  542. package/vendor/include/tlx/sort/networks/bose_nelson_parameter.hpp +0 -507
  543. package/vendor/include/tlx/sort/networks/cswap.hpp +0 -60
  544. package/vendor/include/tlx/sort/parallel_mergesort.hpp +0 -398
  545. package/vendor/include/tlx/sort/strings/insertion_sort.hpp +0 -232
  546. package/vendor/include/tlx/sort/strings/multikey_quicksort.hpp +0 -185
  547. package/vendor/include/tlx/sort/strings/parallel_sample_sort.hpp +0 -1647
  548. package/vendor/include/tlx/sort/strings/radix_sort.hpp +0 -934
  549. package/vendor/include/tlx/sort/strings/sample_sort_tools.hpp +0 -756
  550. package/vendor/include/tlx/sort/strings/string_ptr.hpp +0 -426
  551. package/vendor/include/tlx/sort/strings/string_set.hpp +0 -800
  552. package/vendor/include/tlx/sort/strings.hpp +0 -329
  553. package/vendor/include/tlx/sort/strings_parallel.hpp +0 -325
  554. package/vendor/include/tlx/sort.hpp +0 -29
  555. package/vendor/include/tlx/stack_allocator.hpp +0 -226
  556. package/vendor/include/tlx/string/appendline.hpp +0 -35
  557. package/vendor/include/tlx/string/base64.hpp +0 -87
  558. package/vendor/include/tlx/string/bitdump.hpp +0 -139
  559. package/vendor/include/tlx/string/compare_icase.hpp +0 -42
  560. package/vendor/include/tlx/string/contains.hpp +0 -36
  561. package/vendor/include/tlx/string/contains_word.hpp +0 -42
  562. package/vendor/include/tlx/string/ends_with.hpp +0 -79
  563. package/vendor/include/tlx/string/equal_icase.hpp +0 -42
  564. package/vendor/include/tlx/string/erase_all.hpp +0 -70
  565. package/vendor/include/tlx/string/escape_html.hpp +0 -34
  566. package/vendor/include/tlx/string/escape_uri.hpp +0 -34
  567. package/vendor/include/tlx/string/expand_environment_variables.hpp +0 -49
  568. package/vendor/include/tlx/string/extract_between.hpp +0 -40
  569. package/vendor/include/tlx/string/format_iec_units.hpp +0 -32
  570. package/vendor/include/tlx/string/format_si_iec_units.hpp +0 -19
  571. package/vendor/include/tlx/string/format_si_units.hpp +0 -32
  572. package/vendor/include/tlx/string/hash_djb2.hpp +0 -87
  573. package/vendor/include/tlx/string/hash_sdbm.hpp +0 -86
  574. package/vendor/include/tlx/string/hexdump.hpp +0 -154
  575. package/vendor/include/tlx/string/index_of.hpp +0 -56
  576. package/vendor/include/tlx/string/join.hpp +0 -65
  577. package/vendor/include/tlx/string/join_generic.hpp +0 -89
  578. package/vendor/include/tlx/string/join_quoted.hpp +0 -46
  579. package/vendor/include/tlx/string/less_icase.hpp +0 -64
  580. package/vendor/include/tlx/string/levenshtein.hpp +0 -193
  581. package/vendor/include/tlx/string/pad.hpp +0 -39
  582. package/vendor/include/tlx/string/parse_si_iec_units.hpp +0 -46
  583. package/vendor/include/tlx/string/parse_uri.hpp +0 -66
  584. package/vendor/include/tlx/string/parse_uri_form_data.hpp +0 -136
  585. package/vendor/include/tlx/string/replace.hpp +0 -141
  586. package/vendor/include/tlx/string/split.hpp +0 -170
  587. package/vendor/include/tlx/string/split_quoted.hpp +0 -49
  588. package/vendor/include/tlx/string/split_view.hpp +0 -218
  589. package/vendor/include/tlx/string/split_words.hpp +0 -53
  590. package/vendor/include/tlx/string/ssprintf.hpp +0 -45
  591. package/vendor/include/tlx/string/ssprintf_generic.hpp +0 -95
  592. package/vendor/include/tlx/string/starts_with.hpp +0 -44
  593. package/vendor/include/tlx/string/to_lower.hpp +0 -47
  594. package/vendor/include/tlx/string/to_upper.hpp +0 -47
  595. package/vendor/include/tlx/string/trim.hpp +0 -298
  596. package/vendor/include/tlx/string/union_words.hpp +0 -33
  597. package/vendor/include/tlx/string/word_wrap.hpp +0 -35
  598. package/vendor/include/tlx/string.hpp +0 -68
  599. package/vendor/include/tlx/thread_barrier_mutex.hpp +0 -109
  600. package/vendor/include/tlx/thread_barrier_spin.hpp +0 -127
  601. package/vendor/include/tlx/thread_pool.hpp +0 -151
  602. package/vendor/include/tlx/timestamp.hpp +0 -23
  603. package/vendor/include/tlx/unused.hpp +0 -28
  604. package/vendor/include/tlx/vector_free.hpp +0 -30
  605. package/vendor/include/tlx/version.hpp +0 -49
  606. package/vendor/include/ttmath/ttmath.h +0 -2881
  607. package/vendor/include/ttmath/ttmathbig.h +0 -6111
  608. package/vendor/include/ttmath/ttmathdec.h +0 -419
  609. package/vendor/include/ttmath/ttmathint.h +0 -1923
  610. package/vendor/include/ttmath/ttmathmisc.h +0 -250
  611. package/vendor/include/ttmath/ttmathobjects.h +0 -812
  612. package/vendor/include/ttmath/ttmathparser.h +0 -2791
  613. package/vendor/include/ttmath/ttmaththreads.h +0 -252
  614. package/vendor/include/ttmath/ttmathtypes.h +0 -707
  615. package/vendor/include/ttmath/ttmathuint.h +0 -4190
  616. package/vendor/include/ttmath/ttmathuint_noasm.h +0 -1038
  617. package/vendor/include/ttmath/ttmathuint_x86.h +0 -1620
  618. package/vendor/include/ttmath/ttmathuint_x86_64.h +0 -1177
  619. package/vendor/lib/cmake/tlx/tlx-config.cmake +0 -51
  620. package/vendor/lib/cmake/tlx/tlx-targets-release.cmake +0 -19
  621. package/vendor/lib/cmake/tlx/tlx-targets.cmake +0 -106
  622. package/vendor/lib/cmake/tlx/tlx-version.cmake +0 -11
  623. package/vendor/lib/libtlx.a +0 -0
  624. package/vendor/lib/pkgconfig/networkit.pc +0 -11
  625. package/vendor/lib/pkgconfig/tlx.pc +0 -11
@@ -1,1292 +0,0 @@
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_