anchor.diff:    conv = []
   }*
   
  +deftask plot( png( File ) : cls( File ) k )in python *{
  +
  +import numpy as np
  +import matplotlib.pyplot as plt
  +
  +clusters = np.load( cls ).item()
  +k = int( k )
  +col = ["r", "g", "b", "c"]
  +
  +for i in range( k ):
  +
  +  N = np.array( clusters[ i ] )
  +  Nt = N.transpose()
  +  Nx = Nt[ 0 ]
  +  Ny = Nt[ 1 ]
  +
  +  plt.plot( Nx, Ny, col[ i ]+"." )
  +
  +plt.axis( [-1.1, 1.1, -1.1, 1.1] )
  +png = "fig.png"
  +plt.savefig( png )
  +}*
  +
  +deftask find_clusters( cls( File ) : data( File ) state( File ) ) {
  +
  +  clusters = cluster( data: data, state: state );
  +  state1   = reevaluate( cls: clusters );
  +
  +  cls = if has_converged( old: state, new: state1 )
  +        then
  +          clusters
  +        else
  +          find_clusters( data: data, state: state1 )
  +        end;
  +}
  +
   k = 4;
  -N = 40;
  +N = 1600;
   
   X   = gen_data( N: N, k: k );
   mu0 = init_state( data: X, k: k );
   
  -clusters = cluster( data: X, state: mu0 );
  -mu1      = evaluate( cls: clusters );
  -conv     = has_converged( state0: mu0, state: mu1 );
  +cls = find_clusters( data: X, state: mu0 );
   
  -mu1 conv;+plt = plot( cls: cls, k: k );
  +
  +plt;
positive.code: np.save( cls, clusters )
  }*
  
  deftask evaluate( state1( File ) : cls( File ) ) in python *{
  
  import numpy as np
  
  
negative.code: np.save( state1, newmu )
  }*
  
  deftask has_converged( <conv> : old( File ) new( File ) ) in python *{
  
  import numpy as np
  
  oldmu = np.load( old )
  mu    = np.load( new )
  
  if set([tuple(a) for a in mu]) == set([tuple(a) for a in oldmu]):
    conv = ["true"]
  