-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
189 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
mod one; | ||
mod three; | ||
mod two; | ||
|
||
use stm::Transaction; | ||
|
||
use crate::{ | ||
cmap::{CMap3, CMapResult, DartIdType}, | ||
prelude::CoordsFloat, | ||
}; | ||
|
||
/// Sew operations | ||
impl<T: CoordsFloat> CMap3<T> { | ||
pub fn sew<const I: u8>( | ||
&self, | ||
trans: &mut Transaction, | ||
ld: DartIdType, | ||
rd: DartIdType, | ||
) -> CMapResult<()> { | ||
// these assertions + match on a const are optimized away | ||
assert!(I < 4); | ||
assert_ne!(I, 0); | ||
match I { | ||
1 => self.one_sew(trans, ld, rd), | ||
2 => self.two_sew(trans, ld, rd), | ||
3 => self.three_sew(trans, ld, rd), | ||
_ => unreachable!(), | ||
} | ||
} | ||
|
||
pub fn unsew<const I: u8>(&self, trans: &mut Transaction, ld: DartIdType) -> CMapResult<()> { | ||
// these assertions + match on a const are optimized away | ||
assert!(I < 4); | ||
assert_ne!(I, 0); | ||
match I { | ||
1 => self.one_unsew(trans, ld), | ||
2 => self.one_unsew(trans, ld), | ||
3 => self.one_unsew(trans, ld), | ||
_ => unreachable!(), | ||
} | ||
} | ||
|
||
pub fn force_sew<const I: u8>(&self, ld: DartIdType, rd: DartIdType) { | ||
// these assertions + match on a const are optimized away | ||
assert!(I < 4); | ||
assert_ne!(I, 0); | ||
match I { | ||
1 => self.force_one_sew(ld, rd), | ||
2 => self.force_two_sew(ld, rd), | ||
3 => self.force_three_sew(ld, rd), | ||
_ => unreachable!(), | ||
} | ||
} | ||
|
||
pub fn force_unsew<const I: u8>(&self, ld: DartIdType) { | ||
// these assertions + match on a const are optimized away | ||
assert!(I < 4); | ||
assert_ne!(I, 0); | ||
match I { | ||
1 => self.force_one_unsew(ld), | ||
2 => self.force_two_unsew(ld), | ||
3 => self.force_three_unsew(ld), | ||
_ => unreachable!(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//! 1D sew implementations | ||
use stm::{atomically, Transaction}; | ||
|
||
use crate::{ | ||
cmap::{CMap3, CMapResult, DartIdType, NULL_DART_ID}, | ||
prelude::CoordsFloat, | ||
}; | ||
|
||
/// 1-sews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 1-sew transactional operation. | ||
pub(crate) fn one_sew( | ||
&self, | ||
trans: &mut Transaction, | ||
ld: DartIdType, | ||
rd: DartIdType, | ||
) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 1-sew operation. | ||
pub(crate) fn force_one_sew(&self, ld: DartIdType, rd: DartIdType) { | ||
todo!() | ||
} | ||
} | ||
|
||
/// 1-unsews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 1-unsew transactional operation. | ||
pub(crate) fn one_unsew(&self, trans: &mut Transaction, ld: DartIdType) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 1-unsew operation. | ||
pub(crate) fn force_one_unsew(&self, ld: DartIdType) { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//! 3D sew implementations | ||
use stm::{atomically, Transaction}; | ||
|
||
use crate::{ | ||
cmap::{CMap3, CMapResult, DartIdType, NULL_DART_ID}, | ||
prelude::CoordsFloat, | ||
}; | ||
|
||
/// 3-sews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 3-sew operation. | ||
pub(crate) fn three_sew( | ||
&self, | ||
trans: &mut Transaction, | ||
ld: DartIdType, | ||
rd: DartIdType, | ||
) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 3-sew operation. | ||
pub(crate) fn force_three_sew(&self, ld: DartIdType, rd: DartIdType) { | ||
todo!() | ||
} | ||
} | ||
|
||
/// 3-unsews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 3-unsew operation. | ||
pub(crate) fn three_unsew(&self, trans: &mut Transaction, ld: DartIdType) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 3-unsew operation. | ||
pub(crate) fn force_three_unsew(&self, ld: DartIdType) { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//! 2D sew implementations | ||
use stm::{atomically, Transaction}; | ||
|
||
use crate::{ | ||
cmap::{CMap3, CMapResult, DartIdType}, | ||
prelude::CoordsFloat, | ||
}; | ||
|
||
/// 2-sews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 2-sew transactional operation. | ||
pub(crate) fn two_sew( | ||
&self, | ||
trans: &mut Transaction, | ||
lhs_dart_id: DartIdType, | ||
rhs_dart_id: DartIdType, | ||
) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 2-sew operation. | ||
pub(crate) fn force_two_sew(&self, lhs_dart_id: DartIdType, rhs_dart_id: DartIdType) { | ||
todo!() | ||
} | ||
} | ||
|
||
/// 2-unsews | ||
impl<T: CoordsFloat> CMap3<T> { | ||
/// 2-unsew transactional operation. | ||
pub(crate) fn two_unsew( | ||
&self, | ||
trans: &mut Transaction, | ||
lhs_dart_id: DartIdType, | ||
) -> CMapResult<()> { | ||
todo!() | ||
} | ||
|
||
/// 2-unsew operation. | ||
pub(crate) fn force_two_unsew(&self, lhs_dart_id: DartIdType) { | ||
todo!() | ||
} | ||
} |