Skip to content

Commit

Permalink
equi change
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocoh committed Oct 18, 2024
1 parent e528952 commit 033c73b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/snl/snl/kernel/SNLEquipotential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "SNLBitTerm.h"
#include "SNLInstTerm.h"
#include "SNLInstance.h"
#include <sstream>

namespace {

Expand Down Expand Up @@ -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<SNLBitTerm*> SNLEquipotential::getTerms() const {
return NajaCollection(new NajaSTLCollection(&terms_));
}

NajaCollection<SNLInstTermOccurrence> SNLEquipotential::getInstTermOccurrences() const {
return NajaCollection(new NajaSTLCollection(&instTermOccurrences_));
}

}} // namespace SNL // namespace naja

0 comments on commit 033c73b

Please sign in to comment.