From c7be7ca0188e8edd19afd880f393d5622451fef5 Mon Sep 17 00:00:00 2001 From: Charlotte Pabst Date: Mon, 11 Mar 2024 22:47:36 +0100 Subject: --- src/main.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ba345f8..2fcde6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use core::ops::Deref; pub use ghost_cell::{GhostBorrow, GhostCell, GhostToken}; use paste::paste; use std::{ + collections::HashMap, convert::Infallible, fmt::{self, Debug, Display, Formatter}, hash::{Hash, Hasher}, @@ -36,12 +37,24 @@ mod tests; mod mevvlfs; pub use mevvlfs::*; +// mod mev; +// pub use mev::*; + +// mod mve; +// pub use mve::*; + +// mod melf; +// pub use melf::*; + mod mekh; pub use mekh::*; mod msev; pub use msev::*; +mod mpkh; +pub use mpkh::*; + pub trait ReflAsRef { fn as_ref(&self) -> &T; } @@ -273,6 +286,12 @@ impl<'tok, 'brand, 'arena, T: PartialEq> PartialEq for lens_t!(T) { } impl<'tok, 'brand, 'arena, T: PartialEq> Eq for lens_t!(T) {} +impl<'tok, 'brand, 'arena, T: Hash> Hash for lens_t!(T) { + fn hash(&self, state: &mut H) { + self.item.borrow(self.token).hash(state); + } +} + impl<'tok, 'brand, 'arena, T> ReflAsRef> for lens_t!(T) { fn as_ref(&self) -> &GhostToken<'brand> { &self.token @@ -992,6 +1011,22 @@ impl<'brand, 'arena, V> Dcel<'brand, 'arena, V> { ) -> Result, OperatorErr, KsevError>> { Ksev::new(shell, loops, old_vertex, new_vertex, edge).apply(self) } + + pub fn mpkh( + &mut self, + loop_: ptr!(Loop), + ) -> Result, OperatorErr, MpkhError>> { + Mpkh::new(loop_).apply(self) + } + + pub fn kpmh( + &mut self, + new_shell: Option, + old_face: ptr!(Face), + new_face: own!(Face), + ) -> Result, OperatorErr, KpmhError>> { + Kpmh::new(new_shell, old_face, new_face).apply(self) + } } use std::io::Write; -- cgit v1.2.3