summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/solvers/intuitive.rs21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/solvers/intuitive.rs b/src/solvers/intuitive.rs
index 61ecbdf..16baa03 100644
--- a/src/solvers/intuitive.rs
+++ b/src/solvers/intuitive.rs
@@ -17,7 +17,7 @@ pub struct NormalSolver<T: num::PrimInt> {
static mut COUNT: u32 = 0;
/// Save the current state for each row
-#[derive(Clone, Eq, Copy)]
+#[derive(Clone, Copy)]
pub struct SaveState<T: num::PrimInt> {
/// Mask of all currently used stones
pub bitmask: T,
@@ -27,22 +27,6 @@ pub struct SaveState<T: num::PrimInt> {
pub row: u32,
}
-impl<T: num::PrimInt> std::cmp::Ord for SaveState<T> {
- fn cmp(&self, other: &Self) -> std::cmp::Ordering {
- self.sum.cmp(&other.sum)
- }
-}
-impl<T: num::PrimInt> std::cmp::PartialOrd for SaveState<T> {
- fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
- Some(self.sum.cmp(&other.sum))
- }
-}
-impl<T: num::PrimInt> std::cmp::PartialEq for SaveState<T> {
- fn eq(&self, other: &Self) -> bool {
- self.sum.eq(&other.sum)
- }
-}
-
impl<T: num::PrimInt> SaveState<T> {
pub fn new() -> Self {
Self {
@@ -87,6 +71,7 @@ impl<T: num::PrimInt> NormalSolver<T> {
let heap = permutohedron::Heap::new(&mut heap);
let n_f = permutohedron::factorial(n as usize);
let mut permutations = Vec::with_capacity(n_f);
+ println!("Generating permutations");
for data in heap {
permutations.push(data.clone());
}
@@ -103,7 +88,7 @@ impl<T: num::PrimInt> NormalSolver<T> {
//for (n, i) in self.permutations.iter().enumerate() {
// println!("perm {}: {:?}", n, i);
//}
- self.check_perm(&[3, 16, 23]);
+ println!("calculate results");
self.permute(
permutohedron::factorial(self.n as usize),
0,