[−][src]Trait math::set::traits::Refineable
Given two sets of the same type that are Refineable
, their common refinement can be obtained
Required methods
fn get_common_refinement(&self, other: &Self) -> O
Implementors
impl<E> Refineable<Vec<ContiguousIntegerSet<E>>> for ContiguousIntegerSet<E> where
E: Integer + Copy + ToPrimitive,
[src]
E: Integer + Copy + ToPrimitive,
fn get_common_refinement(
&self,
other: &ContiguousIntegerSet<E>
) -> IntegerIntervalRefinement<E>
[src]
&self,
other: &ContiguousIntegerSet<E>
) -> IntegerIntervalRefinement<E>
impl<E: Integer + Copy> Refineable<OrderedIntervalPartitions<E>> for OrderedIntervalPartitions<E>
[src]
fn get_common_refinement(
&self,
other: &OrderedIntervalPartitions<E>
) -> OrderedIntervalPartitions<E>
[src]
&self,
other: &OrderedIntervalPartitions<E>
) -> OrderedIntervalPartitions<E>
Example
use math::{ partition::ordered_interval_partitions::OrderedIntervalPartitions, set::{contiguous_integer_set::ContiguousIntegerSet, traits::Refineable}, }; let p1 = OrderedIntervalPartitions::from_slice(&[[-1, 4], [8, 10]]); let p2 = OrderedIntervalPartitions::from_slice(&[[3, 7]]); assert_eq!( p1.get_common_refinement(&p2).into_vec(), [[-1, 2], [3, 4], [5, 7], [8, 10]] .iter() .map(|[a, b]| ContiguousIntegerSet::new(*a, *b)) .collect::<Vec<ContiguousIntegerSet<i32>>>() );