8#include <cluster_linearize.h>
18template<
typename SetType>
33template<
typename SetType>
46template<
typename SetType>
73 }
else if ((i & 1) == 0) {
114template<
typename SetType>
117 const auto depgraph = MakeHardGraph<SetType>(ntx);
118 const auto iter_limit = std::min<uint64_t>(10000, uint64_t{1} << (ntx / 2 - 1));
119 uint64_t rng_seed = 0;
122 auto [candidate, iters_performed] = finder.FindCandidateSet(iter_limit, {});
123 assert(iters_performed == iter_limit);
140template<
typename SetType>
143 const auto depgraph = MakeLinearGraph<SetType>(ntx);
144 uint64_t rng_seed = 0;
145 std::vector<ClusterIndex> old_lin(ntx);
148 Linearize(depgraph, 0, rng_seed++, old_lin);
160template<
typename SetType>
163 const auto depgraph = MakeWideGraph<SetType>(ntx);
164 uint64_t rng_seed = 0;
165 std::vector<ClusterIndex> old_lin(ntx);
168 Linearize(depgraph, 0, rng_seed++, old_lin);
172template<
typename SetType>
176 std::vector<ClusterIndex> lin(ntx);
183template<
typename SetType>
191 std::vector<ClusterIndex> lin1;
192 std::vector<ClusterIndex> lin2;
197 lin2.push_back(ntx - i);
#define BENCHMARK(n, priority_level)
static void LinearizePerIter99TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters48TxWorstCaseAnc(benchmark::Bench &bench)
static void PostLinearize16TxWorstCase(benchmark::Bench &bench)
static void PostLinearize48TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters16TxWorstCaseAnc(benchmark::Bench &bench)
static void LinearizeNoIters75TxWorstCaseLIMO(benchmark::Bench &bench)
static void MergeLinearizations99TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters99TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizeNoIters99TxWorstCaseAnc(benchmark::Bench &bench)
static void LinearizeNoIters75TxWorstCaseAnc(benchmark::Bench &bench)
static void MergeLinearizations32TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter64TxWorstCase(benchmark::Bench &bench)
static void MergeLinearizations48TxWorstCase(benchmark::Bench &bench)
static void MergeLinearizations64TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters64TxWorstCaseLIMO(benchmark::Bench &bench)
static void PostLinearize32TxWorstCase(benchmark::Bench &bench)
static void PostLinearize75TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters32TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizeNoIters32TxWorstCaseAnc(benchmark::Bench &bench)
static void PostLinearize64TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters48TxWorstCaseLIMO(benchmark::Bench &bench)
static void MergeLinearizations75TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter48TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter32TxWorstCase(benchmark::Bench &bench)
static void MergeLinearizations16TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter75TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters16TxWorstCaseLIMO(benchmark::Bench &bench)
static void PostLinearize99TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter16TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters64TxWorstCaseAnc(benchmark::Bench &bench)
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Bench & batch(T b) noexcept
Sets the batch size.
Bench & unit(char const *unit)
Sets the operation unit.
Data structure that holds a transaction graph's preprocessed data (fee, size, ancestors,...
void AddDependency(ClusterIndex parent, ClusterIndex child) noexcept
Modify this transaction graph, adding a dependency between a specified parent and child.
ClusterIndex AddTransaction(const FeeFrac &feefrac) noexcept
Add a new unconnected transaction to this transaction graph (at the end), and return its ClusterIndex...
Class encapsulating the state needed to perform search for good candidate sets.
std::pair< std::vector< ClusterIndex >, bool > Linearize(const DepGraph< SetType > &depgraph, uint64_t max_iterations, uint64_t rng_seed, Span< const ClusterIndex > old_linearization={}) noexcept
Find or improve a linearization for a cluster.
uint32_t ClusterIndex
Data type to represent transaction indices in clusters.
void PostLinearize(const DepGraph< SetType > &depgraph, Span< ClusterIndex > linearization)
Improve a given linearization.
std::vector< ClusterIndex > MergeLinearizations(const DepGraph< SetType > &depgraph, Span< const ClusterIndex > lin1, Span< const ClusterIndex > lin2)
Merge two linearizations for the same cluster into one that is as good as both.