bucky.model.adjmat

Utility class to manage the adjacency matrix regardless of if its dense or sparse.

Module Contents

Classes

buckyAij

Class that handles the adjacency matrix for the model, generalizes between dense/sparse.

class bucky.model.adjmat.buckyAij(G, weight_attr='weight', edge_a_min=0.0, force_diag=False, sparse_format='csr', n_nodes=None)[source]

Class that handles the adjacency matrix for the model, generalizes between dense/sparse.

property A(self)

Property refering to the dense/sparse matrix.

_read_nx_edge_mat(self, G, weight_attr='weight', edge_a_min=0.0)[source]

Read the adj matrix of a networkx graph and convert it to the cupy/scipy sparse format.

property diag(self)

Property refering to the cache diagional of the matrix.

normalize(self, mat, axis=0)[source]

Normalize A along a given axis.

perturb(self, var)[source]

Apply a normal perturbation to the matrix (and keep its diag in sync).

property sparsity(self)

Return the sparsity of the matrix.

todense(self)[source]

Convert to dense.

tosparse(self, sparse_format='csr')[source]

Convert to sparse.