Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Functions
profile_routing_algorithms.cpp File Reference
#include <algorithm>
#include <libff/common/profiling.hpp>
#include <libsnark/common/routing_algorithms/as_waksman_routing_algorithm.hpp>
#include <libsnark/common/routing_algorithms/benes_routing_algorithm.hpp>
Include dependency graph for profile_routing_algorithms.cpp:

Go to the source code of this file.

Functions

void profile_benes_algorithm (const size_t n)
 
void profile_as_waksman_algorithm (const size_t n)
 
int main ()
 

Detailed Description

Functions to profile the algorithms that route on Benes and AS-Waksman networks.

Author
This file is part of libsnark, developed by SCIPR Lab and contributors (see AUTHORS).

Definition in file profile_routing_algorithms.cpp.

Function Documentation

◆ main()

int main ( )

Definition at line 50 of file profile_routing_algorithms.cpp.

51 {
52  libff::start_profiling();
53 
54  for (size_t n = 1ul << 10; n <= 1ul << 20; n <<= 1) {
56  }
57 
58  for (size_t n = 1ul << 10; n <= 1ul << 20; n <<= 1) {
60  }
61 }
Here is the call graph for this function:

◆ profile_as_waksman_algorithm()

void profile_as_waksman_algorithm ( const size_t  n)

Definition at line 36 of file profile_routing_algorithms.cpp.

37 {
38  printf("* Size: %zu\n", n);
39 
40  libff::enter_block("Generate permutation");
41  integer_permutation permutation(n);
42  permutation.random_shuffle();
43  libff::leave_block("Generate permutation");
44 
45  libff::enter_block("Generate AS-Waksman routing assignment");
46  const as_waksman_routing routing = get_as_waksman_routing(permutation);
47  libff::leave_block("Generate AS-Waksman routing assignment");
48 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ profile_benes_algorithm()

void profile_benes_algorithm ( const size_t  n)

Definition at line 20 of file profile_routing_algorithms.cpp.

21 {
22  printf("* Size: %zu\n", n);
23 
24  assert(n == 1ul << libff::log2(n));
25 
26  libff::enter_block("Generate permutation");
27  integer_permutation permutation(n);
28  permutation.random_shuffle();
29  libff::leave_block("Generate permutation");
30 
31  libff::enter_block("Generate Benes routing assignment");
32  const benes_routing routing = get_benes_routing(permutation);
33  libff::leave_block("Generate Benes routing assignment");
34 }
Here is the call graph for this function:
Here is the caller graph for this function:
profile_as_waksman_algorithm
void profile_as_waksman_algorithm(const size_t n)
Definition: profile_routing_algorithms.cpp:36
profile_benes_algorithm
void profile_benes_algorithm(const size_t n)
Definition: profile_routing_algorithms.cpp:20
libsnark::get_as_waksman_routing
as_waksman_routing get_as_waksman_routing(const integer_permutation &permutation)
Definition: as_waksman_routing_algorithm.cpp:568
libsnark::benes_routing
std::vector< libff::bit_vector > benes_routing
Definition: benes_routing_algorithm.hpp:61
libsnark::integer_permutation
Definition: integer_permutation.hpp:22
libsnark::as_waksman_routing
std::vector< std::map< size_t, bool > > as_waksman_routing
Definition: as_waksman_routing_algorithm.hpp:102
libsnark::get_benes_routing
benes_routing get_benes_routing(const integer_permutation &permutation)
Definition: benes_routing_algorithm.cpp:320