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.

Functions¶

 _csr_diag(mat, out=None, indptr_sorted=False) Get the diagonal of a scipy/cupy CSR sparse matrix quickly Check if a cupy/scipy CSR sparse matrix has its indices sorted _read_edge_mat(G, weight_attr='weight', sparse=True, a_min=0.0) Read the adj matrix of a networkx graph and convert it to the cupy/scipy format.
class bucky.model.adjmat.buckyAij(G, sparse=True, a_min=0.0)[source]

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

property A(self)[source]

property refering to the dense/sparse matrix

property diag(self)[source]

property refering to the cache diagional of the matrix

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

Normalize A along a given axis and keep the cache A_diag in sync

perturb(self, var)[source]

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

bucky.model.adjmat._csr_diag(mat, out=None, indptr_sorted=False)[source]

Get the diagonal of a scipy/cupy CSR sparse matrix quickly

bucky.model.adjmat._csr_is_ind_sorted(mat)[source]

Check if a cupy/scipy CSR sparse matrix has its indices sorted

bucky.model.adjmat._read_edge_mat(G, weight_attr='weight', sparse=True, a_min=0.0)[source]

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