From 033c73b6faf9dec6e054f6d71deb5dea069faf0c Mon Sep 17 00:00:00 2001 From: nanocoh Date: Fri, 18 Oct 2024 07:54:21 +0200 Subject: [PATCH] equi change --- src/snl/snl/kernel/SNLEquipotential.cpp | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/snl/snl/kernel/SNLEquipotential.cpp b/src/snl/snl/kernel/SNLEquipotential.cpp index 03822a05..20dc2d78 100644 --- a/src/snl/snl/kernel/SNLEquipotential.cpp +++ b/src/snl/snl/kernel/SNLEquipotential.cpp @@ -12,6 +12,7 @@ #include "SNLBitTerm.h" #include "SNLInstTerm.h" #include "SNLInstance.h" +#include namespace { @@ -136,4 +137,36 @@ SNLEquipotential::SNLEquipotential(const SNLNetComponentOccurrence& netComponent extractor.extractNetFromNetComponentOccurrence(netComponentOccurrence, true); } +std::string SNLEquipotential::getString() const { + std::ostringstream stream; + stream << "InstTermOccurrences: ["; + bool first = true; + for (const auto& instTermOccurrence: instTermOccurrences_) { + if (not first) { + stream << ", "; + } + first = false; + stream << instTermOccurrence.getString(); + } + stream << "], Terms: ["; + first = true; + for (const auto& term: terms_) { + if (not first) { + stream << ", "; + } + first = false; + stream << term->getString(); + } + stream << "]"; + return stream.str(); +} + +NajaCollection SNLEquipotential::getTerms() const { + return NajaCollection(new NajaSTLCollection(&terms_)); +} + +NajaCollection SNLEquipotential::getInstTermOccurrences() const { + return NajaCollection(new NajaSTLCollection(&instTermOccurrences_)); +} + }} // namespace SNL // namespace naja