From 4fd0ee040734c3b78227f3bbc8002842083be829 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Thu, 16 Feb 2023 15:12:32 +0100 Subject: [PATCH] Function `get_adj_matrix()` is now specific to `CtbnNetwork` only --- reCTBN/src/process.rs | 2 -- reCTBN/src/process/ctbn.rs | 9 ++++----- reCTBN/src/process/ctmp.rs | 5 ----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/reCTBN/src/process.rs b/reCTBN/src/process.rs index f554af4..45c5e0a 100644 --- a/reCTBN/src/process.rs +++ b/reCTBN/src/process.rs @@ -5,7 +5,6 @@ pub mod ctmp; use std::collections::BTreeSet; -use ndarray::Array2; use thiserror::Error; use crate::params; @@ -118,5 +117,4 @@ pub trait NetworkProcess: Sync { /// /// * The **children set** of the selected node. fn get_children_set(&self, node: usize) -> BTreeSet; - fn get_adj_matrix(&self) -> Option>; } diff --git a/reCTBN/src/process/ctbn.rs b/reCTBN/src/process/ctbn.rs index 9784776..6956ea0 100644 --- a/reCTBN/src/process/ctbn.rs +++ b/reCTBN/src/process/ctbn.rs @@ -138,6 +138,10 @@ impl CtbnNetwork { return array_state; } + /// Get the Adjacency Matrix. + pub fn get_adj_matrix(&self) -> Option> { + self.adj_matrix.clone() + } } impl process::NetworkProcess for CtbnNetwork { @@ -240,9 +244,4 @@ impl process::NetworkProcess for CtbnNetwork { .filter_map(|(idx, x)| if x > &0 { Some(idx) } else { None }) .collect() } - - /// Get the Adjacency Matrix. - fn get_adj_matrix(&self) -> Option> { - self.adj_matrix.clone() - } } diff --git a/reCTBN/src/process/ctmp.rs b/reCTBN/src/process/ctmp.rs index 4a346e7..41b8db6 100644 --- a/reCTBN/src/process/ctmp.rs +++ b/reCTBN/src/process/ctmp.rs @@ -1,7 +1,5 @@ use std::collections::BTreeSet; -use ndarray::Array2; - use crate::{ params::{Params, StateType}, process, @@ -113,7 +111,4 @@ impl NetworkProcess for CtmpProcess { None => panic!("Uninitialized CtmpProcess"), } } - fn get_adj_matrix(&self) -> Option> { - unimplemented!("CtmpProcess has only one node") - } }