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):
| combination | numeric | boolean | string |
|---|---|---|---|
Sum | sum | any is true | – |
Prod | product | all are true | – |
Min/Max | min/max | all/any are true | – |
Mean | mean | majority (ties broken at random) | – |
Median | – (unimplemented) | majority (ties broken at random) | – |
Random, First, Last | yes | yes | yes |
Concat | – | – | concatenation |
Function | yes | yes | – (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
impl Clone for AttributeCombinationType
Source§fn clone(&self) -> AttributeCombinationType
fn clone(&self) -> AttributeCombinationType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AttributeCombinationType
Source§impl Debug for AttributeCombinationType
impl Debug for AttributeCombinationType
impl Eq for AttributeCombinationType
Source§impl From<AttributeCombinationType> for igraph_attribute_combination_type_t
impl From<AttributeCombinationType> for igraph_attribute_combination_type_t
Source§fn from(value: AttributeCombinationType) -> igraph_attribute_combination_type_t
fn from(value: AttributeCombinationType) -> igraph_attribute_combination_type_t
Source§impl Hash for AttributeCombinationType
impl Hash for AttributeCombinationType
Source§impl PartialEq for AttributeCombinationType
impl PartialEq for AttributeCombinationType
Source§fn eq(&self, other: &AttributeCombinationType) -> bool
fn eq(&self, other: &AttributeCombinationType) -> bool
self and other values to be equal, and is used by ==.