Skip to content

Commit

Permalink
use after free debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Goblin80 committed May 6, 2024
1 parent 3158e74 commit 5592844
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/engine/joinOrdering/CostIKKBZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ auto CostIKKBZ<N>::T(const QueryGraph<N>& g, const N& n) -> float {
template <typename N>
requires RelationAble<N>
auto CostIKKBZ<N>::rank(const QueryGraph<N>& g, const N& n) -> float {
if (rank_m.contains(n)) return rank_m[n];
// if (rank_m.contains(n)) return rank_m[n];

auto c = C(g, n);
auto t = T(g, n);
Expand All @@ -50,7 +50,7 @@ auto CostIKKBZ<N>::rank(const QueryGraph<N>& g, const N& n) -> float {
// assert rank [0, 1]
AD_CONTRACT_CHECK(r >= 0 && r <= 1);

rank_m[n] = r;
// rank_m[n] = r;
return r;
}
} // namespace JoinOrdering
14 changes: 13 additions & 1 deletion src/engine/joinOrdering/GOO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ requires RelationAble<N>
g.hist[n].push_back(b);

// TODO: STL chain iterators
for (auto const& [x, e] : boost::join(g.edges_[a], g.edges_[b])) {
// boost::join(g.edges_[a], g.edges_[b])
for (auto const& [x, e] : g.edges_[a]) {
if (e.hidden || x == a || x == b) continue;
g.add_rjoin(n, x, e.weight, Direction::UNDIRECTED);

if (!g.is_common_neighbour(a, b, x)) continue;
// when the 2 relations to be combined have common neighbours
// multiply edge weights of newly combined relation
g.edges_[x][n].weight = g.edges_[a][x].weight * g.edges_[b][x].weight;
g.edges_[n][x].weight = g.edges_[a][x].weight * g.edges_[b][x].weight;
}

for (auto const& [x, e] : g.edges_[b]) {
if (e.hidden || x == a || x == b) continue;
g.add_rjoin(n, x, e.weight, Direction::UNDIRECTED);

Expand Down
2 changes: 0 additions & 2 deletions src/engine/joinOrdering/GOO.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#pragma once

#include <boost/range/join.hpp>

#include "QueryGraph.h"

namespace JoinOrdering {
Expand Down
1 change: 0 additions & 1 deletion src/engine/joinOrdering/IKKBZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ std::vector<N> IKKBZ_Normalized(QueryGraph<N>& g, ICostASI<N>& Ch,
// "precedence graph demands A -> B but rank(A) > rank(B),
// we speak of contradictory sequences."
// 118/637
// if (ASI::rank(g, p) > ASI::rank(g, c)) {
if (Ch.rank(g, p) > Ch.rank(g, c)) {
// a new node representing compound relation
IKKBZ_combine(g, p, c);
Expand Down

0 comments on commit 5592844

Please sign in to comment.