summaryrefslogtreecommitdiff
path: root/src/solvers/mod.rs
blob: 0ea589b8dc3e0533d1623fc1e0ba1488cb8f2bad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//pub mod incremental_block;
pub mod gpu;
pub mod gpusolver;
pub mod bwinf;

/// calculate h and w
pub fn wall_stats(n: u32) -> (u32, u32) {
    let h = (n >> 1) + 1;
    (h, (n - 1) * h)
}

pub trait Solver {
    fn new(n: u32) -> Self;
    fn n(&self) -> u32;
    fn h(&self) -> u32;
    fn w(&self) -> u32;
}

pub trait FirstSolver {
    fn solve(self) -> gpu::RowResult;
}

pub trait IteratorSolver: Solver {
    type IntoIter: Iterator<Item = gpu::RowResult>;
    fn solve(self) -> Self::IntoIter;
}