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(n_nodes, weight_attr='weight', force_diag=False, sparse_format='csr')[source]#

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

property A(self)#

Property refering to the dense/sparse matrix.

_normalize(self, mat, axis=0)[source]#

Normalize A along a given axis.

property diag(self)#

Property refering to the cache diagional of the matrix.

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.