void ScrollBar::calculate_ranges(int view_size, int total_size) { if (view_size <= 0 || total_size <= 0) { set_ranges(0, 1, 1, 1); } else { int scroll_max = max(1, total_size - view_size + 1); int page_step = max(1, view_size); set_ranges(0, scroll_max, 1, page_step); } }
MC1p(const Par &par) : TSP(par) { LOG << "# Read parameters" << std::endl; read_par(); LOG << "# Set parameters" << std::endl; #define JN_MCPSB_PAR_SET(a) par.set(PP_CAT(_mc_, a), PP_STRING3(PP_CAT(mc_, a))); JN_MAP(JN_MCPSB_PAR_SET, JN_MC_PARS1, JN_MC_PARS2) LOG << "# Print parameters" << std::endl; print_parameters(); LOG << "# Read initial structure" << std::endl; chain_read_model(_pred_chain, par.get("pdb")); LOG << "# Set indices" << std::endl; thread_local static std::map<char, int> m {{'A', 0}, {'U', 1}, {'G', 2}, {'C', 3}}; m_indices.resize(_seq.size()); for (int i = 0; i < _seq.size(); i++) { m_indices[i] = m[_seq[i]]; } LOG << "# Set 2D trees" << std::endl; set_trees(); LOG << "# Set ranges" << std::endl; set_ranges(); LOG << "# Print ranges" << std::endl; print_ranges(); }
covariance_param_t::covariance_param_t() : m_covariance_type(COV_SPHERICAL), m_sill(0), m_nugget(0) { set_ranges(0, 0, 0); set_angles(0, 0, 0); }
void ScrollBar::set_page_step(int step) { set_ranges(impl->scroll_min, impl->scroll_max, impl->line_step, step); }
void ScrollBar::set_max(int new_scroll_max) { set_ranges(impl->scroll_min, new_scroll_max, impl->line_step, impl->page_step); }
void CL_ScrollBar::set_line_step(int step) { set_ranges(impl->scroll_min, impl->scroll_max, step, impl->page_step); }
void CL_ScrollBar::set_min(int new_scroll_min) { set_ranges(new_scroll_min, impl->scroll_max, impl->line_step, impl->page_step); }
explicit base_sub_matrix(size_type br, size_type er, size_type bc, size_type ec) : my_nnz(0) { set_ranges(br, er, bc, ec); }