void progress_indicator_subindicator::done() {
#ifndef TPIE_NDEBUG
	softassert(m_init_called);
	softassert(!m_done_called);
	m_done_called=true;

	if(m_logGroupMode == log_group_mode::enabled)
		end_log_group();
#endif
	if (!m_crumb.empty() && m_parent) m_parent->pop_breadcrumb();
	progress_indicator_base::done();
	m_current = m_range; 
	refresh();
}
void fractional_progress::add_sub_indicator(fractional_subindicator & sub) {
    softassert(m_add_state==true);
    if (sub.m_fraction < 0.000000001 && sub.m_confidence > 0.5) return;
    m_total_sum += sub.m_fraction;
    m_confidence = std::min(sub.m_confidence, m_confidence);
    m_time_sum += sub.m_estimate;
}
void progress_indicator_subindicator::init(stream_size_type range) {
#ifndef TPIE_NDEBUG
	softassert(!m_init_called && "Init called twice");
	m_init_called=true;
#endif
	if (!m_crumb.empty() && m_parent) m_parent->push_breadcrumb(m_crumb.c_str(), IMPORTANCE_MAJOR);
	progress_indicator_base::init(range);

	if(m_logGroupMode == log_group_mode::enabled)
		begin_log_group(m_crumb);
}
void fractional_subindicator::init(stream_size_type range) {
    softassert(m_fp.m_init_called);
    m_predict.start_execution(m_n);
    if (m_parent) {
        double f = m_fp.get_fraction(*this);
        double t = static_cast<double>(m_parent->get_range());
        m_outerRange = static_cast<stream_size_type>(t * f);
    }
#ifndef TPIE_NDEBUG
    m_init_called=true;
#endif
    progress_indicator_subindicator::init(range);
}