src/libminisyncpp/minisync.cpp
/*
 * Removes un-used data points from the algorithm internal storage.
 */
Removes un-used data points from the algorithm internal storage.
Removes un - used data points from the algorithm internal storage .
void MiniSync::Algorithms::TinySync::cleanup()
{
    for (auto iter = low_points.begin(); iter != low_points.end();)
    {
        if (low_constraint_pts.first != *iter && high_constraint_pts.first != *iter)
            iter = low_points.erase(iter);
        else
            ++iter;
    }
    for (auto iter = high_points.begin(); iter != high_points.end();)
    {
        if (low_constraint_pts.second != *iter && high_constraint_pts.second != *iter)
            iter = high_points.erase(iter);
        else
            ++iter;
    }
    auto tmp_low_cons = std::move(this->low_constraints);
    auto tmp_high_cons = std::move(this->high_constraints);
    for (auto h_point: high_points)
    {
        for (auto l_point: low_points)
        {
            auto pair = std::make_pair(l_point, h_point);
            if (tmp_low_cons.count(pair) > 0)
                this->low_constraints[pair] = tmp_low_cons.at(pair);
            else if (tmp_high_cons.count(pair) > 0)
                this->high_constraints[pair] = tmp_high_cons.at(pair);
        }
    }
}
void MiniSync :: Algorithms :: TinySync :: cleanup ( ) { for ( auto iter = low_points . begin ( ) ; iter != low_points . end ( ) ; ) { if ( low_constraint_pts . first != * iter && high_constraint_pts . first != * iter ) iter = low_points . erase ( iter ) ; else ++ iter ; } for ( auto iter = high_points . begin ( ) ; iter != high_points . end ( ) ; ) { if ( low_constraint_pts . second != * iter && high_constraint_pts . second != * iter ) iter = high_points . erase ( iter ) ; else ++ iter ; } auto tmp_low_cons = std :: move ( this -> low_constraints ) ; auto tmp_high_cons = std :: move ( this -> high_constraints ) ; for ( auto h_point : high_points ) { for ( auto l_point : low_points ) { auto pair = std :: make_pair ( l_point , h_point ) ; if ( tmp_low_cons . count ( pair ) > 0 ) this -> low_constraints [ pair ] = tmp_low_cons . at ( pair ) ; else if ( tmp_high_cons . count ( pair ) > 0 ) this -> high_constraints [ pair ] = tmp_high_cons . at ( pair ) ; } } }
Removes un-used data points from the algorithm internal storage.
Removes un - used data points from the algorithm internal storage .
// cleanup