why cannot recalculate (2)?

asked 2012-03-24 23:15:58 -0500

canisvetus gravatar image

updated 2012-03-26 07:42:39 -0500

Jason Grout gravatar image
html("<h1> From Dictionary to Matrix (2)</h1>")
@interact
def newtarph( D=input_box(default={0: {1: 2, 2: 3}, 1: {0: 3, 2: 4}, 2: {3: 2, 4: 1}, 3: {0: 2, 1: 3, 4: 1}}, label='Dictionary')):
    G = DiGraph(D)
    W= G.weighted_adjacency_matrix()
    n=G.num_verts()
    C=[(i,j) for (i,j) in CartesianProduct(range(n),range(n)) if (W[i][j]<>0)]
    E0=matrix(C)
    V=vector([W[i][j] for (i,j) in C])
    E=column_matrix([E0.column(0),E0.column(1),V])
    print E
edit retag flag offensive close merge delete

Comments

In these form I can recalculate without problems

canisvetus gravatar imagecanisvetus ( 2012-03-24 23:17:05 -0500 )edit