Skip to content

Commit eb95920

Browse files
committed
Fix edgelist construction
1 parent 9532351 commit eb95920

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/solvers/enummixed/clique.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class CliqueEnumerator {
201201
public:
202202
int node1, node2, nextedge{};
203203

204-
Edge() = default;
205204
explicit Edge(const int n1, const int n2) : node1(n1), node2(n2) {}
206205
~Edge() = default;
207206
bool operator==(const Edge &y) const { return (node1 == y.node1 && node2 == y.node2); }

src/solvers/enummixed/enummixed.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ Array<Array<MixedStrategyProfile<T>>> EnumMixedStrategySolution<T>::GetCliques()
4747
throw DimensionException();
4848
}
4949

50-
Array<CliqueEnumerator::Edge> edgelist(n);
51-
std::transform(m_node1.begin(), m_node1.end(), m_node2.begin(), edgelist.begin(),
50+
Array<CliqueEnumerator::Edge> edgelist;
51+
edgelist.reserve(n);
52+
std::transform(m_node1.begin(), m_node1.end(), m_node2.begin(), std::back_inserter(edgelist),
5253
[](const int a, const int b) { return CliqueEnumerator::Edge(a, b); });
5354

5455
const CliqueEnumerator clique(edgelist, m_v2 + 1, m_v1 + 1);

0 commit comments

Comments
 (0)