src/GRAPHGEN/forest.cpp
// Perform tree pruning by removing useless nodes. Useless nodes are identified looking at given constraints 
Perform tree pruning by removing useless nodes. Useless nodes are identified looking at given constraints
Perform tree pruning by removing useless nodes . Useless nodes are identified looking at given constraints
BinaryDrag<conact>::node* LineForestHandler::Reduce(const BinaryDrag<conact>::node* n, BinaryDrag<conact>& t, const constraints& constr) {
    if (n->isleaf()) {
        return t.make_node(n->data);
    }
    else {
        auto it = constr.find(n->data.condition);
        if (it != end(constr)) {
            if (it->second == 0)
                return Reduce(n->left, t, constr);
            else
                return Reduce(n->right, t, constr);
        }
        else {
            return t.make_node(n->data, Reduce(n->left, t, constr), Reduce(n->right, t, constr));
        }
    }
}
BinaryDrag < conact > :: node * LineForestHandler :: Reduce ( const BinaryDrag < conact > :: node * n , BinaryDrag < conact > & t , const constraints & constr ) { if ( n -> isleaf ( ) ) { return t . make_node ( n -> data ) ; } else { auto it = constr . find ( n -> data . condition ) ; if ( it != end ( constr ) ) { if ( it -> second == 0 ) return Reduce ( n -> left , t , constr ) ; else return Reduce ( n -> right , t , constr ) ; } else { return t . make_node ( n -> data , Reduce ( n -> left , t , constr ) , Reduce ( n -> right , t , constr ) ) ; } } }
Perform tree pruning by removing useless nodes.
Perform tree pruning by removing useless nodes .