Skip to main content

AttributeCombinationType

Enum AttributeCombinationType 

Source
pub enum AttributeCombinationType {
Show 13 variants Ignore, Default, Function, Sum, Prod, Min, Max, Random, First, Last, Mean, Median, Concat,
}
Expand description

How to combine the attribute values of vertices or edges that are merged into one (igraph_attribute_combination_type_t).

The C attribute handler supports the following combinations, per attribute type (anything else fails with ErrorKind::AttributeCombination or ErrorKind::Unimplemented):

combinationnumericbooleanstring
Sumsumany is true–
Prodproductall are true–
Min/Maxmin/maxall/any are true–
Meanmeanmajority (ties broken at random)–
Median– (unimplemented)majority (ties broken at random)–
Random, First, Lastyesyesyes
Concat––concatenation
Functionyesyes– (not supported by this crate)

Ignore and Default drop the attribute for every type.

Variants§

§

Ignore

Drop the attribute from the result.

§

Default

The default behaviour of the handler: for the C handler, the attribute is dropped, like Ignore.

§

Function

A user supplied C function, see AttributeCombination::add_function.

§

Sum

Sum of the values (logical or for booleans).

§

Prod

Product of the values (logical and for booleans).

§

Min

Minimum of the values (logical and for booleans).

§

Max

Maximum of the values (logical or for booleans).

§

Random

A value chosen uniformly at random (uses igraph’s RNG).

§

First

The value of the first element of the merged group (in the order the merging function lists them, usually increasing id).

§

Last

The value of the last element of the merged group (usually the highest id).

§

Mean

Arithmetic mean (majority vote for booleans, with ties broken at random using igraph’s RNG).

§

Median

Median (majority vote for booleans; not implemented for numbers).

§

Concat

Concatenation of the strings.

Note: in igraph 1.0.0 and 1.0.1 the C handler (igraph_i_cattributes_cs_concat) concatenates the values of the first k elements of the graph (where k is the size of the merged group) instead of the values of the merged elements.

Trait Implementations§

Source§

impl Clone for AttributeCombinationType

Source§

fn clone(&self) -> AttributeCombinationType

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 Copy for AttributeCombinationType

Source§

impl Debug for AttributeCombinationType

Source§

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

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

impl Eq for AttributeCombinationType

Source§

impl From<AttributeCombinationType> for igraph_attribute_combination_type_t

Source§

fn from(value: AttributeCombinationType) -> igraph_attribute_combination_type_t

Converts to this type from the input type.
Source§

impl Hash for AttributeCombinationType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AttributeCombinationType

Source§

fn eq(&self, other: &AttributeCombinationType) -> 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 StructuralPartialEq for AttributeCombinationType

Source§

impl TryFrom<u32> for AttributeCombinationType

Source§

type Error = Error

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

fn try_from(value: igraph_attribute_combination_type_t) -> Result<Self>

Performs the conversion.

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.