Guest User

Untitled

a guest
Feb 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def G_ls (xi, basis):
  2.  
  3.     M = numpy.size (xi)
  4.     N = numpy.size (basis)
  5.     G = numpy.zeros (N*N).reshape(N, N)
  6.  
  7.     for k in xrange (N):
  8.         for l in xrange (N):
  9.             G[k, l] = numpy.sum ((basis[l](xi[i]) * basis[k](xi[i])) for i in xrange (M))
  10.     return G
Add Comment
Please, Sign In to add comment