pub struct DhParams {
pub maxiter: u32,
pub fineiter: u32,
pub cool_fact: f64,
pub weight_node_dist: f64,
pub weight_border: f64,
pub weight_edge_lengths: f64,
pub weight_edge_crossings: f64,
pub weight_node_edge_dist: f64,
}Expand description
Parameters for the Davidson-Harel layout.
Fields§
§maxiter: u32Maximum annealing iterations. Default: 10.
fineiter: u32Fine-tuning iterations. Default: max(10, log2(n)).
cool_fact: f64Cooling factor in (0, 1). Default: 0.75.
weight_node_dist: f64Weight for node-node distance repulsion. Default: 1.0.
weight_border: f64Weight for border proximity. Default: 0.0.
weight_edge_lengths: f64Weight for edge length minimization. Default: density/10.
weight_edge_crossings: f64Weight for edge crossing minimization. Default: 1 - sqrt(density).
weight_node_edge_dist: f64Weight for node-edge distance (fine-tuning only). Default: (1-density)/5.
Implementations§
Source§impl DhParams
impl DhParams
Sourcepub fn for_graph(graph: &Graph) -> Self
pub fn for_graph(graph: &Graph) -> Self
Create parameters with defaults scaled to the given graph.
§Examples
use rust_igraph::{Graph, DhParams};
let g = Graph::with_vertices(10);
let params = DhParams::for_graph(&g);
assert_eq!(params.maxiter, 10);
assert!(params.cool_fact > 0.0 && params.cool_fact < 1.0);Trait Implementations§
Auto Trait Implementations§
impl Freeze for DhParams
impl RefUnwindSafe for DhParams
impl Send for DhParams
impl Sync for DhParams
impl Unpin for DhParams
impl UnsafeUnpin for DhParams
impl UnwindSafe for DhParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more