From 2db96a7f02233493849343ff9fed470cd7dc30bd Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 23 Mar 2006 22:14:45 +0000 Subject: Added ascontiguous and asfortran functions. --- numpy/core/numeric.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1769894a5..689e5c733 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -4,7 +4,8 @@ __all__ = ['newaxis', 'ndarray', 'flatiter', 'ufunc', 'getbuffer', 'where', 'concatenate', 'fastCopyAndTranspose', 'lexsort', 'register_dtype', 'set_numeric_ops', 'can_cast', - 'asarray', 'asanyarray', 'isfortran', 'empty_like', 'zeros_like', + 'asarray', 'asanyarray', 'ascontiguous', 'asfortran', + 'isfortran', 'empty_like', 'zeros_like', 'correlate', 'convolve', 'inner', 'dot', 'outer', 'vdot', 'alterdot', 'restoredot', 'cross', 'array2string', 'get_printoptions', 'set_printoptions', @@ -119,6 +120,12 @@ def asanyarray(a, dtype=None, copy=False, fortran=None, ndmin=0): """ return array(a, dtype, copy=copy, fortran=fortran, subok=1, ndmin=ndmin) +def ascontiguous(a, dtype=None, copy=False): + return array(a, dtype, copy=copy, fortran=False, ndmin=1) + +def asfortran(a, dtype=None, copy=False): + return array(a, dtype, copy=copy, fortran=True, ndmin=1) + def isfortran(a): return a.flags.fnc -- cgit v1.2.1