Skip to content

Commit

Permalink
ENH: core: Start einsum function, add copyright notices to files
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiebe committed Jan 23, 2011
1 parent 27987d2 commit a41de3a
Show file tree
Hide file tree
Showing 12 changed files with 930 additions and 3 deletions.
2 changes: 2 additions & 0 deletions THANKS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Roberto de Almeida for the buffered array iterator.
Alan McIntyre for updating the NumPy test framework to use nose, improve
the test coverage, and enhancing the test system documentation.
Joe Harrington for administering the 2008 Documentation Sprint.
Mark Wiebe for the new NumPy iterator, the float16 data type, improved
low-level data type operations, and other NumPy core improvements.

NumPy is based on the Numeric (Jim Hugunin, Paul Dubois, Konrad
Hinsen, and David Ascher) and NumArray (Perry Greenfield, J Todd
Expand Down
1 change: 1 addition & 0 deletions numpy/core/code_generators/genapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
join('multiarray', 'datetime.c'),
join('multiarray', 'new_iterator.c.src'),
join('multiarray', 'new_iterator_pywrap.c'),
join('multiarray', 'einsum.c.src'),
join('umath', 'ufunc_object.c'),
join('umath', 'loops.c.src'),
]
Expand Down
1 change: 1 addition & 0 deletions numpy/core/code_generators/numpy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
'PyArray_ResultType': 265,
'PyArray_CanCastArrayTo': 266,
'PyArray_CanCastTypeTo': 267,
'PyArray_EinsteinSum': 268,
}

ufunc_types_api = {
Expand Down
3 changes: 2 additions & 1 deletion numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'can_cast', 'promote_types', 'min_scalar_type', 'result_type',
'asarray', 'asanyarray', 'ascontiguousarray', 'asfortranarray',
'isfortran', 'empty_like', 'zeros_like',
'correlate', 'convolve', 'inner', 'dot', 'outer', 'vdot',
'correlate', 'convolve', 'inner', 'dot', 'einsum', 'outer', 'vdot',
'alterdot', 'restoredot', 'roll', 'rollaxis', 'cross', 'tensordot',
'array2string', 'get_printoptions', 'set_printoptions',
'array_repr', 'array_str', 'set_string_function',
Expand Down Expand Up @@ -218,6 +218,7 @@ def extend_all(module):
lexsort = multiarray.lexsort
compare_chararrays = multiarray.compare_chararrays
putmask = multiarray.putmask
einsum = multiarray.einsum

def asarray(a, dtype=None, order=None):
"""
Expand Down
6 changes: 4 additions & 2 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,8 @@ def generate_multiarray_templated_sources(ext, build_dir):
sources = [join(local_dir, subpath, 'scalartypes.c.src'),
join(local_dir, subpath, 'arraytypes.c.src'),
join(local_dir, subpath, 'new_iterator.c.src'),
join(local_dir, subpath, 'lowlevel_strided_loops.c.src')]
join(local_dir, subpath, 'lowlevel_strided_loops.c.src'),
join(local_dir, subpath, 'einsum.c.src')]

# numpy.distutils generate .c from .c.src in weird directories, we have
# to add them there as they depend on the build_dir
Expand Down Expand Up @@ -771,7 +772,8 @@ def get_mathlib_info(*args):
join('src', 'multiarray', 'new_iterator.c.src'),
join('src', 'multiarray', 'lowlevel_strided_loops.c.src'),
join('src', 'multiarray', 'dtype_transfer.c'),
join('src', 'multiarray', 'new_iterator_pywrap.c')]
join('src', 'multiarray', 'new_iterator_pywrap.c'),
join('src', 'multiarray', 'einsum.c.src')]

if PYTHON_HAS_UNICODE_WIDE:
multiarray_src.append(join('src', 'multiarray', 'ucsnarrow.c'))
Expand Down
6 changes: 6 additions & 0 deletions numpy/core/src/multiarray/dtype_transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* This file contains low-level loops for data type transfers.
* In particular the function PyArray_GetDTypeTransferFunction is
* implemented here.
*
* Copyright (c) 2010 by Mark Wiebe (mwwiebe@gmail.com)
* The Univerity of British Columbia
*
* See LICENSE.txt for the license.
*/

#define PY_SSIZE_T_CLEAN
Expand Down
Loading

0 comments on commit a41de3a

Please sign in to comment.