def mlinspace(a, b, nums, order='C'):
 a = numpy.array(a, dtype='float64')
 b = numpy.array(b, dtype='float64')
 nums = numpy.array(nums, dtype='int64')
 nodes = [numpy.linspace(a[i], b[i], nums[i]) for i in range(len(nums))]
 return cartesian(nodes, order=order)

def mlinspace ( a , b , nums , order = 'C' ) : a = numpy . array ( a , dtype = 'float64' ) b = numpy . array ( b , dtype = 'float64' ) nums = numpy . array ( nums , dtype = 'int64' ) nodes = [ numpy . linspace ( a [ i ] , b [ i ] , nums [ i ] ) for i in range ( len ( nums ) ) ] return cartesian ( nodes , order = order )
constructs a regular cartesian grid parameters: a: lower bounds in each dimension b: upper bounds in each dimension nums: number of nodes along each dimension order: order in which the product is enumerated returns: out: each line corresponds to one point of the product space .