networkit-rs 0.1.0

Rust bindings for Networkit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589

#ifndef NK_DISTANCE_H
#define NK_DISTANCE_H

#include "rust/cxx.h"
#include "graph_event.h"
#include <networkit/distance/APSP.hpp>
#include <networkit/distance/AStar.hpp>
#include <networkit/distance/AdamicAdarDistance.hpp>
#include <networkit/distance/AlgebraicDistance.hpp>
#include <networkit/reachability/AllSimplePaths.hpp>
#include <networkit/distance/BFS.hpp>
#include <networkit/distance/BidirectionalBFS.hpp>
#include <networkit/distance/BidirectionalDijkstra.hpp>
#include <networkit/distance/CommuteTimeDistance.hpp>
#include <networkit/distance/Diameter.hpp>
#include <networkit/distance/Dijkstra.hpp>
#include <networkit/distance/DynAPSP.hpp>
#include <networkit/distance/DynBFS.hpp>
#include <networkit/distance/Eccentricity.hpp>
#include <networkit/distance/EffectiveDiameter.hpp>
#include <networkit/distance/EffectiveDiameterApproximation.hpp>
#include <networkit/distance/HopPlotApproximation.hpp>
#include <networkit/distance/JaccardDistance.hpp>
#include <networkit/distance/MultiTargetBFS.hpp>
#include <networkit/distance/MultiTargetDijkstra.hpp>
#include <networkit/distance/NeighborhoodFunction.hpp>
#include <networkit/distance/NeighborhoodFunctionApproximation.hpp>
#include <networkit/distance/NeighborhoodFunctionHeuristic.hpp>
#include <networkit/distance/PrunedLandmarkLabeling.hpp>
#include <networkit/distance/ReverseBFS.hpp>
#include <networkit/distance/Volume.hpp>

namespace NetworKit
{
    using namespace std;

    inline unique_ptr<APSP> NewAPSP(const Graph &G)
    {
        return make_unique<APSP>(G);
    }

    inline node APSPGetDistances(const APSP &algo, rust::Vec<edgeweight> &ws)
    {
        auto distances = algo.getDistances();
        for (auto &&edges : distances)
        {
            for (auto &&wt : edges)
            {
                ws.push_back(wt);
            }
        }
        return distances.size();
    }

    inline unique_ptr<AStar> NewAStar(const Graph &G, const std::vector<double> &distanceHeu, node source, node target, bool storePred)
    {
        return make_unique<AStar>(G, distanceHeu, source, target, storePred);
    }

    inline unique_ptr<vector<node>> AStarGetPath(const AStar &algo)
    {
        return make_unique<vector<node>>(algo.getPath());
    }

    inline unique_ptr<vector<node>> AStarGetPredecessors(const AStar &algo)
    {
        return make_unique<vector<node>>(algo.getPredecessors());
    }

    inline unique_ptr<vector<edgeweight>> AStarGetDistances(const AStar &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }
    inline void AStarGetTargetIndexMap(const AStar &algo, rust::Vec<node> &src, rust::Vec<node> &dst)
    {
        for (auto &&pair : algo.getTargetIndexMap())
        {
            src.push_back(pair.first);
            dst.push_back(pair.second);
        }
    }
    inline void AStarSetTargets(AStar &algo, rust::Slice<const node> targets)
    {
        algo.setTargets(targets.begin(), targets.end());
    }

    inline unique_ptr<AdamicAdarDistance> NewAdamicAdarDistance(const Graph &G)
    {
        return make_unique<AdamicAdarDistance>(G);
    }

    inline unique_ptr<vector<double>> AdamicAdarDistanceGetEdgeScores(const AdamicAdarDistance &algo)
    {
        return make_unique<vector<double>>(algo.getEdgeScores());
    }

    inline unique_ptr<AlgebraicDistance> NewAlgebraicDistance(const Graph &G, count numberSystems = 10, count numberIterations = 30,
                                                              double omega = 0.5, index norm = 0, bool withEdgeScores = false)
    {
        return make_unique<AlgebraicDistance>(G, numberSystems, numberIterations, omega, norm, withEdgeScores);
    }

    inline unique_ptr<vector<double>> AlgebraicDistanceGetEdgeScores(const AlgebraicDistance &algo)
    {
        return make_unique<vector<double>>(algo.getEdgeScores());
    }

    inline unique_ptr<AllSimplePaths> NewAllSimplePaths(const Graph &G, node source, node target, count cutoff = none)
    {
        return make_unique<AllSimplePaths>(G, source, target, cutoff);
    }

    inline void AllSimplePathsGetAllSimplePaths(AllSimplePaths &algo, rust::Vec<node> &vs)
    {
        for (auto &&inner : algo.getAllSimplePaths())
        {
            for (auto &&j : inner)
            {
                vs.push_back(j);
            }
            vs.push_back(none);
        }
    }

    inline unique_ptr<BFS> NewBFS(const Graph &G, node source, bool storePaths = true, bool storeNodesSortedByDistance = false, node target = none)
    {
        return make_unique<BFS>(G, source, storePaths, storeNodesSortedByDistance, target);
    }

    inline unique_ptr<vector<edgeweight>> BFSGetDistances(BFS &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }

    inline unique_ptr<vector<node>> BFSGetPredecessors(const BFS &algo, node t)
    {
        return make_unique<vector<node>>(algo.getPredecessors(t));
    }

    inline unique_ptr<vector<node>> BFSGetPath(const BFS &algo, node t, bool forward)
    {
        return make_unique<vector<node>>(algo.getPath(t, forward));
    }

    inline void BFSGetPaths(const BFS &algo, node t, bool forward, rust::Vec<node> &vs)
    {
        for (auto &&p : algo.getPaths(t, forward))
        {
            vs.push_back(none);
            for (auto &&n : p)
            {
                vs.push_back(n);
            }
        }
    }

    inline unique_ptr<vector<node>> BFSGetNodeSortedByDistance(const BFS &algo)
    {
        return make_unique<vector<node>>(algo.getNodesSortedByDistance());
    }

    inline unique_ptr<BidirectionalBFS> NewBidirectionalBFS(const Graph &G, node source, node target, bool storePred)
    {
        return make_unique<BidirectionalBFS>(G, source, target, storePred);
    }

    inline unique_ptr<vector<node>> BidirectionalBFSGetPath(const BidirectionalBFS &algo)
    {
        return make_unique<vector<node>>(algo.getPath());
    }

    inline unique_ptr<vector<node>> BidirectionalBFSGetPredecessors(const BidirectionalBFS &algo)
    {
        return make_unique<vector<node>>(algo.getPredecessors());
    }

    inline unique_ptr<vector<edgeweight>> BidirectionalBFSGetDistances(const BidirectionalBFS &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }
    inline void BidirectionalBFSGetTargetIndexMap(const BidirectionalBFS &algo, rust::Vec<node> &src, rust::Vec<node> &dst)
    {
        for (auto &&pair : algo.getTargetIndexMap())
        {
            src.push_back(pair.first);
            dst.push_back(pair.second);
        }
    }
    inline void BidirectionalBFSSetTargets(BidirectionalBFS &algo, rust::Slice<const node> targets)
    {
        algo.setTargets(targets.begin(), targets.end());
    }

    inline unique_ptr<BidirectionalDijkstra> NewBidirectionalDijkstra(const Graph &G, node source, node target, bool storePred)
    {
        return make_unique<BidirectionalDijkstra>(G, source, target, storePred);
    }

    inline unique_ptr<vector<node>> BidirectionalDijkstraGetPath(const BidirectionalDijkstra &algo)
    {
        return make_unique<vector<node>>(algo.getPath());
    }

    inline unique_ptr<vector<node>> BidirectionalDijkstraGetPredecessors(const BidirectionalDijkstra &algo)
    {
        return make_unique<vector<node>>(algo.getPredecessors());
    }

    inline unique_ptr<vector<edgeweight>> BidirectionalDijkstraGetDistances(const BidirectionalDijkstra &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }
    inline void BidirectionalDijkstraGetTargetIndexMap(const BidirectionalDijkstra &algo, rust::Vec<node> &src, rust::Vec<node> &dst)
    {
        for (auto &&pair : algo.getTargetIndexMap())
        {
            src.push_back(pair.first);
            dst.push_back(pair.second);
        }
    }
    inline void BidirectionalDijkstraSetTargets(BidirectionalDijkstra &algo, rust::Slice<const node> targets)
    {
        algo.setTargets(targets.begin(), targets.end());
    }

    inline unique_ptr<CommuteTimeDistance> NewCommuteTimeDistance(const Graph &G, double tol = 0.1)
    {
        return make_unique<CommuteTimeDistance>(G, tol);
    }

    inline unique_ptr<Diameter> NewDiameter(const Graph &G, uint8_t algo_e, double error = -1.f, count nSamples = 0)
    {
        DiameterAlgo algo;
        switch (algo_e)
        {
        case 0:
            algo = DiameterAlgo::AUTOMATIC;
            break;
        case 1:
            algo = DiameterAlgo::EXACT;
            break;
        case 2:
            algo = DiameterAlgo::
                ESTIMATED_RANGE;
            break;
        case 3:
            algo = DiameterAlgo::
                ESTIMATED_SAMPLES;
            break;
        case 4:
            algo = DiameterAlgo::
                ESTIMATED_PEDANTIC;
            break;
        }
        return make_unique<Diameter>(G, algo, error, nSamples);
    }
    inline void DiameterGetDiameter(const Diameter &algo, count &lower, count &upper)
    {
        auto pair = algo.getDiameter();
        lower = pair.first;
        upper = pair.second;
    }

    inline unique_ptr<Dijkstra> NewDijkstra(const Graph &G, node source, bool storePaths = true, bool storeNodesSortedByDistance = false, node target = none)
    {
        return make_unique<Dijkstra>(G, source, storePaths, storeNodesSortedByDistance, target);
    }

    inline unique_ptr<vector<edgeweight>> DijkstraGetDistances(Dijkstra &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }

    inline unique_ptr<vector<node>> DijkstraGetPredecessors(const Dijkstra &algo, node t)
    {
        return make_unique<vector<node>>(algo.getPredecessors(t));
    }

    inline unique_ptr<vector<node>> DijkstraGetPath(const Dijkstra &algo, node t, bool forward)
    {
        return make_unique<vector<node>>(algo.getPath(t, forward));
    }

    inline void DijkstraGetPaths(const Dijkstra &algo, node t, bool forward, rust::Vec<node> &vs)
    {
        for (auto &&p : algo.getPaths(t, forward))
        {
            vs.push_back(none);
            for (auto &&n : p)
            {
                vs.push_back(n);
            }
        }
    }

    inline unique_ptr<vector<node>> DijkstraGetNodeSortedByDistance(const Dijkstra &algo)
    {
        return make_unique<vector<node>>(algo.getNodesSortedByDistance());
    }

    inline unique_ptr<DynAPSP> NewDynAPSP(Graph &G)
    {
        return make_unique<DynAPSP>(G);
    }

    inline node DynAPSPGetDistances(const DynAPSP &algo, rust::Vec<edgeweight> &ws)
    {
        auto distances = algo.getDistances();
        for (auto &&edges : distances)
        {
            for (auto &&wt : edges)
            {
                ws.push_back(wt);
            }
        }
        return distances.size();
    }

    inline void DynAPSPUpdate(DynAPSP &algo, uint8_t kind, node u, node v, edgeweight ew)
    {
        algo.update(toGraphEvent(kind, u, v, ew));
    }

    inline void DynAPSPUpdateBatch(DynAPSP &algo, rust::Slice<const uint8_t> kinds, rust::Slice<const node> us, rust::Slice<const node> vs, rust::Slice<const edgeweight> ews)
    {
        vector<GraphEvent> evs;
        evs.reserve(kinds.length());
        for (size_t i = 0; i < kinds.length(); ++i)
        {
            evs.emplace_back(toGraphEvent(kinds[i], us[i], vs[i], ews[i]));
        }
        algo.updateBatch(evs);
    }

    inline unique_ptr<DynBFS> NewDynBFS(const Graph &G, node s, bool storePredecessors = true)
    {
        return make_unique<DynBFS>(G, s, storePredecessors);
    }

    inline unique_ptr<vector<edgeweight>> DynBFSGetDistances(DynBFS &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }

    inline unique_ptr<vector<node>> DynBFSGetPredecessors(const DynBFS &algo, node t)
    {
        return make_unique<vector<node>>(algo.getPredecessors(t));
    }

    inline unique_ptr<vector<node>> DynBFSGetPath(const DynBFS &algo, node t, bool forward)
    {
        return make_unique<vector<node>>(algo.getPath(t, forward));
    }

    inline void DynBFSGetPaths(const DynBFS &algo, node t, bool forward, rust::Vec<node> &vs)
    {
        for (auto &&p : algo.getPaths(t, forward))
        {
            vs.push_back(none);
            for (auto &&n : p)
            {
                vs.push_back(n);
            }
        }
    }

    inline unique_ptr<vector<node>> DynBFSGetNodeSortedByDistance(const DynBFS &algo)
    {
        return make_unique<vector<node>>(algo.getNodesSortedByDistance());
    }

    inline void DynBFSUpdate(DynBFS &algo, uint8_t kind, node u, node v, edgeweight ew)
    {
        algo.update(toGraphEvent(kind, u, v, ew));
    }

    inline void DynBFSUpdateBatch(DynBFS &algo, rust::Slice<const uint8_t> kinds, rust::Slice<const node> us, rust::Slice<const node> vs, rust::Slice<const edgeweight> ews)
    {
        vector<GraphEvent> evs;
        evs.reserve(kinds.length());
        for (size_t i = 0; i < kinds.length(); ++i)
        {
            evs.emplace_back(toGraphEvent(kinds[i], us[i], vs[i], ews[i]));
        }
        algo.updateBatch(evs);
    }

    inline void EccentricityGetValue(const Graph &G, node u, node &fartherest, count &dist)
    {
        auto res = Eccentricity::getValue(G, u);
        fartherest = res.first;
        dist = res.second;
    }

    inline unique_ptr<EffectiveDiameter> NewEffectiveDiameter(const Graph &G, double ratio)
    {
        return make_unique<EffectiveDiameter>(G, ratio);
    }

    inline unique_ptr<EffectiveDiameterApproximation> NewEffectiveDiameterApproximation(const Graph &G, double ratio, count k, count r)
    {
        return make_unique<EffectiveDiameterApproximation>(G, ratio, k, r);
    }

    inline unique_ptr<HopPlotApproximation> NewHopPlotApproximation(const Graph &G, count maxDistance, count k, count r)
    {
        return make_unique<HopPlotApproximation>(G, maxDistance, k, r);
    }

    inline void HopPlotApproximationGetHopPlot(const HopPlotApproximation &algo, rust::Vec<count> &ks, rust::Vec<double> &vs)
    {
        for (auto &&pair : algo.getHopPlot())
        {
            ks.push_back(pair.first);
            vs.push_back(pair.second);
        }
    }

    inline unique_ptr<JaccardDistance> NewJaccardDistance(const Graph &G, const std::vector<count> &triangles)
    {
        return make_unique<JaccardDistance>(G, triangles);
    }

    inline unique_ptr<vector<double>> JaccardDistanceGetEdgeScores(const JaccardDistance &algo)
    {
        return make_unique<vector<double>>(algo.getEdgeScores());
    }

    inline unique_ptr<MultiTargetBFS> NewMultiTargetBFS(const Graph &G, node source, rust::Slice<const node> targets)
    {
        return make_unique<MultiTargetBFS>(G, source, targets.begin(), targets.end());
    }

    inline unique_ptr<vector<node>> MultiTargetBFSGetPath(const MultiTargetBFS &algo)
    {
        return make_unique<vector<node>>(algo.getPath());
    }

    inline unique_ptr<vector<node>> MultiTargetBFSGetPredecessors(const MultiTargetBFS &algo)
    {
        return make_unique<vector<node>>(algo.getPredecessors());
    }

    inline unique_ptr<vector<edgeweight>> MultiTargetBFSGetDistances(const MultiTargetBFS &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }
    inline void MultiTargetBFSGetTargetIndexMap(const MultiTargetBFS &algo, rust::Vec<node> &src, rust::Vec<node> &dst)
    {
        for (auto &&pair : algo.getTargetIndexMap())
        {
            src.push_back(pair.first);
            dst.push_back(pair.second);
        }
    }
    inline void MultiTargetBFSSetTargets(MultiTargetBFS &algo, rust::Slice<const node> targets)
    {
        algo.setTargets(targets.begin(), targets.end());
    }

    inline unique_ptr<MultiTargetDijkstra> NewMultiTargetDijkstra(const Graph &G, node source, rust::Slice<const node> targets)
    {
        return make_unique<MultiTargetDijkstra>(G, source, targets.begin(), targets.end());
    }

    inline unique_ptr<vector<node>> MultiTargetDijkstraGetPath(const MultiTargetDijkstra &algo)
    {
        return make_unique<vector<node>>(algo.getPath());
    }

    inline unique_ptr<vector<node>> MultiTargetDijkstraGetPredecessors(const MultiTargetDijkstra &algo)
    {
        return make_unique<vector<node>>(algo.getPredecessors());
    }

    inline unique_ptr<vector<edgeweight>> MultiTargetDijkstraGetDistances(const MultiTargetDijkstra &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }
    inline void MultiTargetDijkstraGetTargetIndexMap(const MultiTargetDijkstra &algo, rust::Vec<node> &src, rust::Vec<node> &dst)
    {
        for (auto &&pair : algo.getTargetIndexMap())
        {
            src.push_back(pair.first);
            dst.push_back(pair.second);
        }
    }
    inline void MultiTargetDijkstraSetTargets(MultiTargetDijkstra &algo, rust::Slice<const node> targets)
    {
        algo.setTargets(targets.begin(), targets.end());
    }

    inline unique_ptr<NeighborhoodFunction> NewNeighborhoodFunction(const Graph &G)
    {
        return make_unique<NeighborhoodFunction>(G);
    }

    inline unique_ptr<vector<count>> NeighborhoodFunctionGetNeighborhoodFunction(const NeighborhoodFunction &algo)
    {
        return make_unique<vector<count>>(algo.getNeighborhoodFunction());
    }

    inline unique_ptr<NeighborhoodFunctionApproximation> NewNeighborhoodFunctionApproximation(const Graph &G, count k = 64, count r = 7)
    {
        return make_unique<NeighborhoodFunctionApproximation>(G, k, r);
    }

    inline unique_ptr<vector<count>> NeighborhoodFunctionApproximationGetNeighborhoodFunction(const NeighborhoodFunctionApproximation &algo)
    {
        return make_unique<vector<count>>(algo.getNeighborhoodFunction());
    }

    inline unique_ptr<NeighborhoodFunctionHeuristic> NewNeighborhoodFunctionHeuristic(const Graph &G, count n_samples, uint8_t strategy)
    {
        NeighborhoodFunctionHeuristic::SelectionStrategy s;
        switch (strategy)
        {
        case 0:
            s = NeighborhoodFunctionHeuristic::SelectionStrategy::RANDOM;
            break;
        case 1:
            s = NeighborhoodFunctionHeuristic::SelectionStrategy::SPLIT;
            break;
        }
        return make_unique<NeighborhoodFunctionHeuristic>(G, n_samples, s);
    }

    inline unique_ptr<vector<count>> NeighborhoodFunctionHeuristicGetNeighborhoodFunction(const NeighborhoodFunctionHeuristic &algo)
    {
        return make_unique<vector<count>>(algo.getNeighborhoodFunction());
    }

    inline unique_ptr<PrunedLandmarkLabeling> NewPrunedLandmarkLabeling(const Graph &G)
    {
        return make_unique<PrunedLandmarkLabeling>(G);
    }

    inline unique_ptr<ReverseBFS> NewReverseBFS(const Graph &G, node source, bool storePaths = true, bool storeNodesSortedByDistance = false, node target = none)
    {
        return make_unique<ReverseBFS>(G, source, storePaths, storeNodesSortedByDistance, target);
    }

    inline unique_ptr<vector<edgeweight>> ReverseBFSGetDistances(ReverseBFS &algo)
    {
        return make_unique<vector<edgeweight>>(algo.getDistances());
    }

    inline unique_ptr<vector<node>> ReverseBFSGetPredecessors(const ReverseBFS &algo, node t)
    {
        return make_unique<vector<node>>(algo.getPredecessors(t));
    }

    inline unique_ptr<vector<node>> ReverseBFSGetPath(const ReverseBFS &algo, node t, bool forward)
    {
        return make_unique<vector<node>>(algo.getPath(t, forward));
    }

    inline void ReverseBFSGetPaths(const ReverseBFS &algo, node t, bool forward, rust::Vec<node> &vs)
    {
        for (auto &&p : algo.getPaths(t, forward))
        {
            vs.push_back(none);
            for (auto &&n : p)
            {
                vs.push_back(n);
            }
        }
    }

    inline unique_ptr<vector<node>> ReverseBFSGetNodeSortedByDistance(const ReverseBFS &algo)
    {
        return make_unique<vector<node>>(algo.getNodesSortedByDistance());
    }

    inline unique_ptr<vector<double>> VolumeVolumes(const Graph &G, rust::Slice<const double> rs, count samples)
    {
        vector<double> radii{rs.begin(), rs.end()};
        return make_unique<vector<double>>(Volume::volume(G, radii, samples));
    }

    inline double VolumeVolume(const Graph &G, double r, count samples)
    {

        return Volume::volume(G, r, samples);
    }
}

#endif // NK_DISTANCE_H