Add missing imports for hypergraph.

This commit is contained in:
FiveMovesAhead 2025-05-06 21:34:39 +01:00
parent c4ed10deed
commit 610212081a
2 changed files with 18 additions and 0 deletions

View File

@ -9,3 +9,7 @@ pub use vehicle_routing as c002;
pub mod vector_search;
#[cfg(feature = "cuda")]
pub use vector_search as c004;
#[cfg(feature = "cuda")]
pub mod hypergraph;
#[cfg(feature = "cuda")]
pub use hypergraph as c005;

View File

@ -12,6 +12,20 @@ pub struct Difficulty {
pub better_than_baseline: u32,
}
impl From<Vec<i32>> for Difficulty {
fn from(arr: Vec<i32>) -> Self {
Self {
num_hyperedges: arr[0] as u32,
better_than_baseline: arr[1] as u32,
}
}
}
impl Into<Vec<i32>> for Difficulty {
fn into(self) -> Vec<i32> {
vec![self.num_hyperedges as i32, self.better_than_baseline as i32]
}
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Solution {
pub sub_solutions: Vec<SubSolution>,