[aGrUM] fix a second bug in BIF reader with proper parents order

parent 850d7cfc
Pipeline #21641930 passed with stages
in 84 minutes and 42 seconds
......@@ -187,7 +187,10 @@ void Parser::PROBA() {
for (Size i=Size(parents.size());i>=Size(1);--i){
TRY(factory().variableId(parents[i-1]));
TRY( factory().addParent(parents[i-1]));
var_seq.push_back(parents[i-1]);
}
var_seq.push_back(var);
for (Size i=0;i<Size(parents.size());++i){
var_seq.push_back(parents[i]);
}
TRY(factory().endParentsDeclaration());
Expect(7 /* "{" */);
......
......@@ -144,7 +144,10 @@ PROBA =
for (Size i=Size(parents.size());i>=Size(1);--i){
TRY(factory().variableId(parents[i-1]));
TRY( factory().addParent(parents[i-1]));
var_seq.push_back(parents[i-1]);
}
var_seq.push_back(var);
for (Size i=0;i<Size(parents.size());++i){
var_seq.push_back(parents[i]);
}
TRY(factory().endParentsDeclaration()); .)
'{'
......
......@@ -199,7 +199,7 @@ namespace gum_tests {
void testRead_file3() {
std::string file = GET_RESSOURCES_PATH("BIFReader_file3.bif");
gum::BayesNet< float >* net = new gum::BayesNet< float >();
auto net = new gum::BayesNet< float >();
gum::BIFReader< float > reader(net, file);
int nbrErr = 0;
......@@ -209,9 +209,9 @@ namespace gum_tests {
TS_ASSERT_EQUALS(reader.warnings(), (gum::Size)3);
// 3 warnings
TS_ASSERT_EQUALS(reader.errors(), (gum::Size)0);
TS_ASSERT(net != 0);
TS_ASSERT(net != nullptr);
if (net != 0) {
if (net != nullptr) {
gum::HashTable< std::string, gum::NodeId > idMap;
for (const auto node : net->nodes())
......
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