[aGrUM] fix bug in parents order for CPTs in readen net files

parent 9b4f2f5b
......@@ -231,10 +231,13 @@ namespace gum {
* Given a sequence [var, p_1, p_2, ...,p_n-1, p_n] of parents, modalities
* are parsed in the given order (if all p_i are binary):
* \verbatim
* [0, 0, ..., 0, 0], [0, 0, ..., 0, 1],
* [0, 0, ..., 1, 0], [0, 0, ..., 1, 1],
* [0, 0, ..., 0, 0],
* [0, 0, ..., 0, 1],
* [0, 0, ..., 1, 0],
* [0, 0, ..., 1, 1],
* ...,
* [1, 1, ..., 1, 0], [1, 1, ..., 1, 1].
* [1, 1, ..., 1, 0],
* [1, 1, ..., 1, 1].
* \endverbatim
*
* @param variables the vector giving the order of parents
......
......@@ -284,11 +284,12 @@ void Parser::PARENTS_DEFINITION(std::string& name,std::vector<std::string>& var_
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]);
}
for(Size i=0;i<Size(parents.size());i++) {
/*for(Size i=0;i<Size(parents.size());i++) {
var_seq.push_back(parents[i]);
}
} */
}
}
......
......@@ -206,11 +206,12 @@ PARENTS_DEFINITION<.std::string& name,std::vector<std::string>& var_seq.> = (.st
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]);
}
for(Size i=0;i<Size(parents.size());i++) {
/*for(Size i=0;i<Size(parents.size());i++) {
var_seq.push_back(parents[i]);
}
} */
.)
]
]
......
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