Skip to main content

KamadaKawaiOptions

Struct KamadaKawaiOptions 

Source
pub struct KamadaKawaiOptions<'a> {
    pub maxiter: Option<usize>,
    pub epsilon: f64,
    pub kkconst: Option<f64>,
    pub weights: Option<&'a [f64]>,
    pub initial: Option<&'a Matrix>,
    pub minx: Option<&'a [f64]>,
    pub maxx: Option<&'a [f64]>,
    pub miny: Option<&'a [f64]>,
    pub maxy: Option<&'a [f64]>,
    pub minz: Option<&'a [f64]>,
    pub maxz: Option<&'a [f64]>,
}
Expand description

Parameters of the Kamada–Kawai layouts (Graph::layout_kamada_kawai and Graph::layout_kamada_kawai_3d).

The Default uses 50 n iterations (the C documentation asks for at least 10 n; 50 n is the default of the R and Python interfaces), epsilon = 0 (always run all the iterations), kkconst = n (as the C documentation recommends), unit edge lengths, a circular (spherical in 3D) start and no bounds.

Fields§

§maxiter: Option<usize>

Maximum number of iterations; None means 50 n.

§epsilon: f64

Stop when the maximum energy change falls below this value (0.0, the default, performs all maxiter iterations).

§kkconst: Option<f64>

The vertex attraction constant; None means the number of vertices.

§weights: Option<&'a [f64]>

Positive edge lengths used in the shortest path computation (higher weight: farther vertices). None means unit lengths.

§initial: Option<&'a Matrix>

Starting positions (n × 2, or n × 3 for the 3D version). None starts from a circle (sphere) of radius 0.36 sqrt(n), or from a random layout when some bounds are given.

§minx: Option<&'a [f64]>

Per-vertex minimum x coordinate (-inf means no bound).

§maxx: Option<&'a [f64]>

Per-vertex maximum x coordinate (+inf means no bound).

§miny: Option<&'a [f64]>

Per-vertex minimum y coordinate (-inf means no bound).

§maxy: Option<&'a [f64]>

Per-vertex maximum y coordinate (+inf means no bound).

§minz: Option<&'a [f64]>

Per-vertex minimum z coordinate (3D only).

§maxz: Option<&'a [f64]>

Per-vertex maximum z coordinate (3D only).

Implementations§

Source§

impl<'a> KamadaKawaiOptions<'a>

Source

pub fn with_weights(self, weights: &'a [f64]) -> Self

Sets the edge lengths.

Source

pub fn with_initial(self, initial: &'a Matrix) -> Self

Sets the starting positions.

Trait Implementations§

Source§

impl<'a> Clone for KamadaKawaiOptions<'a>

Source§

fn clone(&self) -> KamadaKawaiOptions<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for KamadaKawaiOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for KamadaKawaiOptions<'a>

Source§

fn default() -> KamadaKawaiOptions<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for KamadaKawaiOptions<'a>

Source§

fn eq(&self, other: &KamadaKawaiOptions<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for KamadaKawaiOptions<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.