[aGrUM] making mvsc happier

parent 9625f5ed
...@@ -333,11 +333,11 @@ namespace gum { ...@@ -333,11 +333,11 @@ namespace gum {
JointTargetedInference< GUM_SCALAR >::evidenceJointImpact( JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(
const std::vector< NodeId >& targets, const std::vector< NodeId >& evs) { const std::vector< NodeId >& targets, const std::vector< NodeId >& evs) {
NodeSet sotargets(targets.size()); NodeSet sotargets(Size(targets.size()));
for (const auto& e : targets) for (const auto& e : targets)
sotargets << e; sotargets << e;
NodeSet soevs(evs.size()); NodeSet soevs(Size(evs.size()));
for (const auto& e : evs) for (const auto& e : evs)
soevs << e; soevs << e;
......
...@@ -283,7 +283,7 @@ namespace gum { ...@@ -283,7 +283,7 @@ namespace gum {
NodeId target, const std::vector< NodeId >& evs) { NodeId target, const std::vector< NodeId >& evs) {
const auto& vtarget = this->BN().variable(target); const auto& vtarget = this->BN().variable(target);
NodeSet soids(evs.size()); NodeSet soids(Size(evs.size()));
for (const auto& e : evs) for (const auto& e : evs)
soids << e; soids << e;
if (soids.contains(target)) { if (soids.contains(target)) {
......
...@@ -57,7 +57,7 @@ namespace gum { ...@@ -57,7 +57,7 @@ namespace gum {
genericBNLearner::Database::idFromName(const std::string& var_name) const { genericBNLearner::Database::idFromName(const std::string& var_name) const {
try { try {
return __name2nodeId.second(const_cast< std::string& >(var_name)); return __name2nodeId.second(const_cast< std::string& >(var_name));
} catch (gum::NotFound) { } catch (gum::NotFound& ) {
GUM_ERROR(MissingVariableInDatabase, "for variable " << var_name); GUM_ERROR(MissingVariableInDatabase, "for variable " << var_name);
} }
} }
......
...@@ -472,7 +472,7 @@ namespace gum { ...@@ -472,7 +472,7 @@ namespace gum {
std::vector< NodeId > path = graph.directedPath(z, x); std::vector< NodeId > path = graph.directedPath(z, x);
// if we find a cycle, we force the competing edge // if we find a cycle, we force the competing edge
__latent_couples.push_back(Arc(z, x)); __latent_couples.push_back(Arc(z, x));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(x, z); graph.addArc(x, z);
} }
graph.addArc(z, x); graph.addArc(z, x);
...@@ -482,7 +482,7 @@ namespace gum { ...@@ -482,7 +482,7 @@ namespace gum {
// if we find a cycle, we force the competing edge // if we find a cycle, we force the competing edge
graph.addArc(z, x); graph.addArc(z, x);
__latent_couples.push_back(Arc(z, x)); __latent_couples.push_back(Arc(z, x));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(x, z); graph.addArc(x, z);
} }
} }
...@@ -492,7 +492,7 @@ namespace gum { ...@@ -492,7 +492,7 @@ namespace gum {
std::vector< NodeId > path = graph.directedPath(z, y); std::vector< NodeId > path = graph.directedPath(z, y);
// if we find a cycle, we force the competing edge // if we find a cycle, we force the competing edge
__latent_couples.push_back(Arc(z, y)); __latent_couples.push_back(Arc(z, y));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(y, z); graph.addArc(y, z);
} }
graph.addArc(z, y); graph.addArc(z, y);
...@@ -503,7 +503,7 @@ namespace gum { ...@@ -503,7 +503,7 @@ namespace gum {
graph.addArc(z, y); graph.addArc(z, y);
__latent_couples.push_back(Arc(z, y)); __latent_couples.push_back(Arc(z, y));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(y, z); graph.addArc(y, z);
} }
} }
...@@ -540,7 +540,7 @@ namespace gum { ...@@ -540,7 +540,7 @@ namespace gum {
// if we find a cycle, we force the competing edge // if we find a cycle, we force the competing edge
graph.addArc(y, z); graph.addArc(y, z);
__latent_couples.push_back(Arc(y, z)); __latent_couples.push_back(Arc(y, z));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(z, y); graph.addArc(z, y);
} }
} }
...@@ -553,7 +553,7 @@ namespace gum { ...@@ -553,7 +553,7 @@ namespace gum {
// if we find a cycle, we force the competing edge // if we find a cycle, we force the competing edge
graph.addArc(x, z); graph.addArc(x, z);
__latent_couples.push_back(Arc(x, z)); __latent_couples.push_back(Arc(x, z));
} catch (gum::NotFound) { } catch (gum::NotFound&) {
graph.addArc(z, x); graph.addArc(z, x);
} }
} }
......
...@@ -75,7 +75,7 @@ namespace gum_tests { ...@@ -75,7 +75,7 @@ namespace gum_tests {
i.setFirst(); i.setFirst();
TS_ASSERT_EQUALS(p[i], 2.0 / (taille * (taille + 1))); TS_ASSERT_EQUALS(p[i], 2.0 / (taille * (taille + 1)));
} catch (gum::Exception e) { } catch (gum::Exception& e) {
GUM_SHOWERROR(e); GUM_SHOWERROR(e);
} }
} }
......
...@@ -108,7 +108,7 @@ namespace gum_tests { ...@@ -108,7 +108,7 @@ namespace gum_tests {
if (inf != 0) { if (inf != 0) {
TS_GUM_ASSERT_THROWS_NOTHING(delete inf); TS_GUM_ASSERT_THROWS_NOTHING(delete inf);
} }
} catch (gum::Exception e) { } catch (gum::Exception& e) {
TS_ASSERT(false); TS_ASSERT(false);
std::cerr << std::endl << e.errorContent() << std::endl; std::cerr << std::endl << e.errorContent() << std::endl;
throw; throw;
......
...@@ -58,7 +58,7 @@ namespace gum_tests { ...@@ -58,7 +58,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(prm->type("t_color_p").variable().domainSize(), TS_ASSERT_EQUALS(prm->type("t_color_p").variable().domainSize(),
(gum::Size)5); (gum::Size)5);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -90,7 +90,7 @@ namespace gum_tests { ...@@ -90,7 +90,7 @@ namespace gum_tests {
TS_ASSERT(prm->type("t_color_p").isSubTypeOf(prm->type("t_degraded"))); TS_ASSERT(prm->type("t_color_p").isSubTypeOf(prm->type("t_degraded")));
TS_ASSERT_EQUALS(prm->types().size(), (gum::Size)7); TS_ASSERT_EQUALS(prm->types().size(), (gum::Size)7);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -111,7 +111,7 @@ namespace gum_tests { ...@@ -111,7 +111,7 @@ namespace gum_tests {
TS_GUM_ASSERT_THROWS_NOTHING(prm->getClass("Printer")); TS_GUM_ASSERT_THROWS_NOTHING(prm->getClass("Printer"));
TS_GUM_ASSERT_THROWS_NOTHING(prm->getClass("Computer")); TS_GUM_ASSERT_THROWS_NOTHING(prm->getClass("Computer"));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -129,7 +129,7 @@ namespace gum_tests { ...@@ -129,7 +129,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0);
TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)0);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -147,7 +147,7 @@ namespace gum_tests { ...@@ -147,7 +147,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0);
TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)0);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -165,7 +165,7 @@ namespace gum_tests { ...@@ -165,7 +165,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0);
TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)1); TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)1);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -183,7 +183,7 @@ namespace gum_tests { ...@@ -183,7 +183,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0); TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)0);
TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)1); TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)1);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -201,7 +201,7 @@ namespace gum_tests { ...@@ -201,7 +201,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)1); TS_ASSERT_EQUALS(c.aggregates().size(), (gum::Size)1);
TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)2); TS_ASSERT_EQUALS(c.slotChains().size(), (gum::Size)2);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -235,7 +235,7 @@ namespace gum_tests { ...@@ -235,7 +235,7 @@ namespace gum_tests {
prm->getInterface("fr.lip6.printers.Printer")); prm->getInterface("fr.lip6.printers.Printer"));
delete prm; delete prm;
} }
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -321,7 +321,7 @@ namespace gum_tests { ...@@ -321,7 +321,7 @@ namespace gum_tests {
TS_ASSERT(!Computer.isSubTypeOf(ColorPrinter)); TS_ASSERT(!Computer.isSubTypeOf(ColorPrinter));
TS_ASSERT(Computer.isSubTypeOf(Computer)); TS_ASSERT(Computer.isSubTypeOf(Computer));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -407,7 +407,7 @@ namespace gum_tests { ...@@ -407,7 +407,7 @@ namespace gum_tests {
TS_ASSERT(!Computer.isSuperTypeOf(ColorPrinter)); TS_ASSERT(!Computer.isSuperTypeOf(ColorPrinter));
TS_ASSERT(Computer.isSuperTypeOf(Computer)); TS_ASSERT(Computer.isSuperTypeOf(Computer));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -455,7 +455,7 @@ namespace gum_tests { ...@@ -455,7 +455,7 @@ namespace gum_tests {
TS_ASSERT(!PowerSupply.isInnerNode( TS_ASSERT(!PowerSupply.isInnerNode(
PowerSupply["(fr.lip6.printers.t_state)state"])); PowerSupply["(fr.lip6.printers.t_state)state"]));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -475,7 +475,7 @@ namespace gum_tests { ...@@ -475,7 +475,7 @@ namespace gum_tests {
TS_ASSERT_EQUALS(Room.aggregates().size(), (gum::Size)0); TS_ASSERT_EQUALS(Room.aggregates().size(), (gum::Size)0);
TS_ASSERT_EQUALS(Room.slotChains().size(), (gum::Size)0); TS_ASSERT_EQUALS(Room.slotChains().size(), (gum::Size)0);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -529,7 +529,7 @@ namespace gum_tests { ...@@ -529,7 +529,7 @@ namespace gum_tests {
TS_ASSERT(!Equipment.isInputNode(Equipment["(boolean)equipState"])); TS_ASSERT(!Equipment.isInputNode(Equipment["(boolean)equipState"]));
TS_ASSERT(Equipment.isInnerNode(Equipment["(boolean)equipState"])); TS_ASSERT(Equipment.isInnerNode(Equipment["(boolean)equipState"]));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -599,7 +599,7 @@ namespace gum_tests { ...@@ -599,7 +599,7 @@ namespace gum_tests {
TS_ASSERT(!Printer.isInputNode(Printer["hasInk"])); TS_ASSERT(!Printer.isInputNode(Printer["hasInk"]));
TS_ASSERT(Printer.isInnerNode(Printer["hasInk"])); TS_ASSERT(Printer.isInnerNode(Printer["hasInk"]));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1008,7 +1008,7 @@ namespace gum_tests { ...@@ -1008,7 +1008,7 @@ namespace gum_tests {
TS_GUM_ASSERT_THROWS_NOTHING(Computer["printers.equipState"]); TS_GUM_ASSERT_THROWS_NOTHING(Computer["printers.equipState"]);
TS_GUM_ASSERT_THROWS_NOTHING(Computer["room.power.state"]); TS_GUM_ASSERT_THROWS_NOTHING(Computer["room.power.state"]);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1048,7 +1048,7 @@ namespace gum_tests { ...@@ -1048,7 +1048,7 @@ namespace gum_tests {
TS_GUM_ASSERT_THROWS_NOTHING( TS_GUM_ASSERT_THROWS_NOTHING(
SafeComputer["room.power.(fr.lip6.printers.t_state)state"]); SafeComputer["room.power.(fr.lip6.printers.t_state)state"]);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1077,7 +1077,7 @@ namespace gum_tests { ...@@ -1077,7 +1077,7 @@ namespace gum_tests {
} }
TS_ASSERT_EQUALS(set.size(), gum::Size(0)); TS_ASSERT_EQUALS(set.size(), gum::Size(0));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1105,7 +1105,7 @@ namespace gum_tests { ...@@ -1105,7 +1105,7 @@ namespace gum_tests {
} }
TS_ASSERT_EQUALS(set.size(), gum::Size(0)); TS_ASSERT_EQUALS(set.size(), gum::Size(0));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1135,7 +1135,7 @@ namespace gum_tests { ...@@ -1135,7 +1135,7 @@ namespace gum_tests {
} }
TS_ASSERT_EQUALS(set.size(), gum::Size(0)); TS_ASSERT_EQUALS(set.size(), gum::Size(0));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1154,7 +1154,7 @@ namespace gum_tests { ...@@ -1154,7 +1154,7 @@ namespace gum_tests {
if (prm) { if (prm) {
delete prm; delete prm;
} }
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1203,7 +1203,7 @@ namespace gum_tests { ...@@ -1203,7 +1203,7 @@ namespace gum_tests {
if (prm) { if (prm) {
delete prm; delete prm;
} }
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1246,7 +1246,7 @@ namespace gum_tests { ...@@ -1246,7 +1246,7 @@ namespace gum_tests {
if (prm) { if (prm) {
delete prm; delete prm;
} }
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1336,7 +1336,7 @@ namespace gum_tests { ...@@ -1336,7 +1336,7 @@ namespace gum_tests {
if (prm) { if (prm) {
delete prm; delete prm;
} }
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1361,7 +1361,7 @@ namespace gum_tests { ...@@ -1361,7 +1361,7 @@ namespace gum_tests {
TS_GUM_ASSERT_THROWS_NOTHING(ParamClass["equipState"]); TS_GUM_ASSERT_THROWS_NOTHING(ParamClass["equipState"]);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1382,7 +1382,7 @@ namespace gum_tests { ...@@ -1382,7 +1382,7 @@ namespace gum_tests {
prm->getClass("fr.lip6.printers.ParamClass<lambda=0.001,t=4>")); prm->getClass("fr.lip6.printers.ParamClass<lambda=0.001,t=4>"));
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1411,7 +1411,7 @@ namespace gum_tests { ...@@ -1411,7 +1411,7 @@ namespace gum_tests {
TS_ASSERT_DELTA(values[1], 0.6, 1e-6); TS_ASSERT_DELTA(values[1], 0.6, 1e-6);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
...@@ -1441,7 +1441,7 @@ namespace gum_tests { ...@@ -1441,7 +1441,7 @@ namespace gum_tests {
TS_ASSERT_DELTA(values[2], 0.0, 1e-6); TS_ASSERT_DELTA(values[2], 0.0, 1e-6);
delete prm; delete prm;
} catch (gum::Exception) { } catch (gum::Exception&) {
TS_ASSERT(false); TS_ASSERT(false);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment