cartesian

Filename: cartesian.py

Authors: Pablo Winant

Implements cartesian products and regular cartesian grids.

quantecon.cartesian.cartesian(nodes, order='C')[source]

Cartesian product of a list of arrays

Parameters:

nodes: (list of 1d-arrays)

order: (‘C’ or ‘F’) order in which the product is enumerated

Returns:

out: (2d-array) each line corresponds to one point of the product space

quantecon.cartesian.mlinspace(a, b, nums, order='C')[source]

Constructs a regular cartesian grid

Parameters:

a: (1d-array) lower bounds in each dimension

b: (1d-array) upper bounds in each dimension

nums: (1d-array) number of nodes along each dimension

order: (‘C’ or ‘F’) order in which the product is enumerated

Returns:

out: (2d-array) each line corresponds to one point of the product space