use crate::hg_formats::*;
pub fn hg_infer_hg_type(expected_gamma: f64, temperature: f64) -> HgGraphType {
if expected_gamma < HG_INF_GAMMA { if temperature == 0.0 {
HgGraphType::HyperbolicRgg
} else if temperature < HG_INF_TEMPERATURE {
HgGraphType::HyperbolicStandard
} else {
HgGraphType::SoftConfigurationModel
}
} else { if temperature == 0.0 {
HgGraphType::AngularRgg
} else if temperature < HG_INF_TEMPERATURE {
HgGraphType::SoftRgg
} else {
HgGraphType::ErdosRenyi
}
}
}
pub fn hg_uniform_radial_coordinate(radius: f64, rnd: &mut FnMut() -> f64) -> f64 {
if radius == 0.0 {
eprintln!("HGG Warning: Radius = 0.");
return 0.0;
}
let y = rnd();
return (1.0 + y * (radius.cosh() - 1.0)).acosh();
}
pub fn hg_quasi_uniform_radial_coordinate(radius: f64, alpha: f64, rnd: &mut FnMut() -> f64) -> f64 {
if (radius == 0.0) || (alpha == 0.0) {
eprintln!("HGG Warning: Radius = 0 or alpha = 0: discontinuity.");
return 0.0; }
let y = rnd();
return 1.0 / alpha * (1.0 + y * ((alpha * radius).cosh() - 1.0)).acosh();
}
pub fn hg_uniform_angular_coordinate(rnd: &mut FnMut() -> f64) -> f64 {
return rnd() * 2.0 * HG_PI;
}