Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eaasna committed Aug 28, 2023
1 parent 65bfdc3 commit 3afcd02
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/stellar/query_id_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ struct QueryIDMap
size_t recordID(TQuery const & query) const
{
TQuery const * begin = &queries[0];
std::cout << *begin << '\n';
//!ERROR: query is not a reference to the queries set but a copy (that has a different memory address)
std::cout << "Find recordID of query:" << '\n';
std::cout << query << '\n';
TQuery const * current = std::addressof(query);
std::cout << *current << '\n';
std::cout << "recordID:" << current - begin << '\n';
return current - begin;
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/stellar/stellar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ _stellarKernel(StellarSwiftFinder<TAlphabet> & finder, // iterate over database
return find(finder, pattern, swiftVerifier.eps_match_options.epsilon, swiftVerifier.eps_match_options.minLength);
});

if (!has_next)
if (!has_next)
break;

StellarDatabaseSegment<TAlphabet> databaseSegment
Expand Down
1 change: 1 addition & 0 deletions include/stellar/stellar_launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct StellarLauncher
// but in LocalQueryPrefilter case it can just be build over [query0].
// We need to translate that position to a numerical index in the list of queries
size_t const queryRecordID = queryIDMap.recordID(pattern);
std::cout << "queryRecordID:" << queryRecordID << '\n';
return value(localMatches, queryRecordID);
};

Expand Down
5 changes: 5 additions & 0 deletions include/stellar/stellar_query_segment.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ StellarQuerySegment<TAlphabet>
StellarQuerySegment<TAlphabet>::fromPatternMatch(TSwiftPattern const & swiftPattern)
{
size_t const queryID = swiftPattern.curSeqNo;
std::cout << "queryID" << queryID << '\n';
std::cout << std::addresof(swift)
auto const & queryInfix = seqan2::getSequenceByNo(queryID, seqan2::indexText(seqan2::needle(swiftPattern)));
static_assert(std::is_same_v<decltype(queryInfix), TInfixSegment const &>);
auto const & underlyingQuery = host(queryInfix);
std::cout << "queryInfix in fromPatternMatch" << queryInfix << '\n';
std::cout << "from PatternMatch host address:" << std::addressof(queryInfix) << '\n';
std::cout << "from PatternMatch host address:" << std::addressof(underlyingQuery) << '\n';
static_assert(std::is_same_v<decltype(underlyingQuery), seqan2::String<TAlphabet> const &>);
auto const queryInfixInfix = seqan2::infix(swiftPattern, queryInfix);

Expand Down

0 comments on commit 3afcd02

Please sign in to comment.