pub struct HypergraphData {
pub x: Tensor,
pub incidence_matrix: Tensor,
pub hyperedge_weights: Option<Tensor>,
pub hyperedge_features: Option<Tensor>,
pub node_degrees: Tensor,
pub hyperedge_cardinalities: Tensor,
pub num_nodes: usize,
pub num_hyperedges: usize,
}Expand description
Hypergraph data structure representing multi-way relationships
Fields§
§x: TensorNode feature matrix (num_nodes x num_features)
incidence_matrix: TensorHyperedge incidence matrix (num_nodes x num_hyperedges)
hyperedge_weights: Option<Tensor>Hyperedge weights (optional)
hyperedge_features: Option<Tensor>Hyperedge features (optional)
node_degrees: TensorNode degrees (sum of incident hyperedge weights)
hyperedge_cardinalities: TensorHyperedge cardinalities (number of nodes per hyperedge)
num_nodes: usizeNumber of nodes
num_hyperedges: usizeNumber of hyperedges
Implementations§
Source§impl HypergraphData
impl HypergraphData
Sourcepub fn new(x: Tensor, incidence_matrix: Tensor) -> Result<Self, TorshError>
pub fn new(x: Tensor, incidence_matrix: Tensor) -> Result<Self, TorshError>
Create a new hypergraph from node features and incidence matrix
Sourcepub fn with_hyperedge_weights(self, weights: Tensor) -> Self
pub fn with_hyperedge_weights(self, weights: Tensor) -> Self
Add hyperedge weights
Sourcepub fn with_hyperedge_features(self, features: Tensor) -> Self
pub fn with_hyperedge_features(self, features: Tensor) -> Self
Add hyperedge features
Sourcepub fn to_graph_clique_expansion(&self) -> Result<GraphData, TorshError>
pub fn to_graph_clique_expansion(&self) -> Result<GraphData, TorshError>
Convert to regular graph using clique expansion
Sourcepub fn to_graph_star_expansion(&self) -> Result<GraphData, TorshError>
pub fn to_graph_star_expansion(&self) -> Result<GraphData, TorshError>
Convert to regular graph using star expansion
Trait Implementations§
Source§impl Clone for HypergraphData
impl Clone for HypergraphData
Source§fn clone(&self) -> HypergraphData
fn clone(&self) -> HypergraphData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for HypergraphData
impl RefUnwindSafe for HypergraphData
impl Send for HypergraphData
impl Sync for HypergraphData
impl Unpin for HypergraphData
impl UnsafeUnpin for HypergraphData
impl UnwindSafe for HypergraphData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more