This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +vtraag is my blockchain ID. https://onename.com/vtraag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create horizontal line from axis border to axis border. | |
\draw[thick,color=black] | |
({axis cs:0,1}-|{rel axis cs:0,0}) -- | |
({axis cs:0,1}-|{rel axis cs:1,0}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def permute_sparse_matrix(M, order): | |
permuted_row = order[M.row]; | |
permuted_col = order[M.col]; | |
new_M = sparse.coo_matrix((M.data, (permuted_row, permuted_col)), shape=M.shape); | |
return new_M; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_sparse_adjacency_matrix(G, attr=None): | |
if attr: | |
source, target, data = zip(*[(e.source, e.target, e[attr]) | |
for e in G.es if not np.isnan(e[attr])]); | |
else: | |
source, target = zip(*[(e.source, e.target) | |
for e in G.es]); | |
data = np.ones(len(source)).astype('int').tolist(); | |
if not G.is_directed(): | |
# If not directed, also create the other edge |