From 1a9ba98fb2f0aa0475d12d3f8007e851525ccb30 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 12 Jul 2006 19:04:25 +0000 Subject: Keep rand and randn in matlib and make them take tuples as well as individual arguments. --- numpy/matlib.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'numpy/matlib.py') diff --git a/numpy/matlib.py b/numpy/matlib.py index 9fd3cc6e1..2923fe352 100644 --- a/numpy/matlib.py +++ b/numpy/matlib.py @@ -1,8 +1,12 @@ -__all__ = ['ones','zeros','empty','identity','rand','randn','eye'] - from numpy.core.defmatrix import matrix, asmatrix from numpy import ndarray, array import numpy as N +from numpy import * + +__version__ = N.__version__ + +__all__ = N.__all__ +__all__ += ['rand', 'randn'] def empty(shape, dtype=None, order='C'): """return an empty matrix of the given shape @@ -35,7 +39,11 @@ def eye(n,M=None, k=0, dtype=float): return asmatrix(N.eye(n,M,k,dtype)) def rand(*args): + if isinstance(args[0], tuple): + args = args[0] return asmatrix(N.random.rand(*args)) def randn(*args): + if isinstance(args[0], tuple): + args = args[0] return asmatrix(N.random.rand(*args)) -- cgit v1.2.1