Commit 3f9ad61b authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

Levenstain automatically adaptable to old-style interface

parent 15748748
......@@ -23,19 +23,42 @@ namespace levenmain {
std::mt19937_64::default_seed + ctx2.thread_index()
), get<a_size>(ctx4), get<b_size>(ctx4));
levensol::levenstein<policy> data(mg.size1(), mg.size2());
for (auto&& ctx5 : auto_measurement<repeat_policy>(ctx4, 1024))
if constexpr ( std::is_constructible_v<levensol::levenstein<policy>, const levenasgn::data_element *, const levenasgn::data_element *, const levenasgn::data_element *, const levenasgn::data_element *> )
{
std::size_t h = 0;
for (auto i : for_index<repeats>(ctx5))
// old-style interface
levensol::levenstein<policy> data(mg.begin1(), mg.end1(), mg.begin2(), mg.end2());
for (auto&& ctx5 : auto_measurement<repeat_policy>(ctx4, 1024))
{
auto rv = data.compute(mg.data1(), mg.data2());
h = rv;
std::size_t h = 0;
for (auto i : for_index<repeats>(ctx5))
{
auto rv = data.compute();
h = rv;
}
if (stop_for_results(ctx5))
{
store_result<output>(ctx5, h);
}
}
if (stop_for_results(ctx5))
}
else
{
// new interface
levensol::levenstein<policy> data(mg.size1(), mg.size2());
for (auto&& ctx5 : auto_measurement<repeat_policy>(ctx4, 1024))
{
store_result<output>(ctx5, h);
std::size_t h = 0;
for (auto i : for_index<repeats>(ctx5))
{
auto rv = data.compute(mg.data1(), mg.data2());
h = rv;
}
if (stop_for_results(ctx5))
{
store_result<output>(ctx5, h);
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment