@ -5,6 +5,7 @@ pub mod ctmp;
use std::collections::BTreeSet;
use ndarray::Array2;
use thiserror::Error;
use crate::params;
@ -117,4 +118,5 @@ pub trait NetworkProcess: Sync {
///
/// * The **children set** of the selected node.
fn get_children_set(&self, node: usize) -> BTreeSet<usize>;
fn get_adj_matrix(&self) -> Option<Array2<u16>>;
}
@ -240,4 +240,9 @@ 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<Array2<u16>> {
self.adj_matrix.clone()
@ -1,5 +1,7 @@
use crate::{
params::{Params, StateType},
process,
@ -111,4 +113,7 @@ impl NetworkProcess for CtmpProcess {
None => panic!("Uninitialized CtmpProcess"),
unimplemented!("CtmpProcess has only one node")