arbor/morph/morphology.cpp
// Returns false if one of the root's children has the same tag as the root.
Returns false if one of the root's children has the same tag as the root.
Returns false if one of the root ' s children has the same tag as the root .
bool root_sample_tag_differs_from_children(const sample_tree& st) {
    if (st.empty()) return false;
    auto& P = st.parents();
    auto& S = st.samples();
    auto root_tag = S.front().tag;
    for (auto i: util::make_span(1, st.size())) {
        if (0u==P[i] && S[i].tag==root_tag) {
            return false;
        }
    }
    return true;
}
bool root_sample_tag_differs_from_children ( const sample_tree & st ) { if ( st . empty ( ) ) return false ; auto & P = st . parents ( ) ; auto & S = st . samples ( ) ; auto root_tag = S . front ( ) . tag ; for ( auto i : util :: make_span ( 1 , st . size ( ) ) ) { if ( 0u == P [ i ] && S [ i ] . tag == root_tag ) { return false ; } } return true ; }
Returns false if one of the root's children has the same tag as the root.
Returns false if one of the root ' s children has the same tag as the root .