From faff212b9e5b0c28782396cced93290f2b1c4478 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sat, 3 Aug 2024 11:09:16 +0200 Subject: [PATCH] Rename types::array into types::array_tuple so that types::array can be used normally types::array_tuple is exactly what's it seems to be: a tuple of homogeneous data that can be represented as an array. types::array is the underlying type used to store array.ArrayType, currently just an alias on types::list --- pythran/pythonic/__dispatch__/conjugate.hpp | 2 +- pythran/pythonic/__dispatch__/copy.hpp | 2 +- pythran/pythonic/__dispatch__/count.hpp | 6 +- pythran/pythonic/__dispatch__/pop.hpp | 6 +- pythran/pythonic/__dispatch__/remove.hpp | 2 +- pythran/pythonic/__dispatch__/sort.hpp | 8 +- pythran/pythonic/__dispatch__/update.hpp | 4 +- pythran/pythonic/array/array.hpp | 6 +- pythran/pythonic/bisect/bisect.hpp | 4 +- pythran/pythonic/bisect/bisect_left.hpp | 2 +- pythran/pythonic/bisect/bisect_right.hpp | 2 +- pythran/pythonic/builtins/all.hpp | 4 +- pythran/pythonic/builtins/any.hpp | 2 +- pythran/pythonic/builtins/bin.hpp | 2 +- pythran/pythonic/builtins/bool_.hpp | 2 +- pythran/pythonic/builtins/chr.hpp | 2 +- pythran/pythonic/builtins/dict.hpp | 7 +- pythran/pythonic/builtins/dict/clear.hpp | 2 +- pythran/pythonic/builtins/dict/copy.hpp | 2 +- pythran/pythonic/builtins/dict/fromkeys.hpp | 8 +- pythran/pythonic/builtins/dict/get.hpp | 6 +- pythran/pythonic/builtins/dict/items.hpp | 6 +- pythran/pythonic/builtins/dict/keys.hpp | 4 +- pythran/pythonic/builtins/dict/pop.hpp | 2 +- pythran/pythonic/builtins/dict/popitem.hpp | 4 +- pythran/pythonic/builtins/dict/setdefault.hpp | 4 +- pythran/pythonic/builtins/dict/update.hpp | 2 +- pythran/pythonic/builtins/dict/values.hpp | 4 +- pythran/pythonic/builtins/divmod.hpp | 2 +- pythran/pythonic/builtins/enumerate.hpp | 24 +- pythran/pythonic/builtins/file.hpp | 4 +- pythran/pythonic/builtins/file/fileno.hpp | 4 +- pythran/pythonic/builtins/file/isatty.hpp | 4 +- pythran/pythonic/builtins/file/next.hpp | 2 +- pythran/pythonic/builtins/file/readlines.hpp | 4 +- pythran/pythonic/builtins/file/tell.hpp | 4 +- pythran/pythonic/builtins/file/writelines.hpp | 4 +- .../pythonic/builtins/float_/is_integer.hpp | 4 +- pythran/pythonic/builtins/hex.hpp | 4 +- pythran/pythonic/builtins/in.hpp | 2 +- pythran/pythonic/builtins/iter.hpp | 7 +- pythran/pythonic/builtins/len.hpp | 4 +- pythran/pythonic/builtins/list.hpp | 4 +- pythran/pythonic/builtins/list/append.hpp | 6 +- pythran/pythonic/builtins/list/count.hpp | 2 +- pythran/pythonic/builtins/list/extend.hpp | 6 +- pythran/pythonic/builtins/list/insert.hpp | 6 +- pythran/pythonic/builtins/list/pop.hpp | 2 +- pythran/pythonic/builtins/list/remove.hpp | 2 +- pythran/pythonic/builtins/list/reverse.hpp | 6 +- pythran/pythonic/builtins/list/sort.hpp | 6 +- pythran/pythonic/builtins/map.hpp | 64 +-- pythran/pythonic/builtins/max.hpp | 6 +- pythran/pythonic/builtins/min.hpp | 6 +- pythran/pythonic/builtins/minmax.hpp | 16 +- pythran/pythonic/builtins/next.hpp | 2 +- pythran/pythonic/builtins/oct.hpp | 2 +- pythran/pythonic/builtins/open.hpp | 2 +- pythran/pythonic/builtins/ord.hpp | 2 +- .../builtins/pythran/StaticIfBreak.hpp | 6 +- .../builtins/pythran/StaticIfCont.hpp | 6 +- .../builtins/pythran/StaticIfNoReturn.hpp | 6 +- .../builtins/pythran/StaticIfReturn.hpp | 6 +- pythran/pythonic/builtins/pythran/abssqr.hpp | 8 +- pythran/pythonic/builtins/pythran/and_.hpp | 6 +- pythran/pythonic/builtins/pythran/is_none.hpp | 4 +- pythran/pythonic/builtins/pythran/len_set.hpp | 7 +- .../pythonic/builtins/pythran/make_shape.hpp | 4 +- pythran/pythonic/builtins/pythran/or_.hpp | 6 +- .../pythonic/builtins/pythran/static_if.hpp | 10 +- .../pythonic/builtins/pythran/static_list.hpp | 12 +- pythran/pythonic/builtins/reduce.hpp | 2 +- pythran/pythonic/builtins/reversed.hpp | 7 +- pythran/pythonic/builtins/round.hpp | 2 +- pythran/pythonic/builtins/set.hpp | 4 +- pythran/pythonic/builtins/set/add.hpp | 4 +- pythran/pythonic/builtins/set/clear.hpp | 2 +- pythran/pythonic/builtins/set/copy.hpp | 2 +- .../builtins/set/difference_update.hpp | 10 +- pythran/pythonic/builtins/set/discard.hpp | 4 +- .../pythonic/builtins/set/intersection.hpp | 10 +- .../builtins/set/intersection_update.hpp | 10 +- pythran/pythonic/builtins/set/isdisjoint.hpp | 4 +- pythran/pythonic/builtins/set/issubset.hpp | 4 +- pythran/pythonic/builtins/set/issuperset.hpp | 4 +- pythran/pythonic/builtins/set/remove.hpp | 2 +- .../builtins/set/symmetric_difference.hpp | 4 +- .../set/symmetric_difference_update.hpp | 4 +- pythran/pythonic/builtins/set/update.hpp | 2 +- pythran/pythonic/builtins/sorted.hpp | 2 +- pythran/pythonic/builtins/str.hpp | 4 +- pythran/pythonic/builtins/str/__mod__.hpp | 9 +- pythran/pythonic/builtins/str/capitalize.hpp | 4 +- pythran/pythonic/builtins/str/count.hpp | 2 +- pythran/pythonic/builtins/str/endswith.hpp | 4 +- pythran/pythonic/builtins/str/isalpha.hpp | 4 +- pythran/pythonic/builtins/str/isdigit.hpp | 4 +- pythran/pythonic/builtins/str/join.hpp | 4 +- pythran/pythonic/builtins/str/lower.hpp | 4 +- pythran/pythonic/builtins/str/lstrip.hpp | 4 +- pythran/pythonic/builtins/str/rstrip.hpp | 4 +- pythran/pythonic/builtins/str/startswith.hpp | 4 +- pythran/pythonic/builtins/str/strip.hpp | 4 +- pythran/pythonic/builtins/str/upper.hpp | 4 +- pythran/pythonic/builtins/sum.hpp | 19 +- pythran/pythonic/builtins/tuple.hpp | 11 +- pythran/pythonic/builtins/type.hpp | 28 +- pythran/pythonic/builtins/xrange.hpp | 4 +- pythran/pythonic/builtins/zip.hpp | 6 +- pythran/pythonic/cmath/acos.hpp | 2 +- pythran/pythonic/cmath/acosh.hpp | 2 +- pythran/pythonic/cmath/asin.hpp | 2 +- pythran/pythonic/cmath/asinh.hpp | 2 +- pythran/pythonic/cmath/atan.hpp | 2 +- pythran/pythonic/cmath/atanh.hpp | 2 +- pythran/pythonic/cmath/cos.hpp | 4 +- pythran/pythonic/cmath/cosh.hpp | 2 +- pythran/pythonic/cmath/exp.hpp | 2 +- pythran/pythonic/cmath/isinf.hpp | 2 +- pythran/pythonic/cmath/isnan.hpp | 2 +- pythran/pythonic/cmath/log.hpp | 4 +- pythran/pythonic/cmath/log10.hpp | 2 +- pythran/pythonic/cmath/sin.hpp | 2 +- pythran/pythonic/cmath/sinh.hpp | 2 +- pythran/pythonic/cmath/sqrt.hpp | 2 +- pythran/pythonic/cmath/tan.hpp | 2 +- pythran/pythonic/cmath/tanh.hpp | 2 +- pythran/pythonic/core.hpp | 5 +- pythran/pythonic/functools/partial.hpp | 20 +- pythran/pythonic/functools/reduce.hpp | 2 +- .../pythonic/include/__dispatch__/clear.hpp | 2 +- .../include/__dispatch__/conjugate.hpp | 2 +- .../pythonic/include/__dispatch__/copy.hpp | 2 +- .../pythonic/include/__dispatch__/count.hpp | 6 +- .../pythonic/include/__dispatch__/index.hpp | 2 +- pythran/pythonic/include/__dispatch__/pop.hpp | 6 +- .../pythonic/include/__dispatch__/remove.hpp | 2 +- .../pythonic/include/__dispatch__/sort.hpp | 8 +- .../pythonic/include/__dispatch__/update.hpp | 4 +- pythran/pythonic/include/array/array.hpp | 4 +- pythran/pythonic/include/bisect/bisect.hpp | 2 +- .../pythonic/include/bisect/bisect_left.hpp | 2 +- .../pythonic/include/bisect/bisect_right.hpp | 2 +- pythran/pythonic/include/builtins/abs.hpp | 4 +- pythran/pythonic/include/builtins/all.hpp | 2 +- pythran/pythonic/include/builtins/any.hpp | 2 +- pythran/pythonic/include/builtins/bin.hpp | 2 +- pythran/pythonic/include/builtins/bool_.hpp | 8 +- pythran/pythonic/include/builtins/chr.hpp | 4 +- pythran/pythonic/include/builtins/complex.hpp | 6 +- .../include/builtins/complex/conjugate.hpp | 4 +- pythran/pythonic/include/builtins/dict.hpp | 12 +- .../pythonic/include/builtins/dict/clear.hpp | 2 +- .../pythonic/include/builtins/dict/copy.hpp | 2 +- .../include/builtins/dict/fromkeys.hpp | 4 +- .../pythonic/include/builtins/dict/get.hpp | 6 +- .../pythonic/include/builtins/dict/items.hpp | 4 +- .../pythonic/include/builtins/dict/keys.hpp | 4 +- .../pythonic/include/builtins/dict/pop.hpp | 2 +- .../include/builtins/dict/popitem.hpp | 6 +- .../include/builtins/dict/setdefault.hpp | 4 +- .../pythonic/include/builtins/dict/update.hpp | 2 +- .../pythonic/include/builtins/dict/values.hpp | 4 +- pythran/pythonic/include/builtins/divmod.hpp | 2 +- pythran/pythonic/include/builtins/file.hpp | 2 +- .../pythonic/include/builtins/file/close.hpp | 4 +- .../pythonic/include/builtins/file/fileno.hpp | 4 +- .../pythonic/include/builtins/file/flush.hpp | 4 +- .../pythonic/include/builtins/file/isatty.hpp | 4 +- .../pythonic/include/builtins/file/next.hpp | 2 +- .../pythonic/include/builtins/file/read.hpp | 4 +- .../include/builtins/file/readline.hpp | 4 +- .../include/builtins/file/readlines.hpp | 4 +- .../pythonic/include/builtins/file/seek.hpp | 6 +- .../pythonic/include/builtins/file/tell.hpp | 4 +- .../include/builtins/file/truncate.hpp | 4 +- .../pythonic/include/builtins/file/write.hpp | 4 +- .../include/builtins/file/writelines.hpp | 4 +- pythran/pythonic/include/builtins/float_.hpp | 4 +- .../include/builtins/float_/is_integer.hpp | 4 +- pythran/pythonic/include/builtins/hex.hpp | 4 +- pythran/pythonic/include/builtins/id.hpp | 2 +- pythran/pythonic/include/builtins/int_.hpp | 4 +- .../pythonic/include/builtins/isinstance.hpp | 18 +- pythran/pythonic/include/builtins/iter.hpp | 4 +- pythran/pythonic/include/builtins/len.hpp | 4 +- pythran/pythonic/include/builtins/list.hpp | 4 +- .../pythonic/include/builtins/list/append.hpp | 6 +- .../pythonic/include/builtins/list/count.hpp | 2 +- .../pythonic/include/builtins/list/extend.hpp | 6 +- .../pythonic/include/builtins/list/insert.hpp | 8 +- .../pythonic/include/builtins/list/pop.hpp | 2 +- .../pythonic/include/builtins/list/remove.hpp | 2 +- .../include/builtins/list/reverse.hpp | 6 +- .../pythonic/include/builtins/list/sort.hpp | 6 +- pythran/pythonic/include/builtins/map.hpp | 29 +- pythran/pythonic/include/builtins/max.hpp | 8 +- pythran/pythonic/include/builtins/min.hpp | 8 +- pythran/pythonic/include/builtins/minmax.hpp | 6 +- pythran/pythonic/include/builtins/next.hpp | 2 +- pythran/pythonic/include/builtins/oct.hpp | 2 +- pythran/pythonic/include/builtins/open.hpp | 2 +- pythran/pythonic/include/builtins/ord.hpp | 2 +- pythran/pythonic/include/builtins/pow.hpp | 4 +- pythran/pythonic/include/builtins/print.hpp | 8 +- .../builtins/pythran/StaticIfBreak.hpp | 6 +- .../include/builtins/pythran/StaticIfCont.hpp | 6 +- .../builtins/pythran/StaticIfNoReturn.hpp | 6 +- .../builtins/pythran/StaticIfReturn.hpp | 6 +- .../include/builtins/pythran/abssqr.hpp | 8 +- .../include/builtins/pythran/and_.hpp | 6 +- .../include/builtins/pythran/len_set.hpp | 4 +- .../include/builtins/pythran/make_shape.hpp | 4 +- .../pythonic/include/builtins/pythran/or_.hpp | 6 +- .../include/builtins/pythran/static_if.hpp | 19 +- .../include/builtins/pythran/static_list.hpp | 10 +- pythran/pythonic/include/builtins/range.hpp | 6 +- pythran/pythonic/include/builtins/reduce.hpp | 4 +- .../pythonic/include/builtins/reversed.hpp | 4 +- pythran/pythonic/include/builtins/round.hpp | 2 +- pythran/pythonic/include/builtins/set.hpp | 4 +- pythran/pythonic/include/builtins/set/add.hpp | 6 +- .../pythonic/include/builtins/set/clear.hpp | 2 +- .../pythonic/include/builtins/set/copy.hpp | 2 +- .../include/builtins/set/difference.hpp | 10 +- .../builtins/set/difference_update.hpp | 12 +- .../pythonic/include/builtins/set/discard.hpp | 4 +- .../include/builtins/set/intersection.hpp | 8 +- .../builtins/set/intersection_update.hpp | 12 +- .../include/builtins/set/isdisjoint.hpp | 4 +- .../include/builtins/set/issubset.hpp | 4 +- .../include/builtins/set/issuperset.hpp | 4 +- .../pythonic/include/builtins/set/remove.hpp | 2 +- .../builtins/set/symmetric_difference.hpp | 4 +- .../set/symmetric_difference_update.hpp | 4 +- .../pythonic/include/builtins/set/union_.hpp | 8 +- .../pythonic/include/builtins/set/update.hpp | 2 +- pythran/pythonic/include/builtins/sorted.hpp | 2 +- pythran/pythonic/include/builtins/str.hpp | 4 +- .../pythonic/include/builtins/str/__mod__.hpp | 7 +- .../include/builtins/str/capitalize.hpp | 4 +- .../pythonic/include/builtins/str/count.hpp | 2 +- .../include/builtins/str/endswith.hpp | 4 +- .../pythonic/include/builtins/str/find.hpp | 4 +- .../pythonic/include/builtins/str/isalpha.hpp | 6 +- .../pythonic/include/builtins/str/isdigit.hpp | 4 +- .../pythonic/include/builtins/str/join.hpp | 4 +- .../pythonic/include/builtins/str/lower.hpp | 4 +- .../pythonic/include/builtins/str/lstrip.hpp | 4 +- .../pythonic/include/builtins/str/replace.hpp | 4 +- .../pythonic/include/builtins/str/rstrip.hpp | 4 +- .../pythonic/include/builtins/str/split.hpp | 6 +- .../include/builtins/str/startswith.hpp | 4 +- .../pythonic/include/builtins/str/strip.hpp | 4 +- .../pythonic/include/builtins/str/upper.hpp | 4 +- pythran/pythonic/include/builtins/sum.hpp | 26 +- pythran/pythonic/include/builtins/tuple.hpp | 6 +- pythran/pythonic/include/builtins/type.hpp | 2 +- pythran/pythonic/include/builtins/xrange.hpp | 4 +- pythran/pythonic/include/builtins/zip.hpp | 6 +- pythran/pythonic/include/cmath/acos.hpp | 2 +- pythran/pythonic/include/cmath/acosh.hpp | 2 +- pythran/pythonic/include/cmath/asin.hpp | 2 +- pythran/pythonic/include/cmath/asinh.hpp | 2 +- pythran/pythonic/include/cmath/atan.hpp | 2 +- pythran/pythonic/include/cmath/atanh.hpp | 2 +- pythran/pythonic/include/cmath/cos.hpp | 4 +- pythran/pythonic/include/cmath/cosh.hpp | 2 +- pythran/pythonic/include/cmath/e.hpp | 2 +- pythran/pythonic/include/cmath/exp.hpp | 2 +- pythran/pythonic/include/cmath/isinf.hpp | 2 +- pythran/pythonic/include/cmath/isnan.hpp | 2 +- pythran/pythonic/include/cmath/log.hpp | 4 +- pythran/pythonic/include/cmath/log10.hpp | 2 +- pythran/pythonic/include/cmath/pi.hpp | 2 +- pythran/pythonic/include/cmath/sin.hpp | 2 +- pythran/pythonic/include/cmath/sinh.hpp | 2 +- pythran/pythonic/include/cmath/sqrt.hpp | 2 +- pythran/pythonic/include/cmath/tan.hpp | 2 +- pythran/pythonic/include/cmath/tanh.hpp | 2 +- .../pythonic/include/functools/partial.hpp | 19 +- pythran/pythonic/include/functools/reduce.hpp | 2 +- .../include/io/_io/TextIOWrapper/close.hpp | 4 +- .../include/io/_io/TextIOWrapper/fileno.hpp | 4 +- .../include/io/_io/TextIOWrapper/flush.hpp | 4 +- .../include/io/_io/TextIOWrapper/isatty.hpp | 4 +- .../include/io/_io/TextIOWrapper/next.hpp | 4 +- .../include/io/_io/TextIOWrapper/read.hpp | 4 +- .../include/io/_io/TextIOWrapper/readline.hpp | 4 +- .../io/_io/TextIOWrapper/readlines.hpp | 4 +- .../include/io/_io/TextIOWrapper/seek.hpp | 4 +- .../include/io/_io/TextIOWrapper/tell.hpp | 4 +- .../include/io/_io/TextIOWrapper/truncate.hpp | 4 +- .../include/io/_io/TextIOWrapper/write.hpp | 4 +- .../io/_io/TextIOWrapper/writelines.hpp | 4 +- pythran/pythonic/include/itertools/common.hpp | 2 +- pythran/pythonic/include/itertools/count.hpp | 6 +- pythran/pythonic/include/itertools/islice.hpp | 6 +- .../include/itertools/permutations.hpp | 2 +- .../pythonic/include/itertools/product.hpp | 14 +- pythran/pythonic/include/itertools/repeat.hpp | 2 +- pythran/pythonic/include/math/ceil.hpp | 2 +- pythran/pythonic/include/math/degrees.hpp | 2 +- pythran/pythonic/include/math/factorial.hpp | 2 +- pythran/pythonic/include/math/floor.hpp | 2 +- pythran/pythonic/include/math/frexp.hpp | 4 +- pythran/pythonic/include/math/gamma.hpp | 2 +- pythran/pythonic/include/math/isinf.hpp | 2 +- pythran/pythonic/include/math/log.hpp | 2 +- pythran/pythonic/include/math/modf.hpp | 4 +- pythran/pythonic/include/math/pi.hpp | 2 +- pythran/pythonic/include/math/radians.hpp | 2 +- pythran/pythonic/include/math/trunc.hpp | 2 +- pythran/pythonic/include/numpy/abs.hpp | 4 +- pythran/pythonic/include/numpy/absolute.hpp | 2 +- pythran/pythonic/include/numpy/add.hpp | 6 +- pythran/pythonic/include/numpy/alen.hpp | 4 +- pythran/pythonic/include/numpy/all.hpp | 9 +- pythran/pythonic/include/numpy/allclose.hpp | 6 +- pythran/pythonic/include/numpy/alltrue.hpp | 6 +- pythran/pythonic/include/numpy/angle.hpp | 2 +- .../pythonic/include/numpy/angle_in_deg.hpp | 4 +- .../pythonic/include/numpy/angle_in_rad.hpp | 10 +- pythran/pythonic/include/numpy/any.hpp | 9 +- pythran/pythonic/include/numpy/append.hpp | 4 +- pythran/pythonic/include/numpy/arange.hpp | 8 +- pythran/pythonic/include/numpy/arccos.hpp | 4 +- pythran/pythonic/include/numpy/arccosh.hpp | 4 +- pythran/pythonic/include/numpy/arcsin.hpp | 4 +- pythran/pythonic/include/numpy/arcsinh.hpp | 4 +- pythran/pythonic/include/numpy/arctan.hpp | 4 +- pythran/pythonic/include/numpy/arctan2.hpp | 4 +- pythran/pythonic/include/numpy/arctanh.hpp | 4 +- pythran/pythonic/include/numpy/argmax.hpp | 8 +- pythran/pythonic/include/numpy/argmin.hpp | 8 +- pythran/pythonic/include/numpy/argsort.hpp | 15 +- pythran/pythonic/include/numpy/argwhere.hpp | 7 +- pythran/pythonic/include/numpy/around.hpp | 40 +- pythran/pythonic/include/numpy/array.hpp | 14 +- .../pythonic/include/numpy/array2string.hpp | 4 +- .../pythonic/include/numpy/array_equal.hpp | 4 +- .../pythonic/include/numpy/array_equiv.hpp | 2 +- pythran/pythonic/include/numpy/asarray.hpp | 15 +- .../include/numpy/asarray_chkfinite.hpp | 4 +- pythran/pythonic/include/numpy/asfarray.hpp | 6 +- pythran/pythonic/include/numpy/asscalar.hpp | 6 +- pythran/pythonic/include/numpy/atleast_1d.hpp | 2 +- pythran/pythonic/include/numpy/atleast_2d.hpp | 28 +- pythran/pythonic/include/numpy/atleast_3d.hpp | 34 +- pythran/pythonic/include/numpy/average.hpp | 4 +- pythran/pythonic/include/numpy/base_repr.hpp | 4 +- .../pythonic/include/numpy/binary_repr.hpp | 2 +- pythran/pythonic/include/numpy/bincount.hpp | 2 +- .../pythonic/include/numpy/bitwise_and.hpp | 6 +- .../pythonic/include/numpy/bitwise_not.hpp | 6 +- pythran/pythonic/include/numpy/bitwise_or.hpp | 6 +- .../pythonic/include/numpy/bitwise_xor.hpp | 6 +- pythran/pythonic/include/numpy/bool_.hpp | 6 +- .../pythonic/include/numpy/broadcast_to.hpp | 6 +- pythran/pythonic/include/numpy/byte.hpp | 6 +- pythran/pythonic/include/numpy/cbrt.hpp | 4 +- pythran/pythonic/include/numpy/ceil.hpp | 4 +- pythran/pythonic/include/numpy/clip.hpp | 4 +- pythran/pythonic/include/numpy/complex.hpp | 6 +- pythran/pythonic/include/numpy/complex128.hpp | 6 +- pythran/pythonic/include/numpy/complex256.hpp | 6 +- pythran/pythonic/include/numpy/complex64.hpp | 6 +- .../pythonic/include/numpy/concatenate.hpp | 10 +- pythran/pythonic/include/numpy/conj.hpp | 2 +- pythran/pythonic/include/numpy/conjugate.hpp | 6 +- pythran/pythonic/include/numpy/convolve.hpp | 4 +- pythran/pythonic/include/numpy/copy.hpp | 7 +- pythran/pythonic/include/numpy/copysign.hpp | 4 +- pythran/pythonic/include/numpy/copyto.hpp | 13 +- pythran/pythonic/include/numpy/correlate.hpp | 4 +- pythran/pythonic/include/numpy/cos.hpp | 4 +- pythran/pythonic/include/numpy/cosh.hpp | 4 +- .../pythonic/include/numpy/count_nonzero.hpp | 4 +- pythran/pythonic/include/numpy/cross.hpp | 6 +- .../include/numpy/ctypeslib/as_array.hpp | 4 +- pythran/pythonic/include/numpy/cumprod.hpp | 6 +- pythran/pythonic/include/numpy/cumsum.hpp | 6 +- pythran/pythonic/include/numpy/deg2rad.hpp | 10 +- pythran/pythonic/include/numpy/degrees.hpp | 4 +- pythran/pythonic/include/numpy/delete_.hpp | 4 +- pythran/pythonic/include/numpy/diag.hpp | 12 +- pythran/pythonic/include/numpy/diff.hpp | 8 +- pythran/pythonic/include/numpy/digitize.hpp | 4 +- pythran/pythonic/include/numpy/divide.hpp | 6 +- pythran/pythonic/include/numpy/dot.hpp | 29 +- pythran/pythonic/include/numpy/double_.hpp | 2 +- pythran/pythonic/include/numpy/dtype/type.hpp | 4 +- pythran/pythonic/include/numpy/ediff1d.hpp | 2 +- pythran/pythonic/include/numpy/empty.hpp | 7 +- pythran/pythonic/include/numpy/empty_like.hpp | 4 +- pythran/pythonic/include/numpy/equal.hpp | 6 +- pythran/pythonic/include/numpy/exp.hpp | 4 +- .../pythonic/include/numpy/expand_dims.hpp | 4 +- pythran/pythonic/include/numpy/expm1.hpp | 4 +- pythran/pythonic/include/numpy/eye.hpp | 10 +- pythran/pythonic/include/numpy/fabs.hpp | 2 +- pythran/pythonic/include/numpy/fft/c2c.hpp | 6 +- pythran/pythonic/include/numpy/fft/fft.hpp | 27 +- pythran/pythonic/include/numpy/fft/fftn.hpp | 12 +- pythran/pythonic/include/numpy/fft/hfft.hpp | 22 +- pythran/pythonic/include/numpy/fft/ifft.hpp | 30 +- pythran/pythonic/include/numpy/fft/ihfft.hpp | 22 +- pythran/pythonic/include/numpy/fft/irfft.hpp | 22 +- pythran/pythonic/include/numpy/fft/rfft.hpp | 22 +- .../pythonic/include/numpy/fill_diagonal.hpp | 4 +- pythran/pythonic/include/numpy/finfo.hpp | 4 +- pythran/pythonic/include/numpy/fix.hpp | 4 +- .../pythonic/include/numpy/flatnonzero.hpp | 2 +- pythran/pythonic/include/numpy/flip.hpp | 6 +- pythran/pythonic/include/numpy/fliplr.hpp | 7 +- pythran/pythonic/include/numpy/flipud.hpp | 9 +- pythran/pythonic/include/numpy/float128.hpp | 6 +- pythran/pythonic/include/numpy/float32.hpp | 6 +- pythran/pythonic/include/numpy/float64.hpp | 6 +- pythran/pythonic/include/numpy/float_.hpp | 2 +- pythran/pythonic/include/numpy/floor.hpp | 4 +- .../pythonic/include/numpy/floor_divide.hpp | 8 +- pythran/pythonic/include/numpy/fmod.hpp | 4 +- pythran/pythonic/include/numpy/frexp.hpp | 6 +- pythran/pythonic/include/numpy/fromfile.hpp | 2 +- .../pythonic/include/numpy/fromfunction.hpp | 6 +- pythran/pythonic/include/numpy/fromiter.hpp | 4 +- pythran/pythonic/include/numpy/fromstring.hpp | 6 +- pythran/pythonic/include/numpy/full.hpp | 4 +- pythran/pythonic/include/numpy/full_like.hpp | 4 +- pythran/pythonic/include/numpy/greater.hpp | 6 +- .../pythonic/include/numpy/greater_equal.hpp | 6 +- pythran/pythonic/include/numpy/heaviside.hpp | 4 +- pythran/pythonic/include/numpy/hstack.hpp | 2 +- pythran/pythonic/include/numpy/hypot.hpp | 4 +- pythran/pythonic/include/numpy/identity.hpp | 2 +- pythran/pythonic/include/numpy/imag.hpp | 6 +- pythran/pythonic/include/numpy/indices.hpp | 4 +- pythran/pythonic/include/numpy/insert.hpp | 6 +- pythran/pythonic/include/numpy/int16.hpp | 6 +- pythran/pythonic/include/numpy/int32.hpp | 6 +- pythran/pythonic/include/numpy/int64.hpp | 6 +- pythran/pythonic/include/numpy/int8.hpp | 6 +- pythran/pythonic/include/numpy/int_.hpp | 6 +- pythran/pythonic/include/numpy/intc.hpp | 6 +- .../pythonic/include/numpy/intersect1d.hpp | 8 +- pythran/pythonic/include/numpy/intp.hpp | 6 +- pythran/pythonic/include/numpy/invert.hpp | 6 +- pythran/pythonic/include/numpy/isclose.hpp | 6 +- pythran/pythonic/include/numpy/iscomplex.hpp | 8 +- pythran/pythonic/include/numpy/isfinite.hpp | 6 +- pythran/pythonic/include/numpy/isinf.hpp | 6 +- pythran/pythonic/include/numpy/isnan.hpp | 18 +- pythran/pythonic/include/numpy/isneginf.hpp | 4 +- pythran/pythonic/include/numpy/isposinf.hpp | 6 +- pythran/pythonic/include/numpy/isreal.hpp | 8 +- pythran/pythonic/include/numpy/isrealobj.hpp | 4 +- pythran/pythonic/include/numpy/isscalar.hpp | 6 +- pythran/pythonic/include/numpy/issctype.hpp | 2 +- pythran/pythonic/include/numpy/ldexp.hpp | 4 +- pythran/pythonic/include/numpy/left_shift.hpp | 6 +- pythran/pythonic/include/numpy/less.hpp | 6 +- pythran/pythonic/include/numpy/less_equal.hpp | 6 +- pythran/pythonic/include/numpy/lexsort.hpp | 4 +- .../include/numpy/linalg/matrix_power.hpp | 8 +- .../pythonic/include/numpy/linalg/norm.hpp | 24 +- pythran/pythonic/include/numpy/linspace.hpp | 2 +- pythran/pythonic/include/numpy/log.hpp | 4 +- pythran/pythonic/include/numpy/log10.hpp | 4 +- pythran/pythonic/include/numpy/log1p.hpp | 4 +- pythran/pythonic/include/numpy/log2.hpp | 4 +- pythran/pythonic/include/numpy/logaddexp.hpp | 6 +- pythran/pythonic/include/numpy/logaddexp2.hpp | 4 +- .../pythonic/include/numpy/logical_and.hpp | 6 +- .../pythonic/include/numpy/logical_not.hpp | 6 +- pythran/pythonic/include/numpy/logical_or.hpp | 4 +- .../pythonic/include/numpy/logical_xor.hpp | 10 +- pythran/pythonic/include/numpy/logspace.hpp | 2 +- pythran/pythonic/include/numpy/longlong.hpp | 6 +- pythran/pythonic/include/numpy/max.hpp | 6 +- pythran/pythonic/include/numpy/maximum.hpp | 4 +- pythran/pythonic/include/numpy/mean.hpp | 12 +- pythran/pythonic/include/numpy/median.hpp | 11 +- pythran/pythonic/include/numpy/min.hpp | 6 +- pythran/pythonic/include/numpy/minimum.hpp | 4 +- pythran/pythonic/include/numpy/mod.hpp | 6 +- pythran/pythonic/include/numpy/multiply.hpp | 6 +- pythran/pythonic/include/numpy/nan_to_num.hpp | 6 +- pythran/pythonic/include/numpy/nanargmax.hpp | 6 +- pythran/pythonic/include/numpy/nanargmin.hpp | 4 +- pythran/pythonic/include/numpy/nanmax.hpp | 6 +- pythran/pythonic/include/numpy/nanmin.hpp | 6 +- pythran/pythonic/include/numpy/nansum.hpp | 4 +- pythran/pythonic/include/numpy/ndarray.hpp | 4 +- .../pythonic/include/numpy/ndarray/astype.hpp | 4 +- .../pythonic/include/numpy/ndarray/fill.hpp | 8 +- .../include/numpy/ndarray/flatten.hpp | 6 +- .../pythonic/include/numpy/ndarray/item.hpp | 9 +- .../include/numpy/ndarray/reshape.hpp | 8 +- .../pythonic/include/numpy/ndarray/sort.hpp | 4 +- .../pythonic/include/numpy/ndarray/tofile.hpp | 8 +- .../pythonic/include/numpy/ndarray/tolist.hpp | 6 +- .../include/numpy/ndarray/tostring.hpp | 8 +- .../pythonic/include/numpy/ndenumerate.hpp | 6 +- pythran/pythonic/include/numpy/ndim.hpp | 6 +- pythran/pythonic/include/numpy/ndindex.hpp | 24 +- pythran/pythonic/include/numpy/negative.hpp | 6 +- pythran/pythonic/include/numpy/nextafter.hpp | 4 +- pythran/pythonic/include/numpy/nonzero.hpp | 7 +- pythran/pythonic/include/numpy/not_equal.hpp | 6 +- pythran/pythonic/include/numpy/ones.hpp | 7 +- pythran/pythonic/include/numpy/ones_like.hpp | 4 +- pythran/pythonic/include/numpy/outer.hpp | 14 +- .../pythonic/include/numpy/partial_sum.hpp | 7 +- pythran/pythonic/include/numpy/place.hpp | 6 +- pythran/pythonic/include/numpy/power.hpp | 4 +- pythran/pythonic/include/numpy/prod.hpp | 8 +- pythran/pythonic/include/numpy/ptp.hpp | 8 +- pythran/pythonic/include/numpy/put.hpp | 4 +- pythran/pythonic/include/numpy/putmask.hpp | 8 +- pythran/pythonic/include/numpy/rad2deg.hpp | 8 +- pythran/pythonic/include/numpy/radians.hpp | 4 +- .../include/numpy/random/binomial.hpp | 6 +- .../pythonic/include/numpy/random/bytes.hpp | 6 +- .../include/numpy/random/chisquare.hpp | 6 +- .../pythonic/include/numpy/random/choice.hpp | 10 +- .../include/numpy/random/dirichlet.hpp | 6 +- .../include/numpy/random/exponential.hpp | 6 +- pythran/pythonic/include/numpy/random/f.hpp | 13 +- .../pythonic/include/numpy/random/gamma.hpp | 10 +- .../include/numpy/random/generator.hpp | 4 +- .../include/numpy/random/geometric.hpp | 6 +- .../pythonic/include/numpy/random/gumbel.hpp | 10 +- .../pythonic/include/numpy/random/laplace.hpp | 10 +- .../include/numpy/random/logistic.hpp | 10 +- .../include/numpy/random/lognormal.hpp | 11 +- .../include/numpy/random/logseries.hpp | 10 +- .../numpy/random/negative_binomial.hpp | 3 +- .../pythonic/include/numpy/random/normal.hpp | 10 +- .../pythonic/include/numpy/random/pareto.hpp | 6 +- .../pythonic/include/numpy/random/poisson.hpp | 6 +- .../pythonic/include/numpy/random/power.hpp | 10 +- .../pythonic/include/numpy/random/rand.hpp | 9 +- .../pythonic/include/numpy/random/randint.hpp | 12 +- .../pythonic/include/numpy/random/randn.hpp | 7 +- .../pythonic/include/numpy/random/random.hpp | 16 +- .../include/numpy/random/random_integers.hpp | 6 +- .../include/numpy/random/random_sample.hpp | 4 +- .../pythonic/include/numpy/random/ranf.hpp | 2 +- .../include/numpy/random/rayleigh.hpp | 10 +- .../pythonic/include/numpy/random/sample.hpp | 2 +- .../pythonic/include/numpy/random/seed.hpp | 4 +- .../pythonic/include/numpy/random/shuffle.hpp | 8 +- .../numpy/random/standard_exponential.hpp | 10 +- .../include/numpy/random/standard_gamma.hpp | 10 +- .../include/numpy/random/standard_normal.hpp | 10 +- .../pythonic/include/numpy/random/uniform.hpp | 2 +- .../pythonic/include/numpy/random/weibull.hpp | 6 +- pythran/pythonic/include/numpy/ravel.hpp | 2 +- pythran/pythonic/include/numpy/real.hpp | 6 +- pythran/pythonic/include/numpy/reciprocal.hpp | 6 +- pythran/pythonic/include/numpy/reduce.hpp | 12 +- pythran/pythonic/include/numpy/remainder.hpp | 10 +- pythran/pythonic/include/numpy/repeat.hpp | 8 +- pythran/pythonic/include/numpy/resize.hpp | 2 +- .../pythonic/include/numpy/right_shift.hpp | 4 +- pythran/pythonic/include/numpy/rint.hpp | 6 +- pythran/pythonic/include/numpy/roll.hpp | 4 +- pythran/pythonic/include/numpy/rollaxis.hpp | 6 +- pythran/pythonic/include/numpy/rot90.hpp | 8 +- .../pythonic/include/numpy/searchsorted.hpp | 10 +- pythran/pythonic/include/numpy/select.hpp | 7 +- pythran/pythonic/include/numpy/setdiff1d.hpp | 4 +- pythran/pythonic/include/numpy/shape.hpp | 4 +- pythran/pythonic/include/numpy/short_.hpp | 6 +- pythran/pythonic/include/numpy/sin.hpp | 4 +- pythran/pythonic/include/numpy/sinh.hpp | 4 +- pythran/pythonic/include/numpy/sort.hpp | 10 +- .../pythonic/include/numpy/sort_complex.hpp | 2 +- pythran/pythonic/include/numpy/spacing.hpp | 6 +- pythran/pythonic/include/numpy/split.hpp | 10 +- pythran/pythonic/include/numpy/sqrt.hpp | 4 +- pythran/pythonic/include/numpy/square.hpp | 8 +- pythran/pythonic/include/numpy/stack.hpp | 9 +- pythran/pythonic/include/numpy/std_.hpp | 6 +- pythran/pythonic/include/numpy/subtract.hpp | 6 +- pythran/pythonic/include/numpy/sum.hpp | 4 +- pythran/pythonic/include/numpy/swapaxes.hpp | 10 +- pythran/pythonic/include/numpy/take.hpp | 2 +- pythran/pythonic/include/numpy/tan.hpp | 4 +- pythran/pythonic/include/numpy/tanh.hpp | 4 +- pythran/pythonic/include/numpy/tile.hpp | 10 +- pythran/pythonic/include/numpy/trace.hpp | 2 +- pythran/pythonic/include/numpy/transpose.hpp | 35 +- pythran/pythonic/include/numpy/tri.hpp | 6 +- pythran/pythonic/include/numpy/tril.hpp | 4 +- pythran/pythonic/include/numpy/triu.hpp | 4 +- .../pythonic/include/numpy/true_divide.hpp | 6 +- pythran/pythonic/include/numpy/trunc.hpp | 4 +- pythran/pythonic/include/numpy/ubyte.hpp | 6 +- .../include/numpy/ufunc_accumulate.hpp | 4 +- .../pythonic/include/numpy/ufunc_reduce.hpp | 13 +- pythran/pythonic/include/numpy/uint.hpp | 6 +- pythran/pythonic/include/numpy/uint16.hpp | 6 +- pythran/pythonic/include/numpy/uint32.hpp | 6 +- pythran/pythonic/include/numpy/uint64.hpp | 6 +- pythran/pythonic/include/numpy/uint8.hpp | 6 +- pythran/pythonic/include/numpy/uintc.hpp | 6 +- pythran/pythonic/include/numpy/uintp.hpp | 6 +- pythran/pythonic/include/numpy/ulonglong.hpp | 6 +- pythran/pythonic/include/numpy/union1d.hpp | 4 +- pythran/pythonic/include/numpy/unique.hpp | 6 +- .../pythonic/include/numpy/unravel_index.hpp | 7 +- pythran/pythonic/include/numpy/unwrap.hpp | 6 +- pythran/pythonic/include/numpy/ushort.hpp | 6 +- pythran/pythonic/include/numpy/var.hpp | 10 +- pythran/pythonic/include/numpy/vdot.hpp | 8 +- pythran/pythonic/include/numpy/vstack.hpp | 11 +- pythran/pythonic/include/numpy/where.hpp | 6 +- pythran/pythonic/include/numpy/zeros.hpp | 7 +- pythran/pythonic/include/numpy/zeros_like.hpp | 4 +- .../pythonic/include/omp/get_num_threads.hpp | 2 +- .../pythonic/include/omp/get_thread_num.hpp | 4 +- pythran/pythonic/include/omp/get_wtick.hpp | 4 +- pythran/pythonic/include/omp/get_wtime.hpp | 4 +- pythran/pythonic/include/omp/in_parallel.hpp | 4 +- pythran/pythonic/include/omp/set_nested.hpp | 4 +- .../pythonic/include/omp/set_num_threads.hpp | 2 +- .../pythonic/include/operator_/__abs__.hpp | 2 +- .../pythonic/include/operator_/__add__.hpp | 2 +- .../include/operator_/__truediv__.hpp | 2 +- pythran/pythonic/include/operator_/abs.hpp | 2 +- pythran/pythonic/include/operator_/add.hpp | 4 +- pythran/pythonic/include/operator_/and_.hpp | 4 +- pythran/pythonic/include/operator_/concat.hpp | 6 +- .../pythonic/include/operator_/contains.hpp | 8 +- .../pythonic/include/operator_/countOf.hpp | 2 +- .../pythonic/include/operator_/delitem.hpp | 4 +- pythran/pythonic/include/operator_/div.hpp | 4 +- pythran/pythonic/include/operator_/eq.hpp | 2 +- .../pythonic/include/operator_/floordiv.hpp | 2 +- pythran/pythonic/include/operator_/ge.hpp | 2 +- .../pythonic/include/operator_/getitem.hpp | 6 +- pythran/pythonic/include/operator_/gt.hpp | 2 +- pythran/pythonic/include/operator_/iadd.hpp | 6 +- .../pythonic/include/operator_/icommon.hpp | 14 +- .../pythonic/include/operator_/iconcat.hpp | 6 +- .../pythonic/include/operator_/ifloordiv.hpp | 4 +- pythran/pythonic/include/operator_/imax.hpp | 22 +- pythran/pythonic/include/operator_/imin.hpp | 22 +- pythran/pythonic/include/operator_/imod.hpp | 2 +- .../pythonic/include/operator_/indexOf.hpp | 2 +- pythran/pythonic/include/operator_/inv.hpp | 2 +- pythran/pythonic/include/operator_/invert.hpp | 2 +- pythran/pythonic/include/operator_/ipow.hpp | 4 +- pythran/pythonic/include/operator_/is_.hpp | 4 +- pythran/pythonic/include/operator_/is_not.hpp | 2 +- .../pythonic/include/operator_/itemgetter.hpp | 4 +- .../pythonic/include/operator_/itruediv.hpp | 18 +- pythran/pythonic/include/operator_/le.hpp | 2 +- pythran/pythonic/include/operator_/lshift.hpp | 10 +- pythran/pythonic/include/operator_/lt.hpp | 2 +- pythran/pythonic/include/operator_/matmul.hpp | 10 +- pythran/pythonic/include/operator_/mod.hpp | 11 +- pythran/pythonic/include/operator_/mul.hpp | 4 +- pythran/pythonic/include/operator_/ne.hpp | 2 +- pythran/pythonic/include/operator_/neg.hpp | 2 +- pythran/pythonic/include/operator_/not_.hpp | 2 +- pythran/pythonic/include/operator_/or_.hpp | 6 +- pythran/pythonic/include/operator_/pos.hpp | 2 +- pythran/pythonic/include/operator_/rshift.hpp | 10 +- pythran/pythonic/include/operator_/sub.hpp | 4 +- .../pythonic/include/operator_/truediv.hpp | 6 +- pythran/pythonic/include/operator_/truth.hpp | 2 +- pythran/pythonic/include/operator_/xor_.hpp | 4 +- pythran/pythonic/include/os/path/join.hpp | 6 +- pythran/pythonic/include/random/choice.hpp | 4 +- .../pythonic/include/random/expovariate.hpp | 4 +- pythran/pythonic/include/random/gauss.hpp | 4 +- pythran/pythonic/include/random/randint.hpp | 4 +- pythran/pythonic/include/random/random.hpp | 2 +- pythran/pythonic/include/random/randrange.hpp | 4 +- pythran/pythonic/include/random/sample.hpp | 4 +- pythran/pythonic/include/random/seed.hpp | 4 +- pythran/pythonic/include/random/shuffle.hpp | 4 +- pythran/pythonic/include/random/uniform.hpp | 4 +- .../pythonic/include/scipy/special/binom.hpp | 4 +- .../pythonic/include/scipy/special/gamma.hpp | 4 +- .../include/scipy/special/gammaincinv.hpp | 4 +- .../include/scipy/special/gammaln.hpp | 4 +- .../include/scipy/special/hankel1.hpp | 6 +- .../include/scipy/special/hankel2.hpp | 6 +- pythran/pythonic/include/scipy/special/i0.hpp | 6 +- .../pythonic/include/scipy/special/i0e.hpp | 4 +- pythran/pythonic/include/scipy/special/iv.hpp | 4 +- .../pythonic/include/scipy/special/ivp.hpp | 4 +- pythran/pythonic/include/scipy/special/jv.hpp | 4 +- .../pythonic/include/scipy/special/jvp.hpp | 4 +- pythran/pythonic/include/scipy/special/kv.hpp | 4 +- .../pythonic/include/scipy/special/kvp.hpp | 4 +- .../pythonic/include/scipy/special/ndtr.hpp | 4 +- .../pythonic/include/scipy/special/ndtri.hpp | 4 +- .../include/scipy/special/spherical_jn.hpp | 4 +- .../include/scipy/special/spherical_yn.hpp | 4 +- pythran/pythonic/include/scipy/special/yv.hpp | 4 +- .../pythonic/include/scipy/special/yvp.hpp | 4 +- pythran/pythonic/include/string/find.hpp | 4 +- pythran/pythonic/include/time/sleep.hpp | 4 +- pythran/pythonic/include/time/time.hpp | 2 +- pythran/pythonic/include/types/array.hpp | 2 +- pythran/pythonic/include/types/attr.hpp | 4 +- pythran/pythonic/include/types/cfun.hpp | 2 +- pythran/pythonic/include/types/combined.hpp | 15 +- pythran/pythonic/include/types/complex.hpp | 34 +- .../pythonic/include/types/dynamic_tuple.hpp | 4 +- .../pythonic/include/types/empty_iterator.hpp | 2 +- pythran/pythonic/include/types/exceptions.hpp | 17 +- pythran/pythonic/include/types/file.hpp | 12 +- pythran/pythonic/include/types/finfo.hpp | 6 +- pythran/pythonic/include/types/generator.hpp | 4 +- pythran/pythonic/include/types/immediate.hpp | 2 +- pythran/pythonic/include/types/int.hpp | 2 +- pythran/pythonic/include/types/lazy.hpp | 2 +- pythran/pythonic/include/types/list.hpp | 10 +- pythran/pythonic/include/types/ndarray.hpp | 119 +++--- pythran/pythonic/include/types/nditerator.hpp | 14 +- .../include/types/numpy_broadcast.hpp | 10 +- pythran/pythonic/include/types/numpy_expr.hpp | 118 +++--- .../pythonic/include/types/numpy_gexpr.hpp | 75 ++-- .../pythonic/include/types/numpy_iexpr.hpp | 27 +- .../include/types/numpy_nary_expr.hpp | 13 +- .../include/types/numpy_op_helper.hpp | 2 +- .../include/types/numpy_operators.hpp | 18 +- .../pythonic/include/types/numpy_texpr.hpp | 73 ++-- .../pythonic/include/types/numpy_vexpr.hpp | 8 +- pythran/pythonic/include/types/pointer.hpp | 4 +- pythran/pythonic/include/types/raw_array.hpp | 2 +- pythran/pythonic/include/types/static_if.hpp | 4 +- pythran/pythonic/include/types/str.hpp | 9 +- pythran/pythonic/include/types/traits.hpp | 7 +- pythran/pythonic/include/types/tuple.hpp | 102 ++--- .../include/types/variant_functor.hpp | 30 +- .../include/types/vectorizable_type.hpp | 14 +- .../pythonic/include/utils/array_helper.hpp | 8 +- pythran/pythonic/include/utils/functor.hpp | 2 +- pythran/pythonic/include/utils/fwd.hpp | 2 +- pythran/pythonic/include/utils/int_.hpp | 2 +- pythran/pythonic/include/utils/iterator.hpp | 4 +- pythran/pythonic/include/utils/meta.hpp | 2 +- .../include/utils/nested_container.hpp | 6 +- pythran/pythonic/include/utils/neutral.hpp | 6 +- .../include/utils/numpy_conversion.hpp | 4 +- .../pythonic/include/utils/numpy_traits.hpp | 2 +- pythran/pythonic/include/utils/seq.hpp | 8 +- pythran/pythonic/include/utils/tags.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/close.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/fileno.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/flush.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/isatty.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/next.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/read.hpp | 2 +- .../io/_io/TextIOWrapper/readline.hpp | 2 +- .../io/_io/TextIOWrapper/readlines.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/seek.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/tell.hpp | 2 +- .../io/_io/TextIOWrapper/truncate.hpp | 2 +- .../pythonic/io/_io/TextIOWrapper/write.hpp | 2 +- .../io/_io/TextIOWrapper/writelines.hpp | 2 +- pythran/pythonic/itertools/islice.hpp | 22 +- pythran/pythonic/itertools/permutations.hpp | 10 +- pythran/pythonic/itertools/product.hpp | 30 +- pythran/pythonic/itertools/repeat.hpp | 16 +- pythran/pythonic/math/ceil.hpp | 2 +- pythran/pythonic/math/degrees.hpp | 4 +- pythran/pythonic/math/factorial.hpp | 2 +- pythran/pythonic/math/floor.hpp | 2 +- pythran/pythonic/math/frexp.hpp | 4 +- pythran/pythonic/math/gamma.hpp | 2 +- pythran/pythonic/math/modf.hpp | 4 +- pythran/pythonic/math/radians.hpp | 4 +- pythran/pythonic/math/trunc.hpp | 2 +- pythran/pythonic/numpy/abs.hpp | 2 +- pythran/pythonic/numpy/add.hpp | 6 +- pythran/pythonic/numpy/alen.hpp | 4 +- pythran/pythonic/numpy/all.hpp | 27 +- pythran/pythonic/numpy/allclose.hpp | 8 +- pythran/pythonic/numpy/alltrue.hpp | 5 +- pythran/pythonic/numpy/angle.hpp | 2 +- pythran/pythonic/numpy/angle_in_deg.hpp | 4 +- pythran/pythonic/numpy/angle_in_rad.hpp | 14 +- pythran/pythonic/numpy/any.hpp | 20 +- pythran/pythonic/numpy/append.hpp | 10 +- pythran/pythonic/numpy/arange.hpp | 4 +- pythran/pythonic/numpy/arccos.hpp | 4 +- pythran/pythonic/numpy/arccosh.hpp | 4 +- pythran/pythonic/numpy/arcsin.hpp | 4 +- pythran/pythonic/numpy/arcsinh.hpp | 4 +- pythran/pythonic/numpy/arctan.hpp | 4 +- pythran/pythonic/numpy/arctan2.hpp | 4 +- pythran/pythonic/numpy/arctanh.hpp | 4 +- pythran/pythonic/numpy/argmax.hpp | 4 +- pythran/pythonic/numpy/argmin.hpp | 4 +- pythran/pythonic/numpy/argminmax.hpp | 10 +- pythran/pythonic/numpy/argsort.hpp | 36 +- pythran/pythonic/numpy/argwhere.hpp | 11 +- pythran/pythonic/numpy/around.hpp | 42 +- pythran/pythonic/numpy/array.hpp | 16 +- pythran/pythonic/numpy/array2string.hpp | 4 +- pythran/pythonic/numpy/array_equal.hpp | 6 +- pythran/pythonic/numpy/array_equiv.hpp | 4 +- pythran/pythonic/numpy/asarray.hpp | 15 +- pythran/pythonic/numpy/asarray_chkfinite.hpp | 6 +- pythran/pythonic/numpy/asfarray.hpp | 2 +- pythran/pythonic/numpy/asscalar.hpp | 8 +- pythran/pythonic/numpy/atleast_1d.hpp | 2 +- pythran/pythonic/numpy/atleast_2d.hpp | 32 +- pythran/pythonic/numpy/atleast_3d.hpp | 34 +- pythran/pythonic/numpy/average.hpp | 8 +- pythran/pythonic/numpy/base_repr.hpp | 4 +- pythran/pythonic/numpy/bincount.hpp | 9 +- pythran/pythonic/numpy/bitwise_and.hpp | 6 +- pythran/pythonic/numpy/bitwise_or.hpp | 6 +- pythran/pythonic/numpy/bitwise_xor.hpp | 6 +- pythran/pythonic/numpy/broadcast_to.hpp | 6 +- pythran/pythonic/numpy/cbrt.hpp | 4 +- pythran/pythonic/numpy/ceil.hpp | 4 +- pythran/pythonic/numpy/clip.hpp | 4 +- pythran/pythonic/numpy/concatenate.hpp | 27 +- pythran/pythonic/numpy/conjugate.hpp | 2 +- pythran/pythonic/numpy/convolve.hpp | 4 +- pythran/pythonic/numpy/copy.hpp | 7 +- pythran/pythonic/numpy/copysign.hpp | 4 +- pythran/pythonic/numpy/copyto.hpp | 66 +-- pythran/pythonic/numpy/cos.hpp | 4 +- pythran/pythonic/numpy/cosh.hpp | 4 +- pythran/pythonic/numpy/count_nonzero.hpp | 4 +- pythran/pythonic/numpy/cross.hpp | 36 +- pythran/pythonic/numpy/ctypeslib/as_array.hpp | 4 +- pythran/pythonic/numpy/cumprod.hpp | 6 +- pythran/pythonic/numpy/cumsum.hpp | 6 +- pythran/pythonic/numpy/deg2rad.hpp | 6 +- pythran/pythonic/numpy/delete_.hpp | 4 +- pythran/pythonic/numpy/diag.hpp | 11 +- pythran/pythonic/numpy/diff.hpp | 12 +- pythran/pythonic/numpy/digitize.hpp | 6 +- pythran/pythonic/numpy/divide.hpp | 6 +- pythran/pythonic/numpy/dot.hpp | 59 +-- pythran/pythonic/numpy/double_.hpp | 2 +- pythran/pythonic/numpy/dtype/type.hpp | 4 +- pythran/pythonic/numpy/ediff1d.hpp | 2 +- pythran/pythonic/numpy/empty.hpp | 7 +- pythran/pythonic/numpy/empty_like.hpp | 8 +- pythran/pythonic/numpy/equal.hpp | 6 +- pythran/pythonic/numpy/exp.hpp | 4 +- pythran/pythonic/numpy/expand_dims.hpp | 8 +- pythran/pythonic/numpy/expm1.hpp | 4 +- pythran/pythonic/numpy/eye.hpp | 10 +- pythran/pythonic/numpy/fft/c2c.hpp | 49 +-- pythran/pythonic/numpy/fft/fft.hpp | 30 +- pythran/pythonic/numpy/fft/fftn.hpp | 16 +- pythran/pythonic/numpy/fft/hfft.hpp | 26 +- pythran/pythonic/numpy/fft/ifft.hpp | 34 +- pythran/pythonic/numpy/fft/ihfft.hpp | 26 +- pythran/pythonic/numpy/fft/irfft.hpp | 26 +- pythran/pythonic/numpy/fft/pocketfft.hpp | 376 ++++++++++-------- pythran/pythonic/numpy/fft/rfft.hpp | 26 +- pythran/pythonic/numpy/fill_diagonal.hpp | 6 +- pythran/pythonic/numpy/finfo.hpp | 4 +- pythran/pythonic/numpy/fix.hpp | 4 +- pythran/pythonic/numpy/flatnonzero.hpp | 4 +- pythran/pythonic/numpy/flip.hpp | 8 +- pythran/pythonic/numpy/fliplr.hpp | 7 +- pythran/pythonic/numpy/flipud.hpp | 9 +- pythran/pythonic/numpy/float_.hpp | 4 +- pythran/pythonic/numpy/floor.hpp | 4 +- pythran/pythonic/numpy/floor_divide.hpp | 6 +- pythran/pythonic/numpy/fmod.hpp | 4 +- pythran/pythonic/numpy/frexp.hpp | 8 +- pythran/pythonic/numpy/fromfile.hpp | 2 +- pythran/pythonic/numpy/fromfunction.hpp | 24 +- pythran/pythonic/numpy/fromiter.hpp | 6 +- pythran/pythonic/numpy/fromstring.hpp | 6 +- pythran/pythonic/numpy/full.hpp | 4 +- pythran/pythonic/numpy/full_like.hpp | 4 +- pythran/pythonic/numpy/greater.hpp | 6 +- pythran/pythonic/numpy/greater_equal.hpp | 6 +- pythran/pythonic/numpy/heaviside.hpp | 6 +- pythran/pythonic/numpy/hstack.hpp | 2 +- pythran/pythonic/numpy/hypot.hpp | 4 +- pythran/pythonic/numpy/identity.hpp | 2 +- pythran/pythonic/numpy/imag.hpp | 10 +- pythran/pythonic/numpy/indices.hpp | 4 +- pythran/pythonic/numpy/insert.hpp | 6 +- pythran/pythonic/numpy/invert.hpp | 6 +- pythran/pythonic/numpy/isclose.hpp | 8 +- pythran/pythonic/numpy/iscomplex.hpp | 8 +- pythran/pythonic/numpy/isfinite.hpp | 4 +- pythran/pythonic/numpy/isinf.hpp | 6 +- pythran/pythonic/numpy/isnan.hpp | 17 +- pythran/pythonic/numpy/isneginf.hpp | 8 +- pythran/pythonic/numpy/isposinf.hpp | 6 +- pythran/pythonic/numpy/isreal.hpp | 8 +- pythran/pythonic/numpy/isrealobj.hpp | 4 +- pythran/pythonic/numpy/isscalar.hpp | 6 +- pythran/pythonic/numpy/issctype.hpp | 2 +- pythran/pythonic/numpy/ldexp.hpp | 4 +- pythran/pythonic/numpy/left_shift.hpp | 6 +- pythran/pythonic/numpy/less.hpp | 6 +- pythran/pythonic/numpy/less_equal.hpp | 6 +- pythran/pythonic/numpy/lexsort.hpp | 6 +- .../pythonic/numpy/linalg/matrix_power.hpp | 12 +- pythran/pythonic/numpy/linalg/norm.hpp | 21 +- pythran/pythonic/numpy/linspace.hpp | 2 +- pythran/pythonic/numpy/log.hpp | 4 +- pythran/pythonic/numpy/log10.hpp | 4 +- pythran/pythonic/numpy/log1p.hpp | 4 +- pythran/pythonic/numpy/log2.hpp | 4 +- pythran/pythonic/numpy/logaddexp.hpp | 10 +- pythran/pythonic/numpy/logaddexp2.hpp | 6 +- pythran/pythonic/numpy/logical_and.hpp | 8 +- pythran/pythonic/numpy/logical_not.hpp | 6 +- pythran/pythonic/numpy/logical_or.hpp | 6 +- pythran/pythonic/numpy/logical_xor.hpp | 10 +- pythran/pythonic/numpy/logspace.hpp | 2 +- pythran/pythonic/numpy/max.hpp | 6 +- pythran/pythonic/numpy/maximum.hpp | 4 +- pythran/pythonic/numpy/mean.hpp | 6 +- pythran/pythonic/numpy/median.hpp | 9 +- pythran/pythonic/numpy/min.hpp | 4 +- pythran/pythonic/numpy/minimum.hpp | 4 +- pythran/pythonic/numpy/multiply.hpp | 6 +- pythran/pythonic/numpy/nan_to_num.hpp | 10 +- pythran/pythonic/numpy/nanargmax.hpp | 8 +- pythran/pythonic/numpy/nanargmin.hpp | 8 +- pythran/pythonic/numpy/nanmax.hpp | 4 +- pythran/pythonic/numpy/nanmin.hpp | 4 +- pythran/pythonic/numpy/nansum.hpp | 6 +- pythran/pythonic/numpy/ndarray.hpp | 4 +- pythran/pythonic/numpy/ndarray/astype.hpp | 4 +- pythran/pythonic/numpy/ndarray/fill.hpp | 8 +- pythran/pythonic/numpy/ndarray/flatten.hpp | 6 +- pythran/pythonic/numpy/ndarray/item.hpp | 11 +- pythran/pythonic/numpy/ndarray/reshape.hpp | 12 +- pythran/pythonic/numpy/ndarray/tofile.hpp | 6 +- pythran/pythonic/numpy/ndarray/tolist.hpp | 6 +- pythran/pythonic/numpy/ndarray/tostring.hpp | 8 +- pythran/pythonic/numpy/ndenumerate.hpp | 24 +- pythran/pythonic/numpy/ndim.hpp | 4 +- pythran/pythonic/numpy/ndindex.hpp | 14 +- pythran/pythonic/numpy/negative.hpp | 6 +- pythran/pythonic/numpy/nextafter.hpp | 4 +- pythran/pythonic/numpy/nonzero.hpp | 30 +- pythran/pythonic/numpy/not_equal.hpp | 6 +- pythran/pythonic/numpy/ones.hpp | 7 +- pythran/pythonic/numpy/ones_like.hpp | 8 +- pythran/pythonic/numpy/outer.hpp | 22 +- pythran/pythonic/numpy/partial_sum.hpp | 10 +- pythran/pythonic/numpy/place.hpp | 6 +- pythran/pythonic/numpy/power.hpp | 2 +- pythran/pythonic/numpy/prod.hpp | 6 +- pythran/pythonic/numpy/ptp.hpp | 8 +- pythran/pythonic/numpy/put.hpp | 8 +- pythran/pythonic/numpy/putmask.hpp | 8 +- pythran/pythonic/numpy/rad2deg.hpp | 6 +- pythran/pythonic/numpy/random/binomial.hpp | 4 +- pythran/pythonic/numpy/random/chisquare.hpp | 4 +- pythran/pythonic/numpy/random/choice.hpp | 4 +- pythran/pythonic/numpy/random/dirichlet.hpp | 4 +- pythran/pythonic/numpy/random/exponential.hpp | 4 +- pythran/pythonic/numpy/random/f.hpp | 7 +- pythran/pythonic/numpy/random/gamma.hpp | 4 +- pythran/pythonic/numpy/random/geometric.hpp | 4 +- pythran/pythonic/numpy/random/gumbel.hpp | 4 +- pythran/pythonic/numpy/random/laplace.hpp | 4 +- pythran/pythonic/numpy/random/logistic.hpp | 4 +- pythran/pythonic/numpy/random/lognormal.hpp | 4 +- pythran/pythonic/numpy/random/logseries.hpp | 4 +- .../numpy/random/negative_binomial.hpp | 5 +- pythran/pythonic/numpy/random/normal.hpp | 4 +- pythran/pythonic/numpy/random/pareto.hpp | 4 +- pythran/pythonic/numpy/random/poisson.hpp | 4 +- pythran/pythonic/numpy/random/power.hpp | 4 +- pythran/pythonic/numpy/random/rand.hpp | 5 +- pythran/pythonic/numpy/random/randint.hpp | 8 +- pythran/pythonic/numpy/random/randn.hpp | 6 +- pythran/pythonic/numpy/random/random.hpp | 6 +- pythran/pythonic/numpy/random/rayleigh.hpp | 4 +- pythran/pythonic/numpy/random/shuffle.hpp | 6 +- .../numpy/random/standard_exponential.hpp | 4 +- .../pythonic/numpy/random/standard_gamma.hpp | 4 +- .../pythonic/numpy/random/standard_normal.hpp | 4 +- pythran/pythonic/numpy/random/uniform.hpp | 4 +- pythran/pythonic/numpy/random/weibull.hpp | 4 +- pythran/pythonic/numpy/ravel.hpp | 2 +- pythran/pythonic/numpy/real.hpp | 10 +- pythran/pythonic/numpy/reciprocal.hpp | 4 +- pythran/pythonic/numpy/reduce.hpp | 6 +- pythran/pythonic/numpy/remainder.hpp | 4 +- pythran/pythonic/numpy/repeat.hpp | 10 +- pythran/pythonic/numpy/resize.hpp | 2 +- pythran/pythonic/numpy/right_shift.hpp | 4 +- pythran/pythonic/numpy/rint.hpp | 6 +- pythran/pythonic/numpy/roll.hpp | 14 +- pythran/pythonic/numpy/rollaxis.hpp | 6 +- pythran/pythonic/numpy/rot90.hpp | 12 +- pythran/pythonic/numpy/searchsorted.hpp | 22 +- pythran/pythonic/numpy/select.hpp | 10 +- pythran/pythonic/numpy/shape.hpp | 4 +- pythran/pythonic/numpy/sin.hpp | 4 +- pythran/pythonic/numpy/sinh.hpp | 4 +- pythran/pythonic/numpy/size.hpp | 4 +- pythran/pythonic/numpy/sort.hpp | 8 +- pythran/pythonic/numpy/sort_complex.hpp | 2 +- pythran/pythonic/numpy/spacing.hpp | 4 +- pythran/pythonic/numpy/split.hpp | 12 +- pythran/pythonic/numpy/sqrt.hpp | 4 +- pythran/pythonic/numpy/square.hpp | 4 +- pythran/pythonic/numpy/stack.hpp | 33 +- pythran/pythonic/numpy/std_.hpp | 6 +- pythran/pythonic/numpy/subtract.hpp | 6 +- pythran/pythonic/numpy/swapaxes.hpp | 11 +- pythran/pythonic/numpy/take.hpp | 2 +- pythran/pythonic/numpy/tan.hpp | 4 +- pythran/pythonic/numpy/tanh.hpp | 4 +- pythran/pythonic/numpy/tile.hpp | 28 +- pythran/pythonic/numpy/trace.hpp | 2 +- pythran/pythonic/numpy/transpose.hpp | 30 +- pythran/pythonic/numpy/tri.hpp | 4 +- pythran/pythonic/numpy/tril.hpp | 4 +- pythran/pythonic/numpy/triu.hpp | 4 +- pythran/pythonic/numpy/true_divide.hpp | 6 +- pythran/pythonic/numpy/trunc.hpp | 4 +- pythran/pythonic/numpy/ufunc_accumulate.hpp | 6 +- pythran/pythonic/numpy/union1d.hpp | 6 +- pythran/pythonic/numpy/unravel_index.hpp | 15 +- pythran/pythonic/numpy/unwrap.hpp | 10 +- pythran/pythonic/numpy/var.hpp | 20 +- pythran/pythonic/numpy/vectorize.hpp | 7 +- pythran/pythonic/numpy/vstack.hpp | 13 +- pythran/pythonic/numpy/where.hpp | 8 +- pythran/pythonic/numpy/zeros_like.hpp | 8 +- pythran/pythonic/omp/get_num_threads.hpp | 4 +- pythran/pythonic/omp/get_thread_num.hpp | 4 +- pythran/pythonic/omp/get_wtick.hpp | 4 +- pythran/pythonic/omp/get_wtime.hpp | 4 +- pythran/pythonic/omp/in_parallel.hpp | 4 +- pythran/pythonic/omp/set_nested.hpp | 4 +- pythran/pythonic/omp/set_num_threads.hpp | 4 +- pythran/pythonic/operator_/__abs__.hpp | 2 +- pythran/pythonic/operator_/__xor__.hpp | 2 +- pythran/pythonic/operator_/abs.hpp | 2 +- pythran/pythonic/operator_/add.hpp | 9 +- pythran/pythonic/operator_/and_.hpp | 2 +- pythran/pythonic/operator_/concat.hpp | 2 +- pythran/pythonic/operator_/contains.hpp | 8 +- pythran/pythonic/operator_/countOf.hpp | 2 +- pythran/pythonic/operator_/delitem.hpp | 4 +- pythran/pythonic/operator_/getitem.hpp | 2 +- pythran/pythonic/operator_/iadd.hpp | 4 +- pythran/pythonic/operator_/icommon.hpp | 7 +- pythran/pythonic/operator_/iconcat.hpp | 6 +- pythran/pythonic/operator_/ifloordiv.hpp | 2 +- pythran/pythonic/operator_/imax.hpp | 22 +- pythran/pythonic/operator_/imin.hpp | 22 +- pythran/pythonic/operator_/imod.hpp | 2 +- pythran/pythonic/operator_/indexOf.hpp | 4 +- pythran/pythonic/operator_/invert.hpp | 2 +- pythran/pythonic/operator_/ipow.hpp | 4 +- pythran/pythonic/operator_/is_.hpp | 4 +- pythran/pythonic/operator_/is_not.hpp | 2 +- pythran/pythonic/operator_/itruediv.hpp | 18 +- pythran/pythonic/operator_/lshift.hpp | 4 +- pythran/pythonic/operator_/matmul.hpp | 4 +- pythran/pythonic/operator_/mod.hpp | 11 +- pythran/pythonic/operator_/neg.hpp | 2 +- pythran/pythonic/operator_/not_.hpp | 2 +- pythran/pythonic/operator_/or_.hpp | 2 +- pythran/pythonic/operator_/pos.hpp | 2 +- pythran/pythonic/operator_/pow.hpp | 2 +- pythran/pythonic/operator_/rshift.hpp | 6 +- pythran/pythonic/operator_/sub.hpp | 9 +- pythran/pythonic/operator_/truediv.hpp | 6 +- pythran/pythonic/operator_/xor_.hpp | 2 +- pythran/pythonic/random/shuffle.hpp | 6 +- pythran/pythonic/scipy/special/binom.hpp | 6 +- pythran/pythonic/scipy/special/chbevl.hpp | 4 +- pythran/pythonic/scipy/special/gamma.hpp | 4 +- .../pythonic/scipy/special/gammaincinv.hpp | 8 +- pythran/pythonic/scipy/special/gammaln.hpp | 4 +- pythran/pythonic/scipy/special/hankel1.hpp | 6 +- pythran/pythonic/scipy/special/hankel2.hpp | 8 +- pythran/pythonic/scipy/special/i0.hpp | 6 +- pythran/pythonic/scipy/special/i0e.hpp | 6 +- pythran/pythonic/scipy/special/iv.hpp | 6 +- pythran/pythonic/scipy/special/ivp.hpp | 6 +- pythran/pythonic/scipy/special/jv.hpp | 6 +- pythran/pythonic/scipy/special/jvp.hpp | 6 +- pythran/pythonic/scipy/special/kv.hpp | 6 +- pythran/pythonic/scipy/special/kvp.hpp | 6 +- pythran/pythonic/scipy/special/ndtr.hpp | 6 +- pythran/pythonic/scipy/special/ndtri.hpp | 6 +- .../pythonic/scipy/special/spherical_jn.hpp | 6 +- .../pythonic/scipy/special/spherical_yn.hpp | 6 +- pythran/pythonic/scipy/special/yv.hpp | 6 +- pythran/pythonic/scipy/special/yvp.hpp | 6 +- pythran/pythonic/string/find.hpp | 4 +- pythran/pythonic/time/sleep.hpp | 6 +- pythran/pythonic/time/time.hpp | 5 +- pythran/pythonic/types/bool.hpp | 12 +- pythran/pythonic/types/cfun.hpp | 5 +- pythran/pythonic/types/dynamic_tuple.hpp | 18 +- pythran/pythonic/types/file.hpp | 2 +- pythran/pythonic/types/finfo.hpp | 8 +- pythran/pythonic/types/generator.hpp | 17 +- pythran/pythonic/types/ndarray.hpp | 137 ++++--- pythran/pythonic/types/nditerator.hpp | 33 +- pythran/pythonic/types/numpy_broadcast.hpp | 2 +- pythran/pythonic/types/numpy_expr.hpp | 10 +- pythran/pythonic/types/numpy_gexpr.hpp | 12 +- pythran/pythonic/types/numpy_iexpr.hpp | 8 +- pythran/pythonic/types/numpy_nary_expr.hpp | 14 +- pythran/pythonic/types/numpy_operators.hpp | 18 +- pythran/pythonic/types/numpy_texpr.hpp | 24 +- pythran/pythonic/types/numpy_vexpr.hpp | 4 +- pythran/pythonic/types/pointer.hpp | 4 +- pythran/pythonic/types/str.hpp | 4 +- pythran/pythonic/types/tuple.hpp | 23 +- pythran/pythonic/types/variant_functor.hpp | 48 ++- pythran/pythonic/types/vectorizable_type.hpp | 32 +- pythran/pythonic/utils/allocate.hpp | 2 +- pythran/pythonic/utils/array_helper.hpp | 8 +- pythran/pythonic/utils/broadcast_copy.hpp | 16 +- pythran/pythonic/utils/fwd.hpp | 4 +- pythran/pythonic/utils/iterator.hpp | 16 +- pythran/pythonic/utils/nested_container.hpp | 13 +- pythran/pythonic/utils/neutral.hpp | 4 +- pythran/pythonic/utils/numpy_conversion.hpp | 4 +- pythran/pythonic/utils/pdqsort.hpp | 13 +- pythran/pythonic/utils/reserve.hpp | 2 +- 1139 files changed, 4363 insertions(+), 4110 deletions(-) diff --git a/pythran/pythonic/__dispatch__/conjugate.hpp b/pythran/pythonic/__dispatch__/conjugate.hpp index 0a21614138..90bb8be176 100644 --- a/pythran/pythonic/__dispatch__/conjugate.hpp +++ b/pythran/pythonic/__dispatch__/conjugate.hpp @@ -15,7 +15,7 @@ namespace __dispatch__ { return numpy::functor::conjugate{}(any); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/copy.hpp b/pythran/pythonic/__dispatch__/copy.hpp index 70e59d1f38..8eb42561fa 100644 --- a/pythran/pythonic/__dispatch__/copy.hpp +++ b/pythran/pythonic/__dispatch__/copy.hpp @@ -14,7 +14,7 @@ namespace __dispatch__ { return any.copy(); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/count.hpp b/pythran/pythonic/__dispatch__/count.hpp index 5d350f6106..cc566bea02 100644 --- a/pythran/pythonic/__dispatch__/count.hpp +++ b/pythran/pythonic/__dispatch__/count.hpp @@ -11,12 +11,12 @@ namespace __dispatch__ { template - auto count(Any &&any, Value &&value) - -> decltype(any.count(std::forward(value))) + auto count(Any &&any, + Value &&value) -> decltype(any.count(std::forward(value))) { return any.count(std::forward(value)); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/pop.hpp b/pythran/pythonic/__dispatch__/pop.hpp index 72c4aa474f..262c82d240 100644 --- a/pythran/pythonic/__dispatch__/pop.hpp +++ b/pythran/pythonic/__dispatch__/pop.hpp @@ -10,12 +10,12 @@ PYTHONIC_NS_BEGIN namespace __dispatch__ { template - auto pop(Any &&any, Arg0 &&... arg0) - -> decltype(any.pop(std::forward(arg0)...)) + auto pop(Any &&any, + Arg0 &&...arg0) -> decltype(any.pop(std::forward(arg0)...)) { return any.pop(std::forward(arg0)...); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/remove.hpp b/pythran/pythonic/__dispatch__/remove.hpp index 60493e3038..114b02f382 100644 --- a/pythran/pythonic/__dispatch__/remove.hpp +++ b/pythran/pythonic/__dispatch__/remove.hpp @@ -14,7 +14,7 @@ namespace __dispatch__ { return any.remove(arg0); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/sort.hpp b/pythran/pythonic/__dispatch__/sort.hpp index a49b8f8955..3bdc0cdccb 100644 --- a/pythran/pythonic/__dispatch__/sort.hpp +++ b/pythran/pythonic/__dispatch__/sort.hpp @@ -12,14 +12,14 @@ namespace __dispatch__ { template - auto sort(types::list &l, Args &&... args) + auto sort(types::list &l, Args &&...args) -> decltype(pythonic::builtins::list::sort(l, std::forward(args)...)) { return pythonic::builtins::list::sort(l, std::forward(args)...); } template - auto sort(types::list &&l, Args &&... args) + auto sort(types::list &&l, Args &&...args) -> decltype(pythonic::builtins::list::sort(std::move(l), std::forward(args)...)) { @@ -27,12 +27,12 @@ namespace __dispatch__ std::forward(args)...); } template - types::none_type sort(Any &&any, Args &&... args) + types::none_type sort(Any &&any, Args &&...args) { return pythonic::numpy::ndarray::sort(std::forward(any), std::forward(args)...); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/__dispatch__/update.hpp b/pythran/pythonic/__dispatch__/update.hpp index faae8c9a27..12f1acfbfe 100644 --- a/pythran/pythonic/__dispatch__/update.hpp +++ b/pythran/pythonic/__dispatch__/update.hpp @@ -11,12 +11,12 @@ namespace __dispatch__ { template - auto update(Any &&any, Arg0 &&... arg0) + auto update(Any &&any, Arg0 &&...arg0) -> decltype(any.update(std::forward(arg0)...)) { return any.update(std::forward(arg0)...); } -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/array/array.hpp b/pythran/pythonic/array/array.hpp index 29d728f4b7..a2fbc9bc25 100644 --- a/pythran/pythonic/array/array.hpp +++ b/pythran/pythonic/array/array.hpp @@ -12,15 +12,15 @@ namespace array { template - types::list::type> + types::array::type> array(std::integral_constant) { return {}; } template - types::list::type> - array(std::integral_constant, E&& elts) + types::array::type> + array(std::integral_constant, E &&elts) { return {std::forward(elts)}; } diff --git a/pythran/pythonic/bisect/bisect.hpp b/pythran/pythonic/bisect/bisect.hpp index 3efc50b943..84258fbe36 100644 --- a/pythran/pythonic/bisect/bisect.hpp +++ b/pythran/pythonic/bisect/bisect.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_BISECT_BISECT_HPP #define PYTHONIC_BISECT_BISECT_HPP -#include "pythonic/include/bisect/bisect.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/include/bisect/bisect.hpp" #include "pythonic/utils/functor.hpp" @@ -29,7 +29,7 @@ namespace bisect throw types::ValueError("lo must be non-negative"); return std::distance(x.begin(), fun(x.begin() + lo, x.begin() + hi, a)); } -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/bisect/bisect_left.hpp b/pythran/pythonic/bisect/bisect_left.hpp index 964c112663..00e7cf4ea4 100644 --- a/pythran/pythonic/bisect/bisect_left.hpp +++ b/pythran/pythonic/bisect/bisect_left.hpp @@ -24,7 +24,7 @@ namespace bisect return bisect(x, a, lo, hi, std::lower_bound); } -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/bisect/bisect_right.hpp b/pythran/pythonic/bisect/bisect_right.hpp index f82893d2fe..ac71177bd3 100644 --- a/pythran/pythonic/bisect/bisect_right.hpp +++ b/pythran/pythonic/bisect/bisect_right.hpp @@ -22,7 +22,7 @@ namespace bisect { return bisect(x, a, lo, hi); } -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/all.hpp b/pythran/pythonic/builtins/all.hpp index 6fb8383595..a77851e0da 100644 --- a/pythran/pythonic/builtins/all.hpp +++ b/pythran/pythonic/builtins/all.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_BUILTIN_ALL_HPP #define PYTHONIC_BUILTIN_ALL_HPP -#include "pythonic/utils/functor.hpp" #include "pythonic/include/builtins/all.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace builtins return false; return true; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/any.hpp b/pythran/pythonic/builtins/any.hpp index d74e5c2ae2..2246fcf22c 100644 --- a/pythran/pythonic/builtins/any.hpp +++ b/pythran/pythonic/builtins/any.hpp @@ -18,7 +18,7 @@ namespace builtins return true; return false; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/bin.hpp b/pythran/pythonic/builtins/bin.hpp index f102c79700..f53fbc4619 100644 --- a/pythran/pythonic/builtins/bin.hpp +++ b/pythran/pythonic/builtins/bin.hpp @@ -58,7 +58,7 @@ namespace builtins return res; } } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/bool_.hpp b/pythran/pythonic/builtins/bool_.hpp index 843b273cd6..c50889b659 100644 --- a/pythran/pythonic/builtins/bool_.hpp +++ b/pythran/pythonic/builtins/bool_.hpp @@ -26,7 +26,7 @@ namespace builtins } template - bool bool_::operator()(types::array const &val) const + bool bool_::operator()(types::array_tuple const &val) const { return N; } diff --git a/pythran/pythonic/builtins/chr.hpp b/pythran/pythonic/builtins/chr.hpp index 3984cb549a..0f216d2b94 100644 --- a/pythran/pythonic/builtins/chr.hpp +++ b/pythran/pythonic/builtins/chr.hpp @@ -15,7 +15,7 @@ namespace builtins { return types::str((char)v); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict.hpp b/pythran/pythonic/builtins/dict.hpp index f6dc308085..6b54af3328 100644 --- a/pythran/pythonic/builtins/dict.hpp +++ b/pythran/pythonic/builtins/dict.hpp @@ -28,9 +28,10 @@ namespace builtins } template - auto dict(Iterable &&iterable) -> types::dict< - typename std::decay(*iterable.begin()))>::type, - typename std::decay(*iterable.begin()))>::type> + auto dict(Iterable &&iterable) + -> types::dict< + typename std::decay(*iterable.begin()))>::type, + typename std::decay(*iterable.begin()))>::type> { types::dict< typename std::decay(*iterable.begin()))>::type, diff --git a/pythran/pythonic/builtins/dict/clear.hpp b/pythran/pythonic/builtins/dict/clear.hpp index 7efdba9135..cd59ba3311 100644 --- a/pythran/pythonic/builtins/dict/clear.hpp +++ b/pythran/pythonic/builtins/dict/clear.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_DICT_CLEAR_HPP #define PYTHONIC_BUILTIN_DICT_CLEAR_HPP -#include "pythonic/include/builtins/dict/clear.hpp" #include "pythonic/__dispatch__/clear.hpp" +#include "pythonic/include/builtins/dict/clear.hpp" #endif diff --git a/pythran/pythonic/builtins/dict/copy.hpp b/pythran/pythonic/builtins/dict/copy.hpp index 06fcbb767d..3cd0d80061 100644 --- a/pythran/pythonic/builtins/dict/copy.hpp +++ b/pythran/pythonic/builtins/dict/copy.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_DICT_COPY_HPP #define PYTHONIC_BUILTIN_DICT_COPY_HPP -#include "pythonic/include/builtins/dict/copy.hpp" #include "pythonic/__dispatch__/copy.hpp" +#include "pythonic/include/builtins/dict/copy.hpp" #endif diff --git a/pythran/pythonic/builtins/dict/fromkeys.hpp b/pythran/pythonic/builtins/dict/fromkeys.hpp index 2fb83b6e8e..3cfbcfb9ce 100644 --- a/pythran/pythonic/builtins/dict/fromkeys.hpp +++ b/pythran/pythonic/builtins/dict/fromkeys.hpp @@ -21,14 +21,14 @@ namespace builtins fromkeys(Iterable &&iter, V const &v) { types::dict::type::value_type, - V> D = - types::empty_dict(); // Allocate default capacity to dict + V> + D = types::empty_dict(); // Allocate default capacity to dict for (auto const &i : iter) D[i] = v; return D; } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/get.hpp b/pythran/pythonic/builtins/dict/get.hpp index bcb0f587a0..f88f6f31cc 100644 --- a/pythran/pythonic/builtins/dict/get.hpp +++ b/pythran/pythonic/builtins/dict/get.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/dict/get.hpp" -#include "pythonic/types/dict.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/dict.hpp" #include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -32,8 +32,8 @@ namespace builtins { return default_; } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/items.hpp b/pythran/pythonic/builtins/dict/items.hpp index 5bbd6ced2f..dc0a5537a7 100644 --- a/pythran/pythonic/builtins/dict/items.hpp +++ b/pythran/pythonic/builtins/dict/items.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/builtins/dict/items.hpp" -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/dict.hpp" #include "pythonic/include/types/list.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -22,8 +22,8 @@ namespace builtins { return std::forward(d).items(); } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/keys.hpp b/pythran/pythonic/builtins/dict/keys.hpp index d4dfa271d7..2f7563373f 100644 --- a/pythran/pythonic/builtins/dict/keys.hpp +++ b/pythran/pythonic/builtins/dict/keys.hpp @@ -23,8 +23,8 @@ namespace builtins { return std::forward(d).keys(); } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/pop.hpp b/pythran/pythonic/builtins/dict/pop.hpp index a22e470576..7e47d6bbae 100644 --- a/pythran/pythonic/builtins/dict/pop.hpp +++ b/pythran/pythonic/builtins/dict/pop.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_DICT_POP_HPP #define PYTHONIC_BUILTIN_DICT_POP_HPP -#include "pythonic/include/builtins/dict/pop.hpp" #include "pythonic/__dispatch__/pop.hpp" +#include "pythonic/include/builtins/dict/pop.hpp" #endif diff --git a/pythran/pythonic/builtins/dict/popitem.hpp b/pythran/pythonic/builtins/dict/popitem.hpp index e0369befca..4c3dd6e290 100644 --- a/pythran/pythonic/builtins/dict/popitem.hpp +++ b/pythran/pythonic/builtins/dict/popitem.hpp @@ -21,8 +21,8 @@ namespace builtins { return std::forward(d).popitem(); } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/setdefault.hpp b/pythran/pythonic/builtins/dict/setdefault.hpp index 3f1079897a..1fd1dbeb98 100644 --- a/pythran/pythonic/builtins/dict/setdefault.hpp +++ b/pythran/pythonic/builtins/dict/setdefault.hpp @@ -37,8 +37,8 @@ namespace builtins { return d.get(k); } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/dict/update.hpp b/pythran/pythonic/builtins/dict/update.hpp index ffda356efd..21d27c4e4f 100644 --- a/pythran/pythonic/builtins/dict/update.hpp +++ b/pythran/pythonic/builtins/dict/update.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_DICT_UPDATE_HPP #define PYTHONIC_BUILTIN_DICT_UPDATE_HPP -#include "pythonic/include/builtins/dict/update.hpp" #include "pythonic/__dispatch__/update.hpp" +#include "pythonic/include/builtins/dict/update.hpp" #endif diff --git a/pythran/pythonic/builtins/dict/values.hpp b/pythran/pythonic/builtins/dict/values.hpp index 69fd137d3d..cff17f8e21 100644 --- a/pythran/pythonic/builtins/dict/values.hpp +++ b/pythran/pythonic/builtins/dict/values.hpp @@ -19,8 +19,8 @@ namespace builtins { return std::forward(d).values(); } - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/divmod.hpp b/pythran/pythonic/builtins/divmod.hpp index 8227d53915..5f2a22fd1a 100644 --- a/pythran/pythonic/builtins/divmod.hpp +++ b/pythran/pythonic/builtins/divmod.hpp @@ -17,7 +17,7 @@ namespace builtins { return types::make_tuple(t0 / t1, t0 % t1); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/enumerate.hpp b/pythran/pythonic/builtins/enumerate.hpp index 06ed891845..faab84a455 100644 --- a/pythran/pythonic/builtins/enumerate.hpp +++ b/pythran/pythonic/builtins/enumerate.hpp @@ -29,8 +29,8 @@ namespace builtins } template - enumerate_iterator &enumerate_iterator:: - operator+=(long n) + enumerate_iterator & + enumerate_iterator::operator+=(long n) { value += n, iter += n; return *this; @@ -42,29 +42,29 @@ namespace builtins // TODO : We could handle case with && without size if there is a // performances benefits template - bool enumerate_iterator:: - operator!=(enumerate_iterator const &other) const + bool enumerate_iterator::operator!=( + enumerate_iterator const &other) const { return !(*this == other); } template - bool enumerate_iterator:: - operator<(enumerate_iterator const &other) const + bool enumerate_iterator::operator<( + enumerate_iterator const &other) const { return iter < other.iter; } template - bool enumerate_iterator:: - operator==(enumerate_iterator const &other) const + bool enumerate_iterator::operator==( + enumerate_iterator const &other) const { return iter == other.iter; } template - long enumerate_iterator:: - operator-(enumerate_iterator const &other) const + long enumerate_iterator::operator-( + enumerate_iterator const &other) const { return iter - other.iter; } @@ -100,7 +100,7 @@ namespace builtins { return end_iter; } - } + } // namespace details /// enumerate implementation @@ -111,7 +111,7 @@ namespace builtins { return {std::forward(seq), first}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file.hpp b/pythran/pythonic/builtins/file.hpp index fef17cbc15..c79388552e 100644 --- a/pythran/pythonic/builtins/file.hpp +++ b/pythran/pythonic/builtins/file.hpp @@ -18,8 +18,8 @@ namespace builtins { return {filename, strmode}; } - } -} + } // namespace anonymous +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file/fileno.hpp b/pythran/pythonic/builtins/file/fileno.hpp index b167d3ade2..83c7f4305b 100644 --- a/pythran/pythonic/builtins/file/fileno.hpp +++ b/pythran/pythonic/builtins/file/fileno.hpp @@ -18,7 +18,7 @@ namespace builtins { return f.fileno(); } - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file/isatty.hpp b/pythran/pythonic/builtins/file/isatty.hpp index b8e0216003..e9245ffab8 100644 --- a/pythran/pythonic/builtins/file/isatty.hpp +++ b/pythran/pythonic/builtins/file/isatty.hpp @@ -18,7 +18,7 @@ namespace builtins { return f.isatty(); } - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file/next.hpp b/pythran/pythonic/builtins/file/next.hpp index f1ae5fbafe..e41223e31c 100644 --- a/pythran/pythonic/builtins/file/next.hpp +++ b/pythran/pythonic/builtins/file/next.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_FILE_NEXT_HPP #define PYTHONIC_BUILTIN_FILE_NEXT_HPP -#include "pythonic/include/builtins/file/next.hpp" #include "pythonic/__dispatch__/next.hpp" +#include "pythonic/include/builtins/file/next.hpp" #endif diff --git a/pythran/pythonic/builtins/file/readlines.hpp b/pythran/pythonic/builtins/file/readlines.hpp index 5bea169b08..fa31688715 100644 --- a/pythran/pythonic/builtins/file/readlines.hpp +++ b/pythran/pythonic/builtins/file/readlines.hpp @@ -27,7 +27,7 @@ namespace builtins { return f.readlines(sizehint); } - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file/tell.hpp b/pythran/pythonic/builtins/file/tell.hpp index dc5fbabe21..6e645839b8 100644 --- a/pythran/pythonic/builtins/file/tell.hpp +++ b/pythran/pythonic/builtins/file/tell.hpp @@ -18,7 +18,7 @@ namespace builtins { return f.tell(); } - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/file/writelines.hpp b/pythran/pythonic/builtins/file/writelines.hpp index 6859de2d44..bc6ffb2065 100644 --- a/pythran/pythonic/builtins/file/writelines.hpp +++ b/pythran/pythonic/builtins/file/writelines.hpp @@ -19,7 +19,7 @@ namespace builtins { f.writelines(sequence); } - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/float_/is_integer.hpp b/pythran/pythonic/builtins/float_/is_integer.hpp index 5ffccf8383..491acf02cf 100644 --- a/pythran/pythonic/builtins/float_/is_integer.hpp +++ b/pythran/pythonic/builtins/float_/is_integer.hpp @@ -19,8 +19,8 @@ namespace builtins { return std::trunc(d) == d; } - } -} + } // namespace float_ +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/hex.hpp b/pythran/pythonic/builtins/hex.hpp index 3ab0221f0b..ccdbc09063 100644 --- a/pythran/pythonic/builtins/hex.hpp +++ b/pythran/pythonic/builtins/hex.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/hex.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -20,7 +20,7 @@ namespace builtins oss << "0x" << std::hex << v; return oss.str(); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/in.hpp b/pythran/pythonic/builtins/in.hpp index 69623a8dd0..a4f57ee1fa 100644 --- a/pythran/pythonic/builtins/in.hpp +++ b/pythran/pythonic/builtins/in.hpp @@ -30,7 +30,7 @@ namespace details { return t.contains(v); } -} +} // namespace details template bool in(T &&t, V const &v) diff --git a/pythran/pythonic/builtins/iter.hpp b/pythran/pythonic/builtins/iter.hpp index dc54d242a5..b2c155c136 100644 --- a/pythran/pythonic/builtins/iter.hpp +++ b/pythran/pythonic/builtins/iter.hpp @@ -22,8 +22,7 @@ namespace builtins // FIXME : There is a dangling reference as data.begin() is ! the one // from data "saved" in the "iter" struct template - iter::iter(T data) - : iterator(data.begin()), _end(data.end()), data(data) + iter::iter(T data) : iterator(data.begin()), _end(data.end()), data(data) { } @@ -44,7 +43,7 @@ namespace builtins { return _end; } - } + } // namespace details /// iter implementation @@ -55,7 +54,7 @@ namespace builtins { return {std::forward(t)}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/len.hpp b/pythran/pythonic/builtins/len.hpp index 703db0dd98..2c4e4f4449 100644 --- a/pythran/pythonic/builtins/len.hpp +++ b/pythran/pythonic/builtins/len.hpp @@ -6,8 +6,8 @@ #include "pythonic/types/traits.hpp" #include "pythonic/utils/functor.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -24,6 +24,6 @@ namespace builtins { return t.size(); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list.hpp b/pythran/pythonic/builtins/list.hpp index 9c793954b3..95d065d6f9 100644 --- a/pythran/pythonic/builtins/list.hpp +++ b/pythran/pythonic/builtins/list.hpp @@ -38,8 +38,8 @@ namespace builtins Iterable>::type::iterator>::value_type>::type>(t.begin(), t.end()); } - } -} + } // namespace anonymous +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list/append.hpp b/pythran/pythonic/builtins/list/append.hpp index a9d89b544f..804fc11f93 100644 --- a/pythran/pythonic/builtins/list/append.hpp +++ b/pythran/pythonic/builtins/list/append.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/builtins/list/append.hpp" #include "pythonic/builtins/None.hpp" -#include "pythonic/types/list.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/list.hpp" #include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -28,7 +28,7 @@ namespace builtins seq.push_back(std::forward(value)); return builtins::None; } - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list/count.hpp b/pythran/pythonic/builtins/list/count.hpp index e43223ea9d..d986a9fbdc 100644 --- a/pythran/pythonic/builtins/list/count.hpp +++ b/pythran/pythonic/builtins/list/count.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_LIST_COUNT_HPP #define PYTHONIC_BUILTIN_LIST_COUNT_HPP -#include "pythonic/include/builtins/list/count.hpp" #include "pythonic/__dispatch__/count.hpp" +#include "pythonic/include/builtins/list/count.hpp" #endif diff --git a/pythran/pythonic/builtins/list/extend.hpp b/pythran/pythonic/builtins/list/extend.hpp index 273f4cf80a..e1321d79ff 100644 --- a/pythran/pythonic/builtins/list/extend.hpp +++ b/pythran/pythonic/builtins/list/extend.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/builtins/list/extend.hpp" #include "pythonic/builtins/None.hpp" -#include "pythonic/types/list.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/list.hpp" #include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -33,7 +33,7 @@ namespace builtins { return {}; } - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list/insert.hpp b/pythran/pythonic/builtins/list/insert.hpp index 123a017884..452336831d 100644 --- a/pythran/pythonic/builtins/list/insert.hpp +++ b/pythran/pythonic/builtins/list/insert.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/builtins/list/insert.hpp" #include "pythonic/builtins/None.hpp" -#include "pythonic/types/list.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/list.hpp" #include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -27,7 +27,7 @@ namespace builtins seq.insert(n, std::forward(value)); return builtins::None; } - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list/pop.hpp b/pythran/pythonic/builtins/list/pop.hpp index 37cd6fecb9..efbf13994e 100644 --- a/pythran/pythonic/builtins/list/pop.hpp +++ b/pythran/pythonic/builtins/list/pop.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_LIST_POP_HPP #define PYTHONIC_BUILTIN_LIST_POP_HPP -#include "pythonic/include/builtins/list/pop.hpp" #include "pythonic/__dispatch__/pop.hpp" +#include "pythonic/include/builtins/list/pop.hpp" #endif diff --git a/pythran/pythonic/builtins/list/remove.hpp b/pythran/pythonic/builtins/list/remove.hpp index 1d65547065..b7202068bc 100644 --- a/pythran/pythonic/builtins/list/remove.hpp +++ b/pythran/pythonic/builtins/list/remove.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_LIST_REMOVE_HPP #define PYTHONIC_BUILTIN_LIST_REMOVE_HPP -#include "pythonic/include/builtins/list/remove.hpp" #include "pythonic/__dispatch__/remove.hpp" +#include "pythonic/include/builtins/list/remove.hpp" #endif diff --git a/pythran/pythonic/builtins/list/reverse.hpp b/pythran/pythonic/builtins/list/reverse.hpp index 2948d3f24b..a292d22a96 100644 --- a/pythran/pythonic/builtins/list/reverse.hpp +++ b/pythran/pythonic/builtins/list/reverse.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/builtins/list/reverse.hpp" #include "pythonic/builtins/None.hpp" -#include "pythonic/types/list.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/list.hpp" #include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace builtins std::reverse(seq.begin(), seq.end()); return builtins::None; } - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/list/sort.hpp b/pythran/pythonic/builtins/list/sort.hpp index 365de6505d..913b87d4f9 100644 --- a/pythran/pythonic/builtins/list/sort.hpp +++ b/pythran/pythonic/builtins/list/sort.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/builtins/list/sort.hpp" #include "pythonic/builtins/None.hpp" -#include "pythonic/types/list.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/types/list.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/pdqsort.hpp" @@ -32,7 +32,7 @@ namespace builtins }); return builtins::None; } - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/map.hpp b/pythran/pythonic/builtins/map.hpp index fde24f3d3a..ac6eb0354a 100644 --- a/pythran/pythonic/builtins/map.hpp +++ b/pythran/pythonic/builtins/map.hpp @@ -5,10 +5,10 @@ #include "pythonic/itertools/common.hpp" #include "pythonic/types/tuple.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/fwd.hpp" #include "pythonic/utils/int_.hpp" #include "pythonic/utils/iterator.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/utils/seq.hpp" #include @@ -44,8 +44,8 @@ namespace builtins template template typename map_res::type - map_iterator::get_value(utils::index_sequence, - std::false_type) const + map_iterator::get_value(utils::index_sequence, + std::false_type) const { return _op(*std::get(it)...); } @@ -53,16 +53,15 @@ namespace builtins template template typename map_res::type - map_iterator::get_value(utils::index_sequence, - std::true_type) const + map_iterator::get_value(utils::index_sequence, + std::true_type) const { return types::make_tuple(*std::get(it)...); } template typename map_res::type - map_iterator:: - operator*() const + map_iterator::operator*() const { return get_value(utils::make_index_sequence{}, std::is_same()); @@ -76,8 +75,8 @@ namespace builtins } template - map_iterator &map_iterator:: - operator++() + map_iterator & + map_iterator::operator++() { next(utils::make_index_sequence{}); return *this; @@ -98,16 +97,16 @@ namespace builtins } template - map_iterator &map_iterator:: - operator+=(long i) + map_iterator & + map_iterator::operator+=(long i) { - advance(i, utils::int_()); + advance(i, utils::int_()); return *this; } template - map_iterator map_iterator:: - operator+(long i) const + map_iterator + map_iterator::operator+(long i) const { map_iterator other(*this); other += i; @@ -131,22 +130,22 @@ namespace builtins } template - bool map_iterator:: - operator==(map_iterator const &other) const + bool map_iterator::operator==( + map_iterator const &other) const { - return equal(other, utils::int_()); + return equal(other, utils::int_()); } template - bool map_iterator:: - operator!=(map_iterator const &other) const + bool map_iterator::operator!=( + map_iterator const &other) const { return !(*this == other); } template - bool map_iterator:: - operator<(map_iterator const &other) const + bool map_iterator::operator<( + map_iterator const &other) const { return !(*this == other); } @@ -168,15 +167,15 @@ namespace builtins } template - long map_iterator:: - operator-(map_iterator const &other) const + long map_iterator::operator-( + map_iterator const &other) const { - return min_len(other, utils::int_()); + return min_len(other, utils::int_()); } template template - map::map(Operator const &_op, Types &&... _iters) + map::map(Operator const &_op, Types &&..._iters) : utils::iterator_reminder( std::forward(_iters)...), map_iterator( @@ -206,18 +205,19 @@ namespace builtins { return end_iter; } - } + } // namespace details template - auto map(Operator &&_op, Iter &&... iters) -> details::map< - typename std::remove_cv< - typename std::remove_reference::type>::type, - typename types::iterator::type>::type>::type...> + auto map(Operator &&_op, Iter &&...iters) + -> details::map< + typename std::remove_cv< + typename std::remove_reference::type>::type, + typename types::iterator::type>::type>::type...> { return {std::forward(_op), std::forward(iters)...}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/max.hpp b/pythran/pythonic/builtins/max.hpp index 48514877f5..aeb9eb7970 100644 --- a/pythran/pythonic/builtins/max.hpp +++ b/pythran/pythonic/builtins/max.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_BUILTIN_MAX_HPP #define PYTHONIC_BUILTIN_MAX_HPP -#include "pythonic/include/builtins/max.hpp" #include "pythonic/builtins/minmax.hpp" +#include "pythonic/include/builtins/max.hpp" #include "pythonic/operator_/lt.hpp" #include "pythonic/utils/functor.hpp" @@ -13,14 +13,14 @@ namespace builtins { template - auto max(Types &&... values) + auto max(Types &&...values) -> decltype(details::minmax(operator_::functor::lt{}, std::forward(values)...)) { return details::minmax(operator_::functor::lt{}, std::forward(values)...); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/min.hpp b/pythran/pythonic/builtins/min.hpp index 1b41376489..915a711ce8 100644 --- a/pythran/pythonic/builtins/min.hpp +++ b/pythran/pythonic/builtins/min.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_BUILTIN_MIN_HPP #define PYTHONIC_BUILTIN_MIN_HPP -#include "pythonic/include/builtins/min.hpp" #include "pythonic/builtins/minmax.hpp" +#include "pythonic/include/builtins/min.hpp" #include "pythonic/operator_/gt.hpp" #include "pythonic/utils/functor.hpp" @@ -13,14 +13,14 @@ namespace builtins { template - auto min(Types &&... values) + auto min(Types &&...values) -> decltype(details::minmax(operator_::functor::gt{}, std::forward(values)...)) { return details::minmax(operator_::functor::gt{}, std::forward(values)...); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/minmax.hpp b/pythran/pythonic/builtins/minmax.hpp index d580b69715..f74a25cdeb 100644 --- a/pythran/pythonic/builtins/minmax.hpp +++ b/pythran/pythonic/builtins/minmax.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/minmax.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -25,16 +25,16 @@ namespace builtins { using value_type = decltype(*t.begin()); return *std::max_element( - t.begin(), t.end(), - [op, key](value_type const &self, value_type const &other) { - return op(key(self), key(other)); - }); + t.begin(), t.end(), + [op, key](value_type const &self, value_type const &other) { + return op(key(self), key(other)); + }); } template typename std::enable_if::value, typename __combined::type>::type - minmax(Op const &op, T0 const &t0, T1 const &t1, Types const &... ts) + minmax(Op const &op, T0 const &t0, T1 const &t1, Types const &...ts) { using value_type = typename __combined::type; std::initializer_list values = { @@ -42,8 +42,8 @@ namespace builtins static_cast(ts)...}; return minmax(op, values); } - } -} + } // namespace details +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/next.hpp b/pythran/pythonic/builtins/next.hpp index afecc8b2d5..e9ef292321 100644 --- a/pythran/pythonic/builtins/next.hpp +++ b/pythran/pythonic/builtins/next.hpp @@ -23,7 +23,7 @@ namespace builtins } else throw types::StopIteration(); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/oct.hpp b/pythran/pythonic/builtins/oct.hpp index ec4e483429..9150c79063 100644 --- a/pythran/pythonic/builtins/oct.hpp +++ b/pythran/pythonic/builtins/oct.hpp @@ -26,7 +26,7 @@ namespace builtins << std::oct << v; return oss.str(); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/open.hpp b/pythran/pythonic/builtins/open.hpp index 6128c3a36c..adbeaa1b45 100644 --- a/pythran/pythonic/builtins/open.hpp +++ b/pythran/pythonic/builtins/open.hpp @@ -16,7 +16,7 @@ namespace builtins { return {filename, strmode}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/ord.hpp b/pythran/pythonic/builtins/ord.hpp index 07a362bf3c..07f941c7f3 100644 --- a/pythran/pythonic/builtins/ord.hpp +++ b/pythran/pythonic/builtins/ord.hpp @@ -20,7 +20,7 @@ namespace builtins std::to_string(v.size()) + " found"); return (long)v.chars()[0]; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp b/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp index 5086bd6d10..cb0715c02d 100644 --- a/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp +++ b/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_BUILTIN_PYTHRAN_STATICIFBREAK_HPP #include "pythonic/include/builtins/pythran/StaticIfBreak.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/static_if.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins { return {arg}; } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/StaticIfCont.hpp b/pythran/pythonic/builtins/pythran/StaticIfCont.hpp index 12b144b7c0..eb53537bd5 100644 --- a/pythran/pythonic/builtins/pythran/StaticIfCont.hpp +++ b/pythran/pythonic/builtins/pythran/StaticIfCont.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_BUILTIN_PYTHRAN_STATICIFCONT_HPP #include "pythonic/include/builtins/pythran/StaticIfCont.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/static_if.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins { return {arg}; } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp b/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp index d7bb508b99..713e9d99a9 100644 --- a/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp +++ b/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_BUILTIN_PYTHRAN_STATICIFNORETURN_HPP #include "pythonic/include/builtins/pythran/StaticIfNoReturn.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/static_if.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins { return {arg}; } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp b/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp index b0dd350d0b..4a2a194bf1 100644 --- a/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp +++ b/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_BUILTIN_PYTHRAN_STATICIFRETURN_HPP #include "pythonic/include/builtins/pythran/StaticIfReturn.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/static_if.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins { return {arg}; } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/abssqr.hpp b/pythran/pythonic/builtins/pythran/abssqr.hpp index f400910c4e..90375172fb 100644 --- a/pythran/pythonic/builtins/pythran/abssqr.hpp +++ b/pythran/pythonic/builtins/pythran/abssqr.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/builtins/pythran/abssqr.hpp" +#include "pythonic/types/numpy_op_helper.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/meta.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -29,13 +29,13 @@ namespace builtins { return v.real() * v.real() + v.imag() * v.imag(); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME abssqr #define NUMPY_NARY_FUNC_SYM details::abssqr #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/and_.hpp b/pythran/pythonic/builtins/pythran/and_.hpp index 90375ad4e2..193c2d2a62 100644 --- a/pythran/pythonic/builtins/pythran/and_.hpp +++ b/pythran/pythonic/builtins/pythran/and_.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/pythran/and_.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/combined.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -23,8 +23,8 @@ namespace builtins else return (types::lazy_combined_t)val0; } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/is_none.hpp b/pythran/pythonic/builtins/pythran/is_none.hpp index 084170ff62..83a42d9c24 100644 --- a/pythran/pythonic/builtins/pythran/is_none.hpp +++ b/pythran/pythonic/builtins/pythran/is_none.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_BUILTIN_PYTHRAN_IS_NONE_HPP #include "pythonic/include/builtins/pythran/is_none.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace builtins namespace pythran { } -} +} // namespace builtins PYTHONIC_NS_END diff --git a/pythran/pythonic/builtins/pythran/len_set.hpp b/pythran/pythonic/builtins/pythran/len_set.hpp index 6b24e17e50..03b9f8fbd8 100644 --- a/pythran/pythonic/builtins/pythran/len_set.hpp +++ b/pythran/pythonic/builtins/pythran/len_set.hpp @@ -19,10 +19,11 @@ namespace builtins long len_set(Iterable const &s) { return std::set::value_type>(s.begin(), s.end()).size(); + typename Iterable::iterator>::value_type>(s.begin(), s.end()) + .size(); } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/make_shape.hpp b/pythran/pythonic/builtins/pythran/make_shape.hpp index 13db44f138..d3cdd871e8 100644 --- a/pythran/pythonic/builtins/pythran/make_shape.hpp +++ b/pythran/pythonic/builtins/pythran/make_shape.hpp @@ -12,8 +12,8 @@ namespace builtins { return {args...}; } - } // pythran -} // builtins + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/or_.hpp b/pythran/pythonic/builtins/pythran/or_.hpp index 08cbeda546..8fc97fa5a9 100644 --- a/pythran/pythonic/builtins/pythran/or_.hpp +++ b/pythran/pythonic/builtins/pythran/or_.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/pythran/or_.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/combined.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -23,8 +23,8 @@ namespace builtins else return (types::lazy_combined_t)std::forward(v1)(); } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/static_if.hpp b/pythran/pythonic/builtins/pythran/static_if.hpp index cd7e395b84..8e6c975cae 100644 --- a/pythran/pythonic/builtins/pythran/static_if.hpp +++ b/pythran/pythonic/builtins/pythran/static_if.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_BUILTIN_PYTHRAN_STATIC_IF_HPP #define PYTHONIC_BUILTIN_PYTHRAN_STATIC_IF_HPP +#include "pythonic/builtins/pythran/is_none.hpp" #include "pythonic/include/builtins/pythran/static_if.hpp" #include "pythonic/utils/functor.hpp" -#include "pythonic/builtins/pythran/is_none.hpp" PYTHONIC_NS_BEGIN @@ -14,13 +14,13 @@ namespace builtins { template - auto static_if(T const &cond, F0 f0, F1 f1) - -> decltype(details::static_if{cond}(f0, f1)) + auto static_if(T const &cond, F0 f0, + F1 f1) -> decltype(details::static_if{cond}(f0, f1)) { return details::static_if{cond}(f0, f1); } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/pythran/static_list.hpp b/pythran/pythonic/builtins/pythran/static_list.hpp index ee84ae35fc..adf15e8635 100644 --- a/pythran/pythonic/builtins/pythran/static_list.hpp +++ b/pythran/pythonic/builtins/pythran/static_list.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_BUILTIN_PYTHRAN_STATIC_LIST_HPP #define PYTHONIC_BUILTIN_PYTHRAN_STATIC_LIST_HPP -#include "pythonic/include/builtins/pythran/static_list.hpp" #include "pythonic/builtins/list.hpp" +#include "pythonic/include/builtins/pythran/static_list.hpp" #include "pythonic/types/tuple.hpp" #include "pythonic/utils/functor.hpp" @@ -14,17 +14,17 @@ namespace builtins namespace pythran { template - types::static_list static_list(types::array const &other) + types::static_list static_list(types::array_tuple const &other) { return other.template to_array(); } template - types::static_list static_list(types::array &other) + types::static_list static_list(types::array_tuple &other) { return other.template to_array(); } template - types::static_list static_list(types::array &&other) + types::static_list static_list(types::array_tuple &&other) { return other.template to_array(); } @@ -35,8 +35,8 @@ namespace builtins { return pythonic::builtins::functor::list{}(std::forward(other)); } - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/reduce.hpp b/pythran/pythonic/builtins/reduce.hpp index e2fb2569a9..068dc42fbc 100644 --- a/pythran/pythonic/builtins/reduce.hpp +++ b/pythran/pythonic/builtins/reduce.hpp @@ -40,7 +40,7 @@ namespace builtins s.begin(), s.end(), static_cast>(init), op); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/reversed.hpp b/pythran/pythonic/builtins/reversed.hpp index 954dd8bb81..f765c3ac39 100644 --- a/pythran/pythonic/builtins/reversed.hpp +++ b/pythran/pythonic/builtins/reversed.hpp @@ -18,8 +18,7 @@ namespace builtins } template - reversed::reversed(Iterable const &iterable) - : iterable(iterable) + reversed::reversed(Iterable const &iterable) : iterable(iterable) { } @@ -47,14 +46,14 @@ namespace builtins { return iterable.rend(); } - } + } // namespace details template details::reversed reversed(Iterable const &iterable) { return {iterable}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/round.hpp b/pythran/pythonic/builtins/round.hpp index f9618f77af..4089ca084e 100644 --- a/pythran/pythonic/builtins/round.hpp +++ b/pythran/pythonic/builtins/round.hpp @@ -25,7 +25,7 @@ namespace builtins { return std::lround(v); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set.hpp b/pythran/pythonic/builtins/set.hpp index 337f4592e3..736c732aba 100644 --- a/pythran/pythonic/builtins/set.hpp +++ b/pythran/pythonic/builtins/set.hpp @@ -26,7 +26,7 @@ namespace builtins { return {t.begin(), t.end()}; } - } -} + } // namespace anonymous +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/add.hpp b/pythran/pythonic/builtins/set/add.hpp index 329536687c..6ea8f0d73f 100644 --- a/pythran/pythonic/builtins/set/add.hpp +++ b/pythran/pythonic/builtins/set/add.hpp @@ -29,7 +29,7 @@ namespace builtins s.add(value); return builtins::None; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/clear.hpp b/pythran/pythonic/builtins/set/clear.hpp index d855c9c844..cb7020ac63 100644 --- a/pythran/pythonic/builtins/set/clear.hpp +++ b/pythran/pythonic/builtins/set/clear.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_SET_CLEAR_HPP #define PYTHONIC_BUILTIN_SET_CLEAR_HPP -#include "pythonic/include/builtins/set/clear.hpp" #include "pythonic/__dispatch__/clear.hpp" +#include "pythonic/include/builtins/set/clear.hpp" #endif diff --git a/pythran/pythonic/builtins/set/copy.hpp b/pythran/pythonic/builtins/set/copy.hpp index dc309baaa7..7996dc5440 100644 --- a/pythran/pythonic/builtins/set/copy.hpp +++ b/pythran/pythonic/builtins/set/copy.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_SET_COPY_HPP #define PYTHONIC_BUILTIN_SET_COPY_HPP -#include "pythonic/include/builtins/set/copy.hpp" #include "pythonic/__dispatch__/copy.hpp" +#include "pythonic/include/builtins/set/copy.hpp" #endif diff --git a/pythran/pythonic/builtins/set/difference_update.hpp b/pythran/pythonic/builtins/set/difference_update.hpp index 29d1800082..9de4f8a14d 100644 --- a/pythran/pythonic/builtins/set/difference_update.hpp +++ b/pythran/pythonic/builtins/set/difference_update.hpp @@ -16,7 +16,7 @@ namespace builtins template types::none_type difference_update(types::set &set, - Types const &... others) + Types const &...others) { set.difference_update(others...); return {}; @@ -24,7 +24,7 @@ namespace builtins template types::none_type difference_update(types::set &&set, - Types const &... others) + Types const &...others) { // nothing to be done as we work on rvalue return {}; @@ -32,12 +32,12 @@ namespace builtins template types::none_type difference_update(types::empty_set const &set, - Types const &... others) + Types const &...others) { // nothing can be removed in set return {}; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/discard.hpp b/pythran/pythonic/builtins/set/discard.hpp index 8219da30af..82210c22f6 100644 --- a/pythran/pythonic/builtins/set/discard.hpp +++ b/pythran/pythonic/builtins/set/discard.hpp @@ -30,7 +30,7 @@ namespace builtins { // nothing to remove in an empty_set } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/intersection.hpp b/pythran/pythonic/builtins/set/intersection.hpp index 7477fdf0b5..09417a47fb 100644 --- a/pythran/pythonic/builtins/set/intersection.hpp +++ b/pythran/pythonic/builtins/set/intersection.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/builtins/set/intersection.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/set.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace builtins template typename __combined, Types...>::type - intersection(types::set const &set, Types const &... others) + intersection(types::set const &set, Types const &...others) { return set.intersection(others...); } @@ -29,11 +29,11 @@ namespace builtins */ template types::empty_set intersection(types::empty_set const &set, - Types const &... others) + Types const &...others) { return types::empty_set(); } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/intersection_update.hpp b/pythran/pythonic/builtins/set/intersection_update.hpp index 5bf8b65a81..847a4d4dd6 100644 --- a/pythran/pythonic/builtins/set/intersection_update.hpp +++ b/pythran/pythonic/builtins/set/intersection_update.hpp @@ -16,7 +16,7 @@ namespace builtins template types::none_type intersection_update(types::set &set, - Types const &... others) + Types const &...others) { set.intersection_update(others...); return {}; @@ -24,7 +24,7 @@ namespace builtins template types::none_type intersection_update(types::set &&set, - Types const &... others) + Types const &...others) { // If it is an rvalue, we don't really want to update return {}; @@ -32,13 +32,13 @@ namespace builtins template types::none_type intersection_update(types::empty_set &&set, - Types const &... others) + Types const &...others) { // If it is an empty_set, it is ! really updated otherwise we have a // typing issue return {}; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/isdisjoint.hpp b/pythran/pythonic/builtins/set/isdisjoint.hpp index 2f5c08794e..7613c53d7a 100644 --- a/pythran/pythonic/builtins/set/isdisjoint.hpp +++ b/pythran/pythonic/builtins/set/isdisjoint.hpp @@ -25,7 +25,7 @@ namespace builtins { return true; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/issubset.hpp b/pythran/pythonic/builtins/set/issubset.hpp index b74680f918..0222faf745 100644 --- a/pythran/pythonic/builtins/set/issubset.hpp +++ b/pythran/pythonic/builtins/set/issubset.hpp @@ -25,7 +25,7 @@ namespace builtins { return true; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/issuperset.hpp b/pythran/pythonic/builtins/set/issuperset.hpp index 10da3c1ad3..7f3d759798 100644 --- a/pythran/pythonic/builtins/set/issuperset.hpp +++ b/pythran/pythonic/builtins/set/issuperset.hpp @@ -25,7 +25,7 @@ namespace builtins { return false; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/remove.hpp b/pythran/pythonic/builtins/set/remove.hpp index 1035406a69..0cbc67d76e 100644 --- a/pythran/pythonic/builtins/set/remove.hpp +++ b/pythran/pythonic/builtins/set/remove.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_SET_REMOVE_HPP #define PYTHONIC_BUILTIN_SET_REMOVE_HPP -#include "pythonic/include/builtins/set/remove.hpp" #include "pythonic/__dispatch__/remove.hpp" +#include "pythonic/include/builtins/set/remove.hpp" #endif diff --git a/pythran/pythonic/builtins/set/symmetric_difference.hpp b/pythran/pythonic/builtins/set/symmetric_difference.hpp index b8fd245193..14dd6fbbdf 100644 --- a/pythran/pythonic/builtins/set/symmetric_difference.hpp +++ b/pythran/pythonic/builtins/set/symmetric_difference.hpp @@ -33,7 +33,7 @@ namespace builtins { return other; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/symmetric_difference_update.hpp b/pythran/pythonic/builtins/set/symmetric_difference_update.hpp index fcbac1a429..e9aa1675ce 100644 --- a/pythran/pythonic/builtins/set/symmetric_difference_update.hpp +++ b/pythran/pythonic/builtins/set/symmetric_difference_update.hpp @@ -37,7 +37,7 @@ namespace builtins // nothing otherwise empty_set have ! its correct type. return {}; } - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/set/update.hpp b/pythran/pythonic/builtins/set/update.hpp index 673a6e192b..e2965e07b7 100644 --- a/pythran/pythonic/builtins/set/update.hpp +++ b/pythran/pythonic/builtins/set/update.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_SET_UPDATE_HPP #define PYTHONIC_SET_UPDATE_HPP -#include "pythonic/include/builtins/set/update.hpp" #include "pythonic/__dispatch__/update.hpp" +#include "pythonic/include/builtins/set/update.hpp" #endif diff --git a/pythran/pythonic/builtins/sorted.hpp b/pythran/pythonic/builtins/sorted.hpp index 8e247435a0..c8e9e2efda 100644 --- a/pythran/pythonic/builtins/sorted.hpp +++ b/pythran/pythonic/builtins/sorted.hpp @@ -64,7 +64,7 @@ namespace builtins pdqsort(out.begin(), out.end()); return out; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str.hpp b/pythran/pythonic/builtins/str.hpp index d77176f03b..ce0cf778ac 100644 --- a/pythran/pythonic/builtins/str.hpp +++ b/pythran/pythonic/builtins/str.hpp @@ -74,8 +74,8 @@ namespace builtins snprintf(buffer, sizeof(buffer), "%g", l); return buffer; } - } -} + } // namespace anonymous +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/__mod__.hpp b/pythran/pythonic/builtins/str/__mod__.hpp index 812f1abf23..2ea185e1f3 100644 --- a/pythran/pythonic/builtins/str/__mod__.hpp +++ b/pythran/pythonic/builtins/str/__mod__.hpp @@ -29,7 +29,7 @@ namespace builtins fmt(f % std::get::value - I>(a), a, utils::int_()); } - } + } // namespace details template types::str __mod__(types::str const &s, T const &arg) @@ -46,13 +46,14 @@ namespace builtins return fmter.str(); } template - types::str __mod__(types::str const &s, types::array const &args) + types::str __mod__(types::str const &s, + types::array_tuple const &args) { boost::format fmter(s.chars()); details::fmt(fmter, args, utils::int_()); return fmter.str(); } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/capitalize.hpp b/pythran/pythonic/builtins/str/capitalize.hpp index 5102d46dbc..743bbe8c2f 100644 --- a/pythran/pythonic/builtins/str/capitalize.hpp +++ b/pythran/pythonic/builtins/str/capitalize.hpp @@ -26,7 +26,7 @@ namespace builtins return copy; } } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/count.hpp b/pythran/pythonic/builtins/str/count.hpp index 2a9f6b5ec3..b7c6bbdc76 100644 --- a/pythran/pythonic/builtins/str/count.hpp +++ b/pythran/pythonic/builtins/str/count.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_BUILTIN_STR_COUNT_HPP #define PYTHONIC_BUILTIN_STR_COUNT_HPP -#include "pythonic/include/builtins/str/count.hpp" #include "pythonic/__dispatch__/count.hpp" +#include "pythonic/include/builtins/str/count.hpp" #endif diff --git a/pythran/pythonic/builtins/str/endswith.hpp b/pythran/pythonic/builtins/str/endswith.hpp index b8df066ce6..70fa51f46a 100644 --- a/pythran/pythonic/builtins/str/endswith.hpp +++ b/pythran/pythonic/builtins/str/endswith.hpp @@ -22,7 +22,7 @@ namespace builtins long rstart = end - suffix.size(); return rstart >= start && s.compare(rstart, suffix.size(), suffix) == 0; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/isalpha.hpp b/pythran/pythonic/builtins/str/isalpha.hpp index e7d9beaa70..4fa77567ba 100644 --- a/pythran/pythonic/builtins/str/isalpha.hpp +++ b/pythran/pythonic/builtins/str/isalpha.hpp @@ -19,7 +19,7 @@ namespace builtins return !s.empty() && std::all_of(s.chars().begin(), s.chars().end(), (int (*)(int))std::isalpha); } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/isdigit.hpp b/pythran/pythonic/builtins/str/isdigit.hpp index 58da6227c4..43ffe5d5a7 100644 --- a/pythran/pythonic/builtins/str/isdigit.hpp +++ b/pythran/pythonic/builtins/str/isdigit.hpp @@ -21,7 +21,7 @@ namespace builtins return !s.empty() && std::all_of(s.chars().begin(), s.chars().end(), (int (*)(int))std::isdigit); } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/join.hpp b/pythran/pythonic/builtins/str/join.hpp index af966c789b..38cf6fd963 100644 --- a/pythran/pythonic/builtins/str/join.hpp +++ b/pythran/pythonic/builtins/str/join.hpp @@ -112,7 +112,7 @@ namespace builtins } return out; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/lower.hpp b/pythran/pythonic/builtins/str/lower.hpp index 6d2bcd6cb9..417d01df6b 100644 --- a/pythran/pythonic/builtins/str/lower.hpp +++ b/pythran/pythonic/builtins/str/lower.hpp @@ -21,7 +21,7 @@ namespace builtins ::tolower); return copy; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/lstrip.hpp b/pythran/pythonic/builtins/str/lstrip.hpp index d3a031bfed..1b4a37310d 100644 --- a/pythran/pythonic/builtins/str/lstrip.hpp +++ b/pythran/pythonic/builtins/str/lstrip.hpp @@ -23,7 +23,7 @@ namespace builtins else return {chars.begin() + stop, chars.end()}; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/rstrip.hpp b/pythran/pythonic/builtins/str/rstrip.hpp index a1536478bd..2dadb99bc5 100644 --- a/pythran/pythonic/builtins/str/rstrip.hpp +++ b/pythran/pythonic/builtins/str/rstrip.hpp @@ -22,7 +22,7 @@ namespace builtins return {}; return {chars.begin(), chars.begin() + stop + 1}; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/startswith.hpp b/pythran/pythonic/builtins/str/startswith.hpp index 1d297f4c87..226388ca5f 100644 --- a/pythran/pythonic/builtins/str/startswith.hpp +++ b/pythran/pythonic/builtins/str/startswith.hpp @@ -22,7 +22,7 @@ namespace builtins return (end - start) >= prefix.size() && s.compare(start, prefix.size(), prefix) == 0; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/strip.hpp b/pythran/pythonic/builtins/str/strip.hpp index c580a63a8a..e1cab71ee9 100644 --- a/pythran/pythonic/builtins/str/strip.hpp +++ b/pythran/pythonic/builtins/str/strip.hpp @@ -25,7 +25,7 @@ namespace builtins self.chars().begin() + self.find_last_not_of(to_del) + 1); } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/str/upper.hpp b/pythran/pythonic/builtins/str/upper.hpp index 1f8d38a884..d90d583ec2 100644 --- a/pythran/pythonic/builtins/str/upper.hpp +++ b/pythran/pythonic/builtins/str/upper.hpp @@ -21,7 +21,7 @@ namespace builtins ::toupper); return copy; } - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/sum.hpp b/pythran/pythonic/builtins/sum.hpp index 5c35f1c4a6..f583b1ae39 100644 --- a/pythran/pythonic/builtins/sum.hpp +++ b/pythran/pythonic/builtins/sum.hpp @@ -5,8 +5,8 @@ #include "pythonic/types/assignable.hpp" #include "pythonic/types/tuple.hpp" -#include "pythonic/utils/int_.hpp" #include "pythonic/utils/functor.hpp" +#include "pythonic/utils/int_.hpp" #include @@ -25,25 +25,26 @@ namespace builtins } template - auto tuple_sum::operator()(Tuple const &t) - -> decltype(std::get<0>(t)) + auto + tuple_sum::operator()(Tuple const &t) -> decltype(std::get<0>(t)) { return std::get<0>(t); } - } + } // namespace details template - auto sum(Iterable s, T start) -> decltype(std::accumulate( - s.begin(), s.end(), - static_cast::type>( - start))) + auto sum(Iterable s, T start) + -> decltype(std::accumulate( + s.begin(), s.end(), + static_cast::type>( + start))) { return std::accumulate( s.begin(), s.end(), static_cast::type>( start)); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/tuple.hpp b/pythran/pythonic/builtins/tuple.hpp index 4692a1108d..7abe56ad8f 100644 --- a/pythran/pythonic/builtins/tuple.hpp +++ b/pythran/pythonic/builtins/tuple.hpp @@ -38,7 +38,7 @@ namespace builtins typename std::enable_if< types::len_of::type>::type>::value >= 0, - types::array< + types::array_tuple< typename std::iterator_traits< typename std::remove_cv::type>::type::iterator>::value_type, @@ -46,16 +46,17 @@ namespace builtins StaticIterable>::type>::type>::value>>::type tuple(StaticIterable &&i) { - types::array< + types::array_tuple< typename std::iterator_traits< typename std::remove_cv::type>::type::iterator>::value_type, - types::len_of::type>::type>::value> res; + types::len_of::type>::type>::value> + res; std::copy(i.begin(), i.end(), res.begin()); return res; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/type.hpp b/pythran/pythonic/builtins/type.hpp index 55b530a80b..401c566845 100644 --- a/pythran/pythonic/builtins/type.hpp +++ b/pythran/pythonic/builtins/type.hpp @@ -6,27 +6,27 @@ #include "pythonic/utils/functor.hpp" #include "pythonic/builtins/bool_.hpp" -#include "pythonic/builtins/int_.hpp" -#include "pythonic/builtins/float_.hpp" #include "pythonic/builtins/complex.hpp" +#include "pythonic/builtins/dict.hpp" +#include "pythonic/builtins/float_.hpp" +#include "pythonic/builtins/int_.hpp" +#include "pythonic/builtins/list.hpp" #include "pythonic/builtins/set.hpp" #include "pythonic/builtins/str.hpp" -#include "pythonic/builtins/list.hpp" -#include "pythonic/builtins/dict.hpp" #include "pythonic/builtins/tuple.hpp" #include "pythonic/numpy/array.hpp" #include "pythonic/numpy/byte.hpp" -#include "pythonic/numpy/ubyte.hpp" -#include "pythonic/numpy/short_.hpp" -#include "pythonic/numpy/ushort.hpp" -#include "pythonic/numpy/intc.hpp" -#include "pythonic/numpy/uintc.hpp" +#include "pythonic/numpy/float128.hpp" +#include "pythonic/numpy/float32.hpp" #include "pythonic/numpy/int_.hpp" -#include "pythonic/numpy/uint.hpp" +#include "pythonic/numpy/intc.hpp" #include "pythonic/numpy/longlong.hpp" +#include "pythonic/numpy/short_.hpp" +#include "pythonic/numpy/ubyte.hpp" +#include "pythonic/numpy/uint.hpp" +#include "pythonic/numpy/uintc.hpp" #include "pythonic/numpy/ulonglong.hpp" -#include "pythonic/numpy/float32.hpp" -#include "pythonic/numpy/float128.hpp" +#include "pythonic/numpy/ushort.hpp" PYTHONIC_NS_BEGIN @@ -81,7 +81,7 @@ namespace builtins using type = functor::tuple; }; template - struct type_functor> { + struct type_functor> { using type = functor::tuple; }; template @@ -142,7 +142,7 @@ namespace builtins { return {}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/xrange.hpp b/pythran/pythonic/builtins/xrange.hpp index 2436fa470c..696ac32089 100644 --- a/pythran/pythonic/builtins/xrange.hpp +++ b/pythran/pythonic/builtins/xrange.hpp @@ -24,7 +24,7 @@ namespace builtins return _begin + std::min(0L, _step * ((_end - _begin + _step + 1) / _step)); } - } + } // namespace xrange_iterator::xrange_iterator(long v, long s) : value_(v), step_(s) { @@ -102,7 +102,7 @@ namespace builtins { return {begin_ - step_, -step_}; } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/builtins/zip.hpp b/pythran/pythonic/builtins/zip.hpp index 84f7bf8e55..3fb8c04521 100644 --- a/pythran/pythonic/builtins/zip.hpp +++ b/pythran/pythonic/builtins/zip.hpp @@ -12,12 +12,12 @@ namespace builtins { template - auto zip(Iter &&... iters) - -> decltype(map(builtins::None, std::forward(iters)...)) + auto zip(Iter &&...iters) -> decltype(map(builtins::None, + std::forward(iters)...)) { return map(builtins::None, std::forward(iters)...); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/cmath/acos.hpp b/pythran/pythonic/cmath/acos.hpp index d35580c144..b3cb005142 100644 --- a/pythran/pythonic/cmath/acos.hpp +++ b/pythran/pythonic/cmath/acos.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/acos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/acosh.hpp b/pythran/pythonic/cmath/acosh.hpp index 09193d0d3a..67b00ee66c 100644 --- a/pythran/pythonic/cmath/acosh.hpp +++ b/pythran/pythonic/cmath/acosh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/acosh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/asin.hpp b/pythran/pythonic/cmath/asin.hpp index a18a35b291..6c55305660 100644 --- a/pythran/pythonic/cmath/asin.hpp +++ b/pythran/pythonic/cmath/asin.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/asin.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/asinh.hpp b/pythran/pythonic/cmath/asinh.hpp index d460ba71fa..7c6949eab7 100644 --- a/pythran/pythonic/cmath/asinh.hpp +++ b/pythran/pythonic/cmath/asinh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/asinh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/atan.hpp b/pythran/pythonic/cmath/atan.hpp index ecc5020e8d..28d30766eb 100644 --- a/pythran/pythonic/cmath/atan.hpp +++ b/pythran/pythonic/cmath/atan.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/atan.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/atanh.hpp b/pythran/pythonic/cmath/atanh.hpp index 997c74310f..098827ce24 100644 --- a/pythran/pythonic/cmath/atanh.hpp +++ b/pythran/pythonic/cmath/atanh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/atanh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/cos.hpp b/pythran/pythonic/cmath/cos.hpp index fe4965949f..1d73a31ea9 100644 --- a/pythran/pythonic/cmath/cos.hpp +++ b/pythran/pythonic/cmath/cos.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/cos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -23,7 +23,7 @@ namespace cmath { return std::cos(v); } -} +} // namespace cmath PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/cmath/cosh.hpp b/pythran/pythonic/cmath/cosh.hpp index 671143a91b..f466f94c42 100644 --- a/pythran/pythonic/cmath/cosh.hpp +++ b/pythran/pythonic/cmath/cosh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/cosh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/exp.hpp b/pythran/pythonic/cmath/exp.hpp index aa06a419b3..8202b2e111 100644 --- a/pythran/pythonic/cmath/exp.hpp +++ b/pythran/pythonic/cmath/exp.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/exp.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/isinf.hpp b/pythran/pythonic/cmath/isinf.hpp index c2f012b8e3..98303da971 100644 --- a/pythran/pythonic/cmath/isinf.hpp +++ b/pythran/pythonic/cmath/isinf.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/isinf.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/isnan.hpp b/pythran/pythonic/cmath/isnan.hpp index 969dc7461a..96b68e65ce 100644 --- a/pythran/pythonic/cmath/isnan.hpp +++ b/pythran/pythonic/cmath/isnan.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/isnan.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/log.hpp b/pythran/pythonic/cmath/log.hpp index 8c8fe36930..b885a43023 100644 --- a/pythran/pythonic/cmath/log.hpp +++ b/pythran/pythonic/cmath/log.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/log.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -17,7 +17,7 @@ namespace cmath { return log(x) / log(base); } -} +} // namespace cmath PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/cmath/log10.hpp b/pythran/pythonic/cmath/log10.hpp index 86c3c79391..55eda96e70 100644 --- a/pythran/pythonic/cmath/log10.hpp +++ b/pythran/pythonic/cmath/log10.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/log10.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/sin.hpp b/pythran/pythonic/cmath/sin.hpp index 5dcec69e74..1f57e20720 100644 --- a/pythran/pythonic/cmath/sin.hpp +++ b/pythran/pythonic/cmath/sin.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/sin.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/sinh.hpp b/pythran/pythonic/cmath/sinh.hpp index 891d543f06..e1a28836cc 100644 --- a/pythran/pythonic/cmath/sinh.hpp +++ b/pythran/pythonic/cmath/sinh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/sinh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/sqrt.hpp b/pythran/pythonic/cmath/sqrt.hpp index f84a6293ed..8b5582fdcd 100644 --- a/pythran/pythonic/cmath/sqrt.hpp +++ b/pythran/pythonic/cmath/sqrt.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/sqrt.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/tan.hpp b/pythran/pythonic/cmath/tan.hpp index 23052a4a6e..537042c4d9 100644 --- a/pythran/pythonic/cmath/tan.hpp +++ b/pythran/pythonic/cmath/tan.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/tan.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/cmath/tanh.hpp b/pythran/pythonic/cmath/tanh.hpp index b81d76e718..0748384156 100644 --- a/pythran/pythonic/cmath/tanh.hpp +++ b/pythran/pythonic/cmath/tanh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/cmath/tanh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/core.hpp b/pythran/pythonic/core.hpp index feb77722fb..844d944cb5 100644 --- a/pythran/pythonic/core.hpp +++ b/pythran/pythonic/core.hpp @@ -32,7 +32,8 @@ // Define python's visibility macros #include "pyconfig.h" -// Some version of python define that macro on Windows, and it breaks compilation of some C++ headers. +// Some version of python define that macro on Windows, and it breaks +// compilation of some C++ headers. #ifdef copysign #undef copysign #endif @@ -41,8 +42,8 @@ #include "pythonic/types/assignable.hpp" #include "pythonic/types/combined.hpp" -#include "pythonic/types/int.hpp" #include "pythonic/types/float.hpp" +#include "pythonic/types/int.hpp" #include "pythonic/types/slice.hpp" #endif diff --git a/pythran/pythonic/functools/partial.hpp b/pythran/pythonic/functools/partial.hpp index d6ab8bdabe..e2a2df85e7 100644 --- a/pythran/pythonic/functools/partial.hpp +++ b/pythran/pythonic/functools/partial.hpp @@ -17,37 +17,37 @@ namespace functools { template - task::task() - : closure() + task::task() : closure() { } template - task::task(ClosureTypes const &... types) + task::task(ClosureTypes const &...types) : closure(types...) { } template template - auto task::operator()(Types &&... types) const -> decltype( - this->call(utils::make_index_sequence(), - std::forward(types)...)) + auto task::operator()(Types &&...types) const + -> decltype(this->call( + utils::make_index_sequence(), + std::forward(types)...)) { - return call(utils::make_index_sequence(), + return call(utils::make_index_sequence(), std::forward(types)...); } - } + } // namespace details template // remove references as closure capture the env by copy details::task::type>::type...> - partial(Types &&... types) + partial(Types &&...types) { return {std::forward(types)...}; } -} +} // namespace functools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/functools/reduce.hpp b/pythran/pythonic/functools/reduce.hpp index 3d0cdff245..452b85599c 100644 --- a/pythran/pythonic/functools/reduce.hpp +++ b/pythran/pythonic/functools/reduce.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_FUNCTOOLS_REDUCE_HPP #define PYTHONIC_FUNCTOOLS_REDUCE_HPP -#include "pythonic/include/functools/reduce.hpp" #include "pythonic/builtins/reduce.hpp" +#include "pythonic/include/functools/reduce.hpp" #endif diff --git a/pythran/pythonic/include/__dispatch__/clear.hpp b/pythran/pythonic/include/__dispatch__/clear.hpp index ae78da378b..e3a912e2f7 100644 --- a/pythran/pythonic/include/__dispatch__/clear.hpp +++ b/pythran/pythonic/include/__dispatch__/clear.hpp @@ -14,7 +14,7 @@ namespace __dispatch__ } DEFINE_FUNCTOR(pythonic::__dispatch__, clear); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/conjugate.hpp b/pythran/pythonic/include/__dispatch__/conjugate.hpp index 869cb55762..0a5b94b561 100644 --- a/pythran/pythonic/include/__dispatch__/conjugate.hpp +++ b/pythran/pythonic/include/__dispatch__/conjugate.hpp @@ -12,7 +12,7 @@ namespace __dispatch__ auto conjugate(Any const &any) -> decltype(numpy::functor::conjugate{}(any)); DEFINE_FUNCTOR(pythonic::__dispatch__, conjugate); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/copy.hpp b/pythran/pythonic/include/__dispatch__/copy.hpp index 04819e9477..265301da68 100644 --- a/pythran/pythonic/include/__dispatch__/copy.hpp +++ b/pythran/pythonic/include/__dispatch__/copy.hpp @@ -11,7 +11,7 @@ namespace __dispatch__ auto copy(Any const &any) -> decltype(any.copy()); DEFINE_FUNCTOR(pythonic::__dispatch__, copy); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/count.hpp b/pythran/pythonic/include/__dispatch__/count.hpp index 0fe42b94e7..8dcc6fcca1 100644 --- a/pythran/pythonic/include/__dispatch__/count.hpp +++ b/pythran/pythonic/include/__dispatch__/count.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace __dispatch__ { template - auto count(Any &&any, Value &&value) - -> decltype(any.count(std::forward(value))); + auto count(Any &&any, + Value &&value) -> decltype(any.count(std::forward(value))); DEFINE_FUNCTOR(pythonic::__dispatch__, count); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/index.hpp b/pythran/pythonic/include/__dispatch__/index.hpp index c658f74941..0532e6cbce 100644 --- a/pythran/pythonic/include/__dispatch__/index.hpp +++ b/pythran/pythonic/include/__dispatch__/index.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_DISPATCH_INDEX_HPP #define PYTHONIC_INCLUDE_DISPATCH_INDEX_HPP -#include "pythonic/utils/functor.hpp" #include "pythonic/include/operator_/indexOf.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/__dispatch__/pop.hpp b/pythran/pythonic/include/__dispatch__/pop.hpp index 8a44bfe1a5..ac37c2e653 100644 --- a/pythran/pythonic/include/__dispatch__/pop.hpp +++ b/pythran/pythonic/include/__dispatch__/pop.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace __dispatch__ { template - auto pop(Any &&any, Arg0 &&... arg0) - -> decltype(any.pop(std::forward(arg0)...)); + auto pop(Any &&any, + Arg0 &&...arg0) -> decltype(any.pop(std::forward(arg0)...)); DEFINE_FUNCTOR(pythonic::__dispatch__, pop); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/remove.hpp b/pythran/pythonic/include/__dispatch__/remove.hpp index 4b78c24603..7e9c34fe4d 100644 --- a/pythran/pythonic/include/__dispatch__/remove.hpp +++ b/pythran/pythonic/include/__dispatch__/remove.hpp @@ -11,7 +11,7 @@ namespace __dispatch__ auto remove(Any &any, Arg0 const &arg0) -> decltype(any.remove(arg0)); DEFINE_FUNCTOR(pythonic::__dispatch__, remove); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/sort.hpp b/pythran/pythonic/include/__dispatch__/sort.hpp index e2dc8fe4c0..d57b8c2f38 100644 --- a/pythran/pythonic/include/__dispatch__/sort.hpp +++ b/pythran/pythonic/include/__dispatch__/sort.hpp @@ -10,18 +10,18 @@ namespace __dispatch__ { template - auto sort(types::list &l, Args &&... args) + auto sort(types::list &l, Args &&...args) -> decltype(pythonic::builtins::list::sort(l, std::forward(args)...)); template - auto sort(types::list &&l, Args &&... args) + auto sort(types::list &&l, Args &&...args) -> decltype(pythonic::builtins::list::sort(std::move(l), std::forward(args)...)); template - types::none_type sort(Any &&any, Args &&... args); + types::none_type sort(Any &&any, Args &&...args); DEFINE_FUNCTOR(pythonic::__dispatch__, sort); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/__dispatch__/update.hpp b/pythran/pythonic/include/__dispatch__/update.hpp index e7ed9dd06b..258c9f6b86 100644 --- a/pythran/pythonic/include/__dispatch__/update.hpp +++ b/pythran/pythonic/include/__dispatch__/update.hpp @@ -9,11 +9,11 @@ namespace __dispatch__ { template - auto update(Any &&any, Arg0 &&... arg0) + auto update(Any &&any, Arg0 &&...arg0) -> decltype(any.update(std::forward(arg0)...)); DEFINE_FUNCTOR(pythonic::__dispatch__, update); -} +} // namespace __dispatch__ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/array/array.hpp b/pythran/pythonic/include/array/array.hpp index 6ad8be1382..6a16f8a2be 100644 --- a/pythran/pythonic/include/array/array.hpp +++ b/pythran/pythonic/include/array/array.hpp @@ -67,11 +67,11 @@ namespace array } // namespace details template - types::list::type> + types::array::type> array(std::integral_constant); template - types::list::type> + types::array::type> array(std::integral_constant, E &&elts); DEFINE_FUNCTOR(pythonic::array, array); diff --git a/pythran/pythonic/include/bisect/bisect.hpp b/pythran/pythonic/include/bisect/bisect.hpp index 8eb3e9fda5..3d54ae8a09 100644 --- a/pythran/pythonic/include/bisect/bisect.hpp +++ b/pythran/pythonic/include/bisect/bisect.hpp @@ -27,7 +27,7 @@ namespace bisect std::upper_bound); DEFINE_FUNCTOR(pythonic::bisect, bisect); -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/bisect/bisect_left.hpp b/pythran/pythonic/include/bisect/bisect_left.hpp index 0953aa3e4b..589eb2e43a 100644 --- a/pythran/pythonic/include/bisect/bisect_left.hpp +++ b/pythran/pythonic/include/bisect/bisect_left.hpp @@ -14,7 +14,7 @@ namespace bisect long bisect_left(X const &x, A const &a, long lo, long hi); DEFINE_FUNCTOR(pythonic::bisect, bisect_left); -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/bisect/bisect_right.hpp b/pythran/pythonic/include/bisect/bisect_right.hpp index c4d0d479e4..a29a0130c3 100644 --- a/pythran/pythonic/include/bisect/bisect_right.hpp +++ b/pythran/pythonic/include/bisect/bisect_right.hpp @@ -14,7 +14,7 @@ namespace bisect long bisect_right(X const &x, A const &a, long lo, long hi); DEFINE_FUNCTOR(pythonic::bisect, bisect_right); -} +} // namespace bisect PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/abs.hpp b/pythran/pythonic/include/builtins/abs.hpp index ca927fb622..cec382b713 100644 --- a/pythran/pythonic/include/builtins/abs.hpp +++ b/pythran/pythonic/include/builtins/abs.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_ABS_HPP #define PYTHONIC_INCLUDE_BUILTIN_ABS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/abs.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace builtins // FIXME np.abs accept any iterator while builtins.abs only accept // numeric types && numpy.array USING_FUNCTOR(abs, numpy::functor::abs); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/all.hpp b/pythran/pythonic/include/builtins/all.hpp index e3b619e3af..4d9c6085e8 100644 --- a/pythran/pythonic/include/builtins/all.hpp +++ b/pythran/pythonic/include/builtins/all.hpp @@ -12,7 +12,7 @@ namespace builtins bool all(Iterable &&s); DEFINE_FUNCTOR(pythonic::builtins, all); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/any.hpp b/pythran/pythonic/include/builtins/any.hpp index 86b3d845cd..5bb310e634 100644 --- a/pythran/pythonic/include/builtins/any.hpp +++ b/pythran/pythonic/include/builtins/any.hpp @@ -11,7 +11,7 @@ namespace builtins bool any(Iterable &&s); DEFINE_FUNCTOR(pythonic::builtins, any); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/bin.hpp b/pythran/pythonic/include/builtins/bin.hpp index 7365388c78..f507ec4b55 100644 --- a/pythran/pythonic/include/builtins/bin.hpp +++ b/pythran/pythonic/include/builtins/bin.hpp @@ -16,7 +16,7 @@ namespace builtins bin(T const &v); DEFINE_FUNCTOR(pythonic::builtins, bin); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/bool_.hpp b/pythran/pythonic/include/builtins/bool_.hpp index f48b174f59..f0fdd1b52e 100644 --- a/pythran/pythonic/include/builtins/bool_.hpp +++ b/pythran/pythonic/include/builtins/bool_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_BOOL_HPP #define PYTHONIC_INCLUDE_BUILTIN_BOOL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -25,15 +25,15 @@ namespace builtins bool operator()(std::tuple const &val) const; template - bool operator()(types::array const &val) const; + bool operator()(types::array_tuple const &val) const; friend std::ostream &operator<<(std::ostream &os, bool_) { return os << "bool"; } }; - } -} + } // namespace functor +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/chr.hpp b/pythran/pythonic/include/builtins/chr.hpp index 6e30ee9590..0c3819bc00 100644 --- a/pythran/pythonic/include/builtins/chr.hpp +++ b/pythran/pythonic/include/builtins/chr.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_CHR_HPP #define PYTHONIC_INCLUDE_BUILTIN_CHR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace builtins types::str chr(T const &v); DEFINE_FUNCTOR(pythonic::builtins, chr); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/complex.hpp b/pythran/pythonic/include/builtins/complex.hpp index 7057bd3791..1ad6bc6dfe 100644 --- a/pythran/pythonic/include/builtins/complex.hpp +++ b/pythran/pythonic/include/builtins/complex.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_COMPLEX_HPP #define PYTHONIC_INCLUDE_BUILTIN_COMPLEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -21,8 +21,8 @@ namespace builtins return os << "complex"; } }; - } -} + } // namespace functor +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/complex/conjugate.hpp b/pythran/pythonic/include/builtins/complex/conjugate.hpp index dcb8d5ac32..0c2b460779 100644 --- a/pythran/pythonic/include/builtins/complex/conjugate.hpp +++ b/pythran/pythonic/include/builtins/complex/conjugate.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_COMPLEX_CONJUGATE_HPP #define PYTHONIC_INCLUDE_BUILTIN_COMPLEX_CONJUGATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/conjugate.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace builtins @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(conjugate, numpy::functor::conjugate); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict.hpp b/pythran/pythonic/include/builtins/dict.hpp index f84a9798a1..f4fdb16983 100644 --- a/pythran/pythonic/include/builtins/dict.hpp +++ b/pythran/pythonic/include/builtins/dict.hpp @@ -20,13 +20,15 @@ namespace builtins types::dict dict(types::dict const &); template - auto dict(Iterable &&iterable) -> types::dict< - typename std::decay(*iterable.begin()))>::type, - typename std::decay(*iterable.begin()))>::type>; - } + auto dict(Iterable &&iterable) + -> types::dict< + typename std::decay(*iterable.begin()))>::type, + typename std::decay< + decltype(std::get<1>(*iterable.begin()))>::type>; + } // namespace anonymous DEFINE_FUNCTOR(pythonic::builtins::anonymous, dict); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/clear.hpp b/pythran/pythonic/include/builtins/dict/clear.hpp index d90a2f3cf2..c51f03ef47 100644 --- a/pythran/pythonic/include/builtins/dict/clear.hpp +++ b/pythran/pythonic/include/builtins/dict/clear.hpp @@ -11,7 +11,7 @@ namespace builtins { USING_FUNCTOR(clear, pythonic::__dispatch__::functor::clear); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/copy.hpp b/pythran/pythonic/include/builtins/dict/copy.hpp index e0a92e31bb..33213a8226 100644 --- a/pythran/pythonic/include/builtins/dict/copy.hpp +++ b/pythran/pythonic/include/builtins/dict/copy.hpp @@ -11,7 +11,7 @@ namespace builtins { USING_FUNCTOR(copy, pythonic::__dispatch__::functor::copy); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/fromkeys.hpp b/pythran/pythonic/include/builtins/dict/fromkeys.hpp index 0bcf1ff1e8..d06ff6ee57 100644 --- a/pythran/pythonic/include/builtins/dict/fromkeys.hpp +++ b/pythran/pythonic/include/builtins/dict/fromkeys.hpp @@ -20,8 +20,8 @@ namespace builtins fromkeys(Iterable &&iter, V const &v = builtins::None); DEFINE_FUNCTOR(pythonic::builtins::dict, fromkeys); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/get.hpp b/pythran/pythonic/include/builtins/dict/get.hpp index 01edc4b6a5..be4e976f4a 100644 --- a/pythran/pythonic/include/builtins/dict/get.hpp +++ b/pythran/pythonic/include/builtins/dict/get.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_DICT_GET_HPP #define PYTHONIC_INCLUDE_BUILTIN_DICT_GET_HPP -#include "pythonic/include/types/dict.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/dict.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -28,8 +28,8 @@ namespace builtins typename __combined::type get(::dict_container, I, J); DEFINE_FUNCTOR(pythonic::builtins::dict, get); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/items.hpp b/pythran/pythonic/include/builtins/dict/items.hpp index 21e47d0e6e..13d34bc997 100644 --- a/pythran/pythonic/include/builtins/dict/items.hpp +++ b/pythran/pythonic/include/builtins/dict/items.hpp @@ -19,8 +19,8 @@ namespace builtins auto items(D &&d) -> decltype(std::forward(d).items()); DEFINE_FUNCTOR(pythonic::builtins::dict, items); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/keys.hpp b/pythran/pythonic/include/builtins/dict/keys.hpp index f0dbba5452..5f0a78dfb8 100644 --- a/pythran/pythonic/include/builtins/dict/keys.hpp +++ b/pythran/pythonic/include/builtins/dict/keys.hpp @@ -17,8 +17,8 @@ namespace builtins auto keys(D &&d) -> decltype(std::forward(d).keys()); DEFINE_FUNCTOR(pythonic::builtins::dict, keys); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/pop.hpp b/pythran/pythonic/include/builtins/dict/pop.hpp index 7d0562c789..06ae4499ce 100644 --- a/pythran/pythonic/include/builtins/dict/pop.hpp +++ b/pythran/pythonic/include/builtins/dict/pop.hpp @@ -11,7 +11,7 @@ namespace builtins { USING_FUNCTOR(pop, pythonic::__dispatch__::functor::pop); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/popitem.hpp b/pythran/pythonic/include/builtins/dict/popitem.hpp index 5f12f97b59..16d7c1136a 100644 --- a/pythran/pythonic/include/builtins/dict/popitem.hpp +++ b/pythran/pythonic/include/builtins/dict/popitem.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_DICT_POPITEM_HPP #define PYTHONIC_INCLUDE_BUILTIN_DICT_POPITEM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/dict.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -18,8 +18,8 @@ namespace builtins auto popitem(D &&d) -> decltype(std::forward(d).popitem()); DEFINE_FUNCTOR(pythonic::builtins::dict, popitem); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/setdefault.hpp b/pythran/pythonic/include/builtins/dict/setdefault.hpp index e14b8221c0..cd7a58b679 100644 --- a/pythran/pythonic/include/builtins/dict/setdefault.hpp +++ b/pythran/pythonic/include/builtins/dict/setdefault.hpp @@ -25,8 +25,8 @@ namespace builtins types::none setdefault(types::dict &&d, W const &k); DEFINE_FUNCTOR(pythonic::builtins::dict, setdefault); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/update.hpp b/pythran/pythonic/include/builtins/dict/update.hpp index 8d6990a90f..6e95782e33 100644 --- a/pythran/pythonic/include/builtins/dict/update.hpp +++ b/pythran/pythonic/include/builtins/dict/update.hpp @@ -11,7 +11,7 @@ namespace builtins { USING_FUNCTOR(update, pythonic::__dispatch__::functor::update); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/dict/values.hpp b/pythran/pythonic/include/builtins/dict/values.hpp index 26030f7f09..d47d0aa144 100644 --- a/pythran/pythonic/include/builtins/dict/values.hpp +++ b/pythran/pythonic/include/builtins/dict/values.hpp @@ -16,8 +16,8 @@ namespace builtins auto values(D &&d) -> decltype(std::forward(d).values()); DEFINE_FUNCTOR(pythonic::builtins::dict, values); - } -} + } // namespace dict +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/divmod.hpp b/pythran/pythonic/include/builtins/divmod.hpp index c693338267..2dc79538c7 100644 --- a/pythran/pythonic/include/builtins/divmod.hpp +++ b/pythran/pythonic/include/builtins/divmod.hpp @@ -14,7 +14,7 @@ namespace builtins -> decltype(types::make_tuple(t0 / t1, t0 % t1)); DEFINE_FUNCTOR(pythonic::builtins, divmod); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file.hpp b/pythran/pythonic/include/builtins/file.hpp index ac84be64d4..fbe7b70e4b 100644 --- a/pythran/pythonic/include/builtins/file.hpp +++ b/pythran/pythonic/include/builtins/file.hpp @@ -17,7 +17,7 @@ namespace builtins } DEFINE_FUNCTOR(pythonic::builtins::anonymous, file); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/close.hpp b/pythran/pythonic/include/builtins/file/close.hpp index 106b3d0baa..e4fbf8f509 100644 --- a/pythran/pythonic/include/builtins/file/close.hpp +++ b/pythran/pythonic/include/builtins/file/close.hpp @@ -16,7 +16,7 @@ namespace builtins void close(types::file &&f); DEFINE_FUNCTOR(pythonic::builtins::file, close); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/fileno.hpp b/pythran/pythonic/include/builtins/file/fileno.hpp index db8c9c055e..9323f7b699 100644 --- a/pythran/pythonic/include/builtins/file/fileno.hpp +++ b/pythran/pythonic/include/builtins/file/fileno.hpp @@ -15,7 +15,7 @@ namespace builtins long fileno(types::file const &f); DEFINE_FUNCTOR(pythonic::builtins::file, fileno); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/flush.hpp b/pythran/pythonic/include/builtins/file/flush.hpp index e0d2b3a240..e193d9f8b6 100644 --- a/pythran/pythonic/include/builtins/file/flush.hpp +++ b/pythran/pythonic/include/builtins/file/flush.hpp @@ -16,7 +16,7 @@ namespace builtins void flush(types::file &&f); DEFINE_FUNCTOR(pythonic::builtins::file, flush); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/isatty.hpp b/pythran/pythonic/include/builtins/file/isatty.hpp index 87bfb13759..55bdc93335 100644 --- a/pythran/pythonic/include/builtins/file/isatty.hpp +++ b/pythran/pythonic/include/builtins/file/isatty.hpp @@ -15,7 +15,7 @@ namespace builtins bool isatty(types::file const &f); DEFINE_FUNCTOR(pythonic::builtins::file, isatty); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/next.hpp b/pythran/pythonic/include/builtins/file/next.hpp index 1378f872d7..9d51b4ba7e 100644 --- a/pythran/pythonic/include/builtins/file/next.hpp +++ b/pythran/pythonic/include/builtins/file/next.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(next, pythonic::__dispatch__::functor::next); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/read.hpp b/pythran/pythonic/include/builtins/file/read.hpp index aeaa1f3ab2..8ac0b63dbc 100644 --- a/pythran/pythonic/include/builtins/file/read.hpp +++ b/pythran/pythonic/include/builtins/file/read.hpp @@ -17,7 +17,7 @@ namespace builtins types::str read(types::file &&f, long size = -1); DEFINE_FUNCTOR(pythonic::builtins::file, read); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/readline.hpp b/pythran/pythonic/include/builtins/file/readline.hpp index 31abcc98fe..00810611b1 100644 --- a/pythran/pythonic/include/builtins/file/readline.hpp +++ b/pythran/pythonic/include/builtins/file/readline.hpp @@ -17,7 +17,7 @@ namespace builtins types::str readline(types::file &&f, long size = -1); DEFINE_FUNCTOR(pythonic::builtins::file, readline); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/readlines.hpp b/pythran/pythonic/include/builtins/file/readlines.hpp index 32dea082d9..a5f77ee32e 100644 --- a/pythran/pythonic/include/builtins/file/readlines.hpp +++ b/pythran/pythonic/include/builtins/file/readlines.hpp @@ -20,7 +20,7 @@ namespace builtins types::list readlines(F &&f, long sizehint); DEFINE_FUNCTOR(pythonic::builtins::file, readlines); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/seek.hpp b/pythran/pythonic/include/builtins/file/seek.hpp index 40f4202a5c..93cd83c78b 100644 --- a/pythran/pythonic/include/builtins/file/seek.hpp +++ b/pythran/pythonic/include/builtins/file/seek.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_FILE_SEEK_HPP #define PYTHONIC_INCLUDE_BUILTIN_FILE_SEEK_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/file.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace builtins void seek(types::file &&f, long offset, long whence); DEFINE_FUNCTOR(pythonic::builtins::file, seek); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/tell.hpp b/pythran/pythonic/include/builtins/file/tell.hpp index a9f623d3dc..12bbab6783 100644 --- a/pythran/pythonic/include/builtins/file/tell.hpp +++ b/pythran/pythonic/include/builtins/file/tell.hpp @@ -15,7 +15,7 @@ namespace builtins long tell(types::file const &f); DEFINE_FUNCTOR(pythonic::builtins::file, tell); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/truncate.hpp b/pythran/pythonic/include/builtins/file/truncate.hpp index 7278238699..45146410c6 100644 --- a/pythran/pythonic/include/builtins/file/truncate.hpp +++ b/pythran/pythonic/include/builtins/file/truncate.hpp @@ -18,7 +18,7 @@ namespace builtins void truncate(types::file &&f, long size); DEFINE_FUNCTOR(pythonic::builtins::file, truncate); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/write.hpp b/pythran/pythonic/include/builtins/file/write.hpp index 66f09cc73e..66fe5ee813 100644 --- a/pythran/pythonic/include/builtins/file/write.hpp +++ b/pythran/pythonic/include/builtins/file/write.hpp @@ -17,7 +17,7 @@ namespace builtins long write(types::file &&f, types::str const &str); DEFINE_FUNCTOR(pythonic::builtins::file, write); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/file/writelines.hpp b/pythran/pythonic/include/builtins/file/writelines.hpp index f98dfc1482..966173a973 100644 --- a/pythran/pythonic/include/builtins/file/writelines.hpp +++ b/pythran/pythonic/include/builtins/file/writelines.hpp @@ -16,7 +16,7 @@ namespace builtins void writelines(F &&f, T const &sequence); DEFINE_FUNCTOR(pythonic::builtins::file, writelines); - } -} + } // namespace file +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/float_.hpp b/pythran/pythonic/include/builtins/float_.hpp index b9d05a6701..15ca376ccf 100644 --- a/pythran/pythonic/include/builtins/float_.hpp +++ b/pythran/pythonic/include/builtins/float_.hpp @@ -24,8 +24,8 @@ namespace builtins return os << "float"; } }; - } -} + } // namespace functor +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/float_/is_integer.hpp b/pythran/pythonic/include/builtins/float_/is_integer.hpp index cfc14f7e8c..ae979b9d16 100644 --- a/pythran/pythonic/include/builtins/float_/is_integer.hpp +++ b/pythran/pythonic/include/builtins/float_/is_integer.hpp @@ -14,8 +14,8 @@ namespace builtins bool is_integer(double d); DEFINE_FUNCTOR(pythonic::builtins::float_, is_integer); - } -} + } // namespace float_ +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/hex.hpp b/pythran/pythonic/include/builtins/hex.hpp index 5d5acb13fc..a078ffc394 100644 --- a/pythran/pythonic/include/builtins/hex.hpp +++ b/pythran/pythonic/include/builtins/hex.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_HEX_HPP #define PYTHONIC_INCLUDE_BUILTIN_HEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace builtins types::str hex(T const &v); DEFINE_FUNCTOR(pythonic::builtins, hex); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/id.hpp b/pythran/pythonic/include/builtins/id.hpp index 40378062ea..257f36c5bc 100644 --- a/pythran/pythonic/include/builtins/id.hpp +++ b/pythran/pythonic/include/builtins/id.hpp @@ -16,7 +16,7 @@ namespace builtins long id(bool const &t); DEFINE_FUNCTOR(pythonic::builtins, id); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/int_.hpp b/pythran/pythonic/include/builtins/int_.hpp index e7a0d94150..dcee7b1648 100644 --- a/pythran/pythonic/include/builtins/int_.hpp +++ b/pythran/pythonic/include/builtins/int_.hpp @@ -26,8 +26,8 @@ namespace builtins return os << "int"; } }; - } -} + } // namespace functor +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/isinstance.hpp b/pythran/pythonic/include/builtins/isinstance.hpp index 8a25f0f33c..806cd0ee29 100644 --- a/pythran/pythonic/include/builtins/isinstance.hpp +++ b/pythran/pythonic/include/builtins/isinstance.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_ISINSTANCE_HPP #define PYTHONIC_INCLUDE_BUILTIN_ISINSTANCE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/builtins/pythran/is_none.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" PYTHONIC_NS_BEGIN @@ -25,7 +25,7 @@ namespace types struct isinstance { using type = true_type; }; -} +} // namespace types namespace builtins { @@ -41,14 +41,14 @@ namespace builtins template struct isinstance> { using type = typename std::conditional< - utils::any_of< - std::is_same()())>::type>::type, - types::true_type>::value...>::value, + utils::any_of()())>::type>::type, + types::true_type>::value...>::value, types::true_type, types::false_type>::type; }; - } + } // namespace details template typename details::isinstance::type isinstance(Obj, Cls) @@ -57,7 +57,7 @@ namespace builtins } DEFINE_FUNCTOR(pythonic::builtins, isinstance); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/iter.hpp b/pythran/pythonic/include/builtins/iter.hpp index 1e3dc07c49..7c252347b7 100644 --- a/pythran/pythonic/include/builtins/iter.hpp +++ b/pythran/pythonic/include/builtins/iter.hpp @@ -23,7 +23,7 @@ namespace builtins iterator const &begin() const; iterator const &end() const; }; - } + } // namespace details template details::iter< @@ -31,7 +31,7 @@ namespace builtins iter(T &&t); DEFINE_FUNCTOR(pythonic::builtins, iter); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/len.hpp b/pythran/pythonic/include/builtins/len.hpp index e0fcf0aade..d884ee5c38 100644 --- a/pythran/pythonic/include/builtins/len.hpp +++ b/pythran/pythonic/include/builtins/len.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/yield.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -20,6 +20,6 @@ namespace builtins len(T const &t); DEFINE_FUNCTOR(pythonic::builtins, len); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list.hpp b/pythran/pythonic/include/builtins/list.hpp index c587b413c5..aba29bc9c1 100644 --- a/pythran/pythonic/include/builtins/list.hpp +++ b/pythran/pythonic/include/builtins/list.hpp @@ -23,10 +23,10 @@ namespace builtins typename std::remove_reference::type::iterator>::value_type>:: type> list(Iterable &&t); - } + } // namespace anonymous DEFINE_FUNCTOR(pythonic::builtins::anonymous, list); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/append.hpp b/pythran/pythonic/include/builtins/list/append.hpp index 507606d4c3..d07b99cef1 100644 --- a/pythran/pythonic/include/builtins/list/append.hpp +++ b/pythran/pythonic/include/builtins/list/append.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_LIST_APPEND_HPP #define PYTHONIC_INCLUDE_BUILTIN_LIST_APPEND_HPP -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -23,7 +23,7 @@ namespace builtins types::none_type append(types::empty_list &seq, F &&value); DEFINE_FUNCTOR(pythonic::builtins::list, append); - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/count.hpp b/pythran/pythonic/include/builtins/list/count.hpp index b8e3707b90..85e4ef1698 100644 --- a/pythran/pythonic/include/builtins/list/count.hpp +++ b/pythran/pythonic/include/builtins/list/count.hpp @@ -13,7 +13,7 @@ namespace builtins { USING_FUNCTOR(count, pythonic::__dispatch__::functor::count); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/extend.hpp b/pythran/pythonic/include/builtins/list/extend.hpp index 8c071ca1ae..bac4c96704 100644 --- a/pythran/pythonic/include/builtins/list/extend.hpp +++ b/pythran/pythonic/include/builtins/list/extend.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_LIST_EXTEND_HPP #define PYTHONIC_INCLUDE_BUILTIN_LIST_EXTEND_HPP -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -26,7 +26,7 @@ namespace builtins extend(T0 &&seq, T1 const &add); DEFINE_FUNCTOR(pythonic::builtins::list, extend); - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/insert.hpp b/pythran/pythonic/include/builtins/list/insert.hpp index 58bfb6a686..5b762f4eca 100644 --- a/pythran/pythonic/include/builtins/list/insert.hpp +++ b/pythran/pythonic/include/builtins/list/insert.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_LIST_INSERT_HPP #define PYTHONIC_INCLUDE_BUILTIN_LIST_INSERT_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace builtins types::none_type insert(types::list &seq, long n, F &&value); DEFINE_FUNCTOR(pythonic::builtins::list, insert); - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/pop.hpp b/pythran/pythonic/include/builtins/list/pop.hpp index 9ac28a6d27..633e0f00e8 100644 --- a/pythran/pythonic/include/builtins/list/pop.hpp +++ b/pythran/pythonic/include/builtins/list/pop.hpp @@ -13,6 +13,6 @@ namespace builtins { USING_FUNCTOR(pop, pythonic::__dispatch__::functor::pop); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/remove.hpp b/pythran/pythonic/include/builtins/list/remove.hpp index 8fd44c85b3..da4307b42c 100644 --- a/pythran/pythonic/include/builtins/list/remove.hpp +++ b/pythran/pythonic/include/builtins/list/remove.hpp @@ -13,6 +13,6 @@ namespace builtins { USING_FUNCTOR(remove, pythonic::__dispatch__::functor::remove); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/reverse.hpp b/pythran/pythonic/include/builtins/list/reverse.hpp index edc2c52370..f5fe0227c1 100644 --- a/pythran/pythonic/include/builtins/list/reverse.hpp +++ b/pythran/pythonic/include/builtins/list/reverse.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_LIST_REVERSE_HPP #define PYTHONIC_INCLUDE_BUILTIN_LIST_REVERSE_HPP -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace builtins types::none_type reverse(types::list &seq); DEFINE_FUNCTOR(pythonic::builtins::list, reverse); - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/list/sort.hpp b/pythran/pythonic/include/builtins/list/sort.hpp index 4f92e8f033..1db0c70bbe 100644 --- a/pythran/pythonic/include/builtins/list/sort.hpp +++ b/pythran/pythonic/include/builtins/list/sort.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_LIST_SORT_HPP #define PYTHONIC_INCLUDE_BUILTIN_LIST_SORT_HPP -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -20,7 +20,7 @@ namespace builtins types::none_type sort(types::list &seq, K key); DEFINE_FUNCTOR(pythonic::builtins::list, sort); - } -} + } // namespace list +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/map.hpp b/pythran/pythonic/include/builtins/map.hpp index 5e0912eb59..788106712c 100644 --- a/pythran/pythonic/include/builtins/map.hpp +++ b/pythran/pythonic/include/builtins/map.hpp @@ -4,9 +4,9 @@ #include "pythonic/include/itertools/common.hpp" #include "pythonic/include/types/NoneType.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/int_.hpp" #include "pythonic/include/utils/iterator.hpp" -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/seq.hpp" #include @@ -21,15 +21,15 @@ namespace builtins template struct map_res { - using type = decltype( - std::declval()(std::declval()( + std::declval::value_type>()...)); }; template struct map_res { - using type = - decltype(types::make_tuple(std::declval::value_type>()...)); }; @@ -98,23 +98,24 @@ namespace builtins map() = default; // Use an extra template to enable forwarding template - map(Operator const &_op, Types &&... _iters); + map(Operator const &_op, Types &&..._iters); iterator &begin(); iterator const &begin() const; iterator const &end() const; }; - } + } // namespace details template - auto map(Operator &&_op, Iter &&... iters) -> details::map< - typename std::remove_cv< - typename std::remove_reference::type>::type, - typename types::iterator::type>::type>::type...>; + auto map(Operator &&_op, Iter &&...iters) + -> details::map< + typename std::remove_cv< + typename std::remove_reference::type>::type, + typename types::iterator::type>::type>::type...>; DEFINE_FUNCTOR(pythonic::builtins, map); -} +} // namespace builtins namespace types { @@ -135,7 +136,7 @@ namespace types // selected static constexpr long value = (_head < _tail ? _head : _tail); }; -} +} // namespace types PYTHONIC_NS_END /* type inference stuff {*/ diff --git a/pythran/pythonic/include/builtins/max.hpp b/pythran/pythonic/include/builtins/max.hpp index 6f69e58b22..6ece9c3354 100644 --- a/pythran/pythonic/include/builtins/max.hpp +++ b/pythran/pythonic/include/builtins/max.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_MAX_HPP #define PYTHONIC_INCLUDE_BUILTIN_MAX_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/operator_/gt.hpp" #include "pythonic/include/builtins/minmax.hpp" +#include "pythonic/include/operator_/gt.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,12 +11,12 @@ namespace builtins { template - auto max(Types &&... values) + auto max(Types &&...values) -> decltype(details::minmax(operator_::functor::lt{}, std::forward(values)...)); DEFINE_FUNCTOR(pythonic::builtins, max); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/min.hpp b/pythran/pythonic/include/builtins/min.hpp index 9b2a6608c7..4aabbaed45 100644 --- a/pythran/pythonic/include/builtins/min.hpp +++ b/pythran/pythonic/include/builtins/min.hpp @@ -1,21 +1,21 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_MIN_HPP #define PYTHONIC_INCLUDE_BUILTIN_MIN_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/operator_/gt.hpp" #include "pythonic/include/builtins/minmax.hpp" +#include "pythonic/include/operator_/gt.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace builtins { template - auto min(Types &&... values) + auto min(Types &&...values) -> decltype(details::minmax(operator_::functor::gt{}, std::forward(values)...)); DEFINE_FUNCTOR(pythonic::builtins, min); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/minmax.hpp b/pythran/pythonic/include/builtins/minmax.hpp index 8163964c18..68f894dc0f 100644 --- a/pythran/pythonic/include/builtins/minmax.hpp +++ b/pythran/pythonic/include/builtins/minmax.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_MINMAX_HPP #define PYTHONIC_INCLUDE_BUILTIN_MINMAX_HPP -#include #include "pythonic/include/builtins/pythran/kwonly.hpp" +#include PYTHONIC_NS_BEGIN @@ -21,8 +21,8 @@ namespace builtins typename std::enable_if::value, typename __combined::type>::type minmax(Op const &, T0 const &, T1 const &, Types const &...); - } -} + } // namespace details +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/next.hpp b/pythran/pythonic/include/builtins/next.hpp index abea2e5ee3..f89e332cc1 100644 --- a/pythran/pythonic/include/builtins/next.hpp +++ b/pythran/pythonic/include/builtins/next.hpp @@ -14,7 +14,7 @@ namespace builtins auto next(T &&y) -> decltype(*y); DEFINE_FUNCTOR(pythonic::builtins, next); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/oct.hpp b/pythran/pythonic/include/builtins/oct.hpp index af52c36a3e..1b1a219b7d 100644 --- a/pythran/pythonic/include/builtins/oct.hpp +++ b/pythran/pythonic/include/builtins/oct.hpp @@ -12,7 +12,7 @@ namespace builtins types::str oct(T const &v); DEFINE_FUNCTOR(pythonic::builtins, oct); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/open.hpp b/pythran/pythonic/include/builtins/open.hpp index 126985be04..e68d4feaa2 100644 --- a/pythran/pythonic/include/builtins/open.hpp +++ b/pythran/pythonic/include/builtins/open.hpp @@ -13,7 +13,7 @@ namespace builtins types::file open(types::str const &filename, types::str const &strmode = "r"); DEFINE_FUNCTOR(pythonic::builtins, open); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/ord.hpp b/pythran/pythonic/include/builtins/ord.hpp index d9658b94ae..32356b07d6 100644 --- a/pythran/pythonic/include/builtins/ord.hpp +++ b/pythran/pythonic/include/builtins/ord.hpp @@ -11,7 +11,7 @@ namespace builtins long ord(types::str const &v); DEFINE_FUNCTOR(pythonic::builtins, ord); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pow.hpp b/pythran/pythonic/include/builtins/pow.hpp index 7b07574dcb..c31526d7eb 100644 --- a/pythran/pythonic/include/builtins/pow.hpp +++ b/pythran/pythonic/include/builtins/pow.hpp @@ -16,11 +16,11 @@ namespace builtins long pow(long, std::integral_constant); template - auto pow(Types &&... args) + auto pow(Types &&...args) -> decltype(numpy::functor::power{}(std::forward(args)...)); DEFINE_FUNCTOR(pythonic::builtins, pow); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/print.hpp b/pythran/pythonic/include/builtins/print.hpp index 9e6599ffb9..fa7b86ce2d 100644 --- a/pythran/pythonic/include/builtins/print.hpp +++ b/pythran/pythonic/include/builtins/print.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PRINT_HPP #define PYTHONIC_INCLUDE_BUILTIN_PRINT_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -12,14 +12,14 @@ namespace builtins void print_nonl(); template - void print_nonl(T const &value, Types const &... values); + void print_nonl(T const &value, Types const &...values); void print(); template - void print(T const &value, Types const &... values); + void print(T const &value, Types const &...values); DEFINE_FUNCTOR(pythonic::builtins, print); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp b/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp index b631bfff7a..6c590b067d 100644 --- a/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp +++ b/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFBREAK_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFBREAK_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/static_if.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,8 @@ namespace builtins types::StaticIfBreak StaticIfBreak(T const &arg); DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfBreak); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END diff --git a/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp b/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp index 4fc6f53af7..918b9cedbe 100644 --- a/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp +++ b/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFCONT_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFCONT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/static_if.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,8 @@ namespace builtins types::StaticIfCont StaticIfCont(T const &arg); DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfCont); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END diff --git a/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp b/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp index 4f795c261b..b19474f63d 100644 --- a/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp +++ b/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFNORETURN_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFNORETURN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/static_if.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,8 @@ namespace builtins types::StaticIfNoReturn StaticIfNoReturn(T const &arg); DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfNoReturn); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END diff --git a/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp b/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp index 766e5dc5ab..72f7b898fd 100644 --- a/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp +++ b/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFRETURN_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATICIFRETURN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/static_if.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,8 @@ namespace builtins types::StaticIfReturn StaticIfReturn(T const &arg); DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfReturn); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/abssqr.hpp b/pythran/pythonic/include/builtins/pythran/abssqr.hpp index 5f62296b09..2f7284fd19 100644 --- a/pythran/pythonic/include/builtins/pythran/abssqr.hpp +++ b/pythran/pythonic/include/builtins/pythran/abssqr.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_ABSSQR_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_ABSSQR_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -21,13 +21,13 @@ namespace builtins template T abssqr(std::complex const &v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME abssqr #define NUMPY_NARY_FUNC_SYM details::abssqr #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/and_.hpp b/pythran/pythonic/include/builtins/pythran/and_.hpp index d6b15e95bd..2ef5198b39 100644 --- a/pythran/pythonic/include/builtins/pythran/and_.hpp +++ b/pythran/pythonic/include/builtins/pythran/and_.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_AND_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_AND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/combined.hpp" #include "pythonic/include/types/lazy.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins types::lazy_combined_t and_(T0 &&, T1 &&); DEFINE_FUNCTOR(pythonic::builtins::pythran, and_); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/len_set.hpp b/pythran/pythonic/include/builtins/pythran/len_set.hpp index 474f991b17..146e9f8b5e 100644 --- a/pythran/pythonic/include/builtins/pythran/len_set.hpp +++ b/pythran/pythonic/include/builtins/pythran/len_set.hpp @@ -15,8 +15,8 @@ namespace builtins long len_set(Iterable const &s); DEFINE_FUNCTOR(pythonic::builtins::pythran, len_set); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/make_shape.hpp b/pythran/pythonic/include/builtins/pythran/make_shape.hpp index 9f97d723eb..fbe1ad1a31 100644 --- a/pythran/pythonic/include/builtins/pythran/make_shape.hpp +++ b/pythran/pythonic/include/builtins/pythran/make_shape.hpp @@ -11,8 +11,8 @@ namespace builtins pythonic::types::pshape make_shape(Args... args); DEFINE_FUNCTOR(pythonic::builtins::pythran, make_shape); - } // pythran -} // builtins + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/or_.hpp b/pythran/pythonic/include/builtins/pythran/or_.hpp index e84af2fe82..1622c50b54 100644 --- a/pythran/pythonic/include/builtins/pythran/or_.hpp +++ b/pythran/pythonic/include/builtins/pythran/or_.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_OR_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_OR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/combined.hpp" #include "pythonic/include/types/lazy.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace builtins types::lazy_combined_t or_(T0 &&, T1 &&); DEFINE_FUNCTOR(pythonic::builtins::pythran, or_); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/static_if.hpp b/pythran/pythonic/include/builtins/pythran/static_if.hpp index a678609de5..bafed1af01 100644 --- a/pythran/pythonic/include/builtins/pythran/static_if.hpp +++ b/pythran/pythonic/include/builtins/pythran/static_if.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATIC_IF_HPP #define PYTHONIC_INCLUDE_BUILTIN_PYTHRAN_STATIC_IF_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/pythran/is_none.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -54,9 +54,10 @@ namespace builtins { } template - auto operator()(Args &&... args) const -> typename __combined< - decltype(f0(std::forward(args)...)), - decltype(f1(std::forward(args)...))>::type + auto operator()(Args &&...args) const -> + typename __combined< + decltype(f0(std::forward(args)...)), + decltype(f1(std::forward(args)...))>::type { if (state_) return f0(std::forward(args)...); @@ -71,10 +72,10 @@ namespace builtins return {state_, f0, f1}; } }; - } + } // namespace details template - auto static_if(T const &cond, F0 f0, F1 f1) - -> decltype(details::static_if{cond}(f0, f1)); + auto static_if(T const &cond, F0 f0, + F1 f1) -> decltype(details::static_if{cond}(f0, f1)); template auto static_if(int const &cond, F0 f0, F1 f1) @@ -84,8 +85,8 @@ namespace builtins } DEFINE_FUNCTOR(pythonic::builtins::pythran, static_if); - } -} + } // namespace pythran +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/pythran/static_list.hpp b/pythran/pythonic/include/builtins/pythran/static_list.hpp index 3d6ba21c71..cc3067bc0e 100644 --- a/pythran/pythonic/include/builtins/pythran/static_list.hpp +++ b/pythran/pythonic/include/builtins/pythran/static_list.hpp @@ -17,15 +17,15 @@ namespace builtins return {}; } template - types::static_list static_list(types::array const &other); + types::static_list static_list(types::array_tuple const &other); template - types::static_list static_list(types::array &other); + types::static_list static_list(types::array_tuple &other); template - types::static_list static_list(types::array &&other); + types::static_list static_list(types::array_tuple &&other); template - auto static_list(T &&other) -> decltype( - pythonic::builtins::functor::list{}(std::forward(other))); + auto static_list(T &&other) -> decltype(pythonic::builtins::functor::list{}( + std::forward(other))); template types::static_list::type, diff --git a/pythran/pythonic/include/builtins/range.hpp b/pythran/pythonic/include/builtins/range.hpp index d88756401b..7c40b6dcd6 100644 --- a/pythran/pythonic/include/builtins/range.hpp +++ b/pythran/pythonic/include/builtins/range.hpp @@ -30,7 +30,7 @@ namespace builtins bool operator<(range_iterator const &other) const; long operator-(range_iterator const &other) const; }; - } + } // namespace struct range { using value_type = long; @@ -58,7 +58,7 @@ namespace builtins }; DEFINE_FUNCTOR(pythonic::builtins, range); -} +} // namespace builtins PYTHONIC_NS_END namespace std @@ -70,7 +70,7 @@ namespace std struct tuple_element { typedef long type; }; -} +} // namespace std /* type inference stuff {*/ #include "pythonic/include/types/combined.hpp" diff --git a/pythran/pythonic/include/builtins/reduce.hpp b/pythran/pythonic/include/builtins/reduce.hpp index 2084ccbf3a..75791102f4 100644 --- a/pythran/pythonic/include/builtins/reduce.hpp +++ b/pythran/pythonic/include/builtins/reduce.hpp @@ -20,7 +20,7 @@ namespace builtins // this convoluted expression computes the fixed-point type of the output // it's required because, e.g. static_list + static_list - // returns array + // returns array_tuple // and this widens to list template using reduce_helper_t = typename __combined< @@ -36,7 +36,7 @@ namespace builtins static_cast>(init), op)); DEFINE_FUNCTOR(pythonic::builtins, reduce); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/reversed.hpp b/pythran/pythonic/include/builtins/reversed.hpp index ead9297154..805009da18 100644 --- a/pythran/pythonic/include/builtins/reversed.hpp +++ b/pythran/pythonic/include/builtins/reversed.hpp @@ -26,13 +26,13 @@ namespace builtins const_iterator begin() const; const_iterator end() const; }; - } + } // namespace details template details::reversed reversed(Iterable const &iterable); DEFINE_FUNCTOR(pythonic::builtins, reversed); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/round.hpp b/pythran/pythonic/include/builtins/round.hpp index 49563a81db..0e45639481 100644 --- a/pythran/pythonic/include/builtins/round.hpp +++ b/pythran/pythonic/include/builtins/round.hpp @@ -14,7 +14,7 @@ namespace builtins double round(T const &v); DEFINE_FUNCTOR(pythonic::builtins, round); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set.hpp b/pythran/pythonic/include/builtins/set.hpp index d5cf0c3dd3..6bff4e9b7a 100644 --- a/pythran/pythonic/include/builtins/set.hpp +++ b/pythran/pythonic/include/builtins/set.hpp @@ -17,9 +17,9 @@ namespace builtins inline types::set::type::iterator>::value_type> set(Iterable &&t); - } + } // namespace anonymous DEFINE_FUNCTOR(pythonic::builtins::anonymous, set); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/add.hpp b/pythran/pythonic/include/builtins/set/add.hpp index 18794b4ba4..c9e9f2fd86 100644 --- a/pythran/pythonic/include/builtins/set/add.hpp +++ b/pythran/pythonic/include/builtins/set/add.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_SET_ADD_HPP #define PYTHONIC_INCLUDE_BUILTIN_SET_ADD_HPP -#include "pythonic/include/types/set.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/set.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -23,7 +23,7 @@ namespace builtins types::none_type add(types::empty_set const &s, F &&value); DEFINE_FUNCTOR(pythonic::builtins::set, add); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/clear.hpp b/pythran/pythonic/include/builtins/set/clear.hpp index 4ccfbe12bd..1011bd0973 100644 --- a/pythran/pythonic/include/builtins/set/clear.hpp +++ b/pythran/pythonic/include/builtins/set/clear.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(clear, pythonic::__dispatch__::functor::clear); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/copy.hpp b/pythran/pythonic/include/builtins/set/copy.hpp index f6628cd93f..b83eb45376 100644 --- a/pythran/pythonic/include/builtins/set/copy.hpp +++ b/pythran/pythonic/include/builtins/set/copy.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(copy, pythonic::__dispatch__::functor::copy); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/difference.hpp b/pythran/pythonic/include/builtins/set/difference.hpp index e246a88eb3..bdc34bc830 100644 --- a/pythran/pythonic/include/builtins/set/difference.hpp +++ b/pythran/pythonic/include/builtins/set/difference.hpp @@ -13,14 +13,14 @@ namespace builtins { template - types::set difference(types::set const &set, Types const &... others); + types::set difference(types::set const &set, Types const &...others); template - types::set difference(types::set &&set, Types const &... others); + types::set difference(types::set &&set, Types const &...others); template types::empty_set difference(types::empty_set const &set, - Types const &... others); + Types const &...others); template types::set difference(types::set const &set); @@ -31,7 +31,7 @@ namespace builtins types::empty_set difference(types::empty_set const &set); DEFINE_FUNCTOR(pythonic::builtins::set, difference); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/difference_update.hpp b/pythran/pythonic/include/builtins/set/difference_update.hpp index 7057bb5cf5..7514ad93b0 100644 --- a/pythran/pythonic/include/builtins/set/difference_update.hpp +++ b/pythran/pythonic/include/builtins/set/difference_update.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_SET_DIFFERENCEUPDATE_HPP #define PYTHONIC_INCLUDE_BUILTIN_SET_DIFFERENCEUPDATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/set.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,18 +14,18 @@ namespace builtins template types::none_type difference_update(types::set &set, - Types const &... others); + Types const &...others); template types::none_type difference_update(types::set &&set, - Types const &... others); + Types const &...others); template types::none_type difference_update(types::empty_set const &set, - Types const &... others); + Types const &...others); DEFINE_FUNCTOR(pythonic::builtins::set, difference_update); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/discard.hpp b/pythran/pythonic/include/builtins/set/discard.hpp index 1e79a83450..11820088e0 100644 --- a/pythran/pythonic/include/builtins/set/discard.hpp +++ b/pythran/pythonic/include/builtins/set/discard.hpp @@ -21,7 +21,7 @@ namespace builtins void discard(types::empty_set const &set, U const &elem); DEFINE_FUNCTOR(pythonic::builtins::set, discard); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/intersection.hpp b/pythran/pythonic/include/builtins/set/intersection.hpp index eb4e34d172..3a33b6bca5 100644 --- a/pythran/pythonic/include/builtins/set/intersection.hpp +++ b/pythran/pythonic/include/builtins/set/intersection.hpp @@ -14,7 +14,7 @@ namespace builtins template typename __combined, Types...>::type - intersection(types::set const &set, Types const &... others); + intersection(types::set const &set, Types const &...others); /* No rvalue overload possible because of return type modification.: * >>> a = set([1,2,3]) @@ -24,10 +24,10 @@ namespace builtins */ template types::empty_set intersection(types::empty_set const &set, - Types const &... others); + Types const &...others); DEFINE_FUNCTOR(pythonic::builtins::set, intersection); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/intersection_update.hpp b/pythran/pythonic/include/builtins/set/intersection_update.hpp index e7d4583cf4..a9fd1bdfc5 100644 --- a/pythran/pythonic/include/builtins/set/intersection_update.hpp +++ b/pythran/pythonic/include/builtins/set/intersection_update.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_SET_INTERSECTIONUPDATE_HPP #define PYTHONIC_INCLUDE_BUILTIN_SET_INTERSECTIONUPDATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/set.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,18 +14,18 @@ namespace builtins template types::none_type intersection_update(types::set &set, - Types const &... others); + Types const &...others); template types::none_type intersection_update(types::set &&set, - Types const &... others); + Types const &...others); template types::none_type intersection_update(types::empty_set &&set, - Types const &... others); + Types const &...others); DEFINE_FUNCTOR(pythonic::builtins::set, intersection_update); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/isdisjoint.hpp b/pythran/pythonic/include/builtins/set/isdisjoint.hpp index 0edf1bd001..d2a0d41ece 100644 --- a/pythran/pythonic/include/builtins/set/isdisjoint.hpp +++ b/pythran/pythonic/include/builtins/set/isdisjoint.hpp @@ -18,7 +18,7 @@ namespace builtins bool isdisjoint(types::empty_set const &calling_set, U const &arg_set); DEFINE_FUNCTOR(pythonic::builtins::set, isdisjoint); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/issubset.hpp b/pythran/pythonic/include/builtins/set/issubset.hpp index 8748d64acd..fb3026ee7e 100644 --- a/pythran/pythonic/include/builtins/set/issubset.hpp +++ b/pythran/pythonic/include/builtins/set/issubset.hpp @@ -19,7 +19,7 @@ namespace builtins bool issubset(types::empty_set const &set, U const &other); DEFINE_FUNCTOR(pythonic::builtins::set, issubset); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/issuperset.hpp b/pythran/pythonic/include/builtins/set/issuperset.hpp index 3b32830f28..f9f886070c 100644 --- a/pythran/pythonic/include/builtins/set/issuperset.hpp +++ b/pythran/pythonic/include/builtins/set/issuperset.hpp @@ -19,7 +19,7 @@ namespace builtins bool issuperset(types::empty_set const &set, U const &other); DEFINE_FUNCTOR(pythonic::builtins::set, issuperset); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/remove.hpp b/pythran/pythonic/include/builtins/set/remove.hpp index cd1edc50e7..9821115440 100644 --- a/pythran/pythonic/include/builtins/set/remove.hpp +++ b/pythran/pythonic/include/builtins/set/remove.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(remove, pythonic::__dispatch__::functor::remove); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/symmetric_difference.hpp b/pythran/pythonic/include/builtins/set/symmetric_difference.hpp index 916449ae26..a58e3635cc 100644 --- a/pythran/pythonic/include/builtins/set/symmetric_difference.hpp +++ b/pythran/pythonic/include/builtins/set/symmetric_difference.hpp @@ -29,7 +29,7 @@ namespace builtins symmetric_difference(types::empty_set const &set, U const &other); DEFINE_FUNCTOR(pythonic::builtins::set, symmetric_difference); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp b/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp index 094bc11843..71b68679fa 100644 --- a/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp +++ b/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp @@ -25,7 +25,7 @@ namespace builtins U const &other); DEFINE_FUNCTOR(pythonic::builtins::set, symmetric_difference_update); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/union_.hpp b/pythran/pythonic/include/builtins/set/union_.hpp index 92f0741359..2e561dd825 100644 --- a/pythran/pythonic/include/builtins/set/union_.hpp +++ b/pythran/pythonic/include/builtins/set/union_.hpp @@ -14,11 +14,11 @@ namespace builtins template typename __combined, Types...>::type - union_(types::set const &set, Types const &... others); + union_(types::set const &set, Types const &...others); template typename __combined::type - union_(types::empty_set const &init, Types const &... others); + union_(types::empty_set const &init, Types const &...others); template types::set union_(types::set const &set); @@ -29,7 +29,7 @@ namespace builtins types::empty_set union_(types::empty_set const &init); DEFINE_FUNCTOR(pythonic::builtins::set, union_); - } -} + } // namespace set +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/set/update.hpp b/pythran/pythonic/include/builtins/set/update.hpp index 99163e3ecb..ec57cdc152 100644 --- a/pythran/pythonic/include/builtins/set/update.hpp +++ b/pythran/pythonic/include/builtins/set/update.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(update, pythonic::__dispatch__::functor::update); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/sorted.hpp b/pythran/pythonic/include/builtins/sorted.hpp index be2859f02f..61553dbdde 100644 --- a/pythran/pythonic/include/builtins/sorted.hpp +++ b/pythran/pythonic/include/builtins/sorted.hpp @@ -25,7 +25,7 @@ namespace builtins sorted(Iterable &&seq, types::none_type const &key, bool reverse = false); DEFINE_FUNCTOR(pythonic::builtins, sorted); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str.hpp b/pythran/pythonic/include/builtins/str.hpp index ccaa8846de..4adf0379b6 100644 --- a/pythran/pythonic/include/builtins/str.hpp +++ b/pythran/pythonic/include/builtins/str.hpp @@ -18,10 +18,10 @@ namespace builtins inline types::str str(bool b); inline types::str str(long value); inline types::str str(double l); - } + } // namespace anonymous DEFINE_FUNCTOR(pythonic::builtins::anonymous, str); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/__mod__.hpp b/pythran/pythonic/include/builtins/str/__mod__.hpp index e598da55b5..5a687fd6f7 100644 --- a/pythran/pythonic/include/builtins/str/__mod__.hpp +++ b/pythran/pythonic/include/builtins/str/__mod__.hpp @@ -16,10 +16,11 @@ namespace builtins template types::str __mod__(types::str const &, std::tuple const &args); template - types::str __mod__(types::str const &, types::array const &args); + types::str __mod__(types::str const &, + types::array_tuple const &args); DEFINE_FUNCTOR(pythonic::builtins::str, __mod__); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/capitalize.hpp b/pythran/pythonic/include/builtins/str/capitalize.hpp index fdf4929313..9fd4ccc1d8 100644 --- a/pythran/pythonic/include/builtins/str/capitalize.hpp +++ b/pythran/pythonic/include/builtins/str/capitalize.hpp @@ -15,7 +15,7 @@ namespace builtins types::str capitalize(types::str const &s); DEFINE_FUNCTOR(pythonic::builtins::str, capitalize); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/count.hpp b/pythran/pythonic/include/builtins/str/count.hpp index 35c0a6ae88..f6f8244b9a 100644 --- a/pythran/pythonic/include/builtins/str/count.hpp +++ b/pythran/pythonic/include/builtins/str/count.hpp @@ -11,6 +11,6 @@ namespace builtins { USING_FUNCTOR(count, pythonic::__dispatch__::functor::count); } -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/endswith.hpp b/pythran/pythonic/include/builtins/str/endswith.hpp index 78f94b170c..4772df1d17 100644 --- a/pythran/pythonic/include/builtins/str/endswith.hpp +++ b/pythran/pythonic/include/builtins/str/endswith.hpp @@ -17,7 +17,7 @@ namespace builtins long end = -1); DEFINE_FUNCTOR(pythonic::builtins::str, endswith); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/find.hpp b/pythran/pythonic/include/builtins/str/find.hpp index b9852d98cb..f7563e670b 100644 --- a/pythran/pythonic/include/builtins/str/find.hpp +++ b/pythran/pythonic/include/builtins/str/find.hpp @@ -20,7 +20,7 @@ namespace builtins long find(types::str const &s, types::str const &value); DEFINE_FUNCTOR(pythonic::builtins::str, find); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/isalpha.hpp b/pythran/pythonic/include/builtins/str/isalpha.hpp index 463f4f25a2..dec802e5a2 100644 --- a/pythran/pythonic/include/builtins/str/isalpha.hpp +++ b/pythran/pythonic/include/builtins/str/isalpha.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_STR_ISALPHA_HPP #define PYTHONIC_INCLUDE_BUILTIN_STR_ISALPHA_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace builtins bool isalpha(types::str const &s); DEFINE_FUNCTOR(pythonic::builtins::str, isalpha); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/isdigit.hpp b/pythran/pythonic/include/builtins/str/isdigit.hpp index 5771c7da4c..d58089f96f 100644 --- a/pythran/pythonic/include/builtins/str/isdigit.hpp +++ b/pythran/pythonic/include/builtins/str/isdigit.hpp @@ -15,7 +15,7 @@ namespace builtins bool isdigit(types::str const &s); DEFINE_FUNCTOR(pythonic::builtins::str, isdigit); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/join.hpp b/pythran/pythonic/include/builtins/str/join.hpp index aa566d1e4d..cac5684f61 100644 --- a/pythran/pythonic/include/builtins/str/join.hpp +++ b/pythran/pythonic/include/builtins/str/join.hpp @@ -40,7 +40,7 @@ namespace builtins join(S const &s, Iterable &&iterable); DEFINE_FUNCTOR(pythonic::builtins::str, join); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/lower.hpp b/pythran/pythonic/include/builtins/str/lower.hpp index b204a5c25b..2ba4cf0d37 100644 --- a/pythran/pythonic/include/builtins/str/lower.hpp +++ b/pythran/pythonic/include/builtins/str/lower.hpp @@ -15,7 +15,7 @@ namespace builtins types::str lower(types::str const &s); DEFINE_FUNCTOR(pythonic::builtins::str, lower); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/lstrip.hpp b/pythran/pythonic/include/builtins/str/lstrip.hpp index 23c75f0371..565590aa53 100644 --- a/pythran/pythonic/include/builtins/str/lstrip.hpp +++ b/pythran/pythonic/include/builtins/str/lstrip.hpp @@ -14,7 +14,7 @@ namespace builtins types::str lstrip(types::str const &self, types::str const &to_del = " "); DEFINE_FUNCTOR(pythonic::builtins::str, lstrip); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/replace.hpp b/pythran/pythonic/include/builtins/str/replace.hpp index 2493f64145..353d73cff8 100644 --- a/pythran/pythonic/include/builtins/str/replace.hpp +++ b/pythran/pythonic/include/builtins/str/replace.hpp @@ -17,7 +17,7 @@ namespace builtins long count = std::numeric_limits::max()); DEFINE_FUNCTOR(pythonic::builtins::str, replace); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/rstrip.hpp b/pythran/pythonic/include/builtins/str/rstrip.hpp index db2d6a2717..d3beb61e5b 100644 --- a/pythran/pythonic/include/builtins/str/rstrip.hpp +++ b/pythran/pythonic/include/builtins/str/rstrip.hpp @@ -15,7 +15,7 @@ namespace builtins types::str rstrip(types::str const &self, types::str const &to_del = " "); DEFINE_FUNCTOR(pythonic::builtins::str, rstrip); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/split.hpp b/pythran/pythonic/include/builtins/str/split.hpp index a2d19f60f0..43304c4b3e 100644 --- a/pythran/pythonic/include/builtins/str/split.hpp +++ b/pythran/pythonic/include/builtins/str/split.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_STR_SPLIT_HPP #define PYTHONIC_INCLUDE_BUILTIN_STR_SPLIT_HPP -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/str.hpp" #include "pythonic/include/utils/functor.hpp" @@ -22,7 +22,7 @@ namespace builtins long maxsplit = -1); DEFINE_FUNCTOR(pythonic::builtins::str, split); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/startswith.hpp b/pythran/pythonic/include/builtins/str/startswith.hpp index e1931d2e78..41fe387827 100644 --- a/pythran/pythonic/include/builtins/str/startswith.hpp +++ b/pythran/pythonic/include/builtins/str/startswith.hpp @@ -16,7 +16,7 @@ namespace builtins long start = 0, long end = -1); DEFINE_FUNCTOR(pythonic::builtins::str, startswith); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/strip.hpp b/pythran/pythonic/include/builtins/str/strip.hpp index ec045f1118..1a5cfce67b 100644 --- a/pythran/pythonic/include/builtins/str/strip.hpp +++ b/pythran/pythonic/include/builtins/str/strip.hpp @@ -15,7 +15,7 @@ namespace builtins types::str strip(types::str const &self, types::str const &to_del = " \n"); DEFINE_FUNCTOR(pythonic::builtins::str, strip); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/str/upper.hpp b/pythran/pythonic/include/builtins/str/upper.hpp index 6c1b0279f1..19b150ad1e 100644 --- a/pythran/pythonic/include/builtins/str/upper.hpp +++ b/pythran/pythonic/include/builtins/str/upper.hpp @@ -15,7 +15,7 @@ namespace builtins types::str upper(types::str const &s); DEFINE_FUNCTOR(pythonic::builtins::str, upper); - } -} + } // namespace str +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/sum.hpp b/pythran/pythonic/include/builtins/sum.hpp index d33137066a..dd5adfce71 100644 --- a/pythran/pythonic/include/builtins/sum.hpp +++ b/pythran/pythonic/include/builtins/sum.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/types/assignable.hpp" #include "pythonic/include/types/tuple.hpp" -#include "pythonic/include/utils/int_.hpp" #include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/int_.hpp" #include @@ -17,21 +17,22 @@ namespace builtins { template struct tuple_sum { - auto operator()(Tuple const &t) - -> decltype(std::get(t) + tuple_sum()(t)); + auto operator()(Tuple const &t) -> decltype(std::get(t) + + tuple_sum()(t)); }; template struct tuple_sum { auto operator()(Tuple const &t) -> decltype(std::get<0>(t)); }; - } + } // namespace details template - auto sum(Iterable s, T start) -> decltype(std::accumulate( - s.begin(), s.end(), - static_cast::type>( - start))); + auto sum(Iterable s, T start) + -> decltype(std::accumulate( + s.begin(), s.end(), + static_cast::type>( + start))); template auto sum(Iterable s) -> decltype(sum(s, 0L)) @@ -40,10 +41,11 @@ namespace builtins } template - auto sum(std::tuple const &t) -> decltype( - details::tuple_sum, sizeof...(Types)-1>()(t)) + auto sum(std::tuple const &t) + -> decltype(details::tuple_sum, + sizeof...(Types) - 1>()(t)) { - return details::tuple_sum, sizeof...(Types)-1>()(t); + return details::tuple_sum, sizeof...(Types) - 1>()(t); } template @@ -53,7 +55,7 @@ namespace builtins } DEFINE_FUNCTOR(pythonic::builtins, sum); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/tuple.hpp b/pythran/pythonic/include/builtins/tuple.hpp index 59e3db2793..1dcdcfa40d 100644 --- a/pythran/pythonic/include/builtins/tuple.hpp +++ b/pythran/pythonic/include/builtins/tuple.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_BUILTIN_TUPLE_HPP #define PYTHONIC_INCLUDE_BUILTIN_TUPLE_HPP -#include "pythonic/include/types/tuple.hpp" #include "pythonic/include/types/dynamic_tuple.hpp" +#include "pythonic/include/types/tuple.hpp" #include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -30,7 +30,7 @@ namespace builtins typename std::enable_if< types::len_of::type>::type>::value >= 0, - types::array< + types::array_tuple< typename std::iterator_traits< typename std::remove_cv::type>::type::iterator>::value_type, @@ -39,7 +39,7 @@ namespace builtins tuple(StaticIterable &&i); DEFINE_FUNCTOR(pythonic::builtins, tuple); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/type.hpp b/pythran/pythonic/include/builtins/type.hpp index d115066a79..bd50e722b8 100644 --- a/pythran/pythonic/include/builtins/type.hpp +++ b/pythran/pythonic/include/builtins/type.hpp @@ -11,7 +11,7 @@ namespace builtins template typename type_functor::type type(T const &t); DEFINE_FUNCTOR(pythonic::builtins, type); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/xrange.hpp b/pythran/pythonic/include/builtins/xrange.hpp index 340eeabd14..9b2d17d0d4 100644 --- a/pythran/pythonic/include/builtins/xrange.hpp +++ b/pythran/pythonic/include/builtins/xrange.hpp @@ -28,7 +28,7 @@ namespace builtins bool operator<(xrange_iterator const &other) const; long operator-(xrange_iterator const &other) const; }; - } + } // namespace struct xrange { using value_type = long; @@ -51,7 +51,7 @@ namespace builtins }; DEFINE_FUNCTOR(pythonic::builtins, xrange); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/builtins/zip.hpp b/pythran/pythonic/include/builtins/zip.hpp index d37be63b66..731f91eecd 100644 --- a/pythran/pythonic/include/builtins/zip.hpp +++ b/pythran/pythonic/include/builtins/zip.hpp @@ -10,11 +10,11 @@ namespace builtins { template - auto zip(Iter &&... iters) - -> decltype(map(builtins::None, std::forward(iters)...)); + auto zip(Iter &&...iters) -> decltype(map(builtins::None, + std::forward(iters)...)); DEFINE_FUNCTOR(pythonic::builtins, zip); -} +} // namespace builtins PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/cmath/acos.hpp b/pythran/pythonic/include/cmath/acos.hpp index 71ac51e739..92d24f89d5 100644 --- a/pythran/pythonic/include/cmath/acos.hpp +++ b/pythran/pythonic/include/cmath/acos.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ACOS_HPP #define PYTHONIC_INCLUDE_CMATH_ACOS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/acosh.hpp b/pythran/pythonic/include/cmath/acosh.hpp index 46d979f916..1140211104 100644 --- a/pythran/pythonic/include/cmath/acosh.hpp +++ b/pythran/pythonic/include/cmath/acosh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ACOSH_HPP #define PYTHONIC_INCLUDE_CMATH_ACOSH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/asin.hpp b/pythran/pythonic/include/cmath/asin.hpp index f5e8fb2e1d..f40ef73477 100644 --- a/pythran/pythonic/include/cmath/asin.hpp +++ b/pythran/pythonic/include/cmath/asin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ASIN_HPP #define PYTHONIC_INCLUDE_CMATH_ASIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/asinh.hpp b/pythran/pythonic/include/cmath/asinh.hpp index ba7fa7ee2e..904e57f04b 100644 --- a/pythran/pythonic/include/cmath/asinh.hpp +++ b/pythran/pythonic/include/cmath/asinh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ASINH_HPP #define PYTHONIC_INCLUDE_CMATH_ASINH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/atan.hpp b/pythran/pythonic/include/cmath/atan.hpp index 9cef6406d7..47b979517c 100644 --- a/pythran/pythonic/include/cmath/atan.hpp +++ b/pythran/pythonic/include/cmath/atan.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ATAN_HPP #define PYTHONIC_INCLUDE_CMATH_ATAN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/atanh.hpp b/pythran/pythonic/include/cmath/atanh.hpp index ede7ff35f9..9ebc806938 100644 --- a/pythran/pythonic/include/cmath/atanh.hpp +++ b/pythran/pythonic/include/cmath/atanh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ATANH_HPP #define PYTHONIC_INCLUDE_CMATH_ATANH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/cos.hpp b/pythran/pythonic/include/cmath/cos.hpp index f5071fc02b..40a35bc7f3 100644 --- a/pythran/pythonic/include/cmath/cos.hpp +++ b/pythran/pythonic/include/cmath/cos.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_COS_HPP #define PYTHONIC_INCLUDE_CMATH_COS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -16,7 +16,7 @@ namespace cmath std::complex cos(T const &v); DEFINE_FUNCTOR(pythonic::cmath, cos); -} +} // namespace cmath PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/cmath/cosh.hpp b/pythran/pythonic/include/cmath/cosh.hpp index 905b213209..ffcc2e9574 100644 --- a/pythran/pythonic/include/cmath/cosh.hpp +++ b/pythran/pythonic/include/cmath/cosh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_COSH_HPP #define PYTHONIC_INCLUDE_CMATH_COSH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/e.hpp b/pythran/pythonic/include/cmath/e.hpp index d128c68dbe..fbf9acd5c1 100644 --- a/pythran/pythonic/include/cmath/e.hpp +++ b/pythran/pythonic/include/cmath/e.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_E_HPP #define PYTHONIC_INCLUDE_CMATH_E_HPP -#include "pythonic/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/exp.hpp b/pythran/pythonic/include/cmath/exp.hpp index 8c5b3ba1f1..a970e3b148 100644 --- a/pythran/pythonic/include/cmath/exp.hpp +++ b/pythran/pythonic/include/cmath/exp.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_EXP_HPP #define PYTHONIC_INCLUDE_CMATH_EXP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/isinf.hpp b/pythran/pythonic/include/cmath/isinf.hpp index 1b1a0e13de..24acc80756 100644 --- a/pythran/pythonic/include/cmath/isinf.hpp +++ b/pythran/pythonic/include/cmath/isinf.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ISINF_HPP #define PYTHONIC_INCLUDE_CMATH_ISINF_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/isnan.hpp b/pythran/pythonic/include/cmath/isnan.hpp index be7cc9ad84..f52136c3e4 100644 --- a/pythran/pythonic/include/cmath/isnan.hpp +++ b/pythran/pythonic/include/cmath/isnan.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_ISNAN_HPP #define PYTHONIC_INCLUDE_CMATH_ISNAN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/log.hpp b/pythran/pythonic/include/cmath/log.hpp index dd59e40200..618aeae30e 100644 --- a/pythran/pythonic/include/cmath/log.hpp +++ b/pythran/pythonic/include/cmath/log.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_LOG_HPP #define PYTHONIC_INCLUDE_CMATH_LOG_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -13,7 +13,7 @@ namespace cmath using std::log; double log(double x, double base); DEFINE_FUNCTOR(pythonic::cmath, log); -} +} // namespace cmath PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/cmath/log10.hpp b/pythran/pythonic/include/cmath/log10.hpp index 85851944a5..6c2f62768b 100644 --- a/pythran/pythonic/include/cmath/log10.hpp +++ b/pythran/pythonic/include/cmath/log10.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_LOG10_HPP #define PYTHONIC_INCLUDE_CMATH_LOG10_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/pi.hpp b/pythran/pythonic/include/cmath/pi.hpp index 6ddfe9f8d1..5672ddb31d 100644 --- a/pythran/pythonic/include/cmath/pi.hpp +++ b/pythran/pythonic/include/cmath/pi.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_PI_HPP #define PYTHONIC_INCLUDE_CMATH_PI_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/sin.hpp b/pythran/pythonic/include/cmath/sin.hpp index 699b9268c6..12b6890105 100644 --- a/pythran/pythonic/include/cmath/sin.hpp +++ b/pythran/pythonic/include/cmath/sin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_SIN_HPP #define PYTHONIC_INCLUDE_CMATH_SIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/sinh.hpp b/pythran/pythonic/include/cmath/sinh.hpp index 42a64fba04..3a773bc54d 100644 --- a/pythran/pythonic/include/cmath/sinh.hpp +++ b/pythran/pythonic/include/cmath/sinh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_SINH_HPP #define PYTHONIC_INCLUDE_CMATH_SINH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/sqrt.hpp b/pythran/pythonic/include/cmath/sqrt.hpp index 4a78f2d1d8..1a7c0e1fd2 100644 --- a/pythran/pythonic/include/cmath/sqrt.hpp +++ b/pythran/pythonic/include/cmath/sqrt.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_SQRT_HPP #define PYTHONIC_INCLUDE_CMATH_SQRT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/tan.hpp b/pythran/pythonic/include/cmath/tan.hpp index 605d6a5672..26336f5f20 100644 --- a/pythran/pythonic/include/cmath/tan.hpp +++ b/pythran/pythonic/include/cmath/tan.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_TAN_HPP #define PYTHONIC_INCLUDE_CMATH_TAN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/cmath/tanh.hpp b/pythran/pythonic/include/cmath/tanh.hpp index 8a628bd5cc..ded400fd57 100644 --- a/pythran/pythonic/include/cmath/tanh.hpp +++ b/pythran/pythonic/include/cmath/tanh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_CMATH_TANH_HPP #define PYTHONIC_INCLUDE_CMATH_TANH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/utils/functor.hpp" #include diff --git a/pythran/pythonic/include/functools/partial.hpp b/pythran/pythonic/include/functools/partial.hpp index ab6698502d..9fdf30ee90 100644 --- a/pythran/pythonic/include/functools/partial.hpp +++ b/pythran/pythonic/include/functools/partial.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/seq.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -33,10 +33,10 @@ namespace functools task(); task(task const &) = default; - task(ClosureTypes const &... types); + task(ClosureTypes const &...types); template - auto call(utils::index_sequence, Types &&... types) const + auto call(utils::index_sequence, Types &&...types) const -> decltype(std::get<0>(closure)(std::get(closure)..., std::forward(types)...)) { @@ -45,20 +45,21 @@ namespace functools } template - auto operator()(Types &&... types) const -> decltype( - this->call(utils::make_index_sequence(), - std::forward(types)...)); + auto operator()(Types &&...types) const + -> decltype(this->call( + utils::make_index_sequence(), + std::forward(types)...)); }; - } + } // namespace details template // remove references as closure capture the env by copy details::task::type>::type...> - partial(Types &&... types); + partial(Types &&...types); DEFINE_FUNCTOR(pythonic::functools, partial); -} +} // namespace functools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/functools/reduce.hpp b/pythran/pythonic/include/functools/reduce.hpp index 02bb5bac48..c237c65c66 100644 --- a/pythran/pythonic/include/functools/reduce.hpp +++ b/pythran/pythonic/include/functools/reduce.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_FUNCTOOLS_REDUCE_HPP #define PYTHONIC_INCLUDE_FUNCTOOLS_REDUCE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/reduce.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp index ae538dda8b..cfb4b1ede8 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp @@ -14,7 +14,7 @@ namespace io { USING_FUNCTOR(close, builtins::file::functor::close); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp index 3798ee16d1..4a05685c05 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp @@ -14,7 +14,7 @@ namespace io { USING_FUNCTOR(fileno, builtins::file::functor::fileno); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp index 48b802af02..7b06ae234c 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp @@ -14,7 +14,7 @@ namespace io { USING_FUNCTOR(flush, builtins::file::functor::flush); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp index f489ce4356..d5843b66e5 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp @@ -14,7 +14,7 @@ namespace io { USING_FUNCTOR(isatty, builtins::file::functor::isatty); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp index 6b81cfbd98..aa1bcaea8d 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(next, builtins::file::functor::next); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp index 8a168d3276..5065064eed 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(read, builtins::file::functor::read); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp index 8a81030be1..b2ee4f9478 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(readline, builtins::file::functor::readline); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp index d4df432dfa..74b88c44f9 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(readlines, builtins::file::functor::readlines); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp index 0bd1b54c7a..b2b576bc36 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(seek, builtins::file::functor::seek); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp index 09deee54ae..c9d4c50b4a 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(tell, builtins::file::functor::tell); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp index 9dd855b745..20ff10f4ee 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(truncate, builtins::file::functor::truncate); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp index 90813ffebc..7546220544 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(write, builtins::file::functor::write); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp b/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp index ff55e19760..a77af96683 100644 --- a/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp +++ b/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp @@ -13,7 +13,7 @@ namespace io { USING_FUNCTOR(writelines, builtins::file::functor::writelines); } - } -} + } // namespace _io +} // namespace io PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/itertools/common.hpp b/pythran/pythonic/include/itertools/common.hpp index 41295a771d..ea5452d6e9 100644 --- a/pythran/pythonic/include/itertools/common.hpp +++ b/pythran/pythonic/include/itertools/common.hpp @@ -8,7 +8,7 @@ namespace itertools struct npos { }; -} +} // namespace itertools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/itertools/count.hpp b/pythran/pythonic/include/itertools/count.hpp index 16956112d8..06e93d9658 100644 --- a/pythran/pythonic/include/itertools/count.hpp +++ b/pythran/pythonic/include/itertools/count.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_ITERTOOLS_COUNT_HPP #define PYTHONIC_INCLUDE_ITERTOOLS_COUNT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/combined.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -38,7 +38,7 @@ namespace itertools iterator const &begin() const; iterator end() const; }; - } + } // namespace details template details::count::type> count(T0 start, @@ -47,7 +47,7 @@ namespace itertools details::count count(); DEFINE_FUNCTOR(pythonic::itertools, count); -} +} // namespace itertools PYTHONIC_NS_END /* type inference stuff {*/ diff --git a/pythran/pythonic/include/itertools/islice.hpp b/pythran/pythonic/include/itertools/islice.hpp index 69c0afdad9..b6545a0a02 100644 --- a/pythran/pythonic/include/itertools/islice.hpp +++ b/pythran/pythonic/include/itertools/islice.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_ITERTOOLS_ISLICE_HPP #define PYTHONIC_INCLUDE_ITERTOOLS_ISLICE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/itertools/common.hpp" #include "pythonic/include/builtins/range.hpp" +#include "pythonic/include/itertools/common.hpp" +#include "pythonic/include/utils/functor.hpp" #include PYTHONIC_NS_BEGIN @@ -64,7 +64,7 @@ namespace itertools islice(Iterable &&iterable, long stop); DEFINE_FUNCTOR(pythonic::itertools, islice); -} +} // namespace itertools PYTHONIC_NS_END /* type inference stuff {*/ diff --git a/pythran/pythonic/include/itertools/permutations.hpp b/pythran/pythonic/include/itertools/permutations.hpp index 5aff43d041..7b0630622c 100644 --- a/pythran/pythonic/include/itertools/permutations.hpp +++ b/pythran/pythonic/include/itertools/permutations.hpp @@ -88,7 +88,7 @@ namespace itertools permutations(T0 iter); template - _permutations> + _permutations> permutations(T0 iter, std::integral_constant); DEFINE_FUNCTOR(pythonic::itertools, permutations); diff --git a/pythran/pythonic/include/itertools/product.hpp b/pythran/pythonic/include/itertools/product.hpp index 7ca6f0c6a9..070726c630 100644 --- a/pythran/pythonic/include/itertools/product.hpp +++ b/pythran/pythonic/include/itertools/product.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_ITERTOOLS_PRODUCT_HPP #define PYTHONIC_INCLUDE_ITERTOOLS_PRODUCT_HPP -#include "pythonic/include/utils/iterator.hpp" -#include "pythonic/include/utils/seq.hpp" -#include "pythonic/include/utils/int_.hpp" #include "pythonic/include/itertools/common.hpp" #include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/int_.hpp" +#include "pythonic/include/utils/iterator.hpp" +#include "pythonic/include/utils/seq.hpp" #include #include @@ -60,21 +60,21 @@ namespace itertools iterator end_iter; product() = default; - product(Iters const &... _iters); + product(Iters const &..._iters); iterator &begin(); iterator const &begin() const; iterator const &end() const; }; - } + } // namespace details template details::product::type>::type...> - product(Iter &&... iters); + product(Iter &&...iters); DEFINE_FUNCTOR(pythonic::itertools, product); -} +} // namespace itertools PYTHONIC_NS_END /* type inference stuff {*/ diff --git a/pythran/pythonic/include/itertools/repeat.hpp b/pythran/pythonic/include/itertools/repeat.hpp index c827e8d5e3..477a789af5 100644 --- a/pythran/pythonic/include/itertools/repeat.hpp +++ b/pythran/pythonic/include/itertools/repeat.hpp @@ -43,7 +43,7 @@ namespace itertools _repeat repeat(T iter); DEFINE_FUNCTOR(pythonic::itertools, repeat); -} +} // namespace itertools PYTHONIC_NS_END /* type inference stuff {*/ diff --git a/pythran/pythonic/include/math/ceil.hpp b/pythran/pythonic/include/math/ceil.hpp index 2b49601462..e46b2c0e50 100644 --- a/pythran/pythonic/include/math/ceil.hpp +++ b/pythran/pythonic/include/math/ceil.hpp @@ -11,7 +11,7 @@ namespace math long ceil(T x); DEFINE_FUNCTOR(pythonic::math, ceil); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/degrees.hpp b/pythran/pythonic/include/math/degrees.hpp index 724ffd310e..7473031e9d 100644 --- a/pythran/pythonic/include/math/degrees.hpp +++ b/pythran/pythonic/include/math/degrees.hpp @@ -12,7 +12,7 @@ namespace math double degrees(T x); DEFINE_FUNCTOR(pythonic::math, degrees); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/factorial.hpp b/pythran/pythonic/include/math/factorial.hpp index cbfc061282..a0284876ee 100644 --- a/pythran/pythonic/include/math/factorial.hpp +++ b/pythran/pythonic/include/math/factorial.hpp @@ -12,7 +12,7 @@ namespace math T factorial(T x); DEFINE_FUNCTOR(pythonic::math, factorial); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/floor.hpp b/pythran/pythonic/include/math/floor.hpp index 8e2b82dd29..f5d66ac20d 100644 --- a/pythran/pythonic/include/math/floor.hpp +++ b/pythran/pythonic/include/math/floor.hpp @@ -11,7 +11,7 @@ namespace math long floor(T x); DEFINE_FUNCTOR(pythonic::math, floor); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/frexp.hpp b/pythran/pythonic/include/math/frexp.hpp index 56d6a80427..bc91d27687 100644 --- a/pythran/pythonic/include/math/frexp.hpp +++ b/pythran/pythonic/include/math/frexp.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_MATH_FREXP_HPP #define PYTHONIC_INCLUDE_MATH_FREXP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -12,7 +12,7 @@ namespace math { std::tuple frexp(double x); DEFINE_FUNCTOR(pythonic::math, frexp); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/gamma.hpp b/pythran/pythonic/include/math/gamma.hpp index 19e7d1eb8c..fc37585ee6 100644 --- a/pythran/pythonic/include/math/gamma.hpp +++ b/pythran/pythonic/include/math/gamma.hpp @@ -10,7 +10,7 @@ namespace math { double gamma(double x); DEFINE_FUNCTOR(pythonic::math, gamma); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/isinf.hpp b/pythran/pythonic/include/math/isinf.hpp index 6c5f8b0d9e..5884b60d98 100644 --- a/pythran/pythonic/include/math/isinf.hpp +++ b/pythran/pythonic/include/math/isinf.hpp @@ -14,7 +14,7 @@ namespace math return std::isinf(v); } DEFINE_FUNCTOR(pythonic::math, isinf); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/log.hpp b/pythran/pythonic/include/math/log.hpp index 0d4090d3c9..ab2056264c 100644 --- a/pythran/pythonic/include/math/log.hpp +++ b/pythran/pythonic/include/math/log.hpp @@ -11,7 +11,7 @@ namespace math using std::log; double log(double x, double base); DEFINE_FUNCTOR(pythonic::math, log); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/modf.hpp b/pythran/pythonic/include/math/modf.hpp index a3ccd0e8c6..566766971d 100644 --- a/pythran/pythonic/include/math/modf.hpp +++ b/pythran/pythonic/include/math/modf.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_MATH_MODF_HPP #define PYTHONIC_INCLUDE_MATH_MODF_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -12,7 +12,7 @@ namespace math { std::tuple modf(double x); DEFINE_FUNCTOR(pythonic::math, modf); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/pi.hpp b/pythran/pythonic/include/math/pi.hpp index c7cc32985f..065b409812 100644 --- a/pythran/pythonic/include/math/pi.hpp +++ b/pythran/pythonic/include/math/pi.hpp @@ -8,7 +8,7 @@ namespace math // see https://meetingcpp.com/blog/items/cpp-and-pi.html double constexpr pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00; -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/radians.hpp b/pythran/pythonic/include/math/radians.hpp index 1262a000f6..1ed2583a9b 100644 --- a/pythran/pythonic/include/math/radians.hpp +++ b/pythran/pythonic/include/math/radians.hpp @@ -11,7 +11,7 @@ namespace math template double radians(T x); DEFINE_FUNCTOR(pythonic::math, radians); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/math/trunc.hpp b/pythran/pythonic/include/math/trunc.hpp index bdb454b109..b9b6713c5d 100644 --- a/pythran/pythonic/include/math/trunc.hpp +++ b/pythran/pythonic/include/math/trunc.hpp @@ -11,7 +11,7 @@ namespace math long trunc(T x); DEFINE_FUNCTOR(pythonic::math, trunc); -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/abs.hpp b/pythran/pythonic/include/numpy/abs.hpp index 1e6c928967..8459a6790f 100644 --- a/pythran/pythonic/include/numpy/abs.hpp +++ b/pythran/pythonic/include/numpy/abs.hpp @@ -2,9 +2,9 @@ #define PYTHONIC_INCLUDE_NUMPY_ABS_HPP #include "pythonic/include/types/numpy_op_helper.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/utils/functor.hpp" #include @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME abs #define NUMPY_NARY_FUNC_SYM xsimd::abs #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/absolute.hpp b/pythran/pythonic/include/numpy/absolute.hpp index 1b421ac57a..b5dae6727a 100644 --- a/pythran/pythonic/include/numpy/absolute.hpp +++ b/pythran/pythonic/include/numpy/absolute.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ABSOLUTE_HPP #define PYTHONIC_INCLUDE_NUMPY_ABSOLUTE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/abs.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/add.hpp b/pythran/pythonic/include/numpy/add.hpp index fbae482f7a..3e4be00470 100644 --- a/pythran/pythonic/include/numpy/add.hpp +++ b/pythran/pythonic/include/numpy/add.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ADD_HPP #define PYTHONIC_INCLUDE_NUMPY_ADD_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/add.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/add.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME add #define NUMPY_NARY_FUNC_SYM pythonic::operator_::add #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/alen.hpp b/pythran/pythonic/include/numpy/alen.hpp index 6deccde09a..b072d9a6ef 100644 --- a/pythran/pythonic/include/numpy/alen.hpp +++ b/pythran/pythonic/include/numpy/alen.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ALEN_HPP #define PYTHONIC_INCLUDE_NUMPY_ALEN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy long alen(T &&expr); DEFINE_FUNCTOR(pythonic::numpy, alen); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/all.hpp b/pythran/pythonic/include/numpy/all.hpp index 77cc158b55..cfe8caf1be 100644 --- a/pythran/pythonic/include/numpy/all.hpp +++ b/pythran/pythonic/include/numpy/all.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ALL_HPP #define PYTHONIC_INCLUDE_NUMPY_ALL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/multiply.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -31,11 +31,12 @@ namespace numpy template typename std::enable_if< E::value != 1, - types::ndarray>>::type + types::ndarray>>::type all(E const &array, long axis); DEFINE_FUNCTOR(pythonic::numpy, all); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/allclose.hpp b/pythran/pythonic/include/numpy/allclose.hpp index 07b26d4941..c2a373d459 100644 --- a/pythran/pythonic/include/numpy/allclose.hpp +++ b/pythran/pythonic/include/numpy/allclose.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ALLCLOSE_HPP #define PYTHONIC_INCLUDE_NUMPY_ALLCLOSE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/abs.hpp" #include "pythonic/include/numpy/isfinite.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy bool allclose(U const &u, V const &v, double rtol = 1e-5, double atol = 1e-8); DEFINE_FUNCTOR(pythonic::numpy, allclose); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/alltrue.hpp b/pythran/pythonic/include/numpy/alltrue.hpp index da988f7a42..e73ff3660a 100644 --- a/pythran/pythonic/include/numpy/alltrue.hpp +++ b/pythran/pythonic/include/numpy/alltrue.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto alltrue(Types &&... types) - -> decltype(all(std::forward(types)...)); + auto + alltrue(Types &&...types) -> decltype(all(std::forward(types)...)); DEFINE_FUNCTOR(pythonic::numpy, alltrue); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/angle.hpp b/pythran/pythonic/include/numpy/angle.hpp index 991ed7e3bf..619e2ac6a6 100644 --- a/pythran/pythonic/include/numpy/angle.hpp +++ b/pythran/pythonic/include/numpy/angle.hpp @@ -18,7 +18,7 @@ namespace numpy auto angle(T const &t) -> decltype(functor::angle_in_rad()(t)); DEFINE_FUNCTOR(pythonic::numpy, angle); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/angle_in_deg.hpp b/pythran/pythonic/include/numpy/angle_in_deg.hpp index 210bc94cec..ebef8869ce 100644 --- a/pythran/pythonic/include/numpy/angle_in_deg.hpp +++ b/pythran/pythonic/include/numpy/angle_in_deg.hpp @@ -22,11 +22,11 @@ namespace numpy { return angle_in_rad(t) * 180 / pi; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME angle_in_deg #define NUMPY_NARY_FUNC_SYM wrapper::angle_in_deg #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/angle_in_rad.hpp b/pythran/pythonic/include/numpy/angle_in_rad.hpp index 5f5d7def3b..a0d032753a 100644 --- a/pythran/pythonic/include/numpy/angle_in_rad.hpp +++ b/pythran/pythonic/include/numpy/angle_in_rad.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ANGLEINRAD_HPP #define PYTHONIC_INCLUDE_NUMPY_ANGLEINRAD_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/arctan.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/arctan.hpp" /* NOTE: angle_in_rad is not part of the official Numpy API, * this file is here only to split the angle function in two parts @@ -17,13 +17,13 @@ namespace numpy namespace wrapper { template - auto angle_in_rad(T const &t) - -> decltype(std::atan2(std::imag(t), std::real(t))); + auto angle_in_rad(T const &t) -> decltype(std::atan2(std::imag(t), + std::real(t))); } #define NUMPY_NARY_FUNC_NAME angle_in_rad #define NUMPY_NARY_FUNC_SYM wrapper::angle_in_rad #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/any.hpp b/pythran/pythonic/include/numpy/any.hpp index 2add8b0405..044005a66a 100644 --- a/pythran/pythonic/include/numpy/any.hpp +++ b/pythran/pythonic/include/numpy/any.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ANY_HPP #define PYTHONIC_INCLUDE_NUMPY_ANY_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/add.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -31,11 +31,12 @@ namespace numpy template typename std::enable_if< E::value != 1, - types::ndarray>>::type + types::ndarray>>::type any(E const &array, long axis); DEFINE_FUNCTOR(pythonic::numpy, any); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/append.hpp b/pythran/pythonic/include/numpy/append.hpp index 935ef25176..c78901598c 100644 --- a/pythran/pythonic/include/numpy/append.hpp +++ b/pythran/pythonic/include/numpy/append.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_APPEND_HPP #define PYTHONIC_INCLUDE_NUMPY_APPEND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -31,7 +31,7 @@ namespace numpy append(T const &to, F const &data); DEFINE_FUNCTOR(pythonic::numpy, append); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arange.hpp b/pythran/pythonic/include/numpy/arange.hpp index 0b6cb1bcb3..7148c51731 100644 --- a/pythran/pythonic/include/numpy/arange.hpp +++ b/pythran/pythonic/include/numpy/arange.hpp @@ -148,9 +148,11 @@ namespace numpy } template - auto operator()(S const &...s) const -> typename std::enable_if< - (sizeof...(S) > 1), - decltype(std::declval>()(s...))>::type + auto operator()(S const &...s) const -> + typename std::enable_if< + (sizeof...(S) > 1), + decltype(std::declval>()( + s...))>::type { return types::ndarray{ types::numpy_expr{ diff --git a/pythran/pythonic/include/numpy/arccos.hpp b/pythran/pythonic/include/numpy/arccos.hpp index 9c6745408a..3921c46158 100644 --- a/pythran/pythonic/include/numpy/arccos.hpp +++ b/pythran/pythonic/include/numpy/arccos.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCCOS_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCCOS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arccos #define NUMPY_NARY_FUNC_SYM xsimd::acos #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/arccosh.hpp b/pythran/pythonic/include/numpy/arccosh.hpp index 8d1e7695ae..1a77b725f3 100644 --- a/pythran/pythonic/include/numpy/arccosh.hpp +++ b/pythran/pythonic/include/numpy/arccosh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCCOSH_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCCOSH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arccosh #define NUMPY_NARY_FUNC_SYM xsimd::acosh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arcsin.hpp b/pythran/pythonic/include/numpy/arcsin.hpp index 849bead802..0a221c7ab3 100644 --- a/pythran/pythonic/include/numpy/arcsin.hpp +++ b/pythran/pythonic/include/numpy/arcsin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCSIN_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCSIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arcsin #define NUMPY_NARY_FUNC_SYM xsimd::asin #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arcsinh.hpp b/pythran/pythonic/include/numpy/arcsinh.hpp index 94922c939c..efaafe1ee9 100644 --- a/pythran/pythonic/include/numpy/arcsinh.hpp +++ b/pythran/pythonic/include/numpy/arcsinh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCSINH_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCSINH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arcsinh #define NUMPY_NARY_FUNC_SYM xsimd::asinh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arctan.hpp b/pythran/pythonic/include/numpy/arctan.hpp index fb44c56b94..1f12102aed 100644 --- a/pythran/pythonic/include/numpy/arctan.hpp +++ b/pythran/pythonic/include/numpy/arctan.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCTAN_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCTAN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctan #define NUMPY_NARY_FUNC_SYM xsimd::atan #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arctan2.hpp b/pythran/pythonic/include/numpy/arctan2.hpp index fb6ba8fbb3..fc32506c7a 100644 --- a/pythran/pythonic/include/numpy/arctan2.hpp +++ b/pythran/pythonic/include/numpy/arctan2.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCTAN2_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCTAN2_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctan2 #define NUMPY_NARY_FUNC_SYM xsimd::atan2 #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/arctanh.hpp b/pythran/pythonic/include/numpy/arctanh.hpp index ebf4a20807..9dc63e94ae 100644 --- a/pythran/pythonic/include/numpy/arctanh.hpp +++ b/pythran/pythonic/include/numpy/arctanh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARCTANH_HPP #define PYTHONIC_INCLUDE_NUMPY_ARCTANH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctanh #define NUMPY_NARY_FUNC_SYM xsimd::atanh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/argmax.hpp b/pythran/pythonic/include/numpy/argmax.hpp index 1bc9c5522c..bc8de17e62 100644 --- a/pythran/pythonic/include/numpy/argmax.hpp +++ b/pythran/pythonic/include/numpy/argmax.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARGMAX_HPP #define PYTHONIC_INCLUDE_NUMPY_ARGMAX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,11 +13,11 @@ namespace numpy long argmax(E const &expr); template - types::ndarray> argmax(E const &expr, - long axis); + types::ndarray> + argmax(E const &expr, long axis); DEFINE_FUNCTOR(pythonic::numpy, argmax); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/argmin.hpp b/pythran/pythonic/include/numpy/argmin.hpp index 429a168fd3..126ac3bb8c 100644 --- a/pythran/pythonic/include/numpy/argmin.hpp +++ b/pythran/pythonic/include/numpy/argmin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARGMIN_HPP #define PYTHONIC_INCLUDE_NUMPY_ARGMIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,11 +12,11 @@ namespace numpy long argmin(E const &expr); template - types::ndarray> argmin(E const &expr, - long axis); + types::ndarray> + argmin(E const &expr, long axis); DEFINE_FUNCTOR(pythonic::numpy, argmin); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/argsort.hpp b/pythran/pythonic/include/numpy/argsort.hpp index d7c3a189eb..6926de372e 100644 --- a/pythran/pythonic/include/numpy/argsort.hpp +++ b/pythran/pythonic/include/numpy/argsort.hpp @@ -1,30 +1,29 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARGSORT_HPP #define PYTHONIC_INCLUDE_NUMPY_ARGSORT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> argsort(E const &expr, - types::none_type, - types::none_type={}); + types::ndarray> + argsort(E const &expr, types::none_type, types::none_type = {}); template types::ndarray argsort(types::ndarray const &a, - long axis = -1, types::none_type kind={}); + long axis = -1, types::none_type kind = {}); template - types::ndarray argsort(types::ndarray const &a, - long axis, types::str const& kind); + types::ndarray argsort(types::ndarray const &a, long axis, + types::str const &kind); NUMPY_EXPR_TO_NDARRAY0_DECL(argsort); DEFINE_FUNCTOR(pythonic::numpy, argsort); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/argwhere.hpp b/pythran/pythonic/include/numpy/argwhere.hpp index c69144a76f..90107d2f58 100644 --- a/pythran/pythonic/include/numpy/argwhere.hpp +++ b/pythran/pythonic/include/numpy/argwhere.hpp @@ -1,18 +1,19 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARGWHERE_HPP #define PYTHONIC_INCLUDE_NUMPY_ARGWHERE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - typename types::ndarray> argwhere(E const &expr); + typename types::ndarray> + argwhere(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, argwhere); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/around.hpp b/pythran/pythonic/include/numpy/around.hpp index d79a3deff9..4e9ae04c52 100644 --- a/pythran/pythonic/include/numpy/around.hpp +++ b/pythran/pythonic/include/numpy/around.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_AROUND_HPP #define PYTHONIC_INCLUDE_NUMPY_AROUND_HPP -#include "pythonic/include/numpy/rint.hpp" -#include "pythonic/include/numpy/floor_divide.hpp" #include "pythonic/include/numpy/asarray.hpp" #include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/numpy/floor_divide.hpp" #include "pythonic/include/numpy/multiply.hpp" +#include "pythonic/include/numpy/rint.hpp" PYTHONIC_NS_BEGIN @@ -17,30 +17,32 @@ namespace numpy // generic floating point version, pure numpy_expr template - auto around(E &&a, long decimals) -> typename std::enable_if< - !std::is_integral< - typename types::dtype_of::type>::type>::value, - decltype(functor::rint{}(functor::multiply{}( - std::forward(a), + auto around(E &&a, long decimals) -> + typename std::enable_if< + !std::is_integral::type>::type>::value, + decltype(functor::rint{}(functor::multiply{}( + std::forward(a), + std::declval::type>::type>())) / std::declval::type>::type>())) / - std::declval::type>::type>())>::type; + typename std::decay::type>::type>())>::type; // the integer version is only relevant when decimals < 0 template - auto around(E &&a, long decimals) -> typename std::enable_if< - std::is_integral< - typename types::dtype_of::type>::type>::value, - decltype(numpy::functor::floor_divide{}( - functor::float64{}(std::forward(a)), + auto around(E &&a, long decimals) -> + typename std::enable_if< + std::is_integral::type>::type>::value, + decltype(numpy::functor::floor_divide{}( + functor::float64{}(std::forward(a)), + std::declval::type>::type>()) * std::declval::type>::type>()) * - std::declval::type>::type>())>::type; + typename std::decay::type>::type>())>::type; DEFINE_FUNCTOR(pythonic::numpy, around); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/array.hpp b/pythran/pythonic/include/numpy/array.hpp index 694d7a53b1..fbc6081c7d 100644 --- a/pythran/pythonic/include/numpy/array.hpp +++ b/pythran/pythonic/include/numpy/array.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARRAY_HPP #define PYTHONIC_INCLUDE_NUMPY_ARRAY_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/nested_container.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -14,16 +14,18 @@ namespace numpy typename std::enable_if< types::has_size::type>::value, types::ndarray::type::value>>>::type - array(T &&iterable, dtype d = dtype()); + types::array_tuple::type::value>>>:: + type + array(T &&iterable, dtype d = dtype()); template ::type::dtype>> typename std::enable_if< !types::has_size::type>::value && !types::is_dtype::type>::value, types::ndarray::type::value>>>::type - array(T &&iterable, dtype d = dtype()); + types::array_tuple::type::value>>>:: + type + array(T &&iterable, dtype d = dtype()); template ::type>::type>> @@ -52,7 +54,7 @@ namespace numpy array(types::array_base &&, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, array); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/array2string.hpp b/pythran/pythonic/include/numpy/array2string.hpp index 29d2b4960b..c689c72321 100644 --- a/pythran/pythonic/include/numpy/array2string.hpp +++ b/pythran/pythonic/include/numpy/array2string.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARRAY2STRING_HPP #define PYTHONIC_INCLUDE_NUMPY_ARRAY2STRING_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy types::str array2string(E &&a); DEFINE_FUNCTOR(pythonic::numpy, array2string); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/array_equal.hpp b/pythran/pythonic/include/numpy/array_equal.hpp index 617598aef7..218238fa23 100644 --- a/pythran/pythonic/include/numpy/array_equal.hpp +++ b/pythran/pythonic/include/numpy/array_equal.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ARRAYEQUAL_HPP #define PYTHONIC_INCLUDE_NUMPY_ARRAYEQUAL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy bool array_equal(U const &u, V const &v); DEFINE_FUNCTOR(pythonic::numpy, array_equal); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/array_equiv.hpp b/pythran/pythonic/include/numpy/array_equiv.hpp index 1ea7c52028..d79c84c6a5 100644 --- a/pythran/pythonic/include/numpy/array_equiv.hpp +++ b/pythran/pythonic/include/numpy/array_equiv.hpp @@ -22,7 +22,7 @@ namespace numpy array_equiv(U const &u, V const &v); DEFINE_FUNCTOR(pythonic::numpy, array_equiv); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/asarray.hpp b/pythran/pythonic/include/numpy/asarray.hpp index 58fde934b9..40377c3ea2 100644 --- a/pythran/pythonic/include/numpy/asarray.hpp +++ b/pythran/pythonic/include/numpy/asarray.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ASARRAY_HPP #define PYTHONIC_INCLUDE_NUMPY_ASARRAY_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/array.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy template struct _asarray { template - auto operator()(Types &&... args) + auto operator()(Types &&...args) -> decltype(array(std::forward(args)...)); }; @@ -23,9 +23,10 @@ namespace numpy }; template - auto asarray(E &&e, types::none_type d = types::none_type()) -> decltype( - _asarray::type, - typename types::dtype_of::type>::type>{}( + auto asarray(E &&e, types::none_type d = types::none_type()) + -> decltype(_asarray::type, + typename types::dtype_of< + typename std::decay::type>::type>{}( std::forward(e))); template @@ -34,7 +35,7 @@ namespace numpy typename dtype::type>{}(std::forward(e), d)); DEFINE_FUNCTOR(pythonic::numpy, asarray); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/asarray_chkfinite.hpp b/pythran/pythonic/include/numpy/asarray_chkfinite.hpp index f028e6419f..4320bfd34d 100644 --- a/pythran/pythonic/include/numpy/asarray_chkfinite.hpp +++ b/pythran/pythonic/include/numpy/asarray_chkfinite.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ASARRAYCHKFINITE_HPP #define PYTHONIC_INCLUDE_NUMPY_ASARRAYCHKFINITE_HPP +#include "pythonic/include/numpy/isfinite.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/isfinite.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME asarray_chkfinite #define NUMPY_NARY_FUNC_SYM wrapper::asarray_chkfinite #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/asfarray.hpp b/pythran/pythonic/include/numpy/asfarray.hpp index 1c306df3a9..114543d279 100644 --- a/pythran/pythonic/include/numpy/asfarray.hpp +++ b/pythran/pythonic/include/numpy/asfarray.hpp @@ -9,10 +9,10 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto asfarray(E &&e, dtype d = dtype()) - -> decltype(asarray(std::forward(e), d)); + auto asfarray(E &&e, + dtype d = dtype()) -> decltype(asarray(std::forward(e), d)); DEFINE_FUNCTOR(pythonic::numpy, asfarray); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/asscalar.hpp b/pythran/pythonic/include/numpy/asscalar.hpp index b35c22cafe..ef2c5f6cba 100644 --- a/pythran/pythonic/include/numpy/asscalar.hpp +++ b/pythran/pythonic/include/numpy/asscalar.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ASSCALAR_HPP #define PYTHONIC_INCLUDE_NUMPY_ASSCALAR_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy asscalar_result_type asscalar(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, asscalar); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/atleast_1d.hpp b/pythran/pythonic/include/numpy/atleast_1d.hpp index ed73f588f5..f6a43e5128 100644 --- a/pythran/pythonic/include/numpy/atleast_1d.hpp +++ b/pythran/pythonic/include/numpy/atleast_1d.hpp @@ -19,7 +19,7 @@ namespace numpy decltype(asarray(t))>::type; DEFINE_FUNCTOR(pythonic::numpy, atleast_1d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/atleast_2d.hpp b/pythran/pythonic/include/numpy/atleast_2d.hpp index 4e22a00ce2..b882ae747a 100644 --- a/pythran/pythonic/include/numpy/atleast_2d.hpp +++ b/pythran/pythonic/include/numpy/atleast_2d.hpp @@ -15,23 +15,25 @@ namespace numpy atleast_2d(T t); template - auto atleast_2d(T const &t) -> - typename std::enable_if < (!types::is_dtype::value) && - T::value<2, types::ndarray< - typename T::dtype, - types::pshape, - typename std::tuple_element< - 0, typename T::shape_t>::type>>>::type; + auto atleast_2d(T const &t) -> + typename std::enable_if < (!types::is_dtype::value) && + T::value<2, + types::ndarray< + typename T::dtype, + types::pshape, + typename std::tuple_element< + 0, typename T::shape_t>::type>>>::type; template - auto atleast_2d(T &&t) -> typename std::enable_if< - (!types::is_dtype::type>::type>::value) && - std::decay::type::value >= 2, - decltype(std::forward(t))>::type; + auto atleast_2d(T &&t) -> + typename std::enable_if< + (!types::is_dtype::type>::type>::value) && + std::decay::type::value >= 2, + decltype(std::forward(t))>::type; DEFINE_FUNCTOR(pythonic::numpy, atleast_2d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/atleast_3d.hpp b/pythran/pythonic/include/numpy/atleast_3d.hpp index b5755733d1..b7720c1022 100644 --- a/pythran/pythonic/include/numpy/atleast_3d.hpp +++ b/pythran/pythonic/include/numpy/atleast_3d.hpp @@ -15,23 +15,25 @@ namespace numpy std::integral_constant>>>::type atleast_3d(T t); template - auto atleast_3d(T const &t) -> typename std::enable_if< - (!types::is_dtype::value) && (T::value == 1), - types::ndarray, - typename std::tuple_element< - 0, typename T::shape_t>::type, - std::integral_constant>>>::type; + auto atleast_3d(T const &t) -> + typename std::enable_if< + (!types::is_dtype::value) && (T::value == 1), + types::ndarray, + typename std::tuple_element< + 0, typename T::shape_t>::type, + std::integral_constant>>>::type; template - auto atleast_3d(T const &t) -> typename std::enable_if< - (!types::is_dtype::value) && (T::value == 2), - types::ndarray< - typename T::dtype, - types::pshape< - typename std::tuple_element<0, typename T::shape_t>::type, - typename std::tuple_element<1, typename T::shape_t>::type, - std::integral_constant>>>::type; + auto atleast_3d(T const &t) -> + typename std::enable_if< + (!types::is_dtype::value) && (T::value == 2), + types::ndarray< + typename T::dtype, + types::pshape< + typename std::tuple_element<0, typename T::shape_t>::type, + typename std::tuple_element<1, typename T::shape_t>::type, + std::integral_constant>>>::type; template auto atleast_3d(T const &t) -> @@ -39,7 +41,7 @@ namespace numpy decltype(asarray(t))>::type; DEFINE_FUNCTOR(pythonic::numpy, atleast_3d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/average.hpp b/pythran/pythonic/include/numpy/average.hpp index fd93219520..c5ae85b534 100644 --- a/pythran/pythonic/include/numpy/average.hpp +++ b/pythran/pythonic/include/numpy/average.hpp @@ -17,10 +17,10 @@ namespace numpy template auto average(E const &expr, types::none_type const &axis, W const &weights) - -> decltype(average(expr *asarray(weights) / average(asarray(weights)))); + -> decltype(average(expr * asarray(weights) / average(asarray(weights)))); DEFINE_FUNCTOR(pythonic::numpy, average); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/base_repr.hpp b/pythran/pythonic/include/numpy/base_repr.hpp index f102143ef1..83adcc5267 100644 --- a/pythran/pythonic/include/numpy/base_repr.hpp +++ b/pythran/pythonic/include/numpy/base_repr.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BASEREPR_HPP #define PYTHONIC_INCLUDE_NUMPY_BASEREPR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy types::str base_repr(long number, long base = 2, long padding = 0); DEFINE_FUNCTOR(pythonic::numpy, base_repr); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/binary_repr.hpp b/pythran/pythonic/include/numpy/binary_repr.hpp index f6bb382f7d..0891a90828 100644 --- a/pythran/pythonic/include/numpy/binary_repr.hpp +++ b/pythran/pythonic/include/numpy/binary_repr.hpp @@ -13,7 +13,7 @@ namespace numpy types::str binary_repr(long number, long width); DEFINE_FUNCTOR(pythonic::numpy, binary_repr); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/bincount.hpp b/pythran/pythonic/include/numpy/bincount.hpp index 24022fd35c..087b41f550 100644 --- a/pythran/pythonic/include/numpy/bincount.hpp +++ b/pythran/pythonic/include/numpy/bincount.hpp @@ -27,7 +27,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(bincount); DEFINE_FUNCTOR(pythonic::numpy, bincount); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/bitwise_and.hpp b/pythran/pythonic/include/numpy/bitwise_and.hpp index f4389ca83a..34881a76df 100644 --- a/pythran/pythonic/include/numpy/bitwise_and.hpp +++ b/pythran/pythonic/include/numpy/bitwise_and.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BITWISE_AND_HPP #define PYTHONIC_INCLUDE_NUMPY_BITWISE_AND_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/and_.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/and_.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_and #define NUMPY_NARY_FUNC_SYM pythonic::operator_::and_ #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/bitwise_not.hpp b/pythran/pythonic/include/numpy/bitwise_not.hpp index 3673eebe9a..b455b623f5 100644 --- a/pythran/pythonic/include/numpy/bitwise_not.hpp +++ b/pythran/pythonic/include/numpy/bitwise_not.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BITWISENOT_HPP #define PYTHONIC_INCLUDE_NUMPY_BITWISENOT_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -15,12 +15,12 @@ namespace numpy decltype(~std::declval()) bitwise_not(A const &a); bool bitwise_not(bool t0); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME bitwise_not #define NUMPY_NARY_FUNC_SYM wrapper::bitwise_not #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END // ndarray have to be include after as bitwise_not is used as a numpy_operator diff --git a/pythran/pythonic/include/numpy/bitwise_or.hpp b/pythran/pythonic/include/numpy/bitwise_or.hpp index be50b626d8..fd9e76c553 100644 --- a/pythran/pythonic/include/numpy/bitwise_or.hpp +++ b/pythran/pythonic/include/numpy/bitwise_or.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BITWISE_OR_HPP #define PYTHONIC_INCLUDE_NUMPY_BITWISE_OR_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/operator_/or_.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_or #define NUMPY_NARY_FUNC_SYM pythonic::operator_::or_ #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/bitwise_xor.hpp b/pythran/pythonic/include/numpy/bitwise_xor.hpp index 9324d6d542..26fca6f8ed 100644 --- a/pythran/pythonic/include/numpy/bitwise_xor.hpp +++ b/pythran/pythonic/include/numpy/bitwise_xor.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BITWISE_XOR_HPP #define PYTHONIC_INCLUDE_NUMPY_BITWISE_XOR_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/xor_.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/xor_.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_xor #define NUMPY_NARY_FUNC_SYM pythonic::operator_::xor_ #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/bool_.hpp b/pythran/pythonic/include/numpy/bool_.hpp index 546aa96fa4..224aa4313b 100644 --- a/pythran/pythonic/include/numpy/bool_.hpp +++ b/pythran/pythonic/include/numpy/bool_.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BOOL_HPP #define PYTHONIC_INCLUDE_NUMPY_BOOL_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy bool bool_(); template bool bool_(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME bool_ #define NUMPY_NARY_FUNC_SYM details::bool_ #define NUMPY_NARY_EXTRA_METHOD using type = bool; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/broadcast_to.hpp b/pythran/pythonic/include/numpy/broadcast_to.hpp index 122c43c6ab..cc3f14b825 100644 --- a/pythran/pythonic/include/numpy/broadcast_to.hpp +++ b/pythran/pythonic/include/numpy/broadcast_to.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BROADCAST_TO_HPP #define PYTHONIC_INCLUDE_NUMPY_BROADCAST_TO_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/empty.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy shape, typename types::dtype_t::type>{})); DEFINE_FUNCTOR(pythonic::numpy, broadcast_to); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/byte.hpp b/pythran/pythonic/include/numpy/byte.hpp index 79f388e5aa..c7478f393f 100644 --- a/pythran/pythonic/include/numpy/byte.hpp +++ b/pythran/pythonic/include/numpy/byte.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_BYTE_HPP #define PYTHONIC_INCLUDE_NUMPY_BYTE_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy char byte(); template char byte(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME byte #define NUMPY_NARY_FUNC_SYM details::byte #define NUMPY_NARY_EXTRA_METHOD using type = char; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cbrt.hpp b/pythran/pythonic/include/numpy/cbrt.hpp index b78a05ee1a..01e4fa0d95 100644 --- a/pythran/pythonic/include/numpy/cbrt.hpp +++ b/pythran/pythonic/include/numpy/cbrt.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CBRT_HPP #define PYTHONIC_INCLUDE_NUMPY_CBRT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cbrt #define NUMPY_NARY_FUNC_SYM xsimd::cbrt #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ceil.hpp b/pythran/pythonic/include/numpy/ceil.hpp index fa8575c699..4230af7081 100644 --- a/pythran/pythonic/include/numpy/ceil.hpp +++ b/pythran/pythonic/include/numpy/ceil.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CEIL_HPP #define PYTHONIC_INCLUDE_NUMPY_CEIL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME ceil #define NUMPY_NARY_FUNC_SYM xsimd::ceil #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/clip.hpp b/pythran/pythonic/include/numpy/clip.hpp index 610b214673..3d5e11ab6e 100644 --- a/pythran/pythonic/include/numpy/clip.hpp +++ b/pythran/pythonic/include/numpy/clip.hpp @@ -26,7 +26,7 @@ namespace numpy template typename __combined::type clip(T const &v, Mi a_min); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME clip #define NUMPY_NARY_FUNC_SYM wrapper::clip @@ -45,7 +45,7 @@ namespace numpy } #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/complex.hpp b/pythran/pythonic/include/numpy/complex.hpp index 5d14999e4d..a44cacddef 100644 --- a/pythran/pythonic/include/numpy/complex.hpp +++ b/pythran/pythonic/include/numpy/complex.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COMPLEX_HPP #define PYTHONIC_INCLUDE_NUMPY_COMPLEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/numpy_op_helper.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -21,7 +21,7 @@ namespace numpy #define NUMPY_NARY_FUNC_SYM details::complex #define NUMPY_NARY_EXTRA_METHOD using type = std::complex; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/complex128.hpp b/pythran/pythonic/include/numpy/complex128.hpp index 04c240b9b5..cc7a473013 100644 --- a/pythran/pythonic/include/numpy/complex128.hpp +++ b/pythran/pythonic/include/numpy/complex128.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy std::complex complex128(); template std::complex complex128(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME complex128 #define NUMPY_NARY_FUNC_SYM details::complex128 #define NUMPY_NARY_EXTRA_METHOD using type = std::complex; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/complex256.hpp b/pythran/pythonic/include/numpy/complex256.hpp index d92e057a2f..caed53d637 100644 --- a/pythran/pythonic/include/numpy/complex256.hpp +++ b/pythran/pythonic/include/numpy/complex256.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy std::complex complex256(); template std::complex complex256(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME complex256 #define NUMPY_NARY_FUNC_SYM details::complex256 #define NUMPY_NARY_EXTRA_METHOD using type = std::complex; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/complex64.hpp b/pythran/pythonic/include/numpy/complex64.hpp index 623a84e288..f09026f40d 100644 --- a/pythran/pythonic/include/numpy/complex64.hpp +++ b/pythran/pythonic/include/numpy/complex64.hpp @@ -2,10 +2,10 @@ #define PYTHONIC_INCLUDE_NUMPY_COMPLEX64_HPP #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -18,13 +18,13 @@ namespace numpy std::complex complex64(V v); template std::complex complex64(std::complex v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME complex64 #define NUMPY_NARY_FUNC_SYM details::complex64 #define NUMPY_NARY_EXTRA_METHOD using type = std::complex; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/concatenate.hpp b/pythran/pythonic/include/numpy/concatenate.hpp index 8ce663f0bf..a5033900ec 100644 --- a/pythran/pythonic/include/numpy/concatenate.hpp +++ b/pythran/pythonic/include/numpy/concatenate.hpp @@ -1,30 +1,30 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CONCATENATE_HPP #define PYTHONIC_INCLUDE_NUMPY_CONCATENATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> + types::ndarray> concatenate(types::array_base const &args, long axis = 0); template auto concatenate(std::tuple const &args, long axis = 0) -> types::ndarray< typename __combined::type::dtype...>::type, - types::array< + types::array_tuple< long, std::tuple_element<0, std::tuple>::type::value>>; template - types::ndarray> + types::ndarray> concatenate(types::list const &args, long axis = 0); DEFINE_FUNCTOR(pythonic::numpy, concatenate); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/conj.hpp b/pythran/pythonic/include/numpy/conj.hpp index c4ecc6a883..79954543b6 100644 --- a/pythran/pythonic/include/numpy/conj.hpp +++ b/pythran/pythonic/include/numpy/conj.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CONJ_HPP #define PYTHONIC_INCLUDE_NUMPY_CONJ_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/conjugate.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/conjugate.hpp b/pythran/pythonic/include/numpy/conjugate.hpp index 686cd1fd27..442d2ccb08 100644 --- a/pythran/pythonic/include/numpy/conjugate.hpp +++ b/pythran/pythonic/include/numpy/conjugate.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_INCLUDE_NUMPY_CONJUGATE_HPP #include "pythonic/include/types/numpy_op_helper.hpp" -#include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/numpy_traits.hpp" #include @@ -44,11 +44,11 @@ namespace numpy { return v; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME conjugate #define NUMPY_NARY_FUNC_SYM wrapper::conjugate #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/convolve.hpp b/pythran/pythonic/include/numpy/convolve.hpp index b87fa07d51..dd63f4ec2d 100644 --- a/pythran/pythonic/include/numpy/convolve.hpp +++ b/pythran/pythonic/include/numpy/convolve.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CONVOLVE_HPP #define PYTHONIC_INCLUDE_NUMPY_CONVOLVE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(convolve) DEFINE_FUNCTOR(pythonic::numpy, convolve) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/copy.hpp b/pythran/pythonic/include/numpy/copy.hpp index 891b562bd2..952f040735 100644 --- a/pythran/pythonic/include/numpy/copy.hpp +++ b/pythran/pythonic/include/numpy/copy.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COPY_HPP #define PYTHONIC_INCLUDE_NUMPY_COPY_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,8 @@ namespace numpy template typename std::enable_if< !types::is_array::value && !types::is_dtype::value, - types::ndarray>>::type + types::ndarray>>::type copy(E const &v); // scalar / complex case @@ -37,7 +38,7 @@ namespace numpy copy(types::numpy_texpr> const &a); DEFINE_FUNCTOR(pythonic::numpy, copy); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/copysign.hpp b/pythran/pythonic/include/numpy/copysign.hpp index bafe162931..33dcbbfa80 100644 --- a/pythran/pythonic/include/numpy/copysign.hpp +++ b/pythran/pythonic/include/numpy/copysign.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COPYSIGN_HPP #define PYTHONIC_INCLUDE_NUMPY_COPYSIGN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME copysign #define NUMPY_NARY_FUNC_SYM xsimd::copysign #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/copyto.hpp b/pythran/pythonic/include/numpy/copyto.hpp index 2fefe9470c..07854fec2e 100644 --- a/pythran/pythonic/include/numpy/copyto.hpp +++ b/pythran/pythonic/include/numpy/copyto.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COPYTO_HPP #define PYTHONIC_INCLUDE_NUMPY_COPYTO_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -14,20 +14,23 @@ namespace numpy types::none_type copyto(types::ndarray &&out, E const &expr); template - types::none_type copyto(types::numpy_texpr> &out, E const &expr); + types::none_type copyto(types::numpy_texpr> &out, + E const &expr); template - types::none_type copyto(types::numpy_texpr> &&out, E const &expr); + types::none_type copyto(types::numpy_texpr> &&out, + E const &expr); // pythran extensions template - types::none_type copyto(E &out, F const &expr) { + types::none_type copyto(E &out, F const &expr) + { out[types::fast_contiguous_slice(0, types::none_type{})] = expr; return {}; } DEFINE_FUNCTOR(pythonic::numpy, copyto); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/correlate.hpp b/pythran/pythonic/include/numpy/correlate.hpp index 8a33eec0ad..6e6216b78a 100644 --- a/pythran/pythonic/include/numpy/correlate.hpp +++ b/pythran/pythonic/include/numpy/correlate.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CORRELATE_HPP #define PYTHONIC_INCLUDE_NUMPY_CORRELATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(correlate) DEFINE_FUNCTOR(pythonic::numpy, correlate) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cos.hpp b/pythran/pythonic/include/numpy/cos.hpp index aae84e4d5c..c19969a39e 100644 --- a/pythran/pythonic/include/numpy/cos.hpp +++ b/pythran/pythonic/include/numpy/cos.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COS_HPP #define PYTHONIC_INCLUDE_NUMPY_COS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cos #define NUMPY_NARY_FUNC_SYM xsimd::cos #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cosh.hpp b/pythran/pythonic/include/numpy/cosh.hpp index d028a6a12a..9b369f625f 100644 --- a/pythran/pythonic/include/numpy/cosh.hpp +++ b/pythran/pythonic/include/numpy/cosh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COSH_HPP #define PYTHONIC_INCLUDE_NUMPY_COSH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cosh #define NUMPY_NARY_FUNC_SYM xsimd::cosh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/count_nonzero.hpp b/pythran/pythonic/include/numpy/count_nonzero.hpp index 748511e808..3a140881bf 100644 --- a/pythran/pythonic/include/numpy/count_nonzero.hpp +++ b/pythran/pythonic/include/numpy/count_nonzero.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_COUNT_NONZERO_HPP #define PYTHONIC_INCLUDE_NUMPY_COUNT_NONZERO_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -24,7 +24,7 @@ namespace numpy long count_nonzero(E const &array); DEFINE_FUNCTOR(pythonic::numpy, count_nonzero); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cross.hpp b/pythran/pythonic/include/numpy/cross.hpp index 3f12a70544..139d0874a6 100644 --- a/pythran/pythonic/include/numpy/cross.hpp +++ b/pythran/pythonic/include/numpy/cross.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CROSS_HPP #define PYTHONIC_INCLUDE_NUMPY_CROSS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,11 +11,11 @@ namespace numpy template types::ndarray< typename __combined::type, - types::array> + types::array_tuple> cross(E const &e, F const &f); DEFINE_FUNCTOR(pythonic::numpy, cross); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp b/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp index d804c6d958..c6184dc998 100644 --- a/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp +++ b/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp @@ -17,8 +17,8 @@ namespace numpy template types::ndarray> as_array(types::pointer, long); DEFINE_FUNCTOR(pythonic::numpy::ctypeslib, as_array); - } -} + } // namespace ctypeslib +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cumprod.hpp b/pythran/pythonic/include/numpy/cumprod.hpp index a3bbd2cf98..b2e3b58354 100644 --- a/pythran/pythonic/include/numpy/cumprod.hpp +++ b/pythran/pythonic/include/numpy/cumprod.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CUMPROD_HPP #define PYTHONIC_INCLUDE_NUMPY_CUMPROD_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/partial_sum.hpp" #include "pythonic/include/operator_/imul.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,14 +11,14 @@ namespace numpy { template - auto cumprod(E &&e, Opts &&... opts) + auto cumprod(E &&e, Opts &&...opts) -> decltype(partial_sum( std::forward(e), std::forward(opts)...)); NUMPY_EXPR_TO_NDARRAY0_DECL(cumprod); DEFINE_FUNCTOR(pythonic::numpy, cumprod); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/cumsum.hpp b/pythran/pythonic/include/numpy/cumsum.hpp index 8f16278a4a..cd37a1e657 100644 --- a/pythran/pythonic/include/numpy/cumsum.hpp +++ b/pythran/pythonic/include/numpy/cumsum.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_CUMSUM_HPP #define PYTHONIC_INCLUDE_NUMPY_CUMSUM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/partial_sum.hpp" #include "pythonic/include/operator_/iadd.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,12 +11,12 @@ namespace numpy { template - auto cumsum(E &&e, Opts &&... opts) + auto cumsum(E &&e, Opts &&...opts) -> decltype(partial_sum( std::forward(e), std::forward(opts)...)); DEFINE_FUNCTOR(pythonic::numpy, cumsum); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/deg2rad.hpp b/pythran/pythonic/include/numpy/deg2rad.hpp index b104663b38..cf040a3c53 100644 --- a/pythran/pythonic/include/numpy/deg2rad.hpp +++ b/pythran/pythonic/include/numpy/deg2rad.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DEG2RAD_HPP #define PYTHONIC_INCLUDE_NUMPY_DEG2RAD_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/pi.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/pi.hpp" PYTHONIC_NS_BEGIN @@ -13,15 +13,15 @@ namespace numpy namespace wrapper { template - auto deg2rad(T const &val) -> decltype(val *pi / 180) + auto deg2rad(T const &val) -> decltype(val * pi / 180) { return val * pi / 180; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME deg2rad #define NUMPY_NARY_FUNC_SYM wrapper::deg2rad #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/degrees.hpp b/pythran/pythonic/include/numpy/degrees.hpp index 2e2edb275f..f74dcd8c95 100644 --- a/pythran/pythonic/include/numpy/degrees.hpp +++ b/pythran/pythonic/include/numpy/degrees.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DEGREES_HPP #define PYTHONIC_INCLUDE_NUMPY_DEGREES_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/rad2deg.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/rad2deg.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/delete_.hpp b/pythran/pythonic/include/numpy/delete_.hpp index ebdbd409df..d8cc67c48d 100644 --- a/pythran/pythonic/include/numpy/delete_.hpp +++ b/pythran/pythonic/include/numpy/delete_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DELETE_HPP #define PYTHONIC_INCLUDE_NUMPY_DELETE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -21,7 +21,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(delete_); DEFINE_FUNCTOR(pythonic::numpy, delete_); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/diag.hpp b/pythran/pythonic/include/numpy/diag.hpp index 3f4e20f836..c0813ccc99 100644 --- a/pythran/pythonic/include/numpy/diag.hpp +++ b/pythran/pythonic/include/numpy/diag.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DIAG_HPP #define PYTHONIC_INCLUDE_NUMPY_DIAG_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/asarray.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/numpy/asarray.hpp" PYTHONIC_NS_BEGIN @@ -17,16 +17,16 @@ namespace numpy template typename std::enable_if::value == 1, - types::ndarray>>::type + types::ndarray>>::type diag(types::ndarray const &a, long k = 0); template - auto diag(types::list const &a, long k = 0) - -> decltype(diag(asarray(a), k)); + auto diag(types::list const &a, + long k = 0) -> decltype(diag(asarray(a), k)); NUMPY_EXPR_TO_NDARRAY0_DECL(diag); DEFINE_FUNCTOR(pythonic::numpy, diag); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/diff.hpp b/pythran/pythonic/include/numpy/diff.hpp index 2498aa5319..9b610f3a86 100644 --- a/pythran/pythonic/include/numpy/diff.hpp +++ b/pythran/pythonic/include/numpy/diff.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DIFF_HPP #define PYTHONIC_INCLUDE_NUMPY_DIFF_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,11 +11,11 @@ namespace numpy { template - types::ndarray> + types::ndarray> diff(E const &expr, long n = 1, long axis = -1); DEFINE_FUNCTOR(pythonic::numpy, diff); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/digitize.hpp b/pythran/pythonic/include/numpy/digitize.hpp index 08ff40a6dd..ebf182a5a8 100644 --- a/pythran/pythonic/include/numpy/digitize.hpp +++ b/pythran/pythonic/include/numpy/digitize.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DIGITIZE_HPP #define PYTHONIC_INCLUDE_NUMPY_DIGITIZE_HPP -#include "pythonic/include/numpy/asarray.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/numpy/asarray.hpp" #include "pythonic/include/operator_/gt.hpp" #include "pythonic/include/operator_/lt.hpp" @@ -14,7 +14,7 @@ namespace numpy types::ndarray> digitize(E const &expr, F const &b); DEFINE_FUNCTOR(pythonic::numpy, digitize); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/divide.hpp b/pythran/pythonic/include/numpy/divide.hpp index 4b296246f5..b25972fcb8 100644 --- a/pythran/pythonic/include/numpy/divide.hpp +++ b/pythran/pythonic/include/numpy/divide.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DIVIDE_HPP #define PYTHONIC_INCLUDE_NUMPY_DIVIDE_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/div.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/div.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME divide #define NUMPY_NARY_FUNC_SYM pythonic::operator_::div #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/dot.hpp b/pythran/pythonic/include/numpy/dot.hpp index a8dc8089a8..16b8eeefbb 100644 --- a/pythran/pythonic/include/numpy/dot.hpp +++ b/pythran/pythonic/include/numpy/dot.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_DOT_HPP #define PYTHONIC_INCLUDE_NUMPY_DOT_HPP -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/sum.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_expr.hpp" #include "pythonic/include/types/traits.hpp" @@ -136,8 +136,7 @@ namespace numpy is_blas_type::value && is_blas_type::value // With dtype compatible with // blas - && - E::value == 2 && F::value == 1, // And it is matrix / vect + && E::value == 2 && F::value == 1, // And it is matrix / vect types::ndarray< typename __combined::type, types::pshape>>::type @@ -154,8 +153,7 @@ namespace numpy is_blas_type::value && is_blas_type::value // With dtype compatible with // blas - && - E::value == 1 && F::value == 2, // And it is vect / matrix + && E::value == 1 && F::value == 2, // And it is vect / matrix types::ndarray< typename __combined::type, types::pshape>>::type @@ -195,7 +193,7 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::ndarray const &a, types::ndarray const &b); template @@ -211,21 +209,21 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::numpy_texpr> const &a, types::ndarray const &b); template typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::ndarray const &a, types::numpy_texpr> const &b); template typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::numpy_texpr> const &a, types::numpy_texpr> const &b); @@ -240,11 +238,10 @@ namespace numpy is_blas_type::value && is_blas_type::value // With dtype compatible with // blas - && - E::value == 2 && F::value == 2, // And both are matrix + && E::value == 2 && F::value == 2, // And both are matrix types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f); // If one of the arg doesn't have a "blas compatible type", we use a slow @@ -256,7 +253,7 @@ namespace numpy E::value == 2 && F::value == 2, // And it is matrix / matrix types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f); // N x M where N >= 3 and M == 1 @@ -265,7 +262,7 @@ namespace numpy (E::value >= 3 && F::value == 1), types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f); // N x M where N >= 3 and M >= 2 @@ -274,11 +271,11 @@ namespace numpy (E::value >= 3 && F::value >= 2), types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f); DEFINE_FUNCTOR(pythonic::numpy, dot); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/double_.hpp b/pythran/pythonic/include/numpy/double_.hpp index 3fd626d6e8..4a1ddca092 100644 --- a/pythran/pythonic/include/numpy/double_.hpp +++ b/pythran/pythonic/include/numpy/double_.hpp @@ -11,7 +11,7 @@ namespace numpy #define NUMPY_NARY_FUNC_SYM details::float64 #define NUMPY_NARY_EXTRA_METHOD using type = double; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/dtype/type.hpp b/pythran/pythonic/include/numpy/dtype/type.hpp index 004d17dee5..20afbad814 100644 --- a/pythran/pythonic/include/numpy/dtype/type.hpp +++ b/pythran/pythonic/include/numpy/dtype/type.hpp @@ -10,8 +10,8 @@ namespace numpy template auto type(T const &t, V const &v) -> decltype(t(v)); DEFINE_FUNCTOR(pythonic::numpy::dtype, type); - } -} + } // namespace dtype +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/ediff1d.hpp b/pythran/pythonic/include/numpy/ediff1d.hpp index 07c653f58b..7431b33383 100644 --- a/pythran/pythonic/include/numpy/ediff1d.hpp +++ b/pythran/pythonic/include/numpy/ediff1d.hpp @@ -14,7 +14,7 @@ namespace numpy auto ediff1d(types::list const &expr) -> decltype(ediff1d(asarray(expr))); DEFINE_FUNCTOR(pythonic::numpy, ediff1d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/empty.hpp b/pythran/pythonic/include/numpy/empty.hpp index 38546b2060..77047e4c99 100644 --- a/pythran/pythonic/include/numpy/empty.hpp +++ b/pythran/pythonic/include/numpy/empty.hpp @@ -1,17 +1,16 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EMPTY_HPP #define PYTHONIC_INCLUDE_NUMPY_EMPTY_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/float64.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - typename dtype::type - empty(types::pshape<> const &shape, dtype d = dtype()); + typename dtype::type empty(types::pshape<> const &shape, dtype d = dtype()); template types::ndarray> @@ -27,7 +26,7 @@ namespace numpy empty(std::integral_constant, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, empty); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/empty_like.hpp b/pythran/pythonic/include/numpy/empty_like.hpp index 42d82b80da..28baea1b08 100644 --- a/pythran/pythonic/include/numpy/empty_like.hpp +++ b/pythran/pythonic/include/numpy/empty_like.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EMPTYLIKE_HPP #define PYTHONIC_INCLUDE_NUMPY_EMPTYLIKE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/empty.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy types::dtype_t())); DEFINE_FUNCTOR(pythonic::numpy, empty_like) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/equal.hpp b/pythran/pythonic/include/numpy/equal.hpp index 8057acad76..99066bc844 100644 --- a/pythran/pythonic/include/numpy/equal.hpp +++ b/pythran/pythonic/include/numpy/equal.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EQUAL_HPP #define PYTHONIC_INCLUDE_NUMPY_EQUAL_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/eq.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/eq.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::eq #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/exp.hpp b/pythran/pythonic/include/numpy/exp.hpp index 215a81e018..ff78511a8b 100644 --- a/pythran/pythonic/include/numpy/exp.hpp +++ b/pythran/pythonic/include/numpy/exp.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EXP_HPP #define PYTHONIC_INCLUDE_NUMPY_EXP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME exp #define NUMPY_NARY_FUNC_SYM xsimd::exp #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/expand_dims.hpp b/pythran/pythonic/include/numpy/expand_dims.hpp index c549b6cfe0..7ab322f6de 100644 --- a/pythran/pythonic/include/numpy/expand_dims.hpp +++ b/pythran/pythonic/include/numpy/expand_dims.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> + types::ndarray> expand_dims(T const &input, int axis); DEFINE_FUNCTOR(pythonic::numpy, expand_dims); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/expm1.hpp b/pythran/pythonic/include/numpy/expm1.hpp index c755bc6460..a4bddf64ee 100644 --- a/pythran/pythonic/include/numpy/expm1.hpp +++ b/pythran/pythonic/include/numpy/expm1.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EXPM1_HPP #define PYTHONIC_INCLUDE_NUMPY_EXPM1_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME expm1 #define NUMPY_NARY_FUNC_SYM xsimd::expm1 #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/eye.hpp b/pythran/pythonic/include/numpy/eye.hpp index 54da451b1b..62033463c1 100644 --- a/pythran/pythonic/include/numpy/eye.hpp +++ b/pythran/pythonic/include/numpy/eye.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_EYE_HPP #define PYTHONIC_INCLUDE_NUMPY_EYE_HPP -#include "pythonic/include/numpy/zeros.hpp" -#include "pythonic/include/numpy/float64.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/numpy/zeros.hpp" PYTHONIC_NS_BEGIN @@ -11,16 +11,16 @@ namespace numpy { template - types::ndarray> + types::ndarray> eye(long N, long M, long k = 0, dtype d = dtype()); template - types::ndarray> + types::ndarray> eye(long N, types::none_type M = builtins::None, long k = 0, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, eye); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fabs.hpp b/pythran/pythonic/include/numpy/fabs.hpp index 64d6b4c49b..e43839bc5c 100644 --- a/pythran/pythonic/include/numpy/fabs.hpp +++ b/pythran/pythonic/include/numpy/fabs.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FABS_HPP #define PYTHONIC_INCLUDE_NUMPY_FABS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/abs.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/fft/c2c.hpp b/pythran/pythonic/include/numpy/fft/c2c.hpp index 50efdbe4a5..9ea27559ae 100644 --- a/pythran/pythonic/include/numpy/fft/c2c.hpp +++ b/pythran/pythonic/include/numpy/fft/c2c.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_C2C_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_C2C_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,11 +13,11 @@ namespace numpy template types::ndarray, - types::array::value>> + types::array_tuple::value>> c2c(types::ndarray, pS> const &a, long n = -1, long axis = -1, types::str const &norm = {}, bool const forward = true); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/fft.hpp b/pythran/pythonic/include/numpy/fft/fft.hpp index faa4b0488a..512ac55d8e 100644 --- a/pythran/pythonic/include/numpy/fft/fft.hpp +++ b/pythran/pythonic/include/numpy/fft/fft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_FFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_FFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -25,31 +25,34 @@ namespace numpy namespace fft { - template + template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> - fft(types::ndarray const &a, N const & n = {}, long axis = -1, + types::array_tuple::value>> + fft(types::ndarray const &a, N const &n = {}, long axis = -1, Norm const &norm = {}); - template + template types::ndarray::value, std::complex>::type, - types::array::value>> - fft(types::ndarray const &a, N const & n = {}, long axis = -1, + types::array_tuple::value>> + fft(types::ndarray const &a, N const &n = {}, long axis = -1, Norm const &norm = {}); - template + template types::ndarray::value, std::complex>::type, - types::array::value>> - fft(types::ndarray const &a, N const & n = {}, long axis = -1, + types::array_tuple::value>> + fft(types::ndarray const &a, N const &n = {}, long axis = -1, Norm const &norm = {}); NUMPY_EXPR_TO_NDARRAY0_DECL(fft); DEFINE_FUNCTOR(pythonic::numpy::fft, fft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/fftn.hpp b/pythran/pythonic/include/numpy/fft/fftn.hpp index c4c3561caf..8f7d78b17b 100644 --- a/pythran/pythonic/include/numpy/fft/fftn.hpp +++ b/pythran/pythonic/include/numpy/fft/fftn.hpp @@ -15,7 +15,7 @@ namespace numpy class Norm = types::none_type> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::none_type s = {}, Axes const &axes = {}, Norm const &norm = {}); @@ -23,7 +23,7 @@ namespace numpy class Norm = types::none_type> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::none_type s = {}, Axes const &axes = {}, Norm const &norm = {}); @@ -31,7 +31,7 @@ namespace numpy class Norm = types::none_type> types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::none_type s = {}, Axes const &axes = {}, Norm const &norm = {}); @@ -40,7 +40,7 @@ namespace numpy class Axes = types::none_type, class Norm = types::none_type> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes = {}, Norm const &norm = {}); @@ -48,7 +48,7 @@ namespace numpy class Axes = types::none_type, class Norm = types::none_type> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes = {}, Norm const &norm = {}); @@ -56,7 +56,7 @@ namespace numpy class Axes = types::none_type, class Norm = types::none_type> types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes = {}, Norm const &norm = {}); diff --git a/pythran/pythonic/include/numpy/fft/hfft.hpp b/pythran/pythonic/include/numpy/fft/hfft.hpp index 38b06fd511..6337bd991f 100644 --- a/pythran/pythonic/include/numpy/fft/hfft.hpp +++ b/pythran/pythonic/include/numpy/fft/hfft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_HFFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_HFFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" /** * **Noteable difference to numpy.fft.hfft:** @@ -26,22 +26,22 @@ namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &a, long n = -1, long axis = -1, types::str const &norm = {}); template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &a, types::none_type n, long axis, types::str const &norm); template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &a, long n, long axis, types::none_type norm); template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); @@ -50,7 +50,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); @@ -59,7 +59,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); @@ -68,7 +68,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &a, long n, long axis, types::none_type norm); @@ -77,14 +77,14 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); NUMPY_EXPR_TO_NDARRAY0_DECL(hfft); DEFINE_FUNCTOR(pythonic::numpy::fft, hfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/ifft.hpp b/pythran/pythonic/include/numpy/fft/ifft.hpp index 24f6bfa88c..cb15442fd7 100644 --- a/pythran/pythonic/include/numpy/fft/ifft.hpp +++ b/pythran/pythonic/include/numpy/fft/ifft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_IFFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_IFFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -28,91 +28,91 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); NUMPY_EXPR_TO_NDARRAY0_DECL(ifft); DEFINE_FUNCTOR(pythonic::numpy::fft, ifft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/ihfft.hpp b/pythran/pythonic/include/numpy/fft/ihfft.hpp index 6512191907..e1e2af123d 100644 --- a/pythran/pythonic/include/numpy/fft/ihfft.hpp +++ b/pythran/pythonic/include/numpy/fft/ihfft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_IHFFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_IHFFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" /** * **Noteable difference to numpy.fft.ihfft:** @@ -28,63 +28,63 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); NUMPY_EXPR_TO_NDARRAY0_DECL(ihfft); DEFINE_FUNCTOR(pythonic::numpy::fft, ihfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/irfft.hpp b/pythran/pythonic/include/numpy/fft/irfft.hpp index 2ec0ac26b3..b10c977bde 100644 --- a/pythran/pythonic/include/numpy/fft/irfft.hpp +++ b/pythran/pythonic/include/numpy/fft/irfft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_IRFFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_IRFFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" /** * **Noteable difference to numpy.fft.irfft:** @@ -26,22 +26,22 @@ namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &a, long n = -1, long axis = -1, types::str const &norm = {}); template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &a, types::none_type n, long axis, types::str const &norm); template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &a, long n, long axis, types::none_type norm); template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); @@ -50,7 +50,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); @@ -59,7 +59,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); @@ -68,7 +68,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &a, long n, long axis, types::none_type norm); @@ -77,14 +77,14 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); NUMPY_EXPR_TO_NDARRAY0_DECL(irfft); DEFINE_FUNCTOR(pythonic::numpy::fft, irfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fft/rfft.hpp b/pythran/pythonic/include/numpy/fft/rfft.hpp index 2125ab1764..e8b410ff42 100644 --- a/pythran/pythonic/include/numpy/fft/rfft.hpp +++ b/pythran/pythonic/include/numpy/fft/rfft.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FFT_RFFT_HPP #define PYTHONIC_INCLUDE_NUMPY_FFT_RFFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" /** * **Noteable difference to numpy.fft.rfft:** @@ -28,63 +28,63 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, long n = -1, long axis = -1, types::str const &norm = {}); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, types::none_type n, long axis, types::str const &norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, long n, long axis, types::none_type norm); template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &a, types::none_type n, long axis = -1, types::none_type norm = types::none_type{}); NUMPY_EXPR_TO_NDARRAY0_DECL(rfft); DEFINE_FUNCTOR(pythonic::numpy::fft, rfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fill_diagonal.hpp b/pythran/pythonic/include/numpy/fill_diagonal.hpp index 94617bd027..ef8a05cf98 100644 --- a/pythran/pythonic/include/numpy/fill_diagonal.hpp +++ b/pythran/pythonic/include/numpy/fill_diagonal.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FILL_DIAGONAL_HPP #define PYTHONIC_INCLUDE_NUMPY_FILL_DIAGONAL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy types::none_type fill_diagonal(E &&, typename std::decay::type::dtype); DEFINE_FUNCTOR(pythonic::numpy, fill_diagonal) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/finfo.hpp b/pythran/pythonic/include/numpy/finfo.hpp index 9bde752540..93122dc226 100644 --- a/pythran/pythonic/include/numpy/finfo.hpp +++ b/pythran/pythonic/include/numpy/finfo.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FINFO_HPP #define PYTHONIC_INCLUDE_NUMPY_FINFO_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/float64.hpp" #include "pythonic/include/types/finfo.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy types::finfo finfo(dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, finfo) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fix.hpp b/pythran/pythonic/include/numpy/fix.hpp index 2708930d6c..1749278963 100644 --- a/pythran/pythonic/include/numpy/fix.hpp +++ b/pythran/pythonic/include/numpy/fix.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FIX_HPP #define PYTHONIC_INCLUDE_NUMPY_FIX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME fix #define NUMPY_NARY_FUNC_SYM std::trunc #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/flatnonzero.hpp b/pythran/pythonic/include/numpy/flatnonzero.hpp index a592be1df3..9b48111f26 100644 --- a/pythran/pythonic/include/numpy/flatnonzero.hpp +++ b/pythran/pythonic/include/numpy/flatnonzero.hpp @@ -11,7 +11,7 @@ namespace numpy types::ndarray> flatnonzero(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, flatnonzero); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/flip.hpp b/pythran/pythonic/include/numpy/flip.hpp index cc22afce5a..ab2705cf0d 100644 --- a/pythran/pythonic/include/numpy/flip.hpp +++ b/pythran/pythonic/include/numpy/flip.hpp @@ -12,8 +12,8 @@ namespace numpy namespace details { template - auto flip(E const &expr, S const &slices, utils::index_sequence) - -> decltype(expr(slices[I]...)); + auto flip(E const &expr, S const &slices, + utils::index_sequence) -> decltype(expr(slices[I]...)); } template @@ -22,7 +22,7 @@ namespace numpy utils::make_index_sequence{})); DEFINE_FUNCTOR(pythonic::numpy, flip); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fliplr.hpp b/pythran/pythonic/include/numpy/fliplr.hpp index c2738a93e8..605d2677ac 100644 --- a/pythran/pythonic/include/numpy/fliplr.hpp +++ b/pythran/pythonic/include/numpy/fliplr.hpp @@ -9,9 +9,10 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto fliplr(E &&expr) -> decltype(std::forward(expr)( - types::cstride_slice<1>{builtins::None, builtins::None}, - types::slice{builtins::None, builtins::None, -1})); + auto + fliplr(E &&expr) -> decltype(std::forward(expr)( + types::cstride_slice<1>{builtins::None, builtins::None}, + types::slice{builtins::None, builtins::None, -1})); DEFINE_FUNCTOR(pythonic::numpy, fliplr); } // namespace numpy diff --git a/pythran/pythonic/include/numpy/flipud.hpp b/pythran/pythonic/include/numpy/flipud.hpp index e02b76b434..a4b5f241a6 100644 --- a/pythran/pythonic/include/numpy/flipud.hpp +++ b/pythran/pythonic/include/numpy/flipud.hpp @@ -1,19 +1,20 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLIPUD_HPP #define PYTHONIC_INCLUDE_NUMPY_FLIPUD_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto flipud(E &&expr) -> decltype( - std::forward(expr)[types::slice{builtins::None, builtins::None, -1}]); + auto + flipud(E &&expr) -> decltype(std::forward( + expr)[types::slice{builtins::None, builtins::None, -1}]); DEFINE_FUNCTOR(pythonic::numpy, flipud); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/float128.hpp b/pythran/pythonic/include/numpy/float128.hpp index d1638ca45f..a0051f56bc 100644 --- a/pythran/pythonic/include/numpy/float128.hpp +++ b/pythran/pythonic/include/numpy/float128.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLOAT128_HPP #define PYTHONIC_INCLUDE_NUMPY_FLOAT128_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -15,13 +15,13 @@ namespace numpy long double float128(); template long double float128(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME float128 #define NUMPY_NARY_FUNC_SYM details::float128 #define NUMPY_NARY_EXTRA_METHOD using type = long double; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/float32.hpp b/pythran/pythonic/include/numpy/float32.hpp index efb10431bc..a88b5b3d88 100644 --- a/pythran/pythonic/include/numpy/float32.hpp +++ b/pythran/pythonic/include/numpy/float32.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLOAT32_HPP #define PYTHONIC_INCLUDE_NUMPY_FLOAT32_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy float float32(); template float float32(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME float32 #define NUMPY_NARY_FUNC_SYM details::float32 #define NUMPY_NARY_EXTRA_METHOD using type = float; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/float64.hpp b/pythran/pythonic/include/numpy/float64.hpp index 8b5a7b5ebc..0494e3303e 100644 --- a/pythran/pythonic/include/numpy/float64.hpp +++ b/pythran/pythonic/include/numpy/float64.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLOAT64_HPP #define PYTHONIC_INCLUDE_NUMPY_FLOAT64_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -15,13 +15,13 @@ namespace numpy double float64(); template double float64(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME float64 #define NUMPY_NARY_FUNC_SYM details::float64 #define NUMPY_NARY_EXTRA_METHOD using type = double; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/float_.hpp b/pythran/pythonic/include/numpy/float_.hpp index ed470a24c3..b4e25d97ad 100644 --- a/pythran/pythonic/include/numpy/float_.hpp +++ b/pythran/pythonic/include/numpy/float_.hpp @@ -11,7 +11,7 @@ namespace numpy #define NUMPY_NARY_FUNC_SYM details::float64 #define NUMPY_NARY_EXTRA_METHOD using type = double; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/floor.hpp b/pythran/pythonic/include/numpy/floor.hpp index 8e3bec5dbe..ba8cc1eadd 100644 --- a/pythran/pythonic/include/numpy/floor.hpp +++ b/pythran/pythonic/include/numpy/floor.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLOOR_HPP #define PYTHONIC_INCLUDE_NUMPY_FLOOR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME floor #define NUMPY_NARY_FUNC_SYM xsimd::floor #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/floor_divide.hpp b/pythran/pythonic/include/numpy/floor_divide.hpp index 8a9df6d4d4..85de7c5312 100644 --- a/pythran/pythonic/include/numpy/floor_divide.hpp +++ b/pythran/pythonic/include/numpy/floor_divide.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FLOORDIVIDE_HPP #define PYTHONIC_INCLUDE_NUMPY_FLOORDIVIDE_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include//numpy/floor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include//numpy/floor.hpp" PYTHONIC_NS_BEGIN @@ -38,11 +38,11 @@ namespace numpy { return functor::floor{}(arg0 / arg1); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME floor_divide #define NUMPY_NARY_FUNC_SYM wrapper::divfloor #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fmod.hpp b/pythran/pythonic/include/numpy/fmod.hpp index a7b3732c2f..e3d17ff228 100644 --- a/pythran/pythonic/include/numpy/fmod.hpp +++ b/pythran/pythonic/include/numpy/fmod.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FMOD_HPP #define PYTHONIC_INCLUDE_NUMPY_FMOD_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME fmod #define NUMPY_NARY_FUNC_SYM xsimd::fmod #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/frexp.hpp b/pythran/pythonic/include/numpy/frexp.hpp index 6a89480602..e9a2b202af 100644 --- a/pythran/pythonic/include/numpy/frexp.hpp +++ b/pythran/pythonic/include/numpy/frexp.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FREXP_HPP #define PYTHONIC_INCLUDE_NUMPY_FREXP_HPP +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/types/traits.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/traits.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy frexp(E const &arr); DEFINE_FUNCTOR(pythonic::numpy, frexp); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fromfile.hpp b/pythran/pythonic/include/numpy/fromfile.hpp index 62498964bd..4352d16ba4 100644 --- a/pythran/pythonic/include/numpy/fromfile.hpp +++ b/pythran/pythonic/include/numpy/fromfile.hpp @@ -17,7 +17,7 @@ namespace numpy types::str const &sep = {}, long offset = 0); DEFINE_FUNCTOR(pythonic::numpy, fromfile); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fromfunction.hpp b/pythran/pythonic/include/numpy/fromfunction.hpp index c4068d8a7f..ade065d146 100644 --- a/pythran/pythonic/include/numpy/fromfunction.hpp +++ b/pythran/pythonic/include/numpy/fromfunction.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FROMFUNCTION_HPP #define PYTHONIC_INCLUDE_NUMPY_FROMFUNCTION_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/tags.hpp" PYTHONIC_NS_BEGIN @@ -41,7 +41,7 @@ namespace numpy /* TODO: must specialize for higher order */ DEFINE_FUNCTOR(pythonic::numpy, fromfunction); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fromiter.hpp b/pythran/pythonic/include/numpy/fromiter.hpp index 3c6009a2db..077c4de534 100644 --- a/pythran/pythonic/include/numpy/fromiter.hpp +++ b/pythran/pythonic/include/numpy/fromiter.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FROMITER_HPP #define PYTHONIC_INCLUDE_NUMPY_FROMITER_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/float64.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy fromiter(Iterable &&iterable, dtype d = dtype(), long count = -1); DEFINE_FUNCTOR(pythonic::numpy, fromiter); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/fromstring.hpp b/pythran/pythonic/include/numpy/fromstring.hpp index 38aeab73f3..545a053b17 100644 --- a/pythran/pythonic/include/numpy/fromstring.hpp +++ b/pythran/pythonic/include/numpy/fromstring.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FROMSTRING_HPP #define PYTHONIC_INCLUDE_NUMPY_FROMSTRING_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/float64.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/list.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" #include #include @@ -20,7 +20,7 @@ namespace numpy types::str const &sep = {}); DEFINE_FUNCTOR(pythonic::numpy, fromstring); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/full.hpp b/pythran/pythonic/include/numpy/full.hpp index 18deb0cb57..4c945f6dfb 100644 --- a/pythran/pythonic/include/numpy/full.hpp +++ b/pythran/pythonic/include/numpy/full.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_INCLUDE_NUMPY_FULL_HPP #include "pythonic/include/numpy/float64.hpp" -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -36,7 +36,7 @@ namespace numpy full(std::integral_constant, F fill_value, types::none_type _ = {}); DEFINE_FUNCTOR(pythonic::numpy, full); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/full_like.hpp b/pythran/pythonic/include/numpy/full_like.hpp index 0c57174ed2..61cac42cf1 100644 --- a/pythran/pythonic/include/numpy/full_like.hpp +++ b/pythran/pythonic/include/numpy/full_like.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_FULLLIKE_HPP #define PYTHONIC_INCLUDE_NUMPY_FULLLIKE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/full.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -20,7 +20,7 @@ namespace numpy types::dtype_t())); DEFINE_FUNCTOR(pythonic::numpy, full_like) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/greater.hpp b/pythran/pythonic/include/numpy/greater.hpp index e04f675dda..fca6d15479 100644 --- a/pythran/pythonic/include/numpy/greater.hpp +++ b/pythran/pythonic/include/numpy/greater.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_GREATER_HPP #define PYTHONIC_INCLUDE_NUMPY_GREATER_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/gt.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/gt.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME greater #define NUMPY_NARY_FUNC_SYM pythonic::operator_::gt #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/greater_equal.hpp b/pythran/pythonic/include/numpy/greater_equal.hpp index 7ab0b31745..a008201774 100644 --- a/pythran/pythonic/include/numpy/greater_equal.hpp +++ b/pythran/pythonic/include/numpy/greater_equal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_GREATEREQUAL_HPP #define PYTHONIC_INCLUDE_NUMPY_GREATEREQUAL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/operator_/ge.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME greater_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::ge #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/heaviside.hpp b/pythran/pythonic/include/numpy/heaviside.hpp index 1b7594b7f6..b1f749515f 100644 --- a/pythran/pythonic/include/numpy/heaviside.hpp +++ b/pythran/pythonic/include/numpy/heaviside.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_HEAVISIDE_HPP #define PYTHONIC_INCLUDE_NUMPY_HEAVISIDE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME heaviside #define NUMPY_NARY_FUNC_SYM details::heaviside #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/hstack.hpp b/pythran/pythonic/include/numpy/hstack.hpp index 05ea492a4a..13caae7529 100644 --- a/pythran/pythonic/include/numpy/hstack.hpp +++ b/pythran/pythonic/include/numpy/hstack.hpp @@ -13,7 +13,7 @@ namespace numpy -> decltype(concatenate(std::forward(seq), 1)); DEFINE_FUNCTOR(pythonic::numpy, hstack); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/hypot.hpp b/pythran/pythonic/include/numpy/hypot.hpp index 1f98eb076f..e318465c20 100644 --- a/pythran/pythonic/include/numpy/hypot.hpp +++ b/pythran/pythonic/include/numpy/hypot.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_HYPOT_HPP #define PYTHONIC_INCLUDE_NUMPY_HYPOT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME hypot #define NUMPY_NARY_FUNC_SYM xsimd::hypot #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/identity.hpp b/pythran/pythonic/include/numpy/identity.hpp index c506c11569..fb12e68022 100644 --- a/pythran/pythonic/include/numpy/identity.hpp +++ b/pythran/pythonic/include/numpy/identity.hpp @@ -13,7 +13,7 @@ namespace numpy auto identity(long n, dtype d = dtype()) -> decltype(eye(n, n, 0, d)); DEFINE_FUNCTOR(pythonic::numpy, identity); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/imag.hpp b/pythran/pythonic/include/numpy/imag.hpp index 93c772a1ed..086b3b6f80 100644 --- a/pythran/pythonic/include/numpy/imag.hpp +++ b/pythran/pythonic/include/numpy/imag.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_IMAG_HPP #define PYTHONIC_INCLUDE_NUMPY_IMAG_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/asarray.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/list.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy -> decltype(imag(numpy::functor::asarray{}(expr))); DEFINE_FUNCTOR(pythonic::numpy, imag); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/indices.hpp b/pythran/pythonic/include/numpy/indices.hpp index 4fd613a66d..544d96760e 100644 --- a/pythran/pythonic/include/numpy/indices.hpp +++ b/pythran/pythonic/include/numpy/indices.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INDICES_HPP #define PYTHONIC_INCLUDE_NUMPY_INDICES_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/int64.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy indices(pS const &shape, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, indices); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/insert.hpp b/pythran/pythonic/include/numpy/insert.hpp index af748c18d4..5b8b94363f 100644 --- a/pythran/pythonic/include/numpy/insert.hpp +++ b/pythran/pythonic/include/numpy/insert.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INSERT_HPP #define PYTHONIC_INCLUDE_NUMPY_INSERT_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/builtins/None.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/traits.hpp" -#include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -45,7 +45,7 @@ namespace numpy E insert(E, Args const &...); DEFINE_FUNCTOR(pythonic::numpy, insert); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/int16.hpp b/pythran/pythonic/include/numpy/int16.hpp index b4c5361e3f..fa3e9f34bb 100644 --- a/pythran/pythonic/include/numpy/int16.hpp +++ b/pythran/pythonic/include/numpy/int16.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INT16_HPP #define PYTHONIC_INCLUDE_NUMPY_INT16_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy int16_t int16(); template int16_t int16(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME int16 #define NUMPY_NARY_FUNC_SYM details::int16 #define NUMPY_NARY_EXTRA_METHOD using type = int16_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/int32.hpp b/pythran/pythonic/include/numpy/int32.hpp index 6e41d388f3..5bc35e04d6 100644 --- a/pythran/pythonic/include/numpy/int32.hpp +++ b/pythran/pythonic/include/numpy/int32.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INT32_HPP #define PYTHONIC_INCLUDE_NUMPY_INT32_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy int32_t int32(); template int32_t int32(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME int32 #define NUMPY_NARY_FUNC_SYM details::int32 #define NUMPY_NARY_EXTRA_METHOD using type = int32_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/int64.hpp b/pythran/pythonic/include/numpy/int64.hpp index 7a68ef324b..5e0bca6ed5 100644 --- a/pythran/pythonic/include/numpy/int64.hpp +++ b/pythran/pythonic/include/numpy/int64.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INT64_HPP #define PYTHONIC_INCLUDE_NUMPY_INT64_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy int64_t int64(); template int64_t int64(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME int64 #define NUMPY_NARY_FUNC_SYM details::int64 #define NUMPY_NARY_EXTRA_METHOD using type = int64_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/int8.hpp b/pythran/pythonic/include/numpy/int8.hpp index 9e8c5b643e..9021c0972a 100644 --- a/pythran/pythonic/include/numpy/int8.hpp +++ b/pythran/pythonic/include/numpy/int8.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INT8_HPP #define PYTHONIC_INCLUDE_NUMPY_INT8_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy int8_t int8(); template int8_t int8(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME int8 #define NUMPY_NARY_FUNC_SYM details::int8 #define NUMPY_NARY_EXTRA_METHOD using type = int8_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/int_.hpp b/pythran/pythonic/include/numpy/int_.hpp index 57df3fe4b9..efc448dc79 100644 --- a/pythran/pythonic/include/numpy/int_.hpp +++ b/pythran/pythonic/include/numpy/int_.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INT__HPP #define PYTHONIC_INCLUDE_NUMPY_INT__HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy long int_(); template long int_(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME int_ #define NUMPY_NARY_FUNC_SYM details::int_ #define NUMPY_NARY_EXTRA_METHOD using type = long; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/intc.hpp b/pythran/pythonic/include/numpy/intc.hpp index 0293dc392b..a340dee7e6 100644 --- a/pythran/pythonic/include/numpy/intc.hpp +++ b/pythran/pythonic/include/numpy/intc.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INTC_HPP #define PYTHONIC_INCLUDE_NUMPY_INTC_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy int intc(); template int intc(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME intc #define NUMPY_NARY_FUNC_SYM details::intc #define NUMPY_NARY_EXTRA_METHOD using type = int; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/intersect1d.hpp b/pythran/pythonic/include/numpy/intersect1d.hpp index 9888a45a48..e07cb2c91b 100644 --- a/pythran/pythonic/include/numpy/intersect1d.hpp +++ b/pythran/pythonic/include/numpy/intersect1d.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INTERSECT1D_HPP #define PYTHONIC_INCLUDE_NUMPY_INTERSECT1D_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/types/combined.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/combined.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -19,7 +19,7 @@ namespace numpy intersect1d(E const &e, F const &f); DEFINE_FUNCTOR(pythonic::numpy, intersect1d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/intp.hpp b/pythran/pythonic/include/numpy/intp.hpp index d5ccb27c5a..bfaf84eb9d 100644 --- a/pythran/pythonic/include/numpy/intp.hpp +++ b/pythran/pythonic/include/numpy/intp.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INTP_HPP #define PYTHONIC_INCLUDE_NUMPY_INTP_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy intptr_t intp(); template intptr_t intp(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME intp #define NUMPY_NARY_FUNC_SYM details::intp #define NUMPY_NARY_EXTRA_METHOD using type = intptr_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/invert.hpp b/pythran/pythonic/include/numpy/invert.hpp index eb1c8bc3fe..82ccfea6d3 100644 --- a/pythran/pythonic/include/numpy/invert.hpp +++ b/pythran/pythonic/include/numpy/invert.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_INVERT_HPP #define PYTHONIC_INCLUDE_NUMPY_INVERT_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/invert.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/invert.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME invert #define NUMPY_NARY_FUNC_SYM operator_::invert #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isclose.hpp b/pythran/pythonic/include/numpy/isclose.hpp index 1cdcc438a5..922f1c6459 100644 --- a/pythran/pythonic/include/numpy/isclose.hpp +++ b/pythran/pythonic/include/numpy/isclose.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISCLOSE_HPP #define PYTHONIC_INCLUDE_NUMPY_ISCLOSE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/abs.hpp" #include "pythonic/include/numpy/isfinite.hpp" #include "pythonic/include/numpy/isnan.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -20,7 +20,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME isclose #define NUMPY_NARY_FUNC_SYM wrapper::isclose #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/iscomplex.hpp b/pythran/pythonic/include/numpy/iscomplex.hpp index f9fa2ca249..c64d8170dc 100644 --- a/pythran/pythonic/include/numpy/iscomplex.hpp +++ b/pythran/pythonic/include/numpy/iscomplex.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISCOMPLEX_HPP #define PYTHONIC_INCLUDE_NUMPY_ISCOMPLEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/types/traits.hpp" +#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -20,12 +20,12 @@ namespace numpy template constexpr typename std::enable_if::value, bool>::type iscomplex(I const &a); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME iscomplex #define NUMPY_NARY_FUNC_SYM wrapper::iscomplex #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isfinite.hpp b/pythran/pythonic/include/numpy/isfinite.hpp index e0f5e87f70..52c4467f8d 100644 --- a/pythran/pythonic/include/numpy/isfinite.hpp +++ b/pythran/pythonic/include/numpy/isfinite.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISFINITE_HPP #define PYTHONIC_INCLUDE_NUMPY_ISFINITE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -21,12 +21,12 @@ namespace numpy { return std::isfinite(v); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isfinite #define NUMPY_NARY_FUNC_SYM wrapper::isfinite #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isinf.hpp b/pythran/pythonic/include/numpy/isinf.hpp index 138f6a5cf2..6d23fa0b41 100644 --- a/pythran/pythonic/include/numpy/isinf.hpp +++ b/pythran/pythonic/include/numpy/isinf.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISINF_HPP #define PYTHONIC_INCLUDE_NUMPY_ISINF_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,11 +16,11 @@ namespace numpy template bool isinf(std::complex const &v); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isinf #define NUMPY_NARY_FUNC_SYM wrapper::isinf #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isnan.hpp b/pythran/pythonic/include/numpy/isnan.hpp index 4648d1b01f..d471777df7 100644 --- a/pythran/pythonic/include/numpy/isnan.hpp +++ b/pythran/pythonic/include/numpy/isnan.hpp @@ -14,19 +14,21 @@ namespace numpy template bool isnan(std::complex const &v); template - auto isnan(T const &v) -> typename std::enable_if< - std::is_floating_point::type>::value, - bool>::type; + auto isnan(T const &v) -> + typename std::enable_if< + std::is_floating_point::type>::value, + bool>::type; template - auto isnan(T const &v) -> typename std::enable_if< - !std::is_floating_point::type>::value, - bool>::type; - } + auto isnan(T const &v) -> + typename std::enable_if< + !std::is_floating_point::type>::value, + bool>::type; + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isnan #define NUMPY_NARY_FUNC_SYM wrapper::isnan #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isneginf.hpp b/pythran/pythonic/include/numpy/isneginf.hpp index 6e0dc821a0..8a21a2d4e5 100644 --- a/pythran/pythonic/include/numpy/isneginf.hpp +++ b/pythran/pythonic/include/numpy/isneginf.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISNEGINF_HPP #define PYTHONIC_INCLUDE_NUMPY_ISNEGINF_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/numpy/isinf.hpp" @@ -20,7 +20,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME isneginf #define NUMPY_NARY_FUNC_SYM wrapper::isneginf #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isposinf.hpp b/pythran/pythonic/include/numpy/isposinf.hpp index a6ee98e41c..d7167946bf 100644 --- a/pythran/pythonic/include/numpy/isposinf.hpp +++ b/pythran/pythonic/include/numpy/isposinf.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISPOSINF_HPP #define PYTHONIC_INCLUDE_NUMPY_ISPOSINF_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/isinf.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/isinf.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME isposinf #define NUMPY_NARY_FUNC_SYM wrapper::isposinf #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isreal.hpp b/pythran/pythonic/include/numpy/isreal.hpp index f00ee32af2..a43a129b4c 100644 --- a/pythran/pythonic/include/numpy/isreal.hpp +++ b/pythran/pythonic/include/numpy/isreal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISREAL_HPP #define PYTHONIC_INCLUDE_NUMPY_ISREAL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/types/traits.hpp" +#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -20,12 +20,12 @@ namespace numpy template typename std::enable_if::value, bool>::type isreal(I const &a); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isreal #define NUMPY_NARY_FUNC_SYM wrapper::isreal #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isrealobj.hpp b/pythran/pythonic/include/numpy/isrealobj.hpp index 2f131e7b8a..0d9abf0f52 100644 --- a/pythran/pythonic/include/numpy/isrealobj.hpp +++ b/pythran/pythonic/include/numpy/isrealobj.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISREALOBJ_HPP #define PYTHONIC_INCLUDE_NUMPY_ISREALOBJ_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/traits.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy constexpr bool isrealobj(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, isrealobj); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/isscalar.hpp b/pythran/pythonic/include/numpy/isscalar.hpp index a863c041da..e63e134022 100644 --- a/pythran/pythonic/include/numpy/isscalar.hpp +++ b/pythran/pythonic/include/numpy/isscalar.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ISSCALAR_HPP #define PYTHONIC_INCLUDE_NUMPY_ISSCALAR_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/traits.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/types/traits.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -16,7 +16,7 @@ namespace numpy constexpr bool isscalar(E const &); DEFINE_FUNCTOR(pythonic::numpy, isscalar); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/issctype.hpp b/pythran/pythonic/include/numpy/issctype.hpp index bf552fb55c..e38e264753 100644 --- a/pythran/pythonic/include/numpy/issctype.hpp +++ b/pythran/pythonic/include/numpy/issctype.hpp @@ -24,7 +24,7 @@ namespace numpy bool>::type; DEFINE_FUNCTOR(pythonic::numpy, issctype); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ldexp.hpp b/pythran/pythonic/include/numpy/ldexp.hpp index 7d46b5aff3..e7af0bc2c5 100644 --- a/pythran/pythonic/include/numpy/ldexp.hpp +++ b/pythran/pythonic/include/numpy/ldexp.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LDEXP_HPP #define PYTHONIC_INCLUDE_NUMPY_LDEXP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME ldexp #define NUMPY_NARY_FUNC_SYM std::ldexp #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/left_shift.hpp b/pythran/pythonic/include/numpy/left_shift.hpp index 7a4cd6decc..9071066dda 100644 --- a/pythran/pythonic/include/numpy/left_shift.hpp +++ b/pythran/pythonic/include/numpy/left_shift.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LEFT_SHIFT_HPP #define PYTHONIC_INCLUDE_NUMPY_LEFT_SHIFT_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/operator_/lshift.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME left_shift #define NUMPY_NARY_FUNC_SYM pythonic::operator_::lshift #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/less.hpp b/pythran/pythonic/include/numpy/less.hpp index d7980a67de..096be659d2 100644 --- a/pythran/pythonic/include/numpy/less.hpp +++ b/pythran/pythonic/include/numpy/less.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LESS_HPP #define PYTHONIC_INCLUDE_NUMPY_LESS_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/lt.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/lt.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME less #define NUMPY_NARY_FUNC_SYM pythonic::operator_::lt #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/less_equal.hpp b/pythran/pythonic/include/numpy/less_equal.hpp index 77f792b4c7..135782bf15 100644 --- a/pythran/pythonic/include/numpy/less_equal.hpp +++ b/pythran/pythonic/include/numpy/less_equal.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LESSEQUAL_HPP #define PYTHONIC_INCLUDE_NUMPY_LESSEQUAL_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/le.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/le.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME less_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::le #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/lexsort.hpp b/pythran/pythonic/include/numpy/lexsort.hpp index 5a6478d8f8..5f5ef6db25 100644 --- a/pythran/pythonic/include/numpy/lexsort.hpp +++ b/pythran/pythonic/include/numpy/lexsort.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LEXSORT_HPP #define PYTHONIC_INCLUDE_NUMPY_LEXSORT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy types::ndarray> lexsort(pS const &keys); DEFINE_FUNCTOR(pythonic::numpy, lexsort) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/linalg/matrix_power.hpp b/pythran/pythonic/include/numpy/linalg/matrix_power.hpp index 4e00e25736..adb1af5d9c 100644 --- a/pythran/pythonic/include/numpy/linalg/matrix_power.hpp +++ b/pythran/pythonic/include/numpy/linalg/matrix_power.hpp @@ -9,12 +9,12 @@ namespace numpy namespace linalg { template - auto matrix_power(E const &expr, long n) - -> decltype(numpy::functor::array{}(expr)); + auto matrix_power(E const &expr, + long n) -> decltype(numpy::functor::array{}(expr)); DEFINE_FUNCTOR(pythonic::numpy::linalg, matrix_power); - } -} + } // namespace linalg +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/linalg/norm.hpp b/pythran/pythonic/include/numpy/linalg/norm.hpp index 8918ba5de6..42ab8dcaa0 100644 --- a/pythran/pythonic/include/numpy/linalg/norm.hpp +++ b/pythran/pythonic/include/numpy/linalg/norm.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LINALG_NORM_HPP #define PYTHONIC_INCLUDE_NUMPY_LINALG_NORM_HPP -#include "pythonic/include/numpy/sqrt.hpp" #include "pythonic/include/builtins/pythran/abssqr.hpp" -#include "pythonic/include/numpy/sum.hpp" #include "pythonic/include/numpy/asfarray.hpp" +#include "pythonic/include/numpy/sqrt.hpp" +#include "pythonic/include/numpy/sum.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -14,8 +14,8 @@ namespace numpy template auto norm(Array &&array, types::none_type ord = {}, types::none_type axis = {}) - -> decltype( - pythonic::numpy::functor::sqrt{}(pythonic::numpy::functor::sum{}( + -> decltype(pythonic::numpy::functor::sqrt{}( + pythonic::numpy::functor::sum{}( pythonic::builtins::pythran::functor::abssqr{}( std::forward(array))))); @@ -28,9 +28,9 @@ namespace numpy template using norm_t = typename std::conditional< std::decay::type::value == 1, norm_dtype_t, - types::ndarray< - norm_dtype_t, - types::array::type::value - 1>>>::type; + types::ndarray, + types::array_tuple::type::value - + 1>>>::type; template norm_t norm(Array &&array, double ord, types::none_type axis = {}); @@ -42,13 +42,15 @@ namespace numpy norm_t norm(Array &&array, double ord, long axis); template - norm_t norm(Array &&array, double ord, types::array axis); + norm_t norm(Array &&array, double ord, + types::array_tuple axis); template - norm_t norm(Array &&array, double ord, types::array axis); + norm_t norm(Array &&array, double ord, + types::array_tuple axis); DEFINE_FUNCTOR(pythonic::numpy::linalg, norm); - } -} + } // namespace linalg +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/linspace.hpp b/pythran/pythonic/include/numpy/linspace.hpp index 090649d85a..71d009c457 100644 --- a/pythran/pythonic/include/numpy/linspace.hpp +++ b/pythran/pythonic/include/numpy/linspace.hpp @@ -14,7 +14,7 @@ namespace numpy bool retstep = false, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, linspace); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/log.hpp b/pythran/pythonic/include/numpy/log.hpp index f9ef70567d..07562a4e14 100644 --- a/pythran/pythonic/include/numpy/log.hpp +++ b/pythran/pythonic/include/numpy/log.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOG_HPP #define PYTHONIC_INCLUDE_NUMPY_LOG_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log #define NUMPY_NARY_FUNC_SYM xsimd::log #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/log10.hpp b/pythran/pythonic/include/numpy/log10.hpp index 53edf98c8e..c5b3f5eb72 100644 --- a/pythran/pythonic/include/numpy/log10.hpp +++ b/pythran/pythonic/include/numpy/log10.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOG10_HPP #define PYTHONIC_INCLUDE_NUMPY_LOG10_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log10 #define NUMPY_NARY_FUNC_SYM xsimd::log10 #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/log1p.hpp b/pythran/pythonic/include/numpy/log1p.hpp index d294932cba..e27c46df16 100644 --- a/pythran/pythonic/include/numpy/log1p.hpp +++ b/pythran/pythonic/include/numpy/log1p.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOG1P_HPP #define PYTHONIC_INCLUDE_NUMPY_LOG1P_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log1p #define NUMPY_NARY_FUNC_SYM xsimd::log1p #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/log2.hpp b/pythran/pythonic/include/numpy/log2.hpp index b30b3c7ad4..a099783372 100644 --- a/pythran/pythonic/include/numpy/log2.hpp +++ b/pythran/pythonic/include/numpy/log2.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOG2_HPP #define PYTHONIC_INCLUDE_NUMPY_LOG2_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log2 #define NUMPY_NARY_FUNC_SYM xsimd::log2 #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logaddexp.hpp b/pythran/pythonic/include/numpy/logaddexp.hpp index 9403527921..333d5f45a6 100644 --- a/pythran/pythonic/include/numpy/logaddexp.hpp +++ b/pythran/pythonic/include/numpy/logaddexp.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGADDEXP_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGADDEXP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/log.hpp" #include "pythonic/include/numpy/exp.hpp" +#include "pythonic/include/numpy/log.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME logaddexp #define NUMPY_NARY_FUNC_SYM wrapper::logaddexp #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logaddexp2.hpp b/pythran/pythonic/include/numpy/logaddexp2.hpp index b3dbcacd79..9fafebe1c7 100644 --- a/pythran/pythonic/include/numpy/logaddexp2.hpp +++ b/pythran/pythonic/include/numpy/logaddexp2.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGADDEXP2_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGADDEXP2_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/numpy/log2.hpp" @@ -24,7 +24,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME logaddexp2 #define NUMPY_NARY_FUNC_SYM wrapper::logaddexp2 #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logical_and.hpp b/pythran/pythonic/include/numpy/logical_and.hpp index bad0cefd0a..d509f71f6e 100644 --- a/pythran/pythonic/include/numpy/logical_and.hpp +++ b/pythran/pythonic/include/numpy/logical_and.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGICALAND_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGICALAND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,13 +14,13 @@ namespace numpy namespace wrapper { template - auto logical_and(T0 const &t0, T1 const &t1) -> decltype(t0 &&t1); + auto logical_and(T0 const &t0, T1 const &t1) -> decltype(t0 && t1); } #define NUMPY_NARY_FUNC_NAME logical_and #define NUMPY_NARY_FUNC_SYM wrapper::logical_and #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logical_not.hpp b/pythran/pythonic/include/numpy/logical_not.hpp index 3307bb858b..3d83196980 100644 --- a/pythran/pythonic/include/numpy/logical_not.hpp +++ b/pythran/pythonic/include/numpy/logical_not.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGICALNOT_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGICALNOT_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/not_.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/not_.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME logical_not #define NUMPY_NARY_FUNC_SYM pythonic::operator_::not_ #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logical_or.hpp b/pythran/pythonic/include/numpy/logical_or.hpp index 5a91098fe9..f274b85339 100644 --- a/pythran/pythonic/include/numpy/logical_or.hpp +++ b/pythran/pythonic/include/numpy/logical_or.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGICALOR_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGICALOR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME logical_or #define NUMPY_NARY_FUNC_SYM wrapper::logical_or #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logical_xor.hpp b/pythran/pythonic/include/numpy/logical_xor.hpp index f7ad2abf81..1075eaef8b 100644 --- a/pythran/pythonic/include/numpy/logical_xor.hpp +++ b/pythran/pythonic/include/numpy/logical_xor.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LOGICALXOR_HPP #define PYTHONIC_INCLUDE_NUMPY_LOGICALXOR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -13,19 +13,19 @@ namespace numpy namespace wrapper { template - auto logical_xor(T0 const &t0, T1 const &t1) - -> decltype((t0 && !t1) || (t1 && !t0)); + auto logical_xor(T0 const &t0, + T1 const &t1) -> decltype((t0 && !t1) || (t1 && !t0)); template bool logical_xor(std::complex const &t0, std::complex const &t1) { return (!!t0 && !t1) || (!!t1 && !t0); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logical_xor #define NUMPY_NARY_FUNC_SYM wrapper::logical_xor #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/logspace.hpp b/pythran/pythonic/include/numpy/logspace.hpp index cc7b5c5963..478e497a92 100644 --- a/pythran/pythonic/include/numpy/logspace.hpp +++ b/pythran/pythonic/include/numpy/logspace.hpp @@ -14,7 +14,7 @@ namespace numpy endpoint))); DEFINE_FUNCTOR(pythonic::numpy, logspace); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/longlong.hpp b/pythran/pythonic/include/numpy/longlong.hpp index cde5bf455f..393a0658f5 100644 --- a/pythran/pythonic/include/numpy/longlong.hpp +++ b/pythran/pythonic/include/numpy/longlong.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_LONGLONG_HPP #define PYTHONIC_INCLUDE_NUMPY_LONGLONG_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy long long longlong(); template long long longlong(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME longlong #define NUMPY_NARY_FUNC_SYM details::longlong #define NUMPY_NARY_EXTRA_METHOD using type = long long; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/max.hpp b/pythran/pythonic/include/numpy/max.hpp index c1c212c59a..3120f92c94 100644 --- a/pythran/pythonic/include/numpy/max.hpp +++ b/pythran/pythonic/include/numpy/max.hpp @@ -10,11 +10,11 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto max(Args &&... args) -> decltype( - reduce(std::forward(args)...)); + auto max(Args &&...args) -> decltype(reduce( + std::forward(args)...)); DEFINE_FUNCTOR(pythonic::numpy, max); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/maximum.hpp b/pythran/pythonic/include/numpy/maximum.hpp index e8dfc8545f..d13fcd5d6c 100644 --- a/pythran/pythonic/include/numpy/maximum.hpp +++ b/pythran/pythonic/include/numpy/maximum.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MAXIMUM_HPP #define PYTHONIC_INCLUDE_NUMPY_MAXIMUM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME maximum #define NUMPY_NARY_FUNC_SYM xsimd::max #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/mean.hpp b/pythran/pythonic/include/numpy/mean.hpp index 9028bc0e73..0aa0e9a5b9 100644 --- a/pythran/pythonic/include/numpy/mean.hpp +++ b/pythran/pythonic/include/numpy/mean.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MEAN_HPP #define PYTHONIC_INCLUDE_NUMPY_MEAN_HPP -#include "pythonic/include/numpy/sum.hpp" -#include "pythonic/include/numpy/expand_dims.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/numpy/expand_dims.hpp" +#include "pythonic/include/numpy/sum.hpp" #include "pythonic/include/types/immediate.hpp" PYTHONIC_NS_BEGIN @@ -33,7 +33,7 @@ namespace numpy }; template using dtype_or_double = typename dtype_or_double_helper::type; - } + } // namespace details template auto mean(E const &expr, types::none_type axis = {}, dtype d = {}, @@ -43,8 +43,8 @@ namespace numpy template auto mean(E const &expr, long axis, dtype d = {}, types::none_type out = {}, - types::false_immediate keep_dims = {}) - -> decltype(sum(expr, axis, d)); + types::false_immediate keep_dims = {}) -> decltype(sum(expr, axis, + d)); template types::ndarray, @@ -58,7 +58,7 @@ namespace numpy -> decltype(expand_dims(mean(expr, axis, d), axis)); DEFINE_FUNCTOR(pythonic::numpy, mean); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/median.hpp b/pythran/pythonic/include/numpy/median.hpp index 7abd73ec04..af1f229a87 100644 --- a/pythran/pythonic/include/numpy/median.hpp +++ b/pythran/pythonic/include/numpy/median.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MEDIAN_HPP #define PYTHONIC_INCLUDE_NUMPY_MEDIAN_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include PYTHONIC_NS_BEGIN @@ -17,8 +17,9 @@ namespace numpy template typename std::enable_if< std::tuple_size::value != 1, - types::ndarray() + 1.), - types::array::value - 1>>>::type + types::ndarray< + decltype(std::declval() + 1.), + types::array_tuple::value - 1>>>::type median(types::ndarray const &arr, long axis); template @@ -29,7 +30,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(median); DEFINE_FUNCTOR(pythonic::numpy, median); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/min.hpp b/pythran/pythonic/include/numpy/min.hpp index db6734550a..4e5137d9f1 100644 --- a/pythran/pythonic/include/numpy/min.hpp +++ b/pythran/pythonic/include/numpy/min.hpp @@ -11,11 +11,11 @@ namespace numpy { template - auto min(Args &&... args) -> decltype( - reduce(std::forward(args)...)); + auto min(Args &&...args) -> decltype(reduce( + std::forward(args)...)); DEFINE_FUNCTOR(pythonic::numpy, min); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/minimum.hpp b/pythran/pythonic/include/numpy/minimum.hpp index 9611f20a5a..ba6e58a5b9 100644 --- a/pythran/pythonic/include/numpy/minimum.hpp +++ b/pythran/pythonic/include/numpy/minimum.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MINIMUM_HPP #define PYTHONIC_INCLUDE_NUMPY_MINIMUM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME minimum #define NUMPY_NARY_FUNC_SYM xsimd::min #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/mod.hpp b/pythran/pythonic/include/numpy/mod.hpp index 247c3dcec5..72f1587c57 100644 --- a/pythran/pythonic/include/numpy/mod.hpp +++ b/pythran/pythonic/include/numpy/mod.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MOD_HPP #define PYTHONIC_INCLUDE_NUMPY_MOD_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/assignable.hpp" #include "pythonic/include/operator_/mod.hpp" +#include "pythonic/include/types/assignable.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy */ USING_FUNCTOR(mod, operator_::functor::mod); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/multiply.hpp b/pythran/pythonic/include/numpy/multiply.hpp index dd0803a20e..7234ace92b 100644 --- a/pythran/pythonic/include/numpy/multiply.hpp +++ b/pythran/pythonic/include/numpy/multiply.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_MULTIPLY_HPP #define PYTHONIC_INCLUDE_NUMPY_MULTIPLY_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/mul.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/mul.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME multiply #define NUMPY_NARY_FUNC_SYM pythonic::operator_::mul #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nan_to_num.hpp b/pythran/pythonic/include/numpy/nan_to_num.hpp index fd14db8bd2..3ee762ced0 100644 --- a/pythran/pythonic/include/numpy/nan_to_num.hpp +++ b/pythran/pythonic/include/numpy/nan_to_num.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANTONUM_HPP #define PYTHONIC_INCLUDE_NUMPY_NANTONUM_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/isnan.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/isnan.hpp" #include @@ -22,7 +22,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME nan_to_num #define NUMPY_NARY_FUNC_SYM wrapper::nan_to_num #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nanargmax.hpp b/pythran/pythonic/include/numpy/nanargmax.hpp index 8815b77847..8611ee187c 100644 --- a/pythran/pythonic/include/numpy/nanargmax.hpp +++ b/pythran/pythonic/include/numpy/nanargmax.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANARGMAX_HPP #define PYTHONIC_INCLUDE_NUMPY_NANARGMAX_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/isnan.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy long nanargmax(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, nanargmax); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nanargmin.hpp b/pythran/pythonic/include/numpy/nanargmin.hpp index dba681ce9b..d1ff19d629 100644 --- a/pythran/pythonic/include/numpy/nanargmin.hpp +++ b/pythran/pythonic/include/numpy/nanargmin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANARGMIN_HPP #define PYTHONIC_INCLUDE_NUMPY_NANARGMIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy long nanargmin(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, nanargmin); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nanmax.hpp b/pythran/pythonic/include/numpy/nanmax.hpp index 542f6b0328..f3259f8ff2 100644 --- a/pythran/pythonic/include/numpy/nanmax.hpp +++ b/pythran/pythonic/include/numpy/nanmax.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANMAX_HPP #define PYTHONIC_INCLUDE_NUMPY_NANMAX_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/isnan.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy typename E::dtype nanmax(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, nanmax); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nanmin.hpp b/pythran/pythonic/include/numpy/nanmin.hpp index 82853a94b8..ae970b3563 100644 --- a/pythran/pythonic/include/numpy/nanmin.hpp +++ b/pythran/pythonic/include/numpy/nanmin.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANMIN_HPP #define PYTHONIC_INCLUDE_NUMPY_NANMIN_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/isnan.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy typename E::dtype nanmin(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, nanmin); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nansum.hpp b/pythran/pythonic/include/numpy/nansum.hpp index b47f54fa9c..d3d0ff7b96 100644 --- a/pythran/pythonic/include/numpy/nansum.hpp +++ b/pythran/pythonic/include/numpy/nansum.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NANSUM_HPP #define PYTHONIC_INCLUDE_NUMPY_NANSUM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy typename E::dtype nansum(E const &expr); DEFINE_FUNCTOR(pythonic::numpy, nansum); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray.hpp b/pythran/pythonic/include/numpy/ndarray.hpp index 655f0b1f13..293b0467a2 100644 --- a/pythran/pythonic/include/numpy/ndarray.hpp +++ b/pythran/pythonic/include/numpy/ndarray.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/nested_container.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -24,7 +24,7 @@ namespace numpy ndarray(std::integral_constant, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, ndarray); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/astype.hpp b/pythran/pythonic/include/numpy/ndarray/astype.hpp index 2cdde10c73..22fc0e4fce 100644 --- a/pythran/pythonic/include/numpy/ndarray/astype.hpp +++ b/pythran/pythonic/include/numpy/ndarray/astype.hpp @@ -14,8 +14,8 @@ namespace numpy auto astype(E &&e, dtype d) -> decltype(asarray(std::forward(e), d)); DEFINE_FUNCTOR(pythonic::numpy::ndarray, astype); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/fill.hpp b/pythran/pythonic/include/numpy/ndarray/fill.hpp index 5f23d7ea04..3a760ac116 100644 --- a/pythran/pythonic/include/numpy/ndarray/fill.hpp +++ b/pythran/pythonic/include/numpy/ndarray/fill.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_FILL_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_FILL_HPP -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,8 +19,8 @@ namespace numpy types::none_type fill(types::ndarray &e, F f); DEFINE_FUNCTOR(pythonic::numpy::ndarray, fill); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/flatten.hpp b/pythran/pythonic/include/numpy/ndarray/flatten.hpp index c200718689..ab81081b71 100644 --- a/pythran/pythonic/include/numpy/ndarray/flatten.hpp +++ b/pythran/pythonic/include/numpy/ndarray/flatten.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_FLATTEN_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_FLATTEN_HPP -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,8 +17,8 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(flatten); DEFINE_FUNCTOR(pythonic::numpy::ndarray, flatten); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/item.hpp b/pythran/pythonic/include/numpy/ndarray/item.hpp index aed8c4928d..2391263fb6 100644 --- a/pythran/pythonic/include/numpy/ndarray/item.hpp +++ b/pythran/pythonic/include/numpy/ndarray/item.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_ITEM_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_ITEM_HPP -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,15 +16,16 @@ namespace numpy T item(types::ndarray const &expr, long i); template - auto item(E &&expr, types::array const &i) -> decltype(expr[i]); + auto item(E &&expr, + types::array_tuple const &i) -> decltype(expr[i]); // only for compatibility purpose, very bad impl template typename std::decay::type::dtype item(E &&expr, long i); DEFINE_FUNCTOR(pythonic::numpy::ndarray, item); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/reshape.hpp b/pythran/pythonic/include/numpy/ndarray/reshape.hpp index b1f8359ffc..db3aad1d21 100644 --- a/pythran/pythonic/include/numpy/ndarray/reshape.hpp +++ b/pythran/pythonic/include/numpy/ndarray/reshape.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_RESHAPE_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_RESHAPE_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -22,15 +22,15 @@ namespace numpy template auto reshape(types::ndarray const &expr, S0 i0, S1 i1, - S const &... indices) + S const &...indices) -> decltype(reshape(expr, types::pshape{i0, i1, indices...})); NUMPY_EXPR_TO_NDARRAY0_DECL(reshape); DEFINE_FUNCTOR(pythonic::numpy::ndarray, reshape); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/sort.hpp b/pythran/pythonic/include/numpy/ndarray/sort.hpp index a7ada510a2..191fe06375 100644 --- a/pythran/pythonic/include/numpy/ndarray/sort.hpp +++ b/pythran/pythonic/include/numpy/ndarray/sort.hpp @@ -19,8 +19,8 @@ namespace numpy types::none_type sort(E &&expr, long axis, types::str const &kind); DEFINE_FUNCTOR(pythonic::numpy::ndarray, sort); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/tofile.hpp b/pythran/pythonic/include/numpy/ndarray/tofile.hpp index 8e379c504e..e0a38b7afd 100644 --- a/pythran/pythonic/include/numpy/ndarray/tofile.hpp +++ b/pythran/pythonic/include/numpy/ndarray/tofile.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOFILE_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOFILE_HPP -#include "pythonic/utils/functor.hpp" -#include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -19,8 +19,8 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(tofile); DEFINE_FUNCTOR(pythonic::numpy::ndarray, tofile); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/tolist.hpp b/pythran/pythonic/include/numpy/ndarray/tolist.hpp index 05b82e7919..e45630bb2e 100644 --- a/pythran/pythonic/include/numpy/ndarray/tolist.hpp +++ b/pythran/pythonic/include/numpy/ndarray/tolist.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOLIST_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOLIST_HPP +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -35,8 +35,8 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(tolist); DEFINE_FUNCTOR(pythonic::numpy::ndarray, tolist); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndarray/tostring.hpp b/pythran/pythonic/include/numpy/ndarray/tostring.hpp index 302b74012b..8e126ef1cc 100644 --- a/pythran/pythonic/include/numpy/ndarray/tostring.hpp +++ b/pythran/pythonic/include/numpy/ndarray/tostring.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOSTRING_HPP #define PYTHONIC_INCLUDE_NUMPY_NDARRAY_TOSTRING_HPP -#include "pythonic/utils/functor.hpp" -#include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(tostring); DEFINE_FUNCTOR(pythonic::numpy::ndarray, tostring); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndenumerate.hpp b/pythran/pythonic/include/numpy/ndenumerate.hpp index 74fb322f5b..18d78f2ef5 100644 --- a/pythran/pythonic/include/numpy/ndenumerate.hpp +++ b/pythran/pythonic/include/numpy/ndenumerate.hpp @@ -11,7 +11,7 @@ namespace numpy struct ndenumerate_iterator : std::iterator< std::random_access_iterator_tag, - std::tuple, typename E::dtype>> { + std::tuple, typename E::dtype>> { long index; E const &expr; typename E::dtype *iter; @@ -19,7 +19,7 @@ namespace numpy ndenumerate_iterator(); ndenumerate_iterator(E const &expr, long first); - std::tuple, typename E::dtype> + std::tuple, typename E::dtype> operator*() const; ndenumerate_iterator &operator++(); @@ -48,7 +48,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(ndenumerate); DEFINE_FUNCTOR(pythonic::numpy, ndenumerate); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndim.hpp b/pythran/pythonic/include/numpy/ndim.hpp index 18aaf4cf17..163e7470bb 100644 --- a/pythran/pythonic/include/numpy/ndim.hpp +++ b/pythran/pythonic/include/numpy/ndim.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDIM_HPP #define PYTHONIC_INCLUDE_NUMPY_NDIM_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/shape.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy long ndim(E const &e); DEFINE_FUNCTOR(pythonic::numpy, ndim) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ndindex.hpp b/pythran/pythonic/include/numpy/ndindex.hpp index ccc4dab5cf..387665cdbf 100644 --- a/pythran/pythonic/include/numpy/ndindex.hpp +++ b/pythran/pythonic/include/numpy/ndindex.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NDINDEX_HPP #define PYTHONIC_INCLUDE_NUMPY_NDINDEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -13,15 +13,15 @@ namespace numpy template struct ndindex_iterator : std::iterator< - std::random_access_iterator_tag, types::array, ptrdiff_t, - types::array *, - types::array /* reference_type, but no reference is possible*/> { + std::random_access_iterator_tag, types::array_tuple, + ptrdiff_t, types::array_tuple *, + types::array_tuple< + long, N> /* reference_type, but no reference is possible*/> { long index; - types::array shape; + types::array_tuple shape; ndindex_iterator(); - ndindex_iterator(types::array const &shape, long first); - types::array operator*() const; + ndindex_iterator(types::array_tuple const &shape, long first); + types::array_tuple operator*() const; ndindex_iterator &operator++(); ndindex_iterator &operator+=(long n); bool operator!=(ndindex_iterator const &other) const; @@ -32,11 +32,11 @@ namespace numpy template struct _ndindex : ndindex_iterator { using iterator = ndindex_iterator; - types::array shape; + types::array_tuple shape; iterator end_iter; _ndindex(); - _ndindex(types::array const &shape); + _ndindex(types::array_tuple const &shape); iterator &begin(); iterator const &begin() const; iterator end() const; @@ -46,13 +46,13 @@ namespace numpy _ndindex ndindex(Types... args); template - _ndindex ndindex(types::array const &args); + _ndindex ndindex(types::array_tuple const &args); template _ndindex ndindex(types::pshape const &args); DEFINE_FUNCTOR(pythonic::numpy, ndindex); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/negative.hpp b/pythran/pythonic/include/numpy/negative.hpp index 26e1f9809a..8b659ac235 100644 --- a/pythran/pythonic/include/numpy/negative.hpp +++ b/pythran/pythonic/include/numpy/negative.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NEGATIVE_HPP #define PYTHONIC_INCLUDE_NUMPY_NEGATIVE_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/neg.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/neg.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME negative #define NUMPY_NARY_FUNC_SYM pythonic::operator_::neg #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nextafter.hpp b/pythran/pythonic/include/numpy/nextafter.hpp index 4ecf25f5a5..451c85fb1e 100644 --- a/pythran/pythonic/include/numpy/nextafter.hpp +++ b/pythran/pythonic/include/numpy/nextafter.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NEXTAFTER_HPP #define PYTHONIC_INCLUDE_NUMPY_NEXTAFTER_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME nextafter #define NUMPY_NARY_FUNC_SYM std::nextafter #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/nonzero.hpp b/pythran/pythonic/include/numpy/nonzero.hpp index 15751d1029..add55d20ea 100644 --- a/pythran/pythonic/include/numpy/nonzero.hpp +++ b/pythran/pythonic/include/numpy/nonzero.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NONZERO_HPP #define PYTHONIC_INCLUDE_NUMPY_NONZERO_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,10 +11,11 @@ namespace numpy template auto nonzero(E const &expr) - -> types::array>, E::value>; + -> types::array_tuple>, + E::value>; DEFINE_FUNCTOR(pythonic::numpy, nonzero) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/not_equal.hpp b/pythran/pythonic/include/numpy/not_equal.hpp index 8c7fc9a007..5cc374625d 100644 --- a/pythran/pythonic/include/numpy/not_equal.hpp +++ b/pythran/pythonic/include/numpy/not_equal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_NOTEQUAL_HPP #define PYTHONIC_INCLUDE_NUMPY_NOTEQUAL_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/ne.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/ne.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME not_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::ne #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ones.hpp b/pythran/pythonic/include/numpy/ones.hpp index a4e6f69fa8..8ce8d3f505 100644 --- a/pythran/pythonic/include/numpy/ones.hpp +++ b/pythran/pythonic/include/numpy/ones.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_INCLUDE_NUMPY_ONES_HPP #include "pythonic/include/numpy/float64.hpp" -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,8 +11,7 @@ namespace numpy { template - typename dtype::type - ones(std::tuple<> const &shape, dtype d = dtype()); + typename dtype::type ones(std::tuple<> const &shape, dtype d = dtype()); template types::ndarray> @@ -28,7 +27,7 @@ namespace numpy ones(std::integral_constant, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, ones); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ones_like.hpp b/pythran/pythonic/include/numpy/ones_like.hpp index 7212aeeeaa..784b017d7e 100644 --- a/pythran/pythonic/include/numpy/ones_like.hpp +++ b/pythran/pythonic/include/numpy/ones_like.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ONESLIKE_HPP #define PYTHONIC_INCLUDE_NUMPY_ONESLIKE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/ones.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy types::dtype_t())); DEFINE_FUNCTOR(pythonic::numpy, ones_like) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/outer.hpp b/pythran/pythonic/include/numpy/outer.hpp index bd25e14b1a..c125edba2e 100644 --- a/pythran/pythonic/include/numpy/outer.hpp +++ b/pythran/pythonic/include/numpy/outer.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_OUTER_HPP #define PYTHONIC_INCLUDE_NUMPY_OUTER_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/builtins/None.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,19 +16,19 @@ namespace numpy outer(types::ndarray const &a, types::ndarray const &b); template - auto outer(types::ndarray const &a, E1 const &b) - -> decltype(outer(a, asarray(b))); + auto outer(types::ndarray const &a, + E1 const &b) -> decltype(outer(a, asarray(b))); template auto outer(E0 const &a, types::ndarray const &b) -> decltype(outer(asarray(a), b)); template - auto outer(E0 const &a, E1 const &b) - -> decltype(outer(asarray(a), asarray(b))); + auto outer(E0 const &a, + E1 const &b) -> decltype(outer(asarray(a), asarray(b))); DEFINE_FUNCTOR(pythonic::numpy, outer); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/partial_sum.hpp b/pythran/pythonic/include/numpy/partial_sum.hpp index 50267ce09d..968ae7ee2c 100644 --- a/pythran/pythonic/include/numpy/partial_sum.hpp +++ b/pythran/pythonic/include/numpy/partial_sum.hpp @@ -24,15 +24,16 @@ namespace numpy template > using partial_sum_type = - types::ndarray>; + types::ndarray>; template > using partial_sum_type2 = - types::ndarray>; + types::ndarray>; template > typename std::enable_if>::type partial_sum(E const &expr, long axis, dtype d = dtype()); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/place.hpp b/pythran/pythonic/include/numpy/place.hpp index c957d4b5b9..86e0094b91 100644 --- a/pythran/pythonic/include/numpy/place.hpp +++ b/pythran/pythonic/include/numpy/place.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_PLACE_HPP #define PYTHONIC_INCLUDE_NUMPY_PLACE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/builtins/None.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy types::none_type place(E &, M const &, F const &); DEFINE_FUNCTOR(pythonic::numpy, place); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/power.hpp b/pythran/pythonic/include/numpy/power.hpp index d1e439f962..18998d031c 100644 --- a/pythran/pythonic/include/numpy/power.hpp +++ b/pythran/pythonic/include/numpy/power.hpp @@ -2,9 +2,9 @@ #define PYTHONIC_INCLUDE_NUMPY_POWER_HPP #include "pythonic/include/types/numpy_op_helper.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/utils/functor.hpp" #include @@ -17,7 +17,7 @@ namespace numpy // no need to adapt_type here, as it may turn a**2 into a**2.f #define NUMPY_NARY_RESHAPE_MODE reshape_type #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/prod.hpp b/pythran/pythonic/include/numpy/prod.hpp index 3a65ecd5d5..459108a512 100644 --- a/pythran/pythonic/include/numpy/prod.hpp +++ b/pythran/pythonic/include/numpy/prod.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_PROD_HPP #define PYTHONIC_INCLUDE_NUMPY_PROD_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/reduce.hpp" #include "pythonic/include/operator_/imul.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,11 +11,11 @@ namespace numpy { template - auto prod(Args &&... args) -> decltype( - reduce(std::forward(args)...)); + auto prod(Args &&...args) -> decltype(reduce( + std::forward(args)...)); DEFINE_FUNCTOR(pythonic::numpy, prod); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ptp.hpp b/pythran/pythonic/include/numpy/ptp.hpp index 31b6d3b327..6ee15eaaab 100644 --- a/pythran/pythonic/include/numpy/ptp.hpp +++ b/pythran/pythonic/include/numpy/ptp.hpp @@ -1,22 +1,22 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_PTP_HPP #define PYTHONIC_INCLUDE_NUMPY_PTP_HPP -#include "pythonic/include/numpy/min.hpp" #include "pythonic/include/numpy/max.hpp" +#include "pythonic/include/numpy/min.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto ptp(E const &expr, long axis) - -> decltype(max(expr, axis) - min(expr, axis)); + auto ptp(E const &expr, + long axis) -> decltype(max(expr, axis) - min(expr, axis)); template auto ptp(E const &expr) -> decltype(max(expr) - min(expr)); DEFINE_FUNCTOR(pythonic::numpy, ptp); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/put.hpp b/pythran/pythonic/include/numpy/put.hpp index 23f97766ca..fad2c56efe 100644 --- a/pythran/pythonic/include/numpy/put.hpp +++ b/pythran/pythonic/include/numpy/put.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_PUT_HPP #define PYTHONIC_INCLUDE_NUMPY_PUT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -21,7 +21,7 @@ namespace numpy types::none_type put(E &, M const &, V const &); DEFINE_FUNCTOR(pythonic::numpy, put); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/putmask.hpp b/pythran/pythonic/include/numpy/putmask.hpp index e66beae154..c10c896432 100644 --- a/pythran/pythonic/include/numpy/putmask.hpp +++ b/pythran/pythonic/include/numpy/putmask.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_PUTMASK_HPP #define PYTHONIC_INCLUDE_NUMPY_PUTMASK_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/numpy/asarray.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy types::none_type putmask(E &, M const &, F const &); DEFINE_FUNCTOR(pythonic::numpy, putmask); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/rad2deg.hpp b/pythran/pythonic/include/numpy/rad2deg.hpp index 3a8b06880c..f737f3c612 100644 --- a/pythran/pythonic/include/numpy/rad2deg.hpp +++ b/pythran/pythonic/include/numpy/rad2deg.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RAD2DEG_HPP #define PYTHONIC_INCLUDE_NUMPY_RAD2DEG_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/pi.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/pi.hpp" PYTHONIC_NS_BEGIN @@ -17,11 +17,11 @@ namespace numpy { return val * 180 / pi; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME rad2deg #define NUMPY_NARY_FUNC_SYM wrapper::rad2deg #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/radians.hpp b/pythran/pythonic/include/numpy/radians.hpp index 7cb7630d41..a3c9252e86 100644 --- a/pythran/pythonic/include/numpy/radians.hpp +++ b/pythran/pythonic/include/numpy/radians.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RADIANS_HPP #define PYTHONIC_INCLUDE_NUMPY_RADIANS_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/numpy/deg2rad.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/numpy/deg2rad.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/random/binomial.hpp b/pythran/pythonic/include/numpy/random/binomial.hpp index fde9a6d5c3..af628750a7 100644 --- a/pythran/pythonic/include/numpy/random/binomial.hpp +++ b/pythran/pythonic/include/numpy/random/binomial.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray binomial(double n, double p, pS const &shape); auto binomial(double n, double p, long size) - -> decltype(binomial(n, p, types::array{{size}})); + -> decltype(binomial(n, p, types::array_tuple{{size}})); long binomial(double n, double p, types::none_type d = types::none_type()); DEFINE_FUNCTOR(pythonic::numpy::random, binomial); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/bytes.hpp b/pythran/pythonic/include/numpy/random/bytes.hpp index 5c2122f305..a33b1c9313 100644 --- a/pythran/pythonic/include/numpy/random/bytes.hpp +++ b/pythran/pythonic/include/numpy/random/bytes.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_BYTES_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_BYTES_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -12,8 +12,8 @@ namespace numpy types::str bytes(long length); DEFINE_FUNCTOR(pythonic::numpy::random, bytes); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/chisquare.hpp b/pythran/pythonic/include/numpy/random/chisquare.hpp index 7b23a28005..a59171d57d 100644 --- a/pythran/pythonic/include/numpy/random/chisquare.hpp +++ b/pythran/pythonic/include/numpy/random/chisquare.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray chisquare(double df, pS const &shape); auto chisquare(double df, long size) - -> decltype(chisquare(df, types::array{{size}})); + -> decltype(chisquare(df, types::array_tuple{{size}})); double chisquare(double df, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, chisquare); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/choice.hpp b/pythran/pythonic/include/numpy/random/choice.hpp index f105eef022..38234fdbe3 100644 --- a/pythran/pythonic/include/numpy/random/choice.hpp +++ b/pythran/pythonic/include/numpy/random/choice.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_CHOICE_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_CHOICE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/random/randint.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -20,8 +20,8 @@ namespace numpy bool replace, P &&p); template - auto choice(long max, T &&size) - -> decltype(randint(0, max, std::forward(size))); + auto choice(long max, + T &&size) -> decltype(randint(0, max, std::forward(size))); long choice(long max); @@ -44,8 +44,8 @@ namespace numpy choice(T &&a, long size, bool replace, P &&p); DEFINE_FUNCTOR(pythonic::numpy::random, choice); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/dirichlet.hpp b/pythran/pythonic/include/numpy/random/dirichlet.hpp index a4de3ff162..59f8d71c95 100644 --- a/pythran/pythonic/include/numpy/random/dirichlet.hpp +++ b/pythran/pythonic/include/numpy/random/dirichlet.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray dirichlet(double alpha, pS const &shape); auto dirichlet(double alpha, long size) - -> decltype(dirichlet(alpha, types::array{{size}})); + -> decltype(dirichlet(alpha, types::array_tuple{{size}})); double dirichlet(double alpha, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, dirichlet); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/exponential.hpp b/pythran/pythonic/include/numpy/random/exponential.hpp index 14b8bd7a5e..136efcfabc 100644 --- a/pythran/pythonic/include/numpy/random/exponential.hpp +++ b/pythran/pythonic/include/numpy/random/exponential.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray exponential(double scale, pS const &shape); auto exponential(double scale, long size) - -> decltype(exponential(scale, types::array{{size}})); + -> decltype(exponential(scale, types::array_tuple{{size}})); double exponential(double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, exponential); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/f.hpp b/pythran/pythonic/include/numpy/random/f.hpp index fca6ba2a06..32e9ae5399 100644 --- a/pythran/pythonic/include/numpy/random/f.hpp +++ b/pythran/pythonic/include/numpy/random/f.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_F_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_F_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -14,14 +14,15 @@ namespace numpy template types::ndarray f(double dfnum, double dfden, pS const &shape); - auto f(double dfnum, double dfden, long size) - -> decltype(f(dfnum, dfden, types::array{{size}})); + auto f(double dfnum, double dfden, + long size) -> decltype(f(dfnum, dfden, + types::array_tuple{{size}})); double f(double dfnum, double dfden, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, f); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/gamma.hpp b/pythran/pythonic/include/numpy/random/gamma.hpp index a14ad16e76..336e10eb72 100644 --- a/pythran/pythonic/include/numpy/random/gamma.hpp +++ b/pythran/pythonic/include/numpy/random/gamma.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_GAMMA_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_GAMMA_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,14 @@ namespace numpy pS const &array_shape); auto gamma(double shape, double scale, long size) - -> decltype(gamma(shape, scale, types::array{{size}})); + -> decltype(gamma(shape, scale, types::array_tuple{{size}})); double gamma(double shape = 0.0, double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, gamma); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/generator.hpp b/pythran/pythonic/include/numpy/random/generator.hpp index 2c9d7b5b02..f1d0728105 100644 --- a/pythran/pythonic/include/numpy/random/generator.hpp +++ b/pythran/pythonic/include/numpy/random/generator.hpp @@ -95,8 +95,8 @@ namespace numpy std::random_device rd; pcg generator(rd); } // namespace details - } // namespace random -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/geometric.hpp b/pythran/pythonic/include/numpy/random/geometric.hpp index a3ab8f83f1..a41b673a1c 100644 --- a/pythran/pythonic/include/numpy/random/geometric.hpp +++ b/pythran/pythonic/include/numpy/random/geometric.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray geometric(double p, pS const &shape); auto geometric(double p, long size) - -> decltype(geometric(p, types::array{{size}})); + -> decltype(geometric(p, types::array_tuple{{size}})); double geometric(double, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, geometric); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/gumbel.hpp b/pythran/pythonic/include/numpy/random/gumbel.hpp index 2f2633aa01..0dd5481d50 100644 --- a/pythran/pythonic/include/numpy/random/gumbel.hpp +++ b/pythran/pythonic/include/numpy/random/gumbel.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_GUMBEL_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_GUMBEL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,14 @@ namespace numpy pS const &shape); auto gumbel(double loc, double scale, long size) - -> decltype(gumbel(loc, scale, types::array{{size}})); + -> decltype(gumbel(loc, scale, types::array_tuple{{size}})); double gumbel(double loc = 0.0, double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, gumbel); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/laplace.hpp b/pythran/pythonic/include/numpy/random/laplace.hpp index 7e017ab340..f0a5fab81a 100644 --- a/pythran/pythonic/include/numpy/random/laplace.hpp +++ b/pythran/pythonic/include/numpy/random/laplace.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_LAPLACE_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_LAPLACE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,14 @@ namespace numpy pS const &shape); auto laplace(double loc, double scale, long size) - -> decltype(laplace(loc, scale, types::array{{size}})); + -> decltype(laplace(loc, scale, types::array_tuple{{size}})); double laplace(double loc = 0.0, double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, laplace); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/logistic.hpp b/pythran/pythonic/include/numpy/random/logistic.hpp index c4266581ba..938ce930ca 100644 --- a/pythran/pythonic/include/numpy/random/logistic.hpp +++ b/pythran/pythonic/include/numpy/random/logistic.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGISTIC_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGISTIC_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,14 @@ namespace numpy pS const &shape); auto logistic(double loc, double scale, long size) - -> decltype(logistic(loc, scale, types::array{{size}})); + -> decltype(logistic(loc, scale, types::array_tuple{{size}})); double logistic(double loc = 0.0, double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, logistic); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/lognormal.hpp b/pythran/pythonic/include/numpy/random/lognormal.hpp index a1658a0885..5c1ee965f9 100644 --- a/pythran/pythonic/include/numpy/random/lognormal.hpp +++ b/pythran/pythonic/include/numpy/random/lognormal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGNORMAL_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGNORMAL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,15 @@ namespace numpy pS const &shape); auto lognormal(double mean, double sigma, long size) - -> decltype(lognormal(mean, sigma, types::array{{size}})); + -> decltype(lognormal(mean, sigma, + types::array_tuple{{size}})); double lognormal(double mean = 0.0, double sigma = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, lognormal); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/logseries.hpp b/pythran/pythonic/include/numpy/random/logseries.hpp index 70e013ea7b..460902ffc9 100644 --- a/pythran/pythonic/include/numpy/random/logseries.hpp +++ b/pythran/pythonic/include/numpy/random/logseries.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGSERIES_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_LOGSERIES_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -15,13 +15,13 @@ namespace numpy types::ndarray logseries(double loc, pS const &shape); auto logseries(double loc, long size) - -> decltype(logseries(loc, types::array{{size}})); + -> decltype(logseries(loc, types::array_tuple{{size}})); double logseries(double loc, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, logseries); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/negative_binomial.hpp b/pythran/pythonic/include/numpy/random/negative_binomial.hpp index 2ee2f5b4e9..1b70ef5082 100644 --- a/pythran/pythonic/include/numpy/random/negative_binomial.hpp +++ b/pythran/pythonic/include/numpy/random/negative_binomial.hpp @@ -16,7 +16,8 @@ namespace numpy pS const &shape); auto negative_binomial(long n, double p, long size) - -> decltype(negative_binomial(n, p, types::array{{size}})); + -> decltype(negative_binomial(n, p, + types::array_tuple{{size}})); long negative_binomial(long n, double p, types::none_type size = {}); diff --git a/pythran/pythonic/include/numpy/random/normal.hpp b/pythran/pythonic/include/numpy/random/normal.hpp index 0fa8994800..bc69b5ff00 100644 --- a/pythran/pythonic/include/numpy/random/normal.hpp +++ b/pythran/pythonic/include/numpy/random/normal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_NORMAL_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_NORMAL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,14 +16,14 @@ namespace numpy pS const &shape); auto normal(double loc, double scale, long size) - -> decltype(normal(loc, scale, types::array{{size}})); + -> decltype(normal(loc, scale, types::array_tuple{{size}})); double normal(double loc = 0.0, double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, normal); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/pareto.hpp b/pythran/pythonic/include/numpy/random/pareto.hpp index 0cc17e1dd7..a98eb23481 100644 --- a/pythran/pythonic/include/numpy/random/pareto.hpp +++ b/pythran/pythonic/include/numpy/random/pareto.hpp @@ -16,13 +16,13 @@ namespace numpy types::ndarray pareto(double a, pS const &shape); auto pareto(double a, long size) - -> decltype(pareto(a, types::array{{size}})); + -> decltype(pareto(a, types::array_tuple{{size}})); double pareto(double a, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, pareto); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/poisson.hpp b/pythran/pythonic/include/numpy/random/poisson.hpp index 5c55ce22c2..e9491470df 100644 --- a/pythran/pythonic/include/numpy/random/poisson.hpp +++ b/pythran/pythonic/include/numpy/random/poisson.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray poisson(double lam, pS const &shape); auto poisson(double lam, long size) - -> decltype(poisson(lam, types::array{{size}})); + -> decltype(poisson(lam, types::array_tuple{{size}})); double poisson(double lam = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, poisson); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/power.hpp b/pythran/pythonic/include/numpy/random/power.hpp index 3f9fc63ffc..f10fdc7553 100644 --- a/pythran/pythonic/include/numpy/random/power.hpp +++ b/pythran/pythonic/include/numpy/random/power.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_POWER_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_POWER_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include PYTHONIC_NS_BEGIN @@ -15,13 +15,13 @@ namespace numpy template types::ndarray power(double a, pS const &shape); auto power(double a, long size) - -> decltype(power(a, types::array{{size}})); + -> decltype(power(a, types::array_tuple{{size}})); double power(double a, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, power); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/rand.hpp b/pythran/pythonic/include/numpy/random/rand.hpp index 54f14c8ae6..5e10ebecc5 100644 --- a/pythran/pythonic/include/numpy/random/rand.hpp +++ b/pythran/pythonic/include/numpy/random/rand.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RAND_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RAND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -10,13 +10,14 @@ namespace numpy namespace random { template - types::ndarray> rand(T... shape); + types::ndarray> + rand(T... shape); double rand(); DEFINE_FUNCTOR(pythonic::numpy::random, rand); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/randint.hpp b/pythran/pythonic/include/numpy/random/randint.hpp index 58117b85a5..bcc8ebbdeb 100644 --- a/pythran/pythonic/include/numpy/random/randint.hpp +++ b/pythran/pythonic/include/numpy/random/randint.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDINT_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDINT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -21,19 +21,19 @@ namespace numpy randint(long min, long max, pS const &shape); template - auto randint(long max, types::none_type, pS const &shape) - -> decltype(randint(0, max, shape)); + auto randint(long max, types::none_type, + pS const &shape) -> decltype(randint(0, max, shape)); long randint(long min, long max); long randint(long max, types::none_type = {}); auto randint(long min, long max, long size) - -> decltype(randint(min, max, types::array{{size}})); + -> decltype(randint(min, max, types::array_tuple{{size}})); DEFINE_FUNCTOR(pythonic::numpy::random, randint); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/randn.hpp b/pythran/pythonic/include/numpy/random/randn.hpp index f33fce310b..1a9cdd1c64 100644 --- a/pythran/pythonic/include/numpy/random/randn.hpp +++ b/pythran/pythonic/include/numpy/random/randn.hpp @@ -11,13 +11,14 @@ namespace numpy namespace random { template - types::ndarray> randn(T... shape); + types::ndarray> + randn(T... shape); double randn(); DEFINE_FUNCTOR(pythonic::numpy::random, randn); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/random.hpp b/pythran/pythonic/include/numpy/random/random.hpp index faaaceaa1f..084c57b684 100644 --- a/pythran/pythonic/include/numpy/random/random.hpp +++ b/pythran/pythonic/include/numpy/random/random.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -14,20 +14,22 @@ namespace numpy template types::ndarray random(pS const &shape); - auto random(long size) -> decltype(random(types::array{{size}})); + auto + random(long size) -> decltype(random(types::array_tuple{{size}})); template auto random(std::integral_constant) - -> decltype(random(types::array, 1>{})) + -> decltype(random( + types::array_tuple, 1>{})) { - return random(types::array, 1>{}); + return random(types::array_tuple, 1>{}); } double random(types::none_type d = types::none_type()); DEFINE_FUNCTOR(pythonic::numpy::random, random); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/random_integers.hpp b/pythran/pythonic/include/numpy/random/random_integers.hpp index a731edab40..26f2f38d66 100644 --- a/pythran/pythonic/include/numpy/random/random_integers.hpp +++ b/pythran/pythonic/include/numpy/random/random_integers.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_INTEGERS_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_INTEGERS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/random/randint.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -20,8 +20,8 @@ namespace numpy long random_integers(long min, long max); DEFINE_FUNCTOR(pythonic::numpy::random, random_integers); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/random_sample.hpp b/pythran/pythonic/include/numpy/random/random_sample.hpp index bb17bed478..582ac1e8ee 100644 --- a/pythran/pythonic/include/numpy/random/random_sample.hpp +++ b/pythran/pythonic/include/numpy/random/random_sample.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_SAMPLE_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RANDOM_SAMPLE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -11,7 +11,7 @@ namespace numpy { USING_FUNCTOR(random_sample, random); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/ranf.hpp b/pythran/pythonic/include/numpy/random/ranf.hpp index 82c1db1f2f..b49b82467c 100644 --- a/pythran/pythonic/include/numpy/random/ranf.hpp +++ b/pythran/pythonic/include/numpy/random/ranf.hpp @@ -11,7 +11,7 @@ namespace numpy { USING_FUNCTOR(ranf, random); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/rayleigh.hpp b/pythran/pythonic/include/numpy/random/rayleigh.hpp index 6f3eb1f3b9..b638a296dc 100644 --- a/pythran/pythonic/include/numpy/random/rayleigh.hpp +++ b/pythran/pythonic/include/numpy/random/rayleigh.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_RAYLEIGH_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_RAYLEIGH_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy types::ndarray rayleigh(double scale, pS const &array_shape); auto rayleigh(double scale, long size) - -> decltype(rayleigh(scale, types::array{{size}})); + -> decltype(rayleigh(scale, types::array_tuple{{size}})); double rayleigh(double scale = 1.0, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, rayleigh); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/sample.hpp b/pythran/pythonic/include/numpy/random/sample.hpp index 4ac5a4f2b3..908d1bab0b 100644 --- a/pythran/pythonic/include/numpy/random/sample.hpp +++ b/pythran/pythonic/include/numpy/random/sample.hpp @@ -11,7 +11,7 @@ namespace numpy { USING_FUNCTOR(sample, random); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/seed.hpp b/pythran/pythonic/include/numpy/random/seed.hpp index 358462fbc9..343ba16e32 100644 --- a/pythran/pythonic/include/numpy/random/seed.hpp +++ b/pythran/pythonic/include/numpy/random/seed.hpp @@ -13,8 +13,8 @@ namespace numpy types::none_type seed(types::none_type _ = {}); DEFINE_FUNCTOR(pythonic::numpy::random, seed); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/random/shuffle.hpp b/pythran/pythonic/include/numpy/random/shuffle.hpp index 4245f55c22..4922a90c12 100644 --- a/pythran/pythonic/include/numpy/random/shuffle.hpp +++ b/pythran/pythonic/include/numpy/random/shuffle.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_SHUFFLE_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_SHUFFLE_HPP -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/types/NoneType.hpp" #include "pythonic/include/numpy/random/generator.hpp" +#include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,8 @@ namespace numpy types::none_type shuffle(T &seq); DEFINE_FUNCTOR(pythonic::numpy::random, shuffle); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/random/standard_exponential.hpp b/pythran/pythonic/include/numpy/random/standard_exponential.hpp index 4ae39edc88..8e6e7517d5 100644 --- a/pythran/pythonic/include/numpy/random/standard_exponential.hpp +++ b/pythran/pythonic/include/numpy/random/standard_exponential.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_EXPONENTIAL_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_EXPONENTIAL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -15,13 +15,13 @@ namespace numpy types::ndarray standard_exponential(pS const &shape); auto standard_exponential(long size) - -> decltype(standard_exponential(types::array{{size}})); + -> decltype(standard_exponential(types::array_tuple{{size}})); double standard_exponential(types::none_type d = {}); DEFINE_FUNCTOR(pythonic::numpy::random, standard_exponential); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/standard_gamma.hpp b/pythran/pythonic/include/numpy/random/standard_gamma.hpp index 8ca27a1455..055c257a84 100644 --- a/pythran/pythonic/include/numpy/random/standard_gamma.hpp +++ b/pythran/pythonic/include/numpy/random/standard_gamma.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_GAMMA_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_GAMMA_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -15,13 +15,13 @@ namespace numpy types::ndarray standard_gamma(double s, pS const &shape); auto standard_gamma(double s, long size) - -> decltype(standard_gamma(s, types::array{{size}})); + -> decltype(standard_gamma(s, types::array_tuple{{size}})); double standard_gamma(double s, types::none_type d = {}); DEFINE_FUNCTOR(pythonic::numpy::random, standard_gamma); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/standard_normal.hpp b/pythran/pythonic/include/numpy/random/standard_normal.hpp index 3dd2be0475..f2f7c00b66 100644 --- a/pythran/pythonic/include/numpy/random/standard_normal.hpp +++ b/pythran/pythonic/include/numpy/random/standard_normal.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_NORMAL_HPP #define PYTHONIC_INCLUDE_NUMPY_RANDOM_STANDARD_NORMAL_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -15,13 +15,13 @@ namespace numpy types::ndarray standard_normal(pS const &shape); auto standard_normal(long size) - -> decltype(standard_normal(types::array{{size}})); + -> decltype(standard_normal(types::array_tuple{{size}})); double standard_normal(types::none_type d = {}); DEFINE_FUNCTOR(pythonic::numpy::random, standard_normal); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/random/uniform.hpp b/pythran/pythonic/include/numpy/random/uniform.hpp index fee7eb84da..da81018b81 100644 --- a/pythran/pythonic/include/numpy/random/uniform.hpp +++ b/pythran/pythonic/include/numpy/random/uniform.hpp @@ -17,7 +17,7 @@ namespace numpy pS const &array_shape); auto uniform(double low, double high, long size) - -> decltype(uniform(low, high, types::array{{size}})); + -> decltype(uniform(low, high, types::array_tuple{{size}})); double uniform(double low = 0.0, double high = 1.0, types::none_type size = {}); diff --git a/pythran/pythonic/include/numpy/random/weibull.hpp b/pythran/pythonic/include/numpy/random/weibull.hpp index b4411da214..2f96e7d0b9 100644 --- a/pythran/pythonic/include/numpy/random/weibull.hpp +++ b/pythran/pythonic/include/numpy/random/weibull.hpp @@ -15,13 +15,13 @@ namespace numpy types::ndarray weibull(double a, pS const &shape); auto weibull(double a, long size) - -> decltype(weibull(a, types::array{{size}})); + -> decltype(weibull(a, types::array_tuple{{size}})); double weibull(double a, types::none_type size = {}); DEFINE_FUNCTOR(pythonic::numpy::random, weibull); - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ravel.hpp b/pythran/pythonic/include/numpy/ravel.hpp index 797b00edb2..9fd9e8e51e 100644 --- a/pythran/pythonic/include/numpy/ravel.hpp +++ b/pythran/pythonic/include/numpy/ravel.hpp @@ -14,7 +14,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(ravel); DEFINE_FUNCTOR(pythonic::numpy, ravel); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/real.hpp b/pythran/pythonic/include/numpy/real.hpp index ef6fedb391..900733f5f8 100644 --- a/pythran/pythonic/include/numpy/real.hpp +++ b/pythran/pythonic/include/numpy/real.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_REAL_HPP #define PYTHONIC_INCLUDE_NUMPY_REAL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/asarray.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/list.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy -> decltype(real(numpy::functor::asarray{}(expr))); DEFINE_FUNCTOR(pythonic::numpy, real); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/reciprocal.hpp b/pythran/pythonic/include/numpy/reciprocal.hpp index de6e15078d..06d54a00c3 100644 --- a/pythran/pythonic/include/numpy/reciprocal.hpp +++ b/pythran/pythonic/include/numpy/reciprocal.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RECIPROCAL_HPP #define PYTHONIC_INCLUDE_NUMPY_RECIPROCAL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,11 +16,11 @@ namespace numpy { return static_cast(1.) / val; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME reciprocal #define NUMPY_NARY_FUNC_SYM wrapper::reciprocal #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/reduce.hpp b/pythran/pythonic/include/numpy/reduce.hpp index 36ce15dca2..6923590ca5 100644 --- a/pythran/pythonic/include/numpy/reduce.hpp +++ b/pythran/pythonic/include/numpy/reduce.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_REDUCE_HPP #define PYTHONIC_INCLUDE_NUMPY_REDUCE_HPP -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/types/ndarray.hpp" #include @@ -13,8 +13,8 @@ namespace operator_ { struct imax; struct imin; - } -} + } // namespace functor +} // namespace operator_ namespace numpy { @@ -43,7 +43,7 @@ namespace numpy template using reduce_result_type = typename reduce_result_type_helper::type; - } + } // namespace template typename std::enable_if< @@ -79,7 +79,7 @@ namespace numpy { template using reduced_type = types::ndarray, - types::array>; + types::array_tuple>; } template @@ -98,7 +98,7 @@ namespace numpy template typename std::enable_if>::type reduce(E const &array, long axis, types::none_type dtype, Out &&out); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/remainder.hpp b/pythran/pythonic/include/numpy/remainder.hpp index e2d310d863..691687ff80 100644 --- a/pythran/pythonic/include/numpy/remainder.hpp +++ b/pythran/pythonic/include/numpy/remainder.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_REMAINDER_HPP #define PYTHONIC_INCLUDE_NUMPY_REMAINDER_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,17 +15,17 @@ namespace numpy namespace wrapper { template - auto remainder(T0 const &x, T1 const &y) - -> decltype(x - y * xsimd::floor(x / y)) + auto remainder(T0 const &x, + T1 const &y) -> decltype(x - y * xsimd::floor(x / y)) { return x - y * xsimd::floor(x / y); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME remainder #define NUMPY_NARY_FUNC_SYM wrapper::remainder #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/repeat.hpp b/pythran/pythonic/include/numpy/repeat.hpp index e5a37d1ea5..39dba3a7c0 100644 --- a/pythran/pythonic/include/numpy/repeat.hpp +++ b/pythran/pythonic/include/numpy/repeat.hpp @@ -1,17 +1,17 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_REPEAT_HPP #define PYTHONIC_INCLUDE_NUMPY_REPEAT_HPP +#include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/builtins/None.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> repeat(types::ndarray const &expr, long repeats, long axis); template @@ -21,7 +21,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(repeat); DEFINE_FUNCTOR(pythonic::numpy, repeat); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/resize.hpp b/pythran/pythonic/include/numpy/resize.hpp index 4ea024f99b..3028f7cbf8 100644 --- a/pythran/pythonic/include/numpy/resize.hpp +++ b/pythran/pythonic/include/numpy/resize.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RESIZE_HPP #define PYTHONIC_INCLUDE_NUMPY_RESIZE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/ndarray/reshape.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy diff --git a/pythran/pythonic/include/numpy/right_shift.hpp b/pythran/pythonic/include/numpy/right_shift.hpp index e6f93acc2f..ec440429cd 100644 --- a/pythran/pythonic/include/numpy/right_shift.hpp +++ b/pythran/pythonic/include/numpy/right_shift.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RIGHTSHIFT_HPP #define PYTHONIC_INCLUDE_NUMPY_RIGHTSHIFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/operator_/rshift.hpp" @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME right_shift #define NUMPY_NARY_FUNC_SYM operator_::rshift #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/rint.hpp b/pythran/pythonic/include/numpy/rint.hpp index 49f8694ed5..1b5e78d86e 100644 --- a/pythran/pythonic/include/numpy/rint.hpp +++ b/pythran/pythonic/include/numpy/rint.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_RINT_HPP #define PYTHONIC_INCLUDE_NUMPY_RINT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,11 +15,11 @@ namespace numpy T rint(T const &v); template std::complex rint(std::complex const &v); - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME rint #define NUMPY_NARY_FUNC_SYM wrapper::rint #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/roll.hpp b/pythran/pythonic/include/numpy/roll.hpp index 1df6f3181d..cf8e122e52 100644 --- a/pythran/pythonic/include/numpy/roll.hpp +++ b/pythran/pythonic/include/numpy/roll.hpp @@ -18,8 +18,8 @@ namespace numpy template types::ndarray roll(types::ndarray const &expr, - types::array shift, - types::array axis); + types::array_tuple shift, + types::array_tuple axis); NUMPY_EXPR_TO_NDARRAY0_DECL(roll); DEFINE_FUNCTOR(pythonic::numpy, roll); diff --git a/pythran/pythonic/include/numpy/rollaxis.hpp b/pythran/pythonic/include/numpy/rollaxis.hpp index b26633f387..15f1325ebf 100644 --- a/pythran/pythonic/include/numpy/rollaxis.hpp +++ b/pythran/pythonic/include/numpy/rollaxis.hpp @@ -1,20 +1,20 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ROLLAXIS_HPP #define PYTHONIC_INCLUDE_NUMPY_ROLLAXIS_HPP -#include "pythonic/include/numpy/transpose.hpp" #include "pythonic/include/numpy/copy.hpp" +#include "pythonic/include/numpy/transpose.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> rollaxis(types::ndarray const &a, long axis, long start = 0); NUMPY_EXPR_TO_NDARRAY0_DECL(rollaxis); DEFINE_FUNCTOR(pythonic::numpy, rollaxis); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/rot90.hpp b/pythran/pythonic/include/numpy/rot90.hpp index 1faa224a5d..6b3a5cba5a 100644 --- a/pythran/pythonic/include/numpy/rot90.hpp +++ b/pythran/pythonic/include/numpy/rot90.hpp @@ -1,22 +1,22 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ROT90_HPP #define PYTHONIC_INCLUDE_NUMPY_ROT90_HPP +#include "pythonic/include/numpy/copy.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/numpy/copy.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> rot90(types::ndarray const &expr, int k = 1); NUMPY_EXPR_TO_NDARRAY0_DECL(rot90) DEFINE_FUNCTOR(pythonic::numpy, rot90); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/searchsorted.hpp b/pythran/pythonic/include/numpy/searchsorted.hpp index af23a56ef9..378b30d021 100644 --- a/pythran/pythonic/include/numpy/searchsorted.hpp +++ b/pythran/pythonic/include/numpy/searchsorted.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SEARCHSORTED_HPP #define PYTHONIC_INCLUDE_NUMPY_SEARCHSORTED_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/utils/int_.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/int_.hpp" +#include "pythonic/include/utils/numpy_conversion.hpp" #include @@ -21,11 +21,11 @@ namespace numpy template typename std::enable_if< types::is_numexpr_arg::value, - types::ndarray>>::type + types::ndarray>>::type searchsorted(T const &a, E const &v, types::str const &side = "left"); DEFINE_FUNCTOR(pythonic::numpy, searchsorted); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/select.hpp b/pythran/pythonic/include/numpy/select.hpp index 106bf0ad7b..c8040d7a3a 100644 --- a/pythran/pythonic/include/numpy/select.hpp +++ b/pythran/pythonic/include/numpy/select.hpp @@ -10,14 +10,15 @@ namespace numpy { template - types::ndarray> + types::ndarray> select(C const &condlist, L const &choicelist, typename L::dtype _default = 0); template typename std::enable_if< std::tuple_size::value == std::tuple_size::value, - types::ndarray::value>>>::type + types::ndarray< + T, types::array_tuple::value>>>::type select(types::list> const &condlist, types::list> const &choicelist, T _default = 0); @@ -45,7 +46,7 @@ namespace numpy T _default = 0); DEFINE_FUNCTOR(pythonic::numpy, select); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/setdiff1d.hpp b/pythran/pythonic/include/numpy/setdiff1d.hpp index 84b3fad818..2389da8478 100644 --- a/pythran/pythonic/include/numpy/setdiff1d.hpp +++ b/pythran/pythonic/include/numpy/setdiff1d.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SETDIFF1D_HPP #define PYTHONIC_INCLUDE_NUMPY_SETDIFF1D_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy setdiff1d(T const &ar1, U const &ar2, bool assume_unique = false); DEFINE_FUNCTOR(pythonic::numpy, setdiff1d); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/shape.hpp b/pythran/pythonic/include/numpy/shape.hpp index ebb09f40f7..a39ac8591c 100644 --- a/pythran/pythonic/include/numpy/shape.hpp +++ b/pythran/pythonic/include/numpy/shape.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SHAPE_HPP #define PYTHONIC_INCLUDE_NUMPY_SHAPE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy auto shape(E const &e) -> decltype(sutils::getshape(e)); DEFINE_FUNCTOR(pythonic::numpy, shape) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/short_.hpp b/pythran/pythonic/include/numpy/short_.hpp index 74e7443684..df740d99f8 100644 --- a/pythran/pythonic/include/numpy/short_.hpp +++ b/pythran/pythonic/include/numpy/short_.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SHORT__HPP #define PYTHONIC_INCLUDE_NUMPY_SHORT__HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy short short_(); template short short_(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME short_ #define NUMPY_NARY_FUNC_SYM details::short_ #define NUMPY_NARY_EXTRA_METHOD using type = short; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sin.hpp b/pythran/pythonic/include/numpy/sin.hpp index acb1ee91f3..d0b89b8def 100644 --- a/pythran/pythonic/include/numpy/sin.hpp +++ b/pythran/pythonic/include/numpy/sin.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SIN_HPP #define PYTHONIC_INCLUDE_NUMPY_SIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sin #define NUMPY_NARY_FUNC_SYM xsimd::sin #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sinh.hpp b/pythran/pythonic/include/numpy/sinh.hpp index b834cdc97d..d70bdf0ac5 100644 --- a/pythran/pythonic/include/numpy/sinh.hpp +++ b/pythran/pythonic/include/numpy/sinh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SINH_HPP #define PYTHONIC_INCLUDE_NUMPY_SINH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sinh #define NUMPY_NARY_FUNC_SYM xsimd::sinh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sort.hpp b/pythran/pythonic/include/numpy/sort.hpp index 95231004e5..97c4056813 100644 --- a/pythran/pythonic/include/numpy/sort.hpp +++ b/pythran/pythonic/include/numpy/sort.hpp @@ -3,28 +3,28 @@ #include -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> + types::ndarray> sort(E const &expr, types::none_type); template - types::ndarray> + types::ndarray> sort(E const &expr, long axis = -1); template - types::ndarray> + types::ndarray> sort(E const &expr, long axis, types::str const &kind); NUMPY_EXPR_TO_NDARRAY0_DECL(sort); DEFINE_FUNCTOR(pythonic::numpy, sort); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sort_complex.hpp b/pythran/pythonic/include/numpy/sort_complex.hpp index d0cb3c7d04..746a9eacc9 100644 --- a/pythran/pythonic/include/numpy/sort_complex.hpp +++ b/pythran/pythonic/include/numpy/sort_complex.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SORTCOMPLEX_HPP #define PYTHONIC_INCLUDE_NUMPY_SORTCOMPLEX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/sort.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/numpy/spacing.hpp b/pythran/pythonic/include/numpy/spacing.hpp index 3f7fe91e55..c099acd80e 100644 --- a/pythran/pythonic/include/numpy/spacing.hpp +++ b/pythran/pythonic/include/numpy/spacing.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SPACING_HPP #define PYTHONIC_INCLUDE_NUMPY_SPACING_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,11 +16,11 @@ namespace numpy { return std::nextafter(v, 1) - v; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME spacing #define NUMPY_NARY_FUNC_SYM wrapper::spacing #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/split.hpp b/pythran/pythonic/include/numpy/split.hpp index b6d7ccee27..dfc5167347 100644 --- a/pythran/pythonic/include/numpy/split.hpp +++ b/pythran/pythonic/include/numpy/split.hpp @@ -8,22 +8,24 @@ PYTHONIC_NS_BEGIN namespace numpy { template - types::list::value>>> + types::list< + types::ndarray::value>>> split(types::ndarray const &a, long nb_split); template typename std::enable_if< types::is_iterable::value, types::list::value>>>>::type + T, types::array_tuple::value>>>>::type split(types::ndarray const &a, I const &split_mask); template - types::list>> + types::list< + types::ndarray>> split(E const &a, I const &); DEFINE_FUNCTOR(pythonic::numpy, split); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sqrt.hpp b/pythran/pythonic/include/numpy/sqrt.hpp index 4a2aae60fe..6f58776bf1 100644 --- a/pythran/pythonic/include/numpy/sqrt.hpp +++ b/pythran/pythonic/include/numpy/sqrt.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SQRT_HPP #define PYTHONIC_INCLUDE_NUMPY_SQRT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sqrt #define NUMPY_NARY_FUNC_SYM xsimd::sqrt #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/square.hpp b/pythran/pythonic/include/numpy/square.hpp index ab5fe9b1c8..5f93d421df 100644 --- a/pythran/pythonic/include/numpy/square.hpp +++ b/pythran/pythonic/include/numpy/square.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_INCLUDE_NUMPY_SQUARE_HPP #include "pythonic/include/types/numpy_op_helper.hpp" -#include "pythonic/include/utils/numpy_traits.hpp" #include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/numpy_traits.hpp" #include @@ -19,7 +19,7 @@ namespace numpy namespace wrapper { template - auto square(T const &arg) -> decltype(arg *arg) + auto square(T const &arg) -> decltype(arg * arg) { return arg * arg; } @@ -32,12 +32,12 @@ namespace numpy auto i2 = i * i; return {r2 - i2, t + t}; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME square #define NUMPY_NARY_FUNC_SYM wrapper::square #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/stack.hpp b/pythran/pythonic/include/numpy/stack.hpp index 070efe7cce..94cbfcc5dd 100644 --- a/pythran/pythonic/include/numpy/stack.hpp +++ b/pythran/pythonic/include/numpy/stack.hpp @@ -9,7 +9,7 @@ namespace numpy { template types::ndarray> + types::array_tuple> stack(ArraySequence const &args, long axis = 0); namespace details @@ -20,12 +20,13 @@ namespace numpy } template - types::ndarray::dtype, - types::array::value + 1>> + types::ndarray< + typename details::stack_helper_t::dtype, + types::array_tuple::value + 1>> stack(std::tuple const &args, long axis = 0); DEFINE_FUNCTOR(pythonic::numpy, stack); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/std_.hpp b/pythran/pythonic/include/numpy/std_.hpp index 101e533bdc..0e403bf214 100644 --- a/pythran/pythonic/include/numpy/std_.hpp +++ b/pythran/pythonic/include/numpy/std_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_STD_HPP #define PYTHONIC_INCLUDE_NUMPY_STD_HPP -#include "pythonic/include/numpy/var.hpp" #include "pythonic/include/numpy/sqrt.hpp" +#include "pythonic/include/numpy/var.hpp" PYTHONIC_NS_BEGIN @@ -10,11 +10,11 @@ namespace numpy { template - auto std_(Args &&... args) + auto std_(Args &&...args) -> decltype(functor::sqrt{}(var(std::forward(args)...))); DEFINE_FUNCTOR(pythonic::numpy, std_); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/subtract.hpp b/pythran/pythonic/include/numpy/subtract.hpp index 99e6184aa3..45cfeb1527 100644 --- a/pythran/pythonic/include/numpy/subtract.hpp +++ b/pythran/pythonic/include/numpy/subtract.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_SUBTRACT_HPP #define PYTHONIC_INCLUDE_NUMPY_SUBTRACT_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/sub.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/sub.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME subtract #define NUMPY_NARY_FUNC_SYM pythonic::operator_::sub #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/sum.hpp b/pythran/pythonic/include/numpy/sum.hpp index 6ca19b4768..835603298c 100644 --- a/pythran/pythonic/include/numpy/sum.hpp +++ b/pythran/pythonic/include/numpy/sum.hpp @@ -11,14 +11,14 @@ namespace numpy { template - auto sum(Args &&... args) + auto sum(Args &&...args) -> decltype(reduce(std::forward(args)...)) { return reduce(std::forward(args)...); } DEFINE_FUNCTOR(pythonic::numpy, sum); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/swapaxes.hpp b/pythran/pythonic/include/numpy/swapaxes.hpp index f0dfd4d437..13552f2cd3 100644 --- a/pythran/pythonic/include/numpy/swapaxes.hpp +++ b/pythran/pythonic/include/numpy/swapaxes.hpp @@ -8,12 +8,14 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto swapaxes(T &&a, int axis1, int axis2) -> decltype(functor::transpose{}( - std::forward(a), - std::declval::type::value>>())); + auto swapaxes(T &&a, int axis1, int axis2) + -> decltype(functor::transpose{}( + std::forward(a), + std::declval< + types::array_tuple::type::value>>())); DEFINE_FUNCTOR(pythonic::numpy, swapaxes); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/take.hpp b/pythran/pythonic/include/numpy/take.hpp index cd2f7e764f..47c311c86d 100644 --- a/pythran/pythonic/include/numpy/take.hpp +++ b/pythran/pythonic/include/numpy/take.hpp @@ -10,7 +10,7 @@ namespace numpy -> decltype(std::forward(expr)[std::forward(indices)]); DEFINE_FUNCTOR(pythonic::numpy, take); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/tan.hpp b/pythran/pythonic/include/numpy/tan.hpp index 91d322d8a2..142bba6bbe 100644 --- a/pythran/pythonic/include/numpy/tan.hpp +++ b/pythran/pythonic/include/numpy/tan.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TAN_HPP #define PYTHONIC_INCLUDE_NUMPY_TAN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME tan #define NUMPY_NARY_FUNC_SYM xsimd::tan #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/tanh.hpp b/pythran/pythonic/include/numpy/tanh.hpp index 18f38f2d24..edbdb7891a 100644 --- a/pythran/pythonic/include/numpy/tanh.hpp +++ b/pythran/pythonic/include/numpy/tanh.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TANH_HPP #define PYTHONIC_INCLUDE_NUMPY_TANH_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME tanh #define NUMPY_NARY_FUNC_SYM xsimd::tanh #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/tile.hpp b/pythran/pythonic/include/numpy/tile.hpp index 011f00892d..6c844eecee 100644 --- a/pythran/pythonic/include/numpy/tile.hpp +++ b/pythran/pythonic/include/numpy/tile.hpp @@ -1,23 +1,23 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TILE_HPP #define PYTHONIC_INCLUDE_NUMPY_TILE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> + types::ndarray> tile(E const &expr, long reps); template - types::ndarray> - tile(E const &expr, types::array const &reps); + types::ndarray> + tile(E const &expr, types::array_tuple const &reps); DEFINE_FUNCTOR(pythonic::numpy, tile); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/trace.hpp b/pythran/pythonic/include/numpy/trace.hpp index fbd3282c90..a9ae44b1dc 100644 --- a/pythran/pythonic/include/numpy/trace.hpp +++ b/pythran/pythonic/include/numpy/trace.hpp @@ -12,7 +12,7 @@ namespace numpy typename T::dtype trace(T const &expr, int offset = 0); DEFINE_FUNCTOR(pythonic::numpy, trace) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/transpose.hpp b/pythran/pythonic/include/numpy/transpose.hpp index 5a9aa973ea..0eb9ade8b3 100644 --- a/pythran/pythonic/include/numpy/transpose.hpp +++ b/pythran/pythonic/include/numpy/transpose.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRANSPOSE_HPP #define PYTHONIC_INCLUDE_NUMPY_TRANSPOSE_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/utils/nested_container.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_expr.hpp" +#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/utils/nested_container.hpp" +#include "pythonic/include/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -41,19 +41,21 @@ namespace numpy template typename std::enable_if< (std::tuple_size::value > 2), - types::ndarray::value>>>::type - transpose(types::ndarray const &a); + types::ndarray::value>>>:: + type + transpose(types::ndarray const &a); template - types::ndarray::value>> - transpose(types::ndarray const &a, types::array const &t); + types::ndarray::value>> + transpose(types::ndarray const &a, + types::array_tuple const &t); template - types::ndarray> - transpose(types::ndarray const &a, long index, Args const &... indices) + types::ndarray> + transpose(types::ndarray const &a, long index, Args const &...indices) { - return transpose( - a, types::array{{index, (long)indices...}}); + return transpose(a, types::array_tuple{ + {index, (long)indices...}}); } template @@ -79,17 +81,18 @@ namespace numpy }; template - auto transpose(E const &expr) -> typename std::enable_if< - (E::value > 2), - decltype(transpose(types::ndarray{ - expr}))>::type + auto transpose(E const &expr) -> + typename std::enable_if< + (E::value > 2), + decltype(transpose(types::ndarray{expr}))>::type { return transpose( types::ndarray{expr}); } DEFINE_FUNCTOR(pythonic::numpy, transpose); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/tri.hpp b/pythran/pythonic/include/numpy/tri.hpp index bcdd251019..06b1e194be 100644 --- a/pythran/pythonic/include/numpy/tri.hpp +++ b/pythran/pythonic/include/numpy/tri.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRI_HPP #define PYTHONIC_INCLUDE_NUMPY_TRI_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy tri(long N, long M = -1, long k = 0, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, tri) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/tril.hpp b/pythran/pythonic/include/numpy/tril.hpp index a7a6df584d..242674d9c0 100644 --- a/pythran/pythonic/include/numpy/tril.hpp +++ b/pythran/pythonic/include/numpy/tril.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRIL_HPP #define PYTHONIC_INCLUDE_NUMPY_TRIL_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(tril) DEFINE_FUNCTOR(pythonic::numpy, tril) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/triu.hpp b/pythran/pythonic/include/numpy/triu.hpp index a30e68e127..bccfc5af50 100644 --- a/pythran/pythonic/include/numpy/triu.hpp +++ b/pythran/pythonic/include/numpy/triu.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRIU_HPP #define PYTHONIC_INCLUDE_NUMPY_TRIU_HPP +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" -#include "pythonic/include/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy NUMPY_EXPR_TO_NDARRAY0_DECL(triu) DEFINE_FUNCTOR(pythonic::numpy, triu) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/true_divide.hpp b/pythran/pythonic/include/numpy/true_divide.hpp index dc7b68a252..0f6d9e4152 100644 --- a/pythran/pythonic/include/numpy/true_divide.hpp +++ b/pythran/pythonic/include/numpy/true_divide.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRUEDIVIDE_HPP #define PYTHONIC_INCLUDE_NUMPY_TRUEDIVIDE_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/operator_/div.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/operator_/div.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME true_divide #define NUMPY_NARY_FUNC_SYM pythonic::operator_::div #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/trunc.hpp b/pythran/pythonic/include/numpy/trunc.hpp index a5ec9f9429..8a01b4204f 100644 --- a/pythran/pythonic/include/numpy/trunc.hpp +++ b/pythran/pythonic/include/numpy/trunc.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_TRUNC_HPP #define PYTHONIC_INCLUDE_NUMPY_TRUNC_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" #include @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME trunc #define NUMPY_NARY_FUNC_SYM xsimd::trunc #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ubyte.hpp b/pythran/pythonic/include/numpy/ubyte.hpp index 51327e593b..e95fd990de 100644 --- a/pythran/pythonic/include/numpy/ubyte.hpp +++ b/pythran/pythonic/include/numpy/ubyte.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UBYTE_HPP #define PYTHONIC_INCLUDE_NUMPY_UBYTE_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy unsigned char ubyte(); template unsigned char ubyte(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ubyte #define NUMPY_NARY_FUNC_SYM details::ubyte #define NUMPY_NARY_EXTRA_METHOD using type = unsigned char; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ufunc_accumulate.hpp b/pythran/pythonic/include/numpy/ufunc_accumulate.hpp index ffbfa83fb5..be76448d59 100644 --- a/pythran/pythonic/include/numpy/ufunc_accumulate.hpp +++ b/pythran/pythonic/include/numpy/ufunc_accumulate.hpp @@ -21,6 +21,6 @@ namespace numpy -> decltype(partial_sum(std::forward(a), axis, d)); DEFINE_FUNCTOR(pythonic::numpy::UFUNC_NAME, accumulate); - } -} + } // namespace UFUNC_NAME +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/ufunc_reduce.hpp b/pythran/pythonic/include/numpy/ufunc_reduce.hpp index f7d6c7caf0..8f8b19f599 100644 --- a/pythran/pythonic/include/numpy/ufunc_reduce.hpp +++ b/pythran/pythonic/include/numpy/ufunc_reduce.hpp @@ -27,16 +27,17 @@ namespace numpy std::forward(arg), 0L); } template - auto reduce(Args &&... args) -> typename std::enable_if< - sizeof...(Args) != 1, - decltype(numpy::reduce( - std::forward(args)...))>::type + auto reduce(Args &&...args) -> + typename std::enable_if< + sizeof...(Args) != 1, + decltype(numpy::reduce( + std::forward(args)...))>::type { return numpy::reduce( std::forward(args)...); } DEFINE_FUNCTOR(pythonic::numpy::UFUNC_NAME, reduce); - } -} + } // namespace UFUNC_NAME +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/include/numpy/uint.hpp b/pythran/pythonic/include/numpy/uint.hpp index ec4773dae2..dd6242f775 100644 --- a/pythran/pythonic/include/numpy/uint.hpp +++ b/pythran/pythonic/include/numpy/uint.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINT_HPP #define PYTHONIC_INCLUDE_NUMPY_UINT_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy unsigned long uint(); template unsigned long uint(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uint #define NUMPY_NARY_FUNC_SYM details::uint #define NUMPY_NARY_EXTRA_METHOD using type = unsigned long; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uint16.hpp b/pythran/pythonic/include/numpy/uint16.hpp index 05eea7869f..0d1f6c3353 100644 --- a/pythran/pythonic/include/numpy/uint16.hpp +++ b/pythran/pythonic/include/numpy/uint16.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINT16_HPP #define PYTHONIC_INCLUDE_NUMPY_UINT16_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy uint16_t uint16(); template uint16_t uint16(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uint16 #define NUMPY_NARY_FUNC_SYM details::uint16 #define NUMPY_NARY_EXTRA_METHOD using type = uint16_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uint32.hpp b/pythran/pythonic/include/numpy/uint32.hpp index 2c81cac769..0d0bfcb17b 100644 --- a/pythran/pythonic/include/numpy/uint32.hpp +++ b/pythran/pythonic/include/numpy/uint32.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINT32_HPP #define PYTHONIC_INCLUDE_NUMPY_UINT32_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy uint32_t uint32(); template uint32_t uint32(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uint32 #define NUMPY_NARY_FUNC_SYM details::uint32 #define NUMPY_NARY_EXTRA_METHOD using type = uint32_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uint64.hpp b/pythran/pythonic/include/numpy/uint64.hpp index caefe91ef4..85264f209c 100644 --- a/pythran/pythonic/include/numpy/uint64.hpp +++ b/pythran/pythonic/include/numpy/uint64.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINT64_HPP #define PYTHONIC_INCLUDE_NUMPY_UINT64_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy uint64_t uint64(); template uint64_t uint64(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uint64 #define NUMPY_NARY_FUNC_SYM details::uint64 #define NUMPY_NARY_EXTRA_METHOD using type = uint64_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uint8.hpp b/pythran/pythonic/include/numpy/uint8.hpp index c268272cc1..8eef53ba88 100644 --- a/pythran/pythonic/include/numpy/uint8.hpp +++ b/pythran/pythonic/include/numpy/uint8.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINT8_HPP #define PYTHONIC_INCLUDE_NUMPY_UINT8_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy uint8_t uint8(); template uint8_t uint8(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uint8 #define NUMPY_NARY_FUNC_SYM details::uint8 #define NUMPY_NARY_EXTRA_METHOD using type = uint8_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uintc.hpp b/pythran/pythonic/include/numpy/uintc.hpp index 027326c312..dc9a6e25c7 100644 --- a/pythran/pythonic/include/numpy/uintc.hpp +++ b/pythran/pythonic/include/numpy/uintc.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINTC_HPP #define PYTHONIC_INCLUDE_NUMPY_UINTC_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy unsigned uintc(); template unsigned uintc(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uintc #define NUMPY_NARY_FUNC_SYM details::uintc #define NUMPY_NARY_EXTRA_METHOD using type = unsigned; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/uintp.hpp b/pythran/pythonic/include/numpy/uintp.hpp index f8184e349a..10b035e7c5 100644 --- a/pythran/pythonic/include/numpy/uintp.hpp +++ b/pythran/pythonic/include/numpy/uintp.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UINTP_HPP #define PYTHONIC_INCLUDE_NUMPY_UINTP_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy uintptr_t uintp(); template uintptr_t uintp(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME uintp #define NUMPY_NARY_FUNC_SYM details::uintp #define NUMPY_NARY_EXTRA_METHOD using type = uintptr_t; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ulonglong.hpp b/pythran/pythonic/include/numpy/ulonglong.hpp index 8811bd2cc9..b78622d956 100644 --- a/pythran/pythonic/include/numpy/ulonglong.hpp +++ b/pythran/pythonic/include/numpy/ulonglong.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ULONGLONG_HPP #define PYTHONIC_INCLUDE_NUMPY_ULONGLONG_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy unsigned long long ulonglong(); template unsigned long long ulonglong(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ulonglong #define NUMPY_NARY_FUNC_SYM details::ulonglong #define NUMPY_NARY_EXTRA_METHOD using type = unsigned long long; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/union1d.hpp b/pythran/pythonic/include/numpy/union1d.hpp index 5b578c3d9b..241fd221ec 100644 --- a/pythran/pythonic/include/numpy/union1d.hpp +++ b/pythran/pythonic/include/numpy/union1d.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UNION1D_HPP #define PYTHONIC_INCLUDE_NUMPY_UNION1D_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy union1d(E const &e, F const &f); DEFINE_FUNCTOR(pythonic::numpy, union1d) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/unique.hpp b/pythran/pythonic/include/numpy/unique.hpp index b4d8b0cc2f..e353f4de2a 100644 --- a/pythran/pythonic/include/numpy/unique.hpp +++ b/pythran/pythonic/include/numpy/unique.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UNIQUE_HPP #define PYTHONIC_INCLUDE_NUMPY_UNIQUE_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/types/immediate.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/tuple.hpp" -#include "pythonic/include/types/immediate.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -107,7 +107,7 @@ namespace numpy types::true_immediate return_counts); DEFINE_FUNCTOR(pythonic::numpy, unique) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/unravel_index.hpp b/pythran/pythonic/include/numpy/unravel_index.hpp index 9f585f10e1..fcab8025b3 100644 --- a/pythran/pythonic/include/numpy/unravel_index.hpp +++ b/pythran/pythonic/include/numpy/unravel_index.hpp @@ -9,12 +9,13 @@ PYTHONIC_NS_BEGIN namespace numpy { template - typename std::enable_if::value, - types::array::value>>::type + typename std::enable_if< + std::is_scalar::value, + types::array_tuple::value>>::type unravel_index(E const &expr, S const &shape, types::str const &order = "C"); DEFINE_FUNCTOR(pythonic::numpy, unravel_index); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/unwrap.hpp b/pythran/pythonic/include/numpy/unwrap.hpp index 1615cf59f9..e0928a5001 100644 --- a/pythran/pythonic/include/numpy/unwrap.hpp +++ b/pythran/pythonic/include/numpy/unwrap.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_UNWRAP_HPP #define PYTHONIC_INCLUDE_NUMPY_UNWRAP_HPP +#include "pythonic/include/numpy/pi.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/int_.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/numpy/pi.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy double discont = pi); DEFINE_FUNCTOR(pythonic::numpy, unwrap) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/ushort.hpp b/pythran/pythonic/include/numpy/ushort.hpp index 11d2980017..de2018e795 100644 --- a/pythran/pythonic/include/numpy/ushort.hpp +++ b/pythran/pythonic/include/numpy/ushort.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_USHORT_HPP #define PYTHONIC_INCLUDE_NUMPY_USHORT_HPP +#include "pythonic/include/types/numpy_op_helper.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/meta.hpp" #include "pythonic/include/utils/numpy_traits.hpp" -#include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -17,13 +17,13 @@ namespace numpy unsigned short ushort(); template unsigned short ushort(V v); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ushort #define NUMPY_NARY_FUNC_SYM details::ushort #define NUMPY_NARY_EXTRA_METHOD using type = unsigned short; #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/var.hpp b/pythran/pythonic/include/numpy/var.hpp index 104a4f6401..f6a74f69b1 100644 --- a/pythran/pythonic/include/numpy/var.hpp +++ b/pythran/pythonic/include/numpy/var.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_VAR_HPP #define PYTHONIC_INCLUDE_NUMPY_VAR_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/builtins/None.hpp" #include "pythonic/include/numpy/add.hpp" #include "pythonic/include/numpy/mean.hpp" #include "pythonic/include/numpy/sum.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -22,8 +22,8 @@ namespace numpy template auto var(E const &expr, types::none_type axis = builtins::None, types::none_type dtype = builtins::None, - types::none_type out = builtins::None, long ddof = 0) - -> decltype(var_type(std::real(mean(expr)))); + types::none_type out = builtins::None, + long ddof = 0) -> decltype(var_type(std::real(mean(expr)))); template auto var(E const &expr, long axis, types::none_type dtype = builtins::None, @@ -31,7 +31,7 @@ namespace numpy typename assignable() * mean(expr, axis))>::type; DEFINE_FUNCTOR(pythonic::numpy, var); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/vdot.hpp b/pythran/pythonic/include/numpy/vdot.hpp index 67f9ffdad9..db4cdcd64d 100644 --- a/pythran/pythonic/include/numpy/vdot.hpp +++ b/pythran/pythonic/include/numpy/vdot.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_VDOT_HPP #define PYTHONIC_INCLUDE_NUMPY_VDOT_HPP -#include "pythonic/include/utils/functor.hpp" -#include "pythonic/include/types/ndarray.hpp" -#include "pythonic/include/numpy/dot.hpp" #include "pythonic/include/numpy/asarray.hpp" +#include "pythonic/include/numpy/dot.hpp" +#include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy functor::asarray{}(v).flat())); DEFINE_FUNCTOR(pythonic::numpy, vdot); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/vstack.hpp b/pythran/pythonic/include/numpy/vstack.hpp index 38afc53698..9742af5e88 100644 --- a/pythran/pythonic/include/numpy/vstack.hpp +++ b/pythran/pythonic/include/numpy/vstack.hpp @@ -25,13 +25,14 @@ namespace numpy // // the enable if is there to match this behavior template - auto vstack(ArraySequence &&seq) -> typename std::enable_if< - (impl::vstack_helper::value == 1), - decltype(std::declval>().reshape( - std::declval>()))>::type; + auto vstack(ArraySequence &&seq) -> + typename std::enable_if< + (impl::vstack_helper::value == 1), + decltype(std::declval>().reshape( + std::declval>()))>::type; DEFINE_FUNCTOR(pythonic::numpy, vstack); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/where.hpp b/pythran/pythonic/include/numpy/where.hpp index b75fa19621..559c9aca5b 100644 --- a/pythran/pythonic/include/numpy/where.hpp +++ b/pythran/pythonic/include/numpy/where.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_INCLUDE_NUMPY_WHERE_HPP #include "pythonic/include/numpy/asarray.hpp" -#include "pythonic/include/numpy/nonzero.hpp" #include "pythonic/include/numpy/copy.hpp" +#include "pythonic/include/numpy/nonzero.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy #define NUMPY_NARY_EXTRA_METHOD \ template \ - auto operator()(E && expr)->decltype(nonzero{}(std::forward(expr))) \ + auto operator()(E &&expr)->decltype(nonzero{}(std::forward(expr))) \ { \ return nonzero{}(std::forward(expr)); \ } @@ -27,7 +27,7 @@ namespace numpy #define NUMPY_NARY_FUNC_SYM impl::where #define NUMPY_NARY_RESHAPE_MODE reshape_type #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/zeros.hpp b/pythran/pythonic/include/numpy/zeros.hpp index d525edaff6..d716de5d1b 100644 --- a/pythran/pythonic/include/numpy/zeros.hpp +++ b/pythran/pythonic/include/numpy/zeros.hpp @@ -2,16 +2,15 @@ #define PYTHONIC_INCLUDE_NUMPY_ZEROS_HPP #include "pythonic/include/numpy/float64.hpp" -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - typename dtype::type - zeros(std::tuple<> const &shape, dtype d = dtype()); + typename dtype::type zeros(std::tuple<> const &shape, dtype d = dtype()); template types::ndarray> @@ -27,7 +26,7 @@ namespace numpy zeros(std::integral_constant, dtype d = dtype()); DEFINE_FUNCTOR(pythonic::numpy, zeros); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/numpy/zeros_like.hpp b/pythran/pythonic/include/numpy/zeros_like.hpp index 80e063feef..c593ddbad1 100644 --- a/pythran/pythonic/include/numpy/zeros_like.hpp +++ b/pythran/pythonic/include/numpy/zeros_like.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_NUMPY_ZEROSLIKE_HPP #define PYTHONIC_INCLUDE_NUMPY_ZEROSLIKE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/zeros.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy types::dtype_t())); DEFINE_FUNCTOR(pythonic::numpy, zeros_like) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/get_num_threads.hpp b/pythran/pythonic/include/omp/get_num_threads.hpp index 48262f6629..d537b642eb 100644 --- a/pythran/pythonic/include/omp/get_num_threads.hpp +++ b/pythran/pythonic/include/omp/get_num_threads.hpp @@ -13,7 +13,7 @@ namespace omp long get_num_threads(); DEFINE_FUNCTOR(pythonic::omp, get_num_threads); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/get_thread_num.hpp b/pythran/pythonic/include/omp/get_thread_num.hpp index 36829d9b25..3a1eb8c6f4 100644 --- a/pythran/pythonic/include/omp/get_thread_num.hpp +++ b/pythran/pythonic/include/omp/get_thread_num.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OMP_GET_THREAD_NUM_HPP #define PYTHONIC_INCLUDE_OMP_GET_THREAD_NUM_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace omp long get_thread_num(); DEFINE_FUNCTOR(pythonic::omp, get_thread_num); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/get_wtick.hpp b/pythran/pythonic/include/omp/get_wtick.hpp index 5deab26d53..f237f8ab3e 100644 --- a/pythran/pythonic/include/omp/get_wtick.hpp +++ b/pythran/pythonic/include/omp/get_wtick.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OMP_GET_WTICK_HPP #define PYTHONIC_INCLUDE_OMP_GET_WTICK_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace omp long get_wtick(); DEFINE_FUNCTOR(pythonic::omp, get_wtick); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/get_wtime.hpp b/pythran/pythonic/include/omp/get_wtime.hpp index 68760a6cb0..5d89da8b89 100644 --- a/pythran/pythonic/include/omp/get_wtime.hpp +++ b/pythran/pythonic/include/omp/get_wtime.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OMP_GET_WTIME_HPP #define PYTHONIC_INCLUDE_OMP_GET_WTIME_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace omp long get_wtime(); DEFINE_FUNCTOR(pythonic::omp, get_wtime); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/in_parallel.hpp b/pythran/pythonic/include/omp/in_parallel.hpp index 0fc99b376b..d7496c5455 100644 --- a/pythran/pythonic/include/omp/in_parallel.hpp +++ b/pythran/pythonic/include/omp/in_parallel.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OMP_IN_PARALLEL_HPP #define PYTHONIC_INCLUDE_OMP_IN_PARALLEL_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace omp bool in_parallel(); DEFINE_FUNCTOR(pythonic::omp, in_parallel); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/set_nested.hpp b/pythran/pythonic/include/omp/set_nested.hpp index 2760fe13fc..a5aff3cc53 100644 --- a/pythran/pythonic/include/omp/set_nested.hpp +++ b/pythran/pythonic/include/omp/set_nested.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OMP_SET_NESTED_HPP #define PYTHONIC_INCLUDE_OMP_SET_NESTED_HPP -#include #include "pythonic/include/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace omp void set_nested(long val); DEFINE_FUNCTOR(pythonic::omp, set_nested); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/omp/set_num_threads.hpp b/pythran/pythonic/include/omp/set_num_threads.hpp index e31ac8ae96..619fefee97 100644 --- a/pythran/pythonic/include/omp/set_num_threads.hpp +++ b/pythran/pythonic/include/omp/set_num_threads.hpp @@ -13,7 +13,7 @@ namespace omp void set_num_threads(long); DEFINE_FUNCTOR(pythonic::omp, set_num_threads); -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/__abs__.hpp b/pythran/pythonic/include/operator_/__abs__.hpp index add04278d8..7e9b4652fd 100644 --- a/pythran/pythonic/include/operator_/__abs__.hpp +++ b/pythran/pythonic/include/operator_/__abs__.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ABS__HPP #define PYTHONIC_INCLUDE_OPERATOR_ABS__HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/abs.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/__add__.hpp b/pythran/pythonic/include/operator_/__add__.hpp index 1814c94b2d..11e1f97ca6 100644 --- a/pythran/pythonic/include/operator_/__add__.hpp +++ b/pythran/pythonic/include/operator_/__add__.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ADD__HPP #define PYTHONIC_INCLUDE_OPERATOR_ADD__HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/add.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/__truediv__.hpp b/pythran/pythonic/include/operator_/__truediv__.hpp index fdf8d716bf..5a884adfa0 100644 --- a/pythran/pythonic/include/operator_/__truediv__.hpp +++ b/pythran/pythonic/include/operator_/__truediv__.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_TRUEDIV__HPP #define PYTHONIC_INCLUDE_OPERATOR_TRUEDIV__HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/truediv.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/abs.hpp b/pythran/pythonic/include/operator_/abs.hpp index 92eda417cd..e04370d51d 100644 --- a/pythran/pythonic/include/operator_/abs.hpp +++ b/pythran/pythonic/include/operator_/abs.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ABS_HPP #define PYTHONIC_INCLUDE_OPERATOR_ABS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/abs.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/add.hpp b/pythran/pythonic/include/operator_/add.hpp index 4da63a2df9..a3f424457d 100644 --- a/pythran/pythonic/include/operator_/add.hpp +++ b/pythran/pythonic/include/operator_/add.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ADD_HPP #define PYTHONIC_INCLUDE_OPERATOR_ADD_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace operator_ DEFINE_ALL_OPERATOR_OVERLOADS_DECL(add, +) DEFINE_FUNCTOR(pythonic::operator_, add); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/and_.hpp b/pythran/pythonic/include/operator_/and_.hpp index 1c90e41208..430dc280f1 100644 --- a/pythran/pythonic/include/operator_/and_.hpp +++ b/pythran/pythonic/include/operator_/and_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_AND_HPP #define PYTHONIC_INCLUDE_OPERATOR_AND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace operator_ DEFINE_ALL_OPERATOR_OVERLOADS_DECL(and_, &) DEFINE_FUNCTOR(pythonic::operator_, and_); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/concat.hpp b/pythran/pythonic/include/operator_/concat.hpp index b4e5979e69..beba5e98f7 100644 --- a/pythran/pythonic/include/operator_/concat.hpp +++ b/pythran/pythonic/include/operator_/concat.hpp @@ -9,11 +9,11 @@ namespace operator_ { template - auto concat(A &&a, B &&b) - -> decltype(std::forward(a) + std::forward(b)); + auto concat(A &&a, + B &&b) -> decltype(std::forward(a) + std::forward(b)); DEFINE_FUNCTOR(pythonic::operator_, concat); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/contains.hpp b/pythran/pythonic/include/operator_/contains.hpp index cb2b7307d7..ce741d860e 100644 --- a/pythran/pythonic/include/operator_/contains.hpp +++ b/pythran/pythonic/include/operator_/contains.hpp @@ -1,19 +1,19 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_CONTAINS_HPP #define PYTHONIC_INCLUDE_OPERATOR_CONTAINS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/in.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto contains(A &&a, B &&b) - -> decltype(in(std::forward(a), std::forward(b))); + auto contains(A &&a, + B &&b) -> decltype(in(std::forward(a), std::forward(b))); DEFINE_FUNCTOR(pythonic::operator_, contains); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/countOf.hpp b/pythran/pythonic/include/operator_/countOf.hpp index bb941666fe..6e463a5668 100644 --- a/pythran/pythonic/include/operator_/countOf.hpp +++ b/pythran/pythonic/include/operator_/countOf.hpp @@ -12,7 +12,7 @@ namespace operator_ long countOf(A &&a, B &&b); DEFINE_FUNCTOR(pythonic::operator_, countOf); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/delitem.hpp b/pythran/pythonic/include/operator_/delitem.hpp index 56ff597978..9371fae95e 100644 --- a/pythran/pythonic/include/operator_/delitem.hpp +++ b/pythran/pythonic/include/operator_/delitem.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_DELITEM_HPP #define PYTHONIC_INCLUDE_OPERATOR_DELITEM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/None.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace operator_ types::none_type delitem(A &&a, B &&b); DEFINE_FUNCTOR(pythonic::operator_, delitem); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/div.hpp b/pythran/pythonic/include/operator_/div.hpp index 3ac0faccb5..3d8d44f6a4 100644 --- a/pythran/pythonic/include/operator_/div.hpp +++ b/pythran/pythonic/include/operator_/div.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_DIV_HPP #define PYTHONIC_INCLUDE_OPERATOR_DIV_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace operator_ double div(double a, double b); DEFINE_FUNCTOR(pythonic::operator_, div); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/eq.hpp b/pythran/pythonic/include/operator_/eq.hpp index eb9db18ed4..15ecae9c50 100644 --- a/pythran/pythonic/include/operator_/eq.hpp +++ b/pythran/pythonic/include/operator_/eq.hpp @@ -13,7 +13,7 @@ namespace operator_ bool eq(char const *a, char const *b); DEFINE_FUNCTOR(pythonic::operator_, eq); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/floordiv.hpp b/pythran/pythonic/include/operator_/floordiv.hpp index 4f53b9fc26..6da873f404 100644 --- a/pythran/pythonic/include/operator_/floordiv.hpp +++ b/pythran/pythonic/include/operator_/floordiv.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_FLOORDIV_HPP #define PYTHONIC_INCLUDE_OPERATOR_FLOORDIV_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/floor_divide.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/ge.hpp b/pythran/pythonic/include/operator_/ge.hpp index 7b4e07ee64..eb68863292 100644 --- a/pythran/pythonic/include/operator_/ge.hpp +++ b/pythran/pythonic/include/operator_/ge.hpp @@ -13,7 +13,7 @@ namespace operator_ bool ge(char const *, char const *); DEFINE_FUNCTOR(pythonic::operator_, ge); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/getitem.hpp b/pythran/pythonic/include/operator_/getitem.hpp index 380007aa3a..78697dec48 100644 --- a/pythran/pythonic/include/operator_/getitem.hpp +++ b/pythran/pythonic/include/operator_/getitem.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace operator_ { template - auto getitem(A &&a, B &&b) - -> decltype(std::forward(a)[std::forward(b)]); + auto getitem(A &&a, + B &&b) -> decltype(std::forward(a)[std::forward(b)]); DEFINE_FUNCTOR(pythonic::operator_, getitem); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/gt.hpp b/pythran/pythonic/include/operator_/gt.hpp index 805cd62134..371d247e16 100644 --- a/pythran/pythonic/include/operator_/gt.hpp +++ b/pythran/pythonic/include/operator_/gt.hpp @@ -13,7 +13,7 @@ namespace operator_ bool gt(char const *, char const *); DEFINE_FUNCTOR(pythonic::operator_, gt); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/iadd.hpp b/pythran/pythonic/include/operator_/iadd.hpp index 83eaaf3371..e8844df8f3 100644 --- a/pythran/pythonic/include/operator_/iadd.hpp +++ b/pythran/pythonic/include/operator_/iadd.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IADD_HPP #define PYTHONIC_INCLUDE_OPERATOR_IADD_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/types/dict.hpp" #include "pythonic/include/types/list.hpp" #include "pythonic/include/types/set.hpp" -#include "pythonic/include/types/dict.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace operator_ template auto iadd(types::empty_set, types::set const &b) -> decltype(b); -} +} // namespace operator_ PYTHONIC_NS_END #define OPERATOR_NAME iadd #define OPERATOR_SYMBOL + diff --git a/pythran/pythonic/include/operator_/icommon.hpp b/pythran/pythonic/include/operator_/icommon.hpp index 23814a8c10..2d5c6a1745 100644 --- a/pythran/pythonic/include/operator_/icommon.hpp +++ b/pythran/pythonic/include/operator_/icommon.hpp @@ -22,23 +22,25 @@ namespace operator_ { template - auto OPERATOR_NAME(bool, A &&a, B &&b, ...) - -> decltype(std::forward(a) OPERATOR_SYMBOL std::forward(b)); + auto OPERATOR_NAME(bool, A &&a, B &&b, + ...) -> decltype(std::forward(a) + OPERATOR_SYMBOL std::forward(b)); template auto OPERATOR_NAME(bool, A &&a, B &&b, std::nullptr_t) -> decltype(std::forward(a) OPERATOR_ISYMBOL std::forward(b)); template - auto OPERATOR_NAME(A &&a, B &&b) - -> decltype(OPERATOR_NAME(true, std::forward(a), std::forward(b), - nullptr)) + auto OPERATOR_NAME(A &&a, + B &&b) -> decltype(OPERATOR_NAME(true, std::forward(a), + std::forward(b), + nullptr)) { return OPERATOR_NAME(true, std::forward(a), std::forward(b), nullptr); } DEFINE_FUNCTOR(pythonic::operator_, OPERATOR_NAME); -} +} // namespace operator_ PYTHONIC_NS_END #undef OPERATOR_NAME diff --git a/pythran/pythonic/include/operator_/iconcat.hpp b/pythran/pythonic/include/operator_/iconcat.hpp index 96266ca263..3513f6c277 100644 --- a/pythran/pythonic/include/operator_/iconcat.hpp +++ b/pythran/pythonic/include/operator_/iconcat.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ICONCAT_HPP #define PYTHONIC_INCLUDE_OPERATOR_ICONCAT_HPP -#include "pythonic/include/utils/functor.hpp" +#include "pythonic/include/types/dict.hpp" #include "pythonic/include/types/list.hpp" #include "pythonic/include/types/set.hpp" -#include "pythonic/include/types/dict.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -23,7 +23,7 @@ namespace operator_ auto iconcat(types::empty_set a, types::set b) -> decltype(b); DEFINE_FUNCTOR(pythonic::operator_, iconcat); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/ifloordiv.hpp b/pythran/pythonic/include/operator_/ifloordiv.hpp index 721565a647..fc18841ef1 100644 --- a/pythran/pythonic/include/operator_/ifloordiv.hpp +++ b/pythran/pythonic/include/operator_/ifloordiv.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IFLOORDIV_HPP #define PYTHONIC_INCLUDE_OPERATOR_IFLOORDIV_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/mod.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace operator_ auto ifloordiv(A const &a, B &&b) -> decltype((a - mod(a, b)) / b); DEFINE_FUNCTOR(pythonic::operator_, ifloordiv); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/imax.hpp b/pythran/pythonic/include/operator_/imax.hpp index a22a04954b..c57935e245 100644 --- a/pythran/pythonic/include/operator_/imax.hpp +++ b/pythran/pythonic/include/operator_/imax.hpp @@ -1,27 +1,29 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IMAX_HPP #define PYTHONIC_INCLUDE_OPERATOR_IMAX_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/maximum.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto imax(A &&a, B &&b) -> typename std::enable_if< - std::is_const::value || !std::is_assignable::value, - decltype(numpy::functor::maximum{}(std::forward(a), - std::forward(b)))>::type; + auto imax(A &&a, B &&b) -> + typename std::enable_if< + std::is_const::value || !std::is_assignable::value, + decltype(numpy::functor::maximum{}(std::forward(a), + std::forward(b)))>::type; template - auto imax(A &&a, B &&b) -> typename std::enable_if< - !std::is_const::value && std::is_assignable::value, - decltype(a = numpy::functor::maximum{}(std::forward(a), - std::forward(b)))>::type; + auto imax(A &&a, B &&b) -> + typename std::enable_if< + !std::is_const::value && std::is_assignable::value, + decltype(a = numpy::functor::maximum{}(std::forward(a), + std::forward(b)))>::type; DEFINE_FUNCTOR(pythonic::operator_, imax); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/imin.hpp b/pythran/pythonic/include/operator_/imin.hpp index 0fea5836f6..6036ff10db 100644 --- a/pythran/pythonic/include/operator_/imin.hpp +++ b/pythran/pythonic/include/operator_/imin.hpp @@ -1,27 +1,29 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IMIN_HPP #define PYTHONIC_INCLUDE_OPERATOR_IMIN_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/minimum.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto imin(A &&a, B &&b) -> typename std::enable_if< - std::is_const::value || !std::is_assignable::value, - decltype(numpy::functor::minimum{}(std::forward(a), - std::forward(b)))>::type; + auto imin(A &&a, B &&b) -> + typename std::enable_if< + std::is_const::value || !std::is_assignable::value, + decltype(numpy::functor::minimum{}(std::forward(a), + std::forward(b)))>::type; template - auto imin(A &&a, B &&b) -> typename std::enable_if< - !std::is_const::value && std::is_assignable::value, - decltype(a = numpy::functor::minimum{}(std::forward(a), - std::forward(b)))>::type; + auto imin(A &&a, B &&b) -> + typename std::enable_if< + !std::is_const::value && std::is_assignable::value, + decltype(a = numpy::functor::minimum{}(std::forward(a), + std::forward(b)))>::type; DEFINE_FUNCTOR(pythonic::operator_, imin); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/imod.hpp b/pythran/pythonic/include/operator_/imod.hpp index 477d80afbb..e7a828a8b3 100644 --- a/pythran/pythonic/include/operator_/imod.hpp +++ b/pythran/pythonic/include/operator_/imod.hpp @@ -14,7 +14,7 @@ namespace operator_ A imod(A const &a, B &&b); DEFINE_FUNCTOR(pythonic::operator_, imod); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/indexOf.hpp b/pythran/pythonic/include/operator_/indexOf.hpp index b66ff2b5bd..8a2d306e66 100644 --- a/pythran/pythonic/include/operator_/indexOf.hpp +++ b/pythran/pythonic/include/operator_/indexOf.hpp @@ -12,7 +12,7 @@ namespace operator_ long indexOf(A &&a, B &&b); DEFINE_FUNCTOR(pythonic::operator_, indexOf); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/inv.hpp b/pythran/pythonic/include/operator_/inv.hpp index 1f96938880..03c033d002 100644 --- a/pythran/pythonic/include/operator_/inv.hpp +++ b/pythran/pythonic/include/operator_/inv.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_INV_HPP #define PYTHONIC_INCLUDE_OPERATOR_INV_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/invert.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/include/operator_/invert.hpp b/pythran/pythonic/include/operator_/invert.hpp index e647e6f549..cdb0c2cb69 100644 --- a/pythran/pythonic/include/operator_/invert.hpp +++ b/pythran/pythonic/include/operator_/invert.hpp @@ -12,7 +12,7 @@ namespace operator_ auto invert(A &&a) -> decltype(~std::forward(a)); DEFINE_FUNCTOR(pythonic::operator_, invert); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/ipow.hpp b/pythran/pythonic/include/operator_/ipow.hpp index e6ab178fb3..baa721745a 100644 --- a/pythran/pythonic/include/operator_/ipow.hpp +++ b/pythran/pythonic/include/operator_/ipow.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IPOW_HPP #define PYTHONIC_INCLUDE_OPERATOR_IPOW_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/pow.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace operator_ A &ipow(A &a, B &&b); DEFINE_FUNCTOR(pythonic::operator_, ipow); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/is_.hpp b/pythran/pythonic/include/operator_/is_.hpp index 455ad489e1..2426ff1db0 100644 --- a/pythran/pythonic/include/operator_/is_.hpp +++ b/pythran/pythonic/include/operator_/is_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_IS_HPP #define PYTHONIC_INCLUDE_OPERATOR_IS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/id.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace operator_ builtins::id(std::forward(b))); DEFINE_FUNCTOR(pythonic::operator_, is_); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/is_not.hpp b/pythran/pythonic/include/operator_/is_not.hpp index f1fe2132ac..46b51a1d83 100644 --- a/pythran/pythonic/include/operator_/is_not.hpp +++ b/pythran/pythonic/include/operator_/is_not.hpp @@ -13,7 +13,7 @@ namespace operator_ builtins::id(std::forward(b))); DEFINE_FUNCTOR(pythonic::operator_, is_not); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/itemgetter.hpp b/pythran/pythonic/include/operator_/itemgetter.hpp index 4ae3b91fa2..7fd8943fcf 100644 --- a/pythran/pythonic/include/operator_/itemgetter.hpp +++ b/pythran/pythonic/include/operator_/itemgetter.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ITEMGETTER_HPP #define PYTHONIC_INCLUDE_OPERATOR_ITEMGETTER_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/int_.hpp" PYTHONIC_NS_BEGIN @@ -44,7 +44,7 @@ namespace operator_ itemgetter(long const &item1, long const &item2, L... items); DEFINE_FUNCTOR(pythonic::operator_, itemgetter); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/itruediv.hpp b/pythran/pythonic/include/operator_/itruediv.hpp index c903aca21d..75b058e449 100644 --- a/pythran/pythonic/include/operator_/itruediv.hpp +++ b/pythran/pythonic/include/operator_/itruediv.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_ITRUEDIV_HPP #define PYTHONIC_INCLUDE_OPERATOR_ITRUEDIV_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/truediv.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,17 +12,19 @@ namespace operator_ auto itruediv(A const &a, B &&b) -> decltype(truediv(a, std::forward(b))); template - auto itruediv(A &a, B &&b) -> typename std::enable_if< - std::is_same(b)))>::value, - A &>::type; + auto itruediv(A &a, B &&b) -> + typename std::enable_if< + std::is_same(b)))>::value, + A &>::type; template - auto itruediv(A &a, B &&b) -> typename std::enable_if< - !std::is_same(b)))>::value, - decltype(truediv(a, std::forward(b)))>::type; + auto itruediv(A &a, B &&b) -> + typename std::enable_if< + !std::is_same(b)))>::value, + decltype(truediv(a, std::forward(b)))>::type; DEFINE_FUNCTOR(pythonic::operator_, itruediv); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/le.hpp b/pythran/pythonic/include/operator_/le.hpp index 3ea728cb92..f8456b3268 100644 --- a/pythran/pythonic/include/operator_/le.hpp +++ b/pythran/pythonic/include/operator_/le.hpp @@ -12,7 +12,7 @@ namespace operator_ bool le(char const *self, char const *other); DEFINE_FUNCTOR(pythonic::operator_, le); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/lshift.hpp b/pythran/pythonic/include/operator_/lshift.hpp index 33b8936ad6..0de91c7292 100644 --- a/pythran/pythonic/include/operator_/lshift.hpp +++ b/pythran/pythonic/include/operator_/lshift.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_LSHIFT_HPP #define PYTHONIC_INCLUDE_OPERATOR_LSHIFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -10,13 +10,13 @@ namespace operator_ { template - auto lshift(A &&a, B &&b) - -> decltype(std::forward(a) << std::forward(b)); + auto lshift(A &&a, B &&b) -> decltype(std::forward(a) + << std::forward(b)); - DEFINE_ALL_OPERATOR_OVERLOADS_DECL(lshift, << ) + DEFINE_ALL_OPERATOR_OVERLOADS_DECL(lshift, <<) DEFINE_FUNCTOR(pythonic::operator_, lshift); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/lt.hpp b/pythran/pythonic/include/operator_/lt.hpp index 791301650f..b670073c9d 100644 --- a/pythran/pythonic/include/operator_/lt.hpp +++ b/pythran/pythonic/include/operator_/lt.hpp @@ -13,7 +13,7 @@ namespace operator_ bool lt(char const *self, char const *other); DEFINE_FUNCTOR(pythonic::operator_, lt); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/matmul.hpp b/pythran/pythonic/include/operator_/matmul.hpp index 6800c34192..e0733b7d2b 100644 --- a/pythran/pythonic/include/operator_/matmul.hpp +++ b/pythran/pythonic/include/operator_/matmul.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_MATMUL_HPP #define PYTHONIC_INCLUDE_OPERATOR_MATMUL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/numpy/dot.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -10,12 +10,12 @@ namespace operator_ { template - auto matmul(A &&a, B &&b) - -> decltype(numpy::functor::dot{}(std::forward(a), - std::forward(b))); + auto matmul(A &&a, + B &&b) -> decltype(numpy::functor::dot{}(std::forward(a), + std::forward(b))); DEFINE_FUNCTOR(pythonic::operator_, matmul); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/mod.hpp b/pythran/pythonic/include/operator_/mod.hpp index 3b18e51fe7..3fecdec3d1 100644 --- a/pythran/pythonic/include/operator_/mod.hpp +++ b/pythran/pythonic/include/operator_/mod.hpp @@ -9,10 +9,11 @@ namespace operator_ { template - auto mod(A &&a, B &&b) -> typename std::enable_if< - std::is_fundamental::type>::value && - std::is_fundamental::type>::value, - decltype(std::forward(a) % std::forward(b))>::type; + auto mod(A &&a, B &&b) -> + typename std::enable_if< + std::is_fundamental::type>::value && + std::is_fundamental::type>::value, + decltype(std::forward(a) % std::forward(b))>::type; inline double mod(double a, long b); @@ -26,7 +27,7 @@ namespace operator_ decltype(std::forward(a) % std::forward(b))>::type; DEFINE_FUNCTOR(pythonic::operator_, mod); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/mul.hpp b/pythran/pythonic/include/operator_/mul.hpp index 2fbcfeed1c..e5f30d1e66 100644 --- a/pythran/pythonic/include/operator_/mul.hpp +++ b/pythran/pythonic/include/operator_/mul.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_MUL_HPP #define PYTHONIC_INCLUDE_OPERATOR_MUL_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace operator_ DEFINE_ALL_OPERATOR_OVERLOADS_DECL(mul, *) DEFINE_FUNCTOR(pythonic::operator_, mul); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/ne.hpp b/pythran/pythonic/include/operator_/ne.hpp index 650db40338..97b9172232 100644 --- a/pythran/pythonic/include/operator_/ne.hpp +++ b/pythran/pythonic/include/operator_/ne.hpp @@ -14,7 +14,7 @@ namespace operator_ bool ne(char const *a, char const *b); DEFINE_FUNCTOR(pythonic::operator_, ne); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/neg.hpp b/pythran/pythonic/include/operator_/neg.hpp index 584e77d8d8..0b30fbfef1 100644 --- a/pythran/pythonic/include/operator_/neg.hpp +++ b/pythran/pythonic/include/operator_/neg.hpp @@ -12,7 +12,7 @@ namespace operator_ auto neg(A &&a) -> decltype(-std::forward(a)); DEFINE_FUNCTOR(pythonic::operator_, neg); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/not_.hpp b/pythran/pythonic/include/operator_/not_.hpp index b756eba2e7..0c105ca2ed 100644 --- a/pythran/pythonic/include/operator_/not_.hpp +++ b/pythran/pythonic/include/operator_/not_.hpp @@ -14,7 +14,7 @@ namespace operator_ bool not_(std::complex const &a); DEFINE_FUNCTOR(pythonic::operator_, not_); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/or_.hpp b/pythran/pythonic/include/operator_/or_.hpp index 20aaddf55c..7504264275 100644 --- a/pythran/pythonic/include/operator_/or_.hpp +++ b/pythran/pythonic/include/operator_/or_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_OR_HPP #define PYTHONIC_INCLUDE_OPERATOR_OR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,10 +12,10 @@ namespace operator_ template auto or_(A &&a, B &&b) -> decltype(std::forward(a) | std::forward(b)); - DEFINE_ALL_OPERATOR_OVERLOADS_DECL(or_, | ) + DEFINE_ALL_OPERATOR_OVERLOADS_DECL(or_, |) DEFINE_FUNCTOR(pythonic::operator_, or_); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/pos.hpp b/pythran/pythonic/include/operator_/pos.hpp index e3df7fb72b..744b67fd37 100644 --- a/pythran/pythonic/include/operator_/pos.hpp +++ b/pythran/pythonic/include/operator_/pos.hpp @@ -12,7 +12,7 @@ namespace operator_ A pos(A const &a); DEFINE_FUNCTOR(pythonic::operator_, pos); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/rshift.hpp b/pythran/pythonic/include/operator_/rshift.hpp index 0d662582b1..cc64a33a52 100644 --- a/pythran/pythonic/include/operator_/rshift.hpp +++ b/pythran/pythonic/include/operator_/rshift.hpp @@ -1,21 +1,21 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_RSHIFT_HPP #define PYTHONIC_INCLUDE_OPERATOR_RSHIFT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto rshift(A &&a, B &&b) - -> decltype(std::forward(a) >> std::forward(b)); + auto rshift(A &&a, + B &&b) -> decltype(std::forward(a) >> std::forward(b)); - DEFINE_ALL_OPERATOR_OVERLOADS_DECL(rshift, >> ) + DEFINE_ALL_OPERATOR_OVERLOADS_DECL(rshift, >>) DEFINE_FUNCTOR(pythonic::operator_, rshift); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/sub.hpp b/pythran/pythonic/include/operator_/sub.hpp index a5c9e62767..f0c8ac96f5 100644 --- a/pythran/pythonic/include/operator_/sub.hpp +++ b/pythran/pythonic/include/operator_/sub.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_SUB_HPP #define PYTHONIC_INCLUDE_OPERATOR_SUB_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace operator_ DEFINE_ALL_OPERATOR_OVERLOADS_DECL(sub, -) DEFINE_FUNCTOR(pythonic::operator_, sub); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/truediv.hpp b/pythran/pythonic/include/operator_/truediv.hpp index b48350018e..b6df765b47 100644 --- a/pythran/pythonic/include/operator_/truediv.hpp +++ b/pythran/pythonic/include/operator_/truediv.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN namespace operator_ { template - auto truediv(A &&a, B &&b) - -> decltype(std::forward(a) / (double)std::forward(b)); + auto truediv(A &&a, B &&b) -> decltype(std::forward(a) / + (double)std::forward(b)); DEFINE_FUNCTOR(pythonic::operator_, truediv); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/truth.hpp b/pythran/pythonic/include/operator_/truth.hpp index dd7dd80fff..73a8473cd3 100644 --- a/pythran/pythonic/include/operator_/truth.hpp +++ b/pythran/pythonic/include/operator_/truth.hpp @@ -10,7 +10,7 @@ namespace operator_ bool truth(bool const &a); DEFINE_FUNCTOR(pythonic::operator_, truth); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/operator_/xor_.hpp b/pythran/pythonic/include/operator_/xor_.hpp index aad75e9821..8ff75bacde 100644 --- a/pythran/pythonic/include/operator_/xor_.hpp +++ b/pythran/pythonic/include/operator_/xor_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_OPERATOR_XOR_HPP #define PYTHONIC_INCLUDE_OPERATOR_XOR_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/operator_/overloads.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace operator_ DEFINE_ALL_OPERATOR_OVERLOADS_DECL(xor_, ^) DEFINE_FUNCTOR(pythonic::operator_, xor_); -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/os/path/join.hpp b/pythran/pythonic/include/os/path/join.hpp index 74c68b5844..5c2300118f 100644 --- a/pythran/pythonic/include/os/path/join.hpp +++ b/pythran/pythonic/include/os/path/join.hpp @@ -13,11 +13,11 @@ namespace os T join(T &&head); template - types::str join(T &&head, Types &&... tail); + types::str join(T &&head, Types &&...tail); DEFINE_FUNCTOR(pythonic::os::path, join); - } -} + } // namespace path +} // namespace os PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/choice.hpp b/pythran/pythonic/include/random/choice.hpp index 10c93749a5..a69fba9096 100644 --- a/pythran/pythonic/include/random/choice.hpp +++ b/pythran/pythonic/include/random/choice.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_CHOICE_HPP #define PYTHONIC_INCLUDE_RANDOM_CHOICE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace random typename Seq::value_type choice(Seq const &seq); DEFINE_FUNCTOR(pythonic::random, choice); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/expovariate.hpp b/pythran/pythonic/include/random/expovariate.hpp index 28dbb3d499..1d7e1a66d5 100644 --- a/pythran/pythonic/include/random/expovariate.hpp +++ b/pythran/pythonic/include/random/expovariate.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_EXPOVARIATE_HPP #define PYTHONIC_INCLUDE_RANDOM_EXPOVARIATE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace random double expovariate(double l); DEFINE_FUNCTOR(pythonic::random, expovariate); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/gauss.hpp b/pythran/pythonic/include/random/gauss.hpp index 440a55fdb1..d06ebd9eaf 100644 --- a/pythran/pythonic/include/random/gauss.hpp +++ b/pythran/pythonic/include/random/gauss.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_GAUSS_HPP #define PYTHONIC_INCLUDE_RANDOM_GAUSS_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace random double gauss(double mu, double sigma); DEFINE_FUNCTOR(pythonic::random, gauss); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/randint.hpp b/pythran/pythonic/include/random/randint.hpp index a4dcfbbd2d..0c74182242 100644 --- a/pythran/pythonic/include/random/randint.hpp +++ b/pythran/pythonic/include/random/randint.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_RANDINT_HPP #define PYTHONIC_INCLUDE_RANDOM_RANDINT_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/randrange.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace random long randint(long a, long b); DEFINE_FUNCTOR(pythonic::random, randint); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/random.hpp b/pythran/pythonic/include/random/random.hpp index 84ed72880a..d2dec8be45 100644 --- a/pythran/pythonic/include/random/random.hpp +++ b/pythran/pythonic/include/random/random.hpp @@ -14,7 +14,7 @@ namespace random double random(); DEFINE_FUNCTOR(pythonic::random, random); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/randrange.hpp b/pythran/pythonic/include/random/randrange.hpp index 08b5899189..84925cee4a 100644 --- a/pythran/pythonic/include/random/randrange.hpp +++ b/pythran/pythonic/include/random/randrange.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_RANDRANGE_HPP #define PYTHONIC_INCLUDE_RANDOM_RANDRANGE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" #include @@ -15,7 +15,7 @@ namespace random long randrange(long start, long stop, long step); DEFINE_FUNCTOR(pythonic::random, randrange) -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/sample.hpp b/pythran/pythonic/include/random/sample.hpp index 230e57b7d7..df2cfc2382 100644 --- a/pythran/pythonic/include/random/sample.hpp +++ b/pythran/pythonic/include/random/sample.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_SAMPLE_HPP #define PYTHONIC_INCLUDE_RANDOM_SAMPLE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/list.hpp" @@ -17,7 +17,7 @@ namespace random sample(Iterable &&s, size_t k); DEFINE_FUNCTOR(pythonic::random, sample); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/seed.hpp b/pythran/pythonic/include/random/seed.hpp index cc41715f7a..455eb49d5a 100644 --- a/pythran/pythonic/include/random/seed.hpp +++ b/pythran/pythonic/include/random/seed.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_SEED_HPP #define PYTHONIC_INCLUDE_RANDOM_SEED_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/builtins/None.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace random types::none_type seed(); DEFINE_FUNCTOR(pythonic::random, seed); -} +} // namespace random PYTHONIC_NS_END diff --git a/pythran/pythonic/include/random/shuffle.hpp b/pythran/pythonic/include/random/shuffle.hpp index 797256d4bb..d5db47aa42 100644 --- a/pythran/pythonic/include/random/shuffle.hpp +++ b/pythran/pythonic/include/random/shuffle.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_SHUFFLE_HPP #define PYTHONIC_INCLUDE_RANDOM_SHUFFLE_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace random types::none_type shuffle(T &seq, function &&randf); DEFINE_FUNCTOR(pythonic::random, shuffle) -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/random/uniform.hpp b/pythran/pythonic/include/random/uniform.hpp index 2559716bc7..f2bada0491 100644 --- a/pythran/pythonic/include/random/uniform.hpp +++ b/pythran/pythonic/include/random/uniform.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_RANDOM_UNIFORM_HPP #define PYTHONIC_INCLUDE_RANDOM_UNIFORM_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/random/random.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace random double uniform(double a, double b); DEFINE_FUNCTOR(pythonic::random, uniform); -} +} // namespace random PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/binom.hpp b/pythran/pythonic/include/scipy/special/binom.hpp index df2982d605..8cf1773d40 100644 --- a/pythran/pythonic/include/scipy/special/binom.hpp +++ b/pythran/pythonic/include/scipy/special/binom.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME binom #define NUMPY_NARY_FUNC_SYM details::binom #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/gamma.hpp b/pythran/pythonic/include/scipy/special/gamma.hpp index 1cf8ae271e..6567924195 100644 --- a/pythran/pythonic/include/scipy/special/gamma.hpp +++ b/pythran/pythonic/include/scipy/special/gamma.hpp @@ -17,8 +17,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME gamma #define NUMPY_NARY_FUNC_SYM xsimd::tgamma #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/gammaincinv.hpp b/pythran/pythonic/include/scipy/special/gammaincinv.hpp index 8982931245..666ba823ba 100644 --- a/pythran/pythonic/include/scipy/special/gammaincinv.hpp +++ b/pythran/pythonic/include/scipy/special/gammaincinv.hpp @@ -22,8 +22,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME gammaincinv #define NUMPY_NARY_FUNC_SYM details::gammaincinv #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/gammaln.hpp b/pythran/pythonic/include/scipy/special/gammaln.hpp index 7d96d3f9e9..c1048dfbb1 100644 --- a/pythran/pythonic/include/scipy/special/gammaln.hpp +++ b/pythran/pythonic/include/scipy/special/gammaln.hpp @@ -17,8 +17,8 @@ namespace scipy #define NUMPY_NARY_FUNC_SYM xsimd::lgamma #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/hankel1.hpp b/pythran/pythonic/include/scipy/special/hankel1.hpp index 70382e8344..e204d98563 100644 --- a/pythran/pythonic/include/scipy/special/hankel1.hpp +++ b/pythran/pythonic/include/scipy/special/hankel1.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_SCIPY_SPECIAL_HANKEL1_HPP #define PYTHONIC_INCLUDE_SCIPY_SPECIAL_HANKEL1_HPP -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" @@ -22,8 +22,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME hankel1 #define NUMPY_NARY_FUNC_SYM details::hankel1 #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/hankel2.hpp b/pythran/pythonic/include/scipy/special/hankel2.hpp index b3b6f26cf9..d6c126abd2 100644 --- a/pythran/pythonic/include/scipy/special/hankel2.hpp +++ b/pythran/pythonic/include/scipy/special/hankel2.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_SCIPY_SPECIAL_HANKEL2_HPP #define PYTHONIC_INCLUDE_SCIPY_SPECIAL_HANKEL2_HPP -#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/types/complex.hpp" +#include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/utils/numpy_traits.hpp" @@ -22,8 +22,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME hankel2 #define NUMPY_NARY_FUNC_SYM details::hankel2 #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/i0.hpp b/pythran/pythonic/include/scipy/special/i0.hpp index a42dee0928..fd7d18d33a 100644 --- a/pythran/pythonic/include/scipy/special/i0.hpp +++ b/pythran/pythonic/include/scipy/special/i0.hpp @@ -61,13 +61,13 @@ namespace scipy template double i0(T x); - } + } // namespace details #define NUMPY_NARY_FUNC_NAME i0 #define NUMPY_NARY_FUNC_SYM details::i0 #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/i0e.hpp b/pythran/pythonic/include/scipy/special/i0e.hpp index dbb47435ef..1ec5260c12 100644 --- a/pythran/pythonic/include/scipy/special/i0e.hpp +++ b/pythran/pythonic/include/scipy/special/i0e.hpp @@ -23,8 +23,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME i0e #define NUMPY_NARY_FUNC_SYM details::i0e #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/iv.hpp b/pythran/pythonic/include/scipy/special/iv.hpp index 0c4b0f846c..1ef41ad3e4 100644 --- a/pythran/pythonic/include/scipy/special/iv.hpp +++ b/pythran/pythonic/include/scipy/special/iv.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME iv #define NUMPY_NARY_FUNC_SYM details::iv #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/ivp.hpp b/pythran/pythonic/include/scipy/special/ivp.hpp index f9f03e6de5..53e96c2d84 100644 --- a/pythran/pythonic/include/scipy/special/ivp.hpp +++ b/pythran/pythonic/include/scipy/special/ivp.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME ivp #define NUMPY_NARY_FUNC_SYM details::ivp #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/jv.hpp b/pythran/pythonic/include/scipy/special/jv.hpp index 97440d85eb..d72502feec 100644 --- a/pythran/pythonic/include/scipy/special/jv.hpp +++ b/pythran/pythonic/include/scipy/special/jv.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME jv #define NUMPY_NARY_FUNC_SYM details::jv #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/jvp.hpp b/pythran/pythonic/include/scipy/special/jvp.hpp index 2eea0b4ebf..aacbb96842 100644 --- a/pythran/pythonic/include/scipy/special/jvp.hpp +++ b/pythran/pythonic/include/scipy/special/jvp.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME jvp #define NUMPY_NARY_FUNC_SYM details::jvp #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/kv.hpp b/pythran/pythonic/include/scipy/special/kv.hpp index b8b2bff86c..7a4f0b3283 100644 --- a/pythran/pythonic/include/scipy/special/kv.hpp +++ b/pythran/pythonic/include/scipy/special/kv.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME kv #define NUMPY_NARY_FUNC_SYM details::kv #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/kvp.hpp b/pythran/pythonic/include/scipy/special/kvp.hpp index 3727176292..a5bc58c9fa 100644 --- a/pythran/pythonic/include/scipy/special/kvp.hpp +++ b/pythran/pythonic/include/scipy/special/kvp.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME kvp #define NUMPY_NARY_FUNC_SYM details::kvp #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/ndtr.hpp b/pythran/pythonic/include/scipy/special/ndtr.hpp index e0c3d4ca41..1f8a0b7e4c 100644 --- a/pythran/pythonic/include/scipy/special/ndtr.hpp +++ b/pythran/pythonic/include/scipy/special/ndtr.hpp @@ -22,8 +22,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME ndtr #define NUMPY_NARY_FUNC_SYM details::ndtr #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/ndtri.hpp b/pythran/pythonic/include/scipy/special/ndtri.hpp index 17e70609ec..44915c7400 100644 --- a/pythran/pythonic/include/scipy/special/ndtri.hpp +++ b/pythran/pythonic/include/scipy/special/ndtri.hpp @@ -22,8 +22,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME ndtri #define NUMPY_NARY_FUNC_SYM details::ndtri #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/spherical_jn.hpp b/pythran/pythonic/include/scipy/special/spherical_jn.hpp index eba7a55b08..8e2e8a14c7 100644 --- a/pythran/pythonic/include/scipy/special/spherical_jn.hpp +++ b/pythran/pythonic/include/scipy/special/spherical_jn.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME spherical_jn #define NUMPY_NARY_FUNC_SYM details::spherical_jn #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/spherical_yn.hpp b/pythran/pythonic/include/scipy/special/spherical_yn.hpp index 211a8e1d2c..6cb9d0fe28 100644 --- a/pythran/pythonic/include/scipy/special/spherical_yn.hpp +++ b/pythran/pythonic/include/scipy/special/spherical_yn.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME spherical_yn #define NUMPY_NARY_FUNC_SYM details::spherical_yn #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/yv.hpp b/pythran/pythonic/include/scipy/special/yv.hpp index c8936a8e1e..a4f40ebb6c 100644 --- a/pythran/pythonic/include/scipy/special/yv.hpp +++ b/pythran/pythonic/include/scipy/special/yv.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME yv #define NUMPY_NARY_FUNC_SYM details::yv #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/scipy/special/yvp.hpp b/pythran/pythonic/include/scipy/special/yvp.hpp index 53aba998de..b39ff9086e 100644 --- a/pythran/pythonic/include/scipy/special/yvp.hpp +++ b/pythran/pythonic/include/scipy/special/yvp.hpp @@ -21,8 +21,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME yvp #define NUMPY_NARY_FUNC_SYM details::yvp #include "pythonic/include/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/string/find.hpp b/pythran/pythonic/include/string/find.hpp index 9e26442ff5..3486e832cf 100644 --- a/pythran/pythonic/include/string/find.hpp +++ b/pythran/pythonic/include/string/find.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_STRING_FIND_HPP #define PYTHONIC_INCLUDE_STRING_FIND_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace string long find(types::str const &s, T &&val); DEFINE_FUNCTOR(pythonic::string, find); -} +} // namespace string PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/time/sleep.hpp b/pythran/pythonic/include/time/sleep.hpp index 9634aa2979..12056ff8d3 100644 --- a/pythran/pythonic/include/time/sleep.hpp +++ b/pythran/pythonic/include/time/sleep.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_TIME_SLEEP_HPP #define PYTHONIC_INCLUDE_TIME_SLEEP_HPP -#include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -11,7 +11,7 @@ namespace time types::none_type sleep(double const value); DEFINE_FUNCTOR(pythonic::time, sleep) -} +} // namespace time PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/time/time.hpp b/pythran/pythonic/include/time/time.hpp index 6ee19ae75a..d8481c09c1 100644 --- a/pythran/pythonic/include/time/time.hpp +++ b/pythran/pythonic/include/time/time.hpp @@ -11,7 +11,7 @@ namespace time double time(); DEFINE_FUNCTOR(pythonic::time, time) -} +} // namespace time PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/array.hpp b/pythran/pythonic/include/types/array.hpp index 3264800a89..0f29817096 100644 --- a/pythran/pythonic/include/types/array.hpp +++ b/pythran/pythonic/include/types/array.hpp @@ -8,7 +8,7 @@ PYTHONIC_NS_BEGIN namespace types { template - using dataarray = list; + using array = list; } // namespace types diff --git a/pythran/pythonic/include/types/attr.hpp b/pythran/pythonic/include/types/attr.hpp index 41d483d0cf..6b73e92410 100644 --- a/pythran/pythonic/include/types/attr.hpp +++ b/pythran/pythonic/include/types/attr.hpp @@ -61,8 +61,8 @@ namespace types struct STEP { }; /* */ - } -} + } // namespace attr +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/cfun.hpp b/pythran/pythonic/include/types/cfun.hpp index 2dc6d48ed4..6c88f2dd5c 100644 --- a/pythran/pythonic/include/types/cfun.hpp +++ b/pythran/pythonic/include/types/cfun.hpp @@ -20,7 +20,7 @@ namespace types ReturnType operator()(ArgsType... args) const; }; -} +} // namespace types PYTHONIC_NS_END #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/include/types/combined.hpp b/pythran/pythonic/include/types/combined.hpp index cc5e5973f7..6f531e9fb9 100644 --- a/pythran/pythonic/include/types/combined.hpp +++ b/pythran/pythonic/include/types/combined.hpp @@ -13,7 +13,7 @@ namespace types PYTHONIC_NS_END /* type inference stuff -*/ + */ template struct __combined; @@ -33,12 +33,12 @@ struct __combined { // callable -> functor template static pythonic::types::variant_functor - get(std::integral_constant); + get(std::integral_constant); // operator+ exists -> deduce type template - static decltype(std::declval() + std::declval()) - get(std::integral_constant); + static decltype(std::declval() + + std::declval()) get(std::integral_constant); // operator+ does not exists -> pick first one, better than error // note that this is needed because broadcasting is too complex to be modeled @@ -53,9 +53,10 @@ struct __combined { using type = typename std::conditional< std::is_same::value, T0, - decltype(get(std::integral_constant< - bool, pythonic::types::is_callable::value && - pythonic::types::is_callable::value>()))>::type; + decltype(get(std::integral_constant < bool, + pythonic::types::is_callable::value + &&pythonic::types::is_callable::value > + ()))>::type; }; template diff --git a/pythran/pythonic/include/types/complex.hpp b/pythran/pythonic/include/types/complex.hpp index fbb4209c1a..19ae86680a 100644 --- a/pythran/pythonic/include/types/complex.hpp +++ b/pythran/pythonic/include/types/complex.hpp @@ -4,14 +4,12 @@ #include #if defined(_OPENMP) -#pragma omp declare reduction(+ : std::complex < float > : omp_out += omp_in) -#pragma omp declare reduction(* : std::complex < float > : omp_out *= omp_in) -#pragma omp declare reduction(+ : std::complex < double > : omp_out += omp_in) -#pragma omp declare reduction(* : std::complex < double > : omp_out *= omp_in) -#pragma omp declare reduction(+ : std::complex < long double > : omp_out += \ - omp_in) -#pragma omp declare reduction(* : std::complex < long double > : omp_out *= \ - omp_in) +#pragma omp declare reduction(+ : std::complex : omp_out += omp_in) +#pragma omp declare reduction(* : std::complex : omp_out *= omp_in) +#pragma omp declare reduction(+ : std::complex : omp_out += omp_in) +#pragma omp declare reduction(* : std::complex : omp_out *= omp_in) +#pragma omp declare reduction(+ : std::complex : omp_out += omp_in) +#pragma omp declare reduction(* : std::complex : omp_out *= omp_in) #endif PYTHONIC_NS_BEGIN @@ -22,8 +20,8 @@ namespace numpy struct complex64; struct complex128; struct complex256; - } -} + } // namespace functor +} // namespace numpy PYTHONIC_NS_END @@ -84,7 +82,7 @@ namespace std struct hash> { size_t operator()(std::complex const &x) const; }; -} +} // namespace std PYTHONIC_NS_BEGIN namespace builtins @@ -99,7 +97,7 @@ namespace builtins std::complex const &self); numpy::functor::complex256 getattr(types::attr::DTYPE, std::complex const &self); -} +} // namespace builtins PYTHONIC_NS_END /* for type inference { */ @@ -127,19 +125,15 @@ struct __combined, std::complex> { ->std::complex::type> \ { \ using ctype = std::complex::type>; \ - return ctype \ - { \ - lhs \ - } \ - op ctype{rhs}; \ + return ctype{lhs} op ctype{rhs}; \ } STD_COMPLEX_IMPLICT_OPERATOR_CAST(+) STD_COMPLEX_IMPLICT_OPERATOR_CAST(-) STD_COMPLEX_IMPLICT_OPERATOR_CAST(*) -STD_COMPLEX_IMPLICT_OPERATOR_CAST(/ ) -STD_COMPLEX_IMPLICT_OPERATOR_CAST(== ) -STD_COMPLEX_IMPLICT_OPERATOR_CAST(!= ) +STD_COMPLEX_IMPLICT_OPERATOR_CAST(/) +STD_COMPLEX_IMPLICT_OPERATOR_CAST(==) +STD_COMPLEX_IMPLICT_OPERATOR_CAST(!=) #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/include/types/dynamic_tuple.hpp b/pythran/pythonic/include/types/dynamic_tuple.hpp index 389edbfc1a..0db63dcff6 100644 --- a/pythran/pythonic/include/types/dynamic_tuple.hpp +++ b/pythran/pythonic/include/types/dynamic_tuple.hpp @@ -173,8 +173,8 @@ namespace types using shape_t = typename shape_builder::type; template - auto shape() const - -> decltype(details::extract_shape(*this, utils::int_{})) + auto shape() const -> decltype(details::extract_shape(*this, + utils::int_{})) { return details::extract_shape(*this, utils::int_{}); } diff --git a/pythran/pythonic/include/types/empty_iterator.hpp b/pythran/pythonic/include/types/empty_iterator.hpp index 2d58573af0..50ddda302a 100644 --- a/pythran/pythonic/include/types/empty_iterator.hpp +++ b/pythran/pythonic/include/types/empty_iterator.hpp @@ -20,7 +20,7 @@ namespace types double operator*() const; void operator->() const; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/exceptions.hpp b/pythran/pythonic/include/types/exceptions.hpp index 33b5fac887..3cdb832ece 100644 --- a/pythran/pythonic/include/types/exceptions.hpp +++ b/pythran/pythonic/include/types/exceptions.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_INCLUDE_TYPES_EXCEPTIONS_HPP #define PYTHONIC_INCLUDE_TYPES_EXCEPTIONS_HPP -#include "pythonic/include/types/str.hpp" -#include "pythonic/include/types/dynamic_tuple.hpp" -#include "pythonic/include/types/attr.hpp" #include "pythonic/include/builtins/str.hpp" +#include "pythonic/include/types/attr.hpp" +#include "pythonic/include/types/dynamic_tuple.hpp" +#include "pythonic/include/types/str.hpp" #include @@ -18,7 +18,7 @@ namespace types public: BaseException(const BaseException &e) = default; template - BaseException(Types const &... types); + BaseException(Types const &...types); virtual ~BaseException() noexcept = default; dynamic_tuple args; }; @@ -31,8 +31,7 @@ namespace types name() = default; \ name(const name &e) = default; \ template \ - name(Types const &... types) \ - : parent(types...) \ + name(Types const &...types) : parent(types...) \ { \ } \ virtual ~name() noexcept = default; \ @@ -85,13 +84,13 @@ namespace types CLASS_EXCEPTION_DECL(IndentationError, SyntaxError); CLASS_EXCEPTION_DECL(TabError, IndentationError); CLASS_EXCEPTION_DECL(UnicodeError, ValueError); -} +} // namespace types PYTHONIC_NS_END #include "pythonic/include/utils/functor.hpp" #define PYTHONIC_EXCEPTION_DECL(name) \ template \ - types::name name(Types const &... args); \ + types::name name(Types const &...args); \ \ DEFINE_FUNCTOR(pythonic::builtins, name); @@ -185,7 +184,7 @@ namespace types * */ std::ostream &operator<<(std::ostream &o, EnvironmentError const &e); -} +} // namespace types PYTHONIC_NS_END /* } */ diff --git a/pythran/pythonic/include/types/file.hpp b/pythran/pythonic/include/types/file.hpp index 8781adb250..90c6050be6 100644 --- a/pythran/pythonic/include/types/file.hpp +++ b/pythran/pythonic/include/types/file.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_INCLUDE_TYPES_FILE_HPP #define PYTHONIC_INCLUDE_TYPES_FILE_HPP -#include "pythonic/include/types/assignable.hpp" -#include "pythonic/include/utils/shared_ref.hpp" -#include "pythonic/include/types/str.hpp" -#include "pythonic/include/types/list.hpp" #include "pythonic/include/types/NoneType.hpp" +#include "pythonic/include/types/assignable.hpp" #include "pythonic/include/types/attr.hpp" +#include "pythonic/include/types/list.hpp" +#include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/shared_ref.hpp" #include #include @@ -107,7 +107,7 @@ namespace types template void writelines(T const &seq); }; -} +} // namespace types PYTHONIC_NS_END /* pythran attribute system { */ @@ -123,7 +123,7 @@ namespace builtins // Python seems to always return none... Doing the same. types::none_type getattr(types::attr::NEWLINES, types::file const &f); -} +} // namespace builtins PYTHONIC_NS_END /* } */ diff --git a/pythran/pythonic/include/types/finfo.hpp b/pythran/pythonic/include/types/finfo.hpp index f5af81c04b..f15b2acc57 100644 --- a/pythran/pythonic/include/types/finfo.hpp +++ b/pythran/pythonic/include/types/finfo.hpp @@ -18,7 +18,7 @@ namespace types struct finfo> { T eps() const; }; -} +} // namespace types PYTHONIC_NS_END /* pythran attribute system { */ @@ -26,8 +26,8 @@ PYTHONIC_NS_BEGIN namespace builtins { template - auto getattr(types::attr::EPS, pythonic::types::finfo const &f) - -> decltype(f.eps()); + auto getattr(types::attr::EPS, + pythonic::types::finfo const &f) -> decltype(f.eps()); } PYTHONIC_NS_END /* } */ diff --git a/pythran/pythonic/include/types/generator.hpp b/pythran/pythonic/include/types/generator.hpp index 587d71c6eb..85998cccb5 100644 --- a/pythran/pythonic/include/types/generator.hpp +++ b/pythran/pythonic/include/types/generator.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_TYPES_GENERATOR_HPP #define PYTHONIC_INCLUDE_TYPES_GENERATOR_HPP -#include #include +#include PYTHONIC_NS_BEGIN @@ -23,7 +23,7 @@ namespace types bool operator==(generator_iterator const &other) const; bool operator<(generator_iterator const &other) const; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/immediate.hpp b/pythran/pythonic/include/types/immediate.hpp index 7e7bf3e075..7b8de529d4 100644 --- a/pythran/pythonic/include/types/immediate.hpp +++ b/pythran/pythonic/include/types/immediate.hpp @@ -26,7 +26,7 @@ namespace types using true_immediate = immediate; using false_immediate = immediate; -} +} // namespace types PYTHONIC_NS_END diff --git a/pythran/pythonic/include/types/int.hpp b/pythran/pythonic/include/types/int.hpp index ebd94eb8d1..40a53da214 100644 --- a/pythran/pythonic/include/types/int.hpp +++ b/pythran/pythonic/include/types/int.hpp @@ -12,7 +12,7 @@ namespace builtins template typename std::enable_if::value, T>::value getattr(types::attr::IMAG, T self); -} +} // namespace builtins PYTHONIC_NS_END #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/include/types/lazy.hpp b/pythran/pythonic/include/types/lazy.hpp index b5ea869df6..13680b0c1a 100644 --- a/pythran/pythonic/include/types/lazy.hpp +++ b/pythran/pythonic/include/types/lazy.hpp @@ -15,7 +15,7 @@ namespace types std::is_same, lazy_res_t>::value, lazy_res_t, typename __combined, lazy_res_decay_t>::type>::type; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/list.hpp b/pythran/pythonic/include/types/list.hpp index 15a1db3086..0b921bd6aa 100644 --- a/pythran/pythonic/include/types/list.hpp +++ b/pythran/pythonic/include/types/list.hpp @@ -104,10 +104,10 @@ namespace types static const bool is_flat = std::is_same::value; static const bool is_strided = std::is_same::value; - using shape_t = types::array; + using shape_t = types::array_tuple; template - auto shape() const - -> decltype(details::extract_shape(*this, utils::int_{})) + auto shape() const -> decltype(details::extract_shape(*this, + utils::int_{})) { return details::extract_shape(*this, utils::int_{}); } @@ -391,7 +391,7 @@ namespace types intptr_t id() const; long count(T const &x) const; - using shape_t = array; + using shape_t = array_tuple; template long shape() const { @@ -439,7 +439,7 @@ namespace types static const size_t value = 1; static const bool is_vectorizable = false; static const bool is_strided = false; - using shape_t = types::array; + using shape_t = types::array_tuple; typedef char value_type; typedef empty_iterator iterator; diff --git a/pythran/pythonic/include/types/ndarray.hpp b/pythran/pythonic/include/types/ndarray.hpp index e28d665e1f..49c8254987 100644 --- a/pythran/pythonic/include/types/ndarray.hpp +++ b/pythran/pythonic/include/types/ndarray.hpp @@ -168,7 +168,7 @@ namespace types }; template - struct type_helper>> { + struct type_helper>> { using type = T; using iterator = T *; @@ -176,18 +176,18 @@ namespace types type_helper() = delete; // Not intended to be instantiated - static iterator make_iterator(ndarray> &n, long i); - static const_iterator make_iterator(ndarray> const &n, + static iterator make_iterator(ndarray> &n, long i); + static const_iterator make_iterator(ndarray> const &n, long i); template static T *initialize_from_iterable(S &shape, T *from, Iter &&iter); - static type get(ndarray> &&self, long i); + static type get(ndarray> &&self, long i); }; template - struct type_helper> const &> { + struct type_helper> const &> { using type = T; using iterator = T *; @@ -195,13 +195,13 @@ namespace types type_helper() = delete; // Not intended to be instantiated - static iterator make_iterator(ndarray> &n, long i); - static const_iterator make_iterator(ndarray> const &n, + static iterator make_iterator(ndarray> &n, long i); + static const_iterator make_iterator(ndarray> const &n, long i); template static T *initialize_from_iterable(S &shape, T *from, Iter &&iter); - static type &get(ndarray> const &self, long i); + static type &get(ndarray> const &self, long i); }; /* Multidimensional array of values @@ -240,7 +240,7 @@ namespace types T *buffer; // pointer to the first data stored in the equivalent flat // array shape_t _shape; // shape of the multidimensional array - sutils::concat_t, + sutils::concat_t, pshape>> _strides; // strides @@ -346,14 +346,14 @@ namespace types { static_assert(is_dtype::value, "valid store"); *(buffer + noffset::value>{}( - *this, array{{indices...}})) = + *this, array_tuple{{indices...}})) = static_cast(elt); } template dtype load(Indices... indices) const { return *(buffer + noffset::value>{}( - *this, array{{indices...}})); + *this, array_tuple{{indices...}})); } template @@ -361,7 +361,7 @@ namespace types { static_assert(is_dtype::value, "valid store"); Op{}(*(buffer + noffset::value>{}( - *this, array{{indices...}})), + *this, array_tuple{{indices...}})), static_cast(elt)); } @@ -382,19 +382,19 @@ namespace types template typename std::enable_if::value, T &>::type - fast(array const &indices); + fast(array_tuple const &indices); template typename std::enable_if::value, T>::type - fast(array const &indices) const; + fast(array_tuple const &indices) const; template - auto fast(array const &indices) const & -> + auto fast(array_tuple const &indices) const & -> typename std::enable_if::value, decltype(nget().fast(*this, indices))>::type; template - auto fast(array const &indices) && -> + auto fast(array_tuple const &indices) && -> typename std::enable_if::value, decltype(nget().fast(std::move(*this), indices))>::type; @@ -449,17 +449,20 @@ namespace types } template - auto operator()(S0 const &s0, S const &...s) const & -> decltype( - extended_slice::value>{}((*this), s0, s...)); + auto operator()(S0 const &s0, S const &...s) + const & -> decltype(extended_slice::value>{}( + (*this), s0, s...)); template - auto operator()(S0 const &s0, S const &...s) & -> decltype( - extended_slice::value>{}((*this), s0, s...)); + auto operator()(S0 const &s0, S const &...s) + & -> decltype(extended_slice::value>{}((*this), + s0, + s...)); template - auto operator()(S0 const &s0, S const &...s) && -> decltype( - extended_slice::value>{}(std::move(*this), s0, - s...)); + auto operator()(S0 const &s0, S const &...s) + && -> decltype(extended_slice::value>{}( + std::move(*this), s0, s...)); /* element filtering */ template // indexing through an array of boolean -- a mask @@ -528,19 +531,19 @@ namespace types template typename std::enable_if::value, T const &>::type - operator[](array const &indices) const; + operator[](array_tuple const &indices) const; template typename std::enable_if::value, T &>::type - operator[](array const &indices); + operator[](array_tuple const &indices); template - auto operator[](array const &indices) const & -> + auto operator[](array_tuple const &indices) const & -> typename std::enable_if::value, decltype(nget()(*this, indices))>::type; template - auto operator[](array const &indices) && -> + auto operator[](array_tuple const &indices) && -> typename std::enable_if::value, decltype(nget()(std::move(*this), indices))>::type; @@ -622,7 +625,7 @@ namespace types template ::value, void>::type> - auto operator[](array const &indices) const + auto operator[](array_tuple const &indices) const & -> decltype(this->_fwdindex(indices, utils::make_index_sequence())) { return _fwdindex(indices, utils::make_index_sequence()); @@ -664,12 +667,12 @@ namespace types ndarray reshape(qS const &shape) &&; template - ndarray> recast() + ndarray> recast() { auto new_shape = sutils::array(_shape); new_shape[value - 1] = new_shape[value - 1] * sizeof(T) / sizeof(OT); auto new_mem = mem.template recast>(); - return ndarray>(new_mem, new_shape); + return ndarray>(new_mem, new_shape); } explicit operator bool() const; @@ -715,10 +718,11 @@ namespace std { template - auto get(E &&a) -> typename std::enable_if< - pythonic::types::is_array::type>::type>::value, - decltype(std::forward(a)[I])>::type; + auto get(E &&a) -> + typename std::enable_if< + pythonic::types::is_array::type>::type>::value, + decltype(std::forward(a)[I])>::type; template struct tuple_element> { @@ -748,7 +752,8 @@ namespace std template struct tuple_element> { - using type = decltype(std::declval>()[0]); + using type = + decltype(std::declval>()[0]); }; } // namespace std @@ -825,8 +830,8 @@ namespace builtins template <> struct _build_gexpr<1> { template - auto - operator()(E const &a, S const &...slices) -> decltype(E(a)(slices...)); + auto operator()(E const &a, + S const &...slices) -> decltype(E(a)(slices...)); }; template @@ -836,7 +841,7 @@ namespace builtins auto _make_real(E const &a, utils::int_<1>) -> decltype(_build_gexpr{}( types::ndarray::type, - types::array>{}, + types::array_tuple>{}, types::slice())); template auto real_get(T &&expr, Ss const &indices, utils::index_sequence) @@ -852,7 +857,7 @@ namespace builtins auto _make_imag(E const &a, utils::int_<1>) -> decltype(_build_gexpr{}( types::ndarray::type, - types::array>{}, + types::array_tuple>{}, types::slice())); template auto imag_get(T &&expr, Ss const &indices, utils::index_sequence) @@ -863,7 +868,7 @@ namespace builtins } // namespace details template - types::array getattr(types::attr::SHAPE, E const &a); + types::array_tuple getattr(types::attr::SHAPE, E const &a); inline types::pshape<> getattr(types::attr::SHAPE, ...) { @@ -883,7 +888,7 @@ namespace builtins } template - types::array getattr(types::attr::STRIDES, E const &a); + types::array_tuple getattr(types::attr::STRIDES, E const &a); inline std::tuple<> getattr(types::attr::STRIDES, ...) { @@ -924,22 +929,24 @@ namespace builtins typename types::numpy_expr::dtype>::value>{})); template - auto getattr(types::attr::REAL, types::numpy_texpr const &a) -> decltype( - types::numpy_texpr{ + auto getattr(types::attr::REAL, types::numpy_texpr const &a) + -> decltype(types::numpy_texpr{ getattr(types::attr::REAL{}, a.arg)}); template - auto getattr(types::attr::REAL, types::numpy_iexpr const &a) -> decltype( - types::numpy_iexpr{ + auto getattr(types::attr::REAL, types::numpy_iexpr const &a) + -> decltype(types::numpy_iexpr{ getattr(types::attr::REAL{}, a.arg)}) { return {getattr(types::attr::REAL{}, a.arg)}; } template - auto - getattr(types::attr::REAL, types::numpy_vexpr const &a) -> decltype( - types::numpy_vexpr{ + auto getattr(types::attr::REAL, types::numpy_vexpr const &a) + -> decltype(types::numpy_vexpr< + decltype(getattr(types::attr::REAL{}, a.data_)), F>{ getattr(types::attr::REAL{}, a.data_), a.view_}) { return {getattr(types::attr::REAL{}, a.data_), a.view_}; @@ -969,22 +976,24 @@ namespace builtins typename types::numpy_expr::dtype>::value>{})); template - auto getattr(types::attr::IMAG, types::numpy_texpr const &a) -> decltype( - types::numpy_texpr{ + auto getattr(types::attr::IMAG, types::numpy_texpr const &a) + -> decltype(types::numpy_texpr{ getattr(types::attr::IMAG{}, a.arg)}); template - auto geatttr(types::attr::IMAG, types::numpy_iexpr const &a) -> decltype( - types::numpy_iexpr{ + auto geatttr(types::attr::IMAG, types::numpy_iexpr const &a) + -> decltype(types::numpy_iexpr{ getattr(types::attr::IMAG{}, a.arg)}) { return {getattr(types::attr::IMAG{}, a.arg)}; } template - auto - getattr(types::attr::IMAG, types::numpy_vexpr const &a) -> decltype( - types::numpy_vexpr{ + auto getattr(types::attr::IMAG, types::numpy_vexpr const &a) + -> decltype(types::numpy_vexpr< + decltype(getattr(types::attr::IMAG{}, a.data_)), F>{ getattr(types::attr::IMAG{}, a.data_), a.view_}) { return {getattr(types::attr::IMAG{}, a.data_), a.view_}; diff --git a/pythran/pythonic/include/types/nditerator.hpp b/pythran/pythonic/include/types/nditerator.hpp index e74f19c2b5..0d1f8281ad 100644 --- a/pythran/pythonic/include/types/nditerator.hpp +++ b/pythran/pythonic/include/types/nditerator.hpp @@ -48,8 +48,8 @@ namespace types template struct nditerator : public std::iterator().fast(0))>::type> { + typename std::remove_reference< + decltype(std::declval().fast(0))>::type> { E &data; long index; nditerator(E &data, long index); @@ -75,8 +75,8 @@ namespace types template struct const_nditerator : public std::iterator().fast(0))>::type> { + typename std::remove_reference< + decltype(std::declval().fast(0))>::type> { E const &data; long index; const_nditerator(E const &data, long index); @@ -153,8 +153,8 @@ namespace types template struct make_const_nditerator { template - auto operator()(T const &self, long i) - -> decltype(const_nditerator(self, i)) const; + auto operator()(T const &self, + long i) -> decltype(const_nditerator(self, i)) const; }; template <> @@ -162,7 +162,7 @@ namespace types template typename T::dtype const *operator()(T const &self, long i) const; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/numpy_broadcast.hpp b/pythran/pythonic/include/types/numpy_broadcast.hpp index 2340b10d16..f86dc628fe 100644 --- a/pythran/pythonic/include/types/numpy_broadcast.hpp +++ b/pythran/pythonic/include/types/numpy_broadcast.hpp @@ -87,7 +87,7 @@ namespace types using iterator = const_iterator; T ref; - using shape_t = types::array; + using shape_t = types::array_tuple; template long shape() const @@ -259,8 +259,10 @@ namespace types template struct broadcast_dtype { using type = - typename std::conditional<(std::is_integral::value && std::is_integral::value) - ||(std::is_floating_point::value && std::is_floating_point::value), + typename std::conditional<(std::is_integral::value && + std::is_integral::value) || + (std::is_floating_point::value && + std::is_floating_point::value), T, typename __combined::type>::type; }; #ifndef USE_XSIMD @@ -299,7 +301,7 @@ namespace types dtype operator[](long) const; template - dtype operator[](array) const; + dtype operator[](array_tuple) const; template typename std::enable_if::value, broadcast const &>::type diff --git a/pythran/pythonic/include/types/numpy_expr.hpp b/pythran/pythonic/include/types/numpy_expr.hpp index c6ae90eb17..0d13801a6b 100644 --- a/pythran/pythonic/include/types/numpy_expr.hpp +++ b/pythran/pythonic/include/types/numpy_expr.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_TYPES_NUMPY_EXPR_HPP #define PYTHONIC_INCLUDE_TYPES_NUMPY_EXPR_HPP -#include "pythonic/include/utils/meta.hpp" #include "pythonic/include/types/nditerator.hpp" +#include "pythonic/include/utils/meta.hpp" PYTHONIC_NS_BEGIN @@ -85,9 +85,10 @@ namespace types template struct numpy_expr_iterator - : std::iterator()(*std::declval()...))>::type> { + : std::iterator< + std::random_access_iterator_tag, + typename std::remove_reference()( + *std::declval()...))>::type> { Steps steps_; std::tuple iters_; @@ -114,8 +115,8 @@ namespace types return Dereferencer{}(iters_, s); } - auto operator*() const -> decltype( - this->_dereference(utils::make_index_sequence{})) + auto operator*() const -> decltype(this->_dereference( + utils::make_index_sequence{})) { return _dereference(utils::make_index_sequence{}); } @@ -141,9 +142,10 @@ namespace types template void _incr(utils::index_sequence) { - (void)std::initializer_list{_incr_opt(std::integral_constant< - bool, std::is_same::type>::value>{})...}; + (void)std::initializer_list{_incr_opt( + std::integral_constant< + bool, std::is_same::type>::value>{})...}; } numpy_expr_iterator &operator++() { @@ -242,14 +244,15 @@ namespace types #ifdef USE_XSIMD template struct numpy_expr_simd_iterator - : std::iterator()(*std::declval()...))>::type> { + : std::iterator< + std::random_access_iterator_tag, + typename std::remove_reference()( + *std::declval()...))>::type> { Steps steps_; std::tuple iters_; SIters siters_; - numpy_expr_simd_iterator(array steps, + numpy_expr_simd_iterator(array_tuple steps, SIters const &siters, Iters... iters) : steps_(steps), iters_(iters...), siters_(siters) { @@ -275,8 +278,8 @@ namespace types : (std::get(siters_)))...); } - auto operator*() const -> decltype( - this->_dereference(utils::make_index_sequence{})) + auto operator*() const -> decltype(this->_dereference( + utils::make_index_sequence{})) { return _dereference(utils::make_index_sequence{}); } @@ -302,9 +305,10 @@ namespace types template void _incr(utils::index_sequence) { - (void)std::initializer_list{_incr_opt(std::integral_constant< - bool, std::is_same::type>::value>{})...}; + (void)std::initializer_list{_incr_opt( + std::integral_constant< + bool, std::is_same::type>::value>{})...}; } numpy_expr_simd_iterator &operator++() { @@ -404,9 +408,10 @@ namespace types template struct numpy_expr_simd_iterator_nobroadcast - : std::iterator()(*std::declval()...))>::type> { + : std::iterator< + std::random_access_iterator_tag, + typename std::remove_reference()( + *std::declval()...))>::type> { std::tuple iters_; numpy_expr_simd_iterator_nobroadcast(Iters... iters) : iters_(iters...) @@ -433,8 +438,8 @@ namespace types return Op{}((*std::get(iters_))...); } - auto operator*() const -> decltype( - this->_dereference(utils::make_index_sequence{})) + auto operator*() const -> decltype(this->_dereference( + utils::make_index_sequence{})) { return _dereference(utils::make_index_sequence{}); } @@ -563,8 +568,9 @@ namespace types template constexpr size_t count_none(size_t I) { - return I == 0 ? 0 : (std::is_same::value + - count_none(I - 1)); + return I == 0 ? 0 + : (std::is_same::value + + count_none(I - 1)); } template @@ -577,9 +583,9 @@ namespace types } template - auto make_subslice(utils::index_sequence, Arg const &arg, - Shp const &shp, std::tuple const &ss) - -> decltype(arg(std::get(ss)...)) + auto + make_subslice(utils::index_sequence, Arg const &arg, Shp const &shp, + std::tuple const &ss) -> decltype(arg(std::get(ss)...)) { // we need to adapt_slice to take broadcasting into account return arg(adapt_slice( @@ -610,8 +616,9 @@ namespace types static constexpr size_t value = utils::max_element::type::value...>::value; - using value_type = decltype(Op()(std::declval< - typename std::remove_reference::type::value_type>()...)); + using value_type = decltype(Op()( + std::declval< + typename std::remove_reference::type::value_type>()...)); using dtype = decltype(Op()( std::declval::type::dtype>()...)); @@ -639,13 +646,12 @@ namespace types #ifdef CYTHON_ABI template - numpy_expr(numpy_expr const &other) - : args(other.args) + numpy_expr(numpy_expr const &other) : args(other.args) { } #endif - numpy_expr(Args const &... args); + numpy_expr(Args const &...args); template const_iterator _begin(utils::index_sequence) const; @@ -694,7 +700,7 @@ namespace types } template - auto _map_fast(array const &indices, + auto _map_fast(array_tuple const &indices, utils::index_sequence) const -> decltype(Op()(std::get(args).fast(std::get(indices))...)) { @@ -702,14 +708,15 @@ namespace types } template - auto map_fast(Indices... indices) const -> decltype( - this->_map_fast(array{{indices...}}, - utils::make_index_sequence{})); + auto map_fast(Indices... indices) const + -> decltype(this->_map_fast( + array_tuple{{indices...}}, + utils::make_index_sequence{})); public: template auto shape() const -> decltype(details::init_shape_element( - args, valid_indices>{})) + args, valid_indices>{})) { return details::init_shape_element( args, valid_indices>{}); @@ -733,8 +740,9 @@ namespace types typename std::remove_reference::type::value_type>...>, typename std::remove_reference::type::simd_iterator...>; using simd_iterator_nobroadcast = numpy_expr_simd_iterator_nobroadcast< - numpy_expr, Op, typename std::remove_reference< - Args>::type::simd_iterator_nobroadcast...>; + numpy_expr, Op, + typename std::remove_reference< + Args>::type::simd_iterator_nobroadcast...>; template simd_iterator _vbegin(types::vectorize, utils::index_sequence) const; simd_iterator vbegin(types::vectorize) const; @@ -754,9 +762,10 @@ namespace types #endif template - auto _get(utils::index_sequence is, S const &... s) const -> decltype( - Op{}(make_subslice(utils::make_index_sequence{}, - std::get(args), *this, std::make_tuple(s...))...)) + auto _get(utils::index_sequence is, S const &...s) const + -> decltype(Op{}( + make_subslice(utils::make_index_sequence{}, + std::get(args), *this, std::make_tuple(s...))...)) { return Op{}(make_subslice(utils::make_index_sequence{}, std::get(args), *this, @@ -764,7 +773,7 @@ namespace types } template - auto operator()(S const &... s) const + auto operator()(S const &...s) const -> decltype(this->_get(utils::make_index_sequence{}, s...)); @@ -811,14 +820,13 @@ namespace types } template auto operator[](S s) const - -> decltype((*this) - ._index((s.lower, s), - utils::make_index_sequence{})) + -> decltype((*this)._index( + (s.lower, s), utils::make_index_sequence{})) { return _index(s, utils::make_index_sequence{}); } - dtype operator[](array const &indices) const + dtype operator[](array_tuple const &indices) const { return _index(indices, utils::make_index_sequence{}); } @@ -829,7 +837,7 @@ namespace types long size() const; }; -} +} // namespace types template struct assignable> { @@ -882,8 +890,8 @@ struct __combined, pythonic::types::numpy_expr> { using type = pythonic::types::ndarray< typename pythonic::types::numpy_expr::dtype, - pythonic::types::array::value>>; + pythonic::types::array_tuple< + long, pythonic::types::numpy_expr::value>>; }; template struct __combined, @@ -907,8 +915,8 @@ struct __combined, pythonic::types::numpy_texpr> { using type = pythonic::types::ndarray< typename pythonic::types::numpy_expr::dtype, - pythonic::types::array::value>>; + pythonic::types::array_tuple< + long, pythonic::types::numpy_expr::value>>; }; template @@ -916,8 +924,8 @@ struct __combined, pythonic::types::numpy_expr> { using type = pythonic::types::ndarray< typename pythonic::types::numpy_expr::dtype, - pythonic::types::array::value>>; + pythonic::types::array_tuple< + long, pythonic::types::numpy_expr::value>>; }; /*}*/ diff --git a/pythran/pythonic/include/types/numpy_gexpr.hpp b/pythran/pythonic/include/types/numpy_gexpr.hpp index cda948ff80..277ab1cb88 100644 --- a/pythran/pythonic/include/types/numpy_gexpr.hpp +++ b/pythran/pythonic/include/types/numpy_gexpr.hpp @@ -150,12 +150,12 @@ namespace types typename std::enable_if< !is_slice::value, numpy_gexpr::type::dtype, - array::type::value>>, + array_tuple::type::value>>, cstride_normalized_slice<1>, normalize_t...>>::type operator()(E &&expr, F const &s0, S const &...s) { return numpy_vexpr::type::dtype, - array::type::value>>, + array_tuple::type::value>>, F>{std::forward(expr), s0}( fast_contiguous_slice(none_type{}, none_type{}), s...); } @@ -234,9 +234,10 @@ namespace types } template - auto - tuple_push_head(T const &val, Ts const &vals) -> decltype(tuple_push_head( - val, vals, utils::make_index_sequence::value>())) + auto tuple_push_head(T const &val, Ts const &vals) + -> decltype(tuple_push_head( + val, vals, + utils::make_index_sequence::value>())) { return tuple_push_head( val, vals, utils::make_index_sequence::value>()); @@ -515,13 +516,13 @@ namespace types }; template - struct gexpr_shape, array> { + struct gexpr_shape, array_tuple> { using type = pshape; }; template - struct gexpr_shape, array> - : gexpr_shape, array> { + struct gexpr_shape, array_tuple> + : gexpr_shape, array_tuple> { }; template @@ -548,12 +549,12 @@ namespace types : gexpr_shape, pshape, S...> { }; template - struct gexpr_shape, array, long, S...> - : gexpr_shape, array, S...> { + struct gexpr_shape, array_tuple, long, S...> + : gexpr_shape, array_tuple, S...> { }; template - struct gexpr_shape, array, cS, S...> - : gexpr_shape, array, S...> { + struct gexpr_shape, array_tuple, cS, S...> + : gexpr_shape, array_tuple, S...> { }; template @@ -640,13 +641,13 @@ namespace types template static constexpr types::pshape> last_stride(cstride_normalized_slice); - static constexpr types::array last_stride(...); + static constexpr types::array_tuple last_stride(...); - sutils::concat_t, + sutils::concat_t, typename std::conditional< sizeof...(S) == std::decay::type::value, decltype(last_stride(std::declval())), - types::array>::type> + types::array_tuple>::type> _strides; // strides template @@ -814,22 +815,23 @@ namespace types void store(E elt, Indices... indices) { static_assert(is_dtype::value, "valid store"); - *(buffer + noffset{}(*this, array{{indices...}})) = + *(buffer + + noffset{}(*this, array_tuple{{indices...}})) = static_cast(elt); } template dtype load(Indices... indices) const { return *(buffer + - noffset{}(*this, array{{indices...}})); + noffset{}(*this, array_tuple{{indices...}})); } template void update(E elt, Indices... indices) const { static_assert(is_dtype::value, "valid store"); - Op{}( - *(buffer + noffset{}(*this, array{{indices...}})), - static_cast(elt)); + Op{}(*(buffer + + noffset{}(*this, array_tuple{{indices...}})), + static_cast(elt)); } #ifdef USE_XSIMD @@ -845,24 +847,26 @@ namespace types auto operator()(Sp const &...s) const -> decltype(make_gexpr(*this, s...)); template - auto operator[](Sp const &s) const -> typename std::enable_if< - is_slice::value, decltype(make_gexpr(*this, (s.lower, s)))>::type; + auto operator[](Sp const &s) const -> + typename std::enable_if::value, + decltype(make_gexpr(*this, + (s.lower, s)))>::type; template - auto fast(array const &indices) + auto fast(array_tuple const &indices) const & -> decltype(nget().fast(*this, indices)); template - auto fast(array const &indices) && -> decltype(nget().fast( - std::move(*this), indices)); + auto fast(array_tuple const &indices) + && -> decltype(nget().fast(std::move(*this), indices)); template - auto operator[](array const &indices) + auto operator[](array_tuple const &indices) const & -> decltype(nget()(*this, indices)); template - auto operator[](array const &indices) && -> decltype(nget()( - std::move(*this), indices)); + auto operator[](array_tuple const &indices) + && -> decltype(nget()(std::move(*this), indices)); template // indexing through an array of indices -- a view typename std::enable_if::value && @@ -927,9 +931,10 @@ namespace types } template - auto recast(utils::index_sequence) -> decltype(make_gexpr( - arg.template recast(), - recast_slice(std::get(slices))...)) + auto recast(utils::index_sequence) + -> decltype(make_gexpr( + arg.template recast(), + recast_slice(std::get(slices))...)) { return make_gexpr( arg.template recast(), @@ -937,8 +942,8 @@ namespace types } template - auto recast() - -> decltype(recast(utils::make_index_sequence())) + auto + recast() -> decltype(recast(utils::make_index_sequence())) { return recast(utils::make_index_sequence()); } @@ -988,8 +993,8 @@ struct __combined, using type = pythonic::types::ndarray < typename __combined::type, - pythonic::types::array>; + pythonic::types::array_tuple< + long, t0::value>; }; template diff --git a/pythran/pythonic/include/types/numpy_iexpr.hpp b/pythran/pythonic/include/types/numpy_iexpr.hpp index 18cd024213..d0a6526231 100644 --- a/pythran/pythonic/include/types/numpy_iexpr.hpp +++ b/pythran/pythonic/include/types/numpy_iexpr.hpp @@ -14,9 +14,9 @@ namespace types template struct noffset { template - long operator()(S const &strides, array const &indices) const; + long operator()(S const &strides, array_tuple const &indices) const; template - long operator()(S const &strides, array const &indices, + long operator()(S const &strides, array_tuple const &indices, pS const &shape) const; }; @@ -175,11 +175,11 @@ namespace types return numpy_iexpr_helper::get(std::move(*this), i); } - dtype const &fast(array const &indices) const; - dtype &fast(array const &indices); + dtype const &fast(array_tuple const &indices) const; + dtype &fast(array_tuple const &indices); template - auto fast(array const &indices) const + auto fast(array_tuple const &indices) const -> decltype(nget()(*this, indices)) { return nget()(*this, indices); @@ -197,7 +197,8 @@ namespace types { static_assert(is_dtype::value, "valid store"); assert(buffer); - *(buffer + noffset{}(*this, array{{indices...}})) = + *(buffer + + noffset{}(*this, array_tuple{{indices...}})) = static_cast(elt); } template @@ -205,16 +206,16 @@ namespace types { assert(buffer); return *(buffer + - noffset{}(*this, array{{indices...}})); + noffset{}(*this, array_tuple{{indices...}})); } template void update(E elt, Indices... indices) const { static_assert(is_dtype::value, "valid store"); assert(buffer); - Op{}( - *(buffer + noffset{}(*this, array{{indices...}})), - static_cast(elt)); + Op{}(*(buffer + + noffset{}(*this, array_tuple{{indices...}})), + static_cast(elt)); } #ifdef USE_XSIMD @@ -258,10 +259,10 @@ namespace types numpy_gexpr>>::type operator[](Sp const &s0) const; - dtype const &operator[](array const &indices) const; - dtype &operator[](array const &indices); + dtype const &operator[](array_tuple const &indices) const; + dtype &operator[](array_tuple const &indices); template - auto operator[](array const &indices) + auto operator[](array_tuple const &indices) const & -> decltype(nget()(*this, indices)) { return nget()(*this, indices); diff --git a/pythran/pythonic/include/types/numpy_nary_expr.hpp b/pythran/pythonic/include/types/numpy_nary_expr.hpp index df7142e881..dd42278b3b 100644 --- a/pythran/pythonic/include/types/numpy_nary_expr.hpp +++ b/pythran/pythonic/include/types/numpy_nary_expr.hpp @@ -26,10 +26,11 @@ namespace functor NUMPY_NARY_EXTRA_METHOD template - auto operator()(T &&... args) const -> typename std::enable_if< - !types::valid_numexpr_parameters< - typename std::decay::type...>::value, - decltype(NUMPY_NARY_FUNC_SYM(std::forward(args)...))>::type; + auto operator()(T &&...args) const -> + typename std::enable_if< + !types::valid_numexpr_parameters< + typename std::decay::type...>::value, + decltype(NUMPY_NARY_FUNC_SYM(std::forward(args)...))>::type; template typename std::enable_if< @@ -37,14 +38,14 @@ namespace functor types::numpy_expr< NUMPY_NARY_FUNC_NAME, typename types::NUMPY_NARY_RESHAPE_MODE::type...>>::type - operator()(E &&... args) const; + operator()(E &&...args) const; friend std::ostream &operator<<(std::ostream &os, NUMPY_NARY_FUNC_NAME) { return os << STR(NUMPY_NARY_FUNC_NAME); } }; -} +} // namespace functor #undef NUMPY_NARY_FUNC_NAME #undef NUMPY_NARY_FUNC_SYM diff --git a/pythran/pythonic/include/types/numpy_op_helper.hpp b/pythran/pythonic/include/types/numpy_op_helper.hpp index 226c883ffb..034a9a0826 100644 --- a/pythran/pythonic/include/types/numpy_op_helper.hpp +++ b/pythran/pythonic/include/types/numpy_op_helper.hpp @@ -217,7 +217,7 @@ namespace types struct is_array_index : std::false_type { }; template - struct is_array_index> : std::true_type { + struct is_array_index> : std::true_type { }; } // namespace types PYTHONIC_NS_END diff --git a/pythran/pythonic/include/types/numpy_operators.hpp b/pythran/pythonic/include/types/numpy_operators.hpp index 6a8a1dacc1..4348df93d0 100644 --- a/pythran/pythonic/include/types/numpy_operators.hpp +++ b/pythran/pythonic/include/types/numpy_operators.hpp @@ -1,27 +1,27 @@ #ifndef PYTHONIC_INCLUDE_TYPES_NUMPY_OPERATORS_HPP #define PYTHONIC_INCLUDE_TYPES_NUMPY_OPERATORS_HPP -#include "pythonic/include/types/numpy_broadcast.hpp" +#include "pythonic/include/numpy/bitwise_not.hpp" +#include "pythonic/include/numpy/mod.hpp" #include "pythonic/include/operator_/add.hpp" #include "pythonic/include/operator_/and_.hpp" -#include "pythonic/include/operator_/or_.hpp" -#include "pythonic/include/operator_/xor_.hpp" #include "pythonic/include/operator_/div.hpp" #include "pythonic/include/operator_/eq.hpp" -#include "pythonic/include/operator_/gt.hpp" #include "pythonic/include/operator_/ge.hpp" +#include "pythonic/include/operator_/gt.hpp" +#include "pythonic/include/operator_/le.hpp" #include "pythonic/include/operator_/lshift.hpp" #include "pythonic/include/operator_/lt.hpp" -#include "pythonic/include/operator_/le.hpp" #include "pythonic/include/operator_/mul.hpp" +#include "pythonic/include/operator_/ne.hpp" #include "pythonic/include/operator_/neg.hpp" #include "pythonic/include/operator_/not_.hpp" -#include "pythonic/include/operator_/ne.hpp" +#include "pythonic/include/operator_/or_.hpp" #include "pythonic/include/operator_/pos.hpp" #include "pythonic/include/operator_/rshift.hpp" #include "pythonic/include/operator_/sub.hpp" -#include "pythonic/include/numpy/mod.hpp" -#include "pythonic/include/numpy/bitwise_not.hpp" +#include "pythonic/include/operator_/xor_.hpp" +#include "pythonic/include/types/numpy_broadcast.hpp" #include "pythonic/include/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -107,7 +107,7 @@ namespace types #define NUMPY_BINARY_FUNC_NAME operator- #define NUMPY_BINARY_FUNC_SYM operator_::functor::sub #include "pythonic/include/types/numpy_binary_op.hpp" -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/numpy_texpr.hpp b/pythran/pythonic/include/types/numpy_texpr.hpp index 5f7f29f218..592bbaf76e 100644 --- a/pythran/pythonic/include/types/numpy_texpr.hpp +++ b/pythran/pythonic/include/types/numpy_texpr.hpp @@ -73,15 +73,15 @@ namespace types -> decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, pythonic::builtins::None), i)); - auto fast(array const &indices) - -> decltype(arg.fast(array{{indices[1], indices[0]}})) + auto fast(array_tuple const &indices) + -> decltype(arg.fast(array_tuple{{indices[1], indices[0]}})) { - return arg.fast(array{{indices[1], indices[0]}}); + return arg.fast(array_tuple{{indices[1], indices[0]}}); } - auto fast(array const &indices) const - -> decltype(arg.fast(array{{indices[1], indices[0]}})) + auto fast(array_tuple const &indices) const + -> decltype(arg.fast(array_tuple{{indices[1], indices[0]}})) { - return arg.fast(array{{indices[1], indices[0]}}); + return arg.fast(array_tuple{{indices[1], indices[0]}}); } auto load(long i, long j) const -> decltype(arg.load(j, i)) @@ -157,16 +157,16 @@ namespace types auto operator[](long i) const -> decltype(this->fast(i)); auto operator[](long i) -> decltype(this->fast(i)); template - auto operator[](array const &indices) - -> decltype(arg[array{{indices[1], indices[0]}}]) + auto operator[](array_tuple const &indices) + -> decltype(arg[array_tuple{{indices[1], indices[0]}}]) { - return arg[array{{indices[1], indices[0]}}]; + return arg[array_tuple{{indices[1], indices[0]}}]; } template - auto operator[](array const &indices) const - -> decltype(arg[array{{indices[1], indices[0]}}]) + auto operator[](array_tuple const &indices) const + -> decltype(arg[array_tuple{{indices[1], indices[0]}}]) { - return arg[array{{indices[1], indices[0]}}]; + return arg[array_tuple{{indices[1], indices[0]}}]; } template auto operator[](std::tuple const &indices) @@ -188,20 +188,22 @@ namespace types } template - auto operator[](S const &s0) const -> numpy_texpr< - decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, - pythonic::builtins::None), - (s0.step, s0)))>; + auto operator[](S const &s0) const + -> numpy_texpr< + decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, + pythonic::builtins::None), + (s0.step, s0)))>; template - auto operator[](S const &s0) -> numpy_texpr< - decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, - pythonic::builtins::None), - (s0.step, s0)))>; + auto + operator[](S const &s0) -> numpy_texprarg( + fast_contiguous_slice(pythonic::builtins::None, + pythonic::builtins::None), + (s0.step, s0)))>; template auto _reverse_index(S const &indices, utils::index_sequence) const - -> decltype( - numpy::functor::transpose{}(this->arg(std::get(indices)...))) + -> decltype(numpy::functor::transpose{}( + this->arg(std::get(indices)...))) { return numpy::functor::transpose{}(arg(std::get(indices)...)); } @@ -211,19 +213,20 @@ namespace types } template - auto recast() - -> decltype(numpy::functor::transpose{}(arg.template recast())) + auto + recast() -> decltype(numpy::functor::transpose{}(arg.template recast())) { return numpy::functor::transpose{}(arg.template recast()); } template - auto - operator()(S0 const &s0, S const &...s) const -> typename std::enable_if< - !is_numexpr_arg::value, - decltype(this->_reverse_index( - std::tuple{s0, s...}, - utils::make_reversed_index_sequence<1 + sizeof...(S)>()))>::type; + auto operator()(S0 const &s0, S const &...s) const -> + typename std::enable_if< + !is_numexpr_arg::value, + decltype(this->_reverse_index( + std::tuple{s0, s...}, + utils::make_reversed_index_sequence<1 + sizeof...(S)>()))>:: + type; template auto operator()(S0 const &s0, S const &...s) const -> @@ -280,16 +283,16 @@ namespace types using numpy_texpr_2>>::operator=; }; template - struct numpy_texpr>> - : numpy_texpr_2>> { + struct numpy_texpr>> + : numpy_texpr_2>> { numpy_texpr() = default; numpy_texpr(numpy_texpr const &) = default; numpy_texpr(numpy_texpr &&) = default; - numpy_texpr(ndarray> const &arg); + numpy_texpr(ndarray> const &arg); numpy_texpr &operator=(numpy_texpr const &) = default; - using numpy_texpr_2>>::operator=; + using numpy_texpr_2>>::operator=; }; template @@ -314,7 +317,7 @@ namespace types static constexpr auto value = broadcasted::value; using value_type = broadcast; using dtype = typename broadcasted::dtype; - using shape_t = types::array; + using shape_t = types::array_tuple; using iterator = nditerator>>; using const_iterator = const_nditerator>>; // FIXME: I've got the feeling that this could be improved diff --git a/pythran/pythonic/include/types/numpy_vexpr.hpp b/pythran/pythonic/include/types/numpy_vexpr.hpp index 02c5f1e5cf..a58d796f91 100644 --- a/pythran/pythonic/include/types/numpy_vexpr.hpp +++ b/pythran/pythonic/include/types/numpy_vexpr.hpp @@ -48,7 +48,7 @@ namespace types numpy_vexpr &operator=(numpy_vexpr const &); - using shape_t = array; + using shape_t = array_tuple; template long shape() const { @@ -97,8 +97,8 @@ namespace types return data_.fast(view_.fast(i)); } template - auto operator()(S const &... slices) const - -> decltype(ndarray>{*this}(slices...)); + auto operator()(S const &...slices) const + -> decltype(ndarray>{*this}(slices...)); auto operator[](long i) const -> decltype(data_[i]) { @@ -171,7 +171,7 @@ namespace types template numpy_vexpr &operator^=(E const &expr); }; -} +} // namespace types template struct assignable> { diff --git a/pythran/pythonic/include/types/pointer.hpp b/pythran/pythonic/include/types/pointer.hpp index cdb8513093..ee6fddb21c 100644 --- a/pythran/pythonic/include/types/pointer.hpp +++ b/pythran/pythonic/include/types/pointer.hpp @@ -19,7 +19,7 @@ namespace types reference fast(long); value_type fast(long) const; }; -} +} // namespace types PYTHONIC_NS_END namespace std @@ -40,7 +40,7 @@ namespace std struct tuple_element> { typedef typename pythonic::types::pointer::value_type type; }; -} +} // namespace std #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/include/types/raw_array.hpp b/pythran/pythonic/include/types/raw_array.hpp index b27bcc8395..55f3548837 100644 --- a/pythran/pythonic/include/types/raw_array.hpp +++ b/pythran/pythonic/include/types/raw_array.hpp @@ -33,7 +33,7 @@ namespace types private: bool external; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/static_if.hpp b/pythran/pythonic/include/types/static_if.hpp index 86e4b6c946..f5cb1f7038 100644 --- a/pythran/pythonic/include/types/static_if.hpp +++ b/pythran/pythonic/include/types/static_if.hpp @@ -124,7 +124,7 @@ namespace types { } }; -} +} // namespace types PYTHONIC_NS_END @@ -181,7 +181,7 @@ namespace std { return t.get(std::integral_constant{}); } -} +} // namespace std /* type inference stuff { */ #include "pythonic/include/types/combined.hpp" diff --git a/pythran/pythonic/include/types/str.hpp b/pythran/pythonic/include/types/str.hpp index 4771a181fb..ca373c734f 100644 --- a/pythran/pythonic/include/types/str.hpp +++ b/pythran/pythonic/include/types/str.hpp @@ -328,8 +328,9 @@ namespace operator_ { template - auto mod(const char (&fmt)[N], Arg &&arg) - -> decltype(pythonic::types::str(fmt) % std::forward(arg)); + auto mod(const char (&fmt)[N], + Arg &&arg) -> decltype(pythonic::types::str(fmt) % + std::forward(arg)); pythonic::types::str add(char const *self, char const *other); @@ -355,7 +356,9 @@ struct assignable { using type = types::str; }; template -struct assignable { using type = types::str; }; +struct assignable { + using type = types::str; +}; PYTHONIC_NS_END namespace std diff --git a/pythran/pythonic/include/types/traits.hpp b/pythran/pythonic/include/types/traits.hpp index 1434466419..c14ca8fce6 100644 --- a/pythran/pythonic/include/types/traits.hpp +++ b/pythran/pythonic/include/types/traits.hpp @@ -47,8 +47,9 @@ namespace types static std::integral_constant _test(decltype(&C::member)); \ template \ static std::integral_constant _test(...); \ - static const bool value = decltype( \ - _test::type>(nullptr))::value; \ + static const bool value = \ + decltype(_test::type>( \ + nullptr))::value; \ }; /* trait to check if a type is iterable*/ @@ -87,7 +88,7 @@ namespace types struct len_of { static long constexpr value = -1; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/tuple.hpp b/pythran/pythonic/include/types/tuple.hpp index 40c6f55a9f..a5eed3475e 100644 --- a/pythran/pythonic/include/types/tuple.hpp +++ b/pythran/pythonic/include/types/tuple.hpp @@ -66,7 +66,7 @@ namespace types }; template - using array = array_base; + using array_tuple = array_base; template using static_list = array_base; @@ -134,7 +134,7 @@ namespace types template struct iterator> { - using type = array; + using type = array_tuple; }; template @@ -230,16 +230,17 @@ namespace types pshape &operator=(pshape &&) = default; template - types::array array(utils::index_sequence) const + types::array_tuple + array(utils::index_sequence) const { return {{get()...}}; } - types::array array() const + types::array_tuple array() const { return array(utils::make_index_sequence()); } - operator types::array() const + operator types::array_tuple() const { return array(); } @@ -275,14 +276,14 @@ namespace types struct array_base_slicer { template - dynamic_tuple operator()(array const &b, slice const &s); + dynamic_tuple operator()(array_tuple const &b, slice const &s); template - dynamic_tuple operator()(array const &b, + dynamic_tuple operator()(array_tuple const &b, cstride_slice const &s); template - dynamic_tuple operator()(array const &b, + dynamic_tuple operator()(array_tuple const &b, fast_contiguous_slice const &s); template @@ -404,8 +405,8 @@ namespace types const_reference operator[](long __n) const noexcept; template - auto operator[](S s) const - -> decltype(array_base_slicer{}(*this, (s.lower, s))) + auto operator[](S s) const -> decltype(array_base_slicer{}(*this, + (s.lower, s))) { return array_base_slicer{}(*this, s); } @@ -483,8 +484,8 @@ namespace types using shape_t = typename shape_builder::type; template - auto shape() const - -> decltype(details::extract_shape(*this, utils::int_{})) + auto shape() const -> decltype(details::extract_shape(*this, + utils::int_{})) { return details::extract_shape(*this, utils::int_{}); } @@ -587,7 +588,7 @@ namespace types template struct _make_tuple { - types::array::type, sizeof...(Types)> + types::array_tuple::type, sizeof...(Types)> operator()(Types &&...types) { return {{std::forward(types)...}}; @@ -609,14 +610,14 @@ namespace types using make_tuple_t = decltype(types::make_tuple(std::declval()...)); template - types::array _to_array(Tuple const &t, - utils::index_sequence) + types::array_tuple _to_array(Tuple const &t, + utils::index_sequence) { return {{static_cast(std::get(t))...}}; } template - types::array to_array(std::tuple const &t) + types::array_tuple to_array(std::tuple const &t) { return _to_array(t, utils::make_index_sequence()); } @@ -734,8 +735,9 @@ struct __combined, }; template -struct __combined, pythonic::types::array> { - using type = pythonic::types::array; +struct __combined, + pythonic::types::array_tuple> { + using type = pythonic::types::array_tuple; }; template @@ -833,8 +835,9 @@ struct __combined, static std::tuple::type, t, I == Is>::type...> make_type(pythonic::utils::index_sequence); - static auto make_type() -> decltype(make_type( - pythonic::utils::make_index_sequence())); + static auto + make_type() -> decltype(make_type( + pythonic::utils::make_index_sequence())); using type = decltype(make_type()); }; @@ -844,23 +847,23 @@ struct __combined, std::tuple> }; template -struct __combined, std::tuple> { +struct __combined, std::tuple> { using type = std::tuple::type...>; }; template -struct __combined, +struct __combined, pythonic::types::pshape> { - using type = pythonic::types::array; + using type = pythonic::types::array_tuple; }; template struct __combined, - pythonic::types::array> { - using type = pythonic::types::array; + pythonic::types::array_tuple> { + using type = pythonic::types::array_tuple; }; template -struct __combined, pythonic::types::array> { +struct __combined, pythonic::types::array_tuple> { using type = std::tuple::type...>; }; template @@ -946,7 +949,7 @@ namespace sutils template struct make_shape> { - using type = types::array; + using type = types::array_tuple; }; template @@ -1050,8 +1053,8 @@ namespace sutils template struct transpose; template - struct transpose> { - using type = types::array; + struct transpose> { + using type = types::array_tuple; }; template @@ -1118,7 +1121,7 @@ namespace sutils }; template struct pop_tail> { - using type = types::array; + using type = types::array_tuple; }; template @@ -1130,7 +1133,7 @@ namespace sutils }; template struct pop_head> { - using type = types::array; + using type = types::array_tuple; }; template @@ -1155,7 +1158,8 @@ namespace sutils using head_t = typename head::type; template - types::array array(types::pshape const &pS) + types::array_tuple + array(types::pshape const &pS) { return pS.array(); } @@ -1166,8 +1170,8 @@ namespace sutils return pS; } template - types::array getshape(E const &e, - utils::index_sequence) + types::array_tuple getshape(E const &e, + utils::index_sequence) { return {(long)(e.template shape())...}; } @@ -1192,27 +1196,27 @@ namespace sutils }; template - struct concat, types::array> { + struct concat, types::array_tuple> { using type = types::pshape; }; template - struct concat, types::array> - : concat, types::array> { + struct concat, types::array_tuple> + : concat, types::array_tuple> { }; template - struct concat, types::pshape> { + struct concat, types::pshape> { using type = types::pshape; }; template - struct concat, types::pshape> - : concat, types::pshape> { + struct concat, types::pshape> + : concat, types::pshape> { }; template - struct concat, types::array> { - using type = types::array; + struct concat, types::array_tuple> { + using type = types::array_tuple; }; template @@ -1619,12 +1623,12 @@ struct to_python> { }; template -struct to_python> { +struct to_python> { template - static PyObject *do_convert(types::array const &t, + static PyObject *do_convert(types::array_tuple const &t, utils::index_sequence); - static PyObject *convert(types::array const &t); + static PyObject *convert(types::array_tuple const &t); }; template @@ -1652,14 +1656,14 @@ struct from_python> { }; template -struct from_python> { +struct from_python> { static bool is_convertible(PyObject *obj); template - static types::array do_convert(PyObject *obj, - typename utils::index_sequence); - static types::array convert(PyObject *obj); + static types::array_tuple + do_convert(PyObject *obj, typename utils::index_sequence); + static types::array_tuple convert(PyObject *obj); }; PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/variant_functor.hpp b/pythran/pythonic/include/types/variant_functor.hpp index 2225cb029a..46df29576d 100644 --- a/pythran/pythonic/include/types/variant_functor.hpp +++ b/pythran/pythonic/include/types/variant_functor.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_INCLUDE_TYPES_VARIANT_FUNCTOR_HPP #define PYTHONIC_INCLUDE_TYPES_VARIANT_FUNCTOR_HPP -#include "pythonic/include/utils/meta.hpp" #include "pythonic/include/types/combined.hpp" +#include "pythonic/include/utils/meta.hpp" #include @@ -80,11 +80,11 @@ namespace types void assign(char mem[], variant_functor const &); template - auto operator()(Args &&... args) + auto operator()(Args &&...args) -> decltype(std::declval()(std::forward(args)...)); template - auto operator()(Args &&... args) const + auto operator()(Args &&...args) const -> decltype(std::declval()(std::forward(args)...)); }; @@ -98,7 +98,7 @@ namespace types variant_functor_impl(variant_functor_impl const &) = delete; template - variant_functor_impl(char mem[], OtherTypes const &... t); + variant_functor_impl(char mem[], OtherTypes const &...t); template variant_functor_impl(char mem[], @@ -112,16 +112,20 @@ namespace types void assign(char mem[], OtherType const &); template - auto operator()(Args &&... args) -> typename __combined< - decltype(std::declval()(std::forward(args)...)), - decltype(std::declval()(std::forward(args)...))...>::type; + auto operator()(Args &&...args) -> + typename __combined< + decltype(std::declval()(std::forward(args)...)), + decltype(std::declval()( + std::forward(args)...))...>::type; template - auto operator()(Args &&... args) const -> typename __combined< - decltype(std::declval()(std::forward(args)...)), - decltype(std::declval()(std::forward(args)...))...>::type; + auto operator()(Args &&...args) const -> + typename __combined< + decltype(std::declval()(std::forward(args)...)), + decltype(std::declval()( + std::forward(args)...))...>::type; }; - } + } // namespace details template struct variant_functor : details::variant_functor_impl { @@ -144,11 +148,11 @@ namespace types variant_functor &operator=(variant_functor const &); template - variant_functor(OtherTypes const &... t); + variant_functor(OtherTypes const &...t); template variant_functor(variant_functor const &t); }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/types/vectorizable_type.hpp b/pythran/pythonic/include/types/vectorizable_type.hpp index 4c1ea98788..e8a3f77342 100644 --- a/pythran/pythonic/include/types/vectorizable_type.hpp +++ b/pythran/pythonic/include/types/vectorizable_type.hpp @@ -14,14 +14,14 @@ namespace types }; struct vectorizer { template - static auto vbegin(E &&expr) - -> decltype(std::forward(expr).vbegin(vectorize{})) + static auto + vbegin(E &&expr) -> decltype(std::forward(expr).vbegin(vectorize{})) { return std::forward(expr).vbegin(vectorize{}); } template - static auto vend(E &&expr) - -> decltype(std::forward(expr).vend(vectorize{})) + static auto + vend(E &&expr) -> decltype(std::forward(expr).vend(vectorize{})) { return std::forward(expr).vend(vectorize{}); } @@ -52,7 +52,7 @@ namespace types }; /* trait to check if is T is an array-like type that supports vectorization - */ + */ template ::value> struct is_vectorizable_array; @@ -77,7 +77,7 @@ namespace types template struct numpy_expr; -} +} // namespace types namespace utils { @@ -111,6 +111,6 @@ namespace utils { return true; } -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/array_helper.hpp b/pythran/pythonic/include/utils/array_helper.hpp index 694e117aeb..2a309b2322 100644 --- a/pythran/pythonic/include/utils/array_helper.hpp +++ b/pythran/pythonic/include/utils/array_helper.hpp @@ -13,20 +13,20 @@ PYTHONIC_NS_BEGIN template struct nget { template - auto operator()(A &&self, types::array const &indices) + auto operator()(A &&self, types::array_tuple const &indices) -> decltype(nget()(std::forward(self)[0], indices)); template - auto fast(A &&self, types::array const &indices) + auto fast(A &&self, types::array_tuple const &indices) -> decltype(nget().fast(std::forward(self).fast(0), indices)); }; template <> struct nget<0> { template - auto operator()(A &&self, types::array const &indices) + auto operator()(A &&self, types::array_tuple const &indices) -> decltype(std::forward(self)[indices[M - 1]]); template - auto fast(A &&self, types::array const &indices) + auto fast(A &&self, types::array_tuple const &indices) -> decltype(std::forward(self).fast(indices[M - 1])); }; PYTHONIC_NS_END diff --git a/pythran/pythonic/include/utils/functor.hpp b/pythran/pythonic/include/utils/functor.hpp index 5c40c6b495..260e4d597a 100644 --- a/pythran/pythonic/include/utils/functor.hpp +++ b/pythran/pythonic/include/utils/functor.hpp @@ -11,7 +11,7 @@ struct name { \ using callable = void; \ template \ - auto operator()(Types && ... types) const \ + auto operator()(Types &&...types) const \ -> decltype(f(std::forward(types)...)) \ { \ return f(std::forward(types)...); \ diff --git a/pythran/pythonic/include/utils/fwd.hpp b/pythran/pythonic/include/utils/fwd.hpp index 102d9c27ca..fb3a962005 100644 --- a/pythran/pythonic/include/utils/fwd.hpp +++ b/pythran/pythonic/include/utils/fwd.hpp @@ -7,7 +7,7 @@ namespace utils { template - void fwd(Types const &... types); + void fwd(Types const &...types); } PYTHONIC_NS_END diff --git a/pythran/pythonic/include/utils/int_.hpp b/pythran/pythonic/include/utils/int_.hpp index 7f1d30b4f7..4790c074df 100644 --- a/pythran/pythonic/include/utils/int_.hpp +++ b/pythran/pythonic/include/utils/int_.hpp @@ -8,7 +8,7 @@ namespace utils template struct int_ { }; // compile-time counter -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/iterator.hpp b/pythran/pythonic/include/utils/iterator.hpp index 398ffd03c2..306d96376a 100644 --- a/pythran/pythonic/include/utils/iterator.hpp +++ b/pythran/pythonic/include/utils/iterator.hpp @@ -24,7 +24,7 @@ namespace utils // FIXME : It works only because template arguments are ! references // so it trigger a copy. iterator_reminder() = default; - iterator_reminder(T const &v, Others const &... o); + iterator_reminder(T const &v, Others const &...o); }; template @@ -60,7 +60,7 @@ namespace utils std::forward_iterator_tag>::value, std::forward_iterator_tag, typename iterator_min::type>::type; }; -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/meta.hpp b/pythran/pythonic/include/utils/meta.hpp index e955d21267..f2962595da 100644 --- a/pythran/pythonic/include/utils/meta.hpp +++ b/pythran/pythonic/include/utils/meta.hpp @@ -61,7 +61,7 @@ namespace utils static constexpr size_t value = V0; static constexpr size_t index = 0; }; -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/nested_container.hpp b/pythran/pythonic/include/utils/nested_container.hpp index aaedefa8c4..3f8e8dd14c 100644 --- a/pythran/pythonic/include/utils/nested_container.hpp +++ b/pythran/pythonic/include/utils/nested_container.hpp @@ -1,9 +1,9 @@ #ifndef PYTHONIC_INCLUDE_UTILS_NESTED_CONTAINER_HPP #define PYTHONIC_INCLUDE_UTILS_NESTED_CONTAINER_HPP -#include #include "pythonic/include/types/traits.hpp" #include "pythonic/include/utils/numpy_traits.hpp" +#include PYTHONIC_NS_BEGIN namespace types @@ -16,7 +16,7 @@ namespace types struct array_base; template struct dynamic_tuple; -} +} // namespace types namespace utils { @@ -129,7 +129,7 @@ namespace utils struct nested_container_value_type> { using type = T; }; -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/neutral.hpp b/pythran/pythonic/include/utils/neutral.hpp index 8ddc471013..21eecd2b8d 100644 --- a/pythran/pythonic/include/utils/neutral.hpp +++ b/pythran/pythonic/include/utils/neutral.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/operator_/iadd.hpp" #include "pythonic/include/operator_/iand.hpp" -#include "pythonic/include/operator_/ior.hpp" -#include "pythonic/include/operator_/imul.hpp" #include "pythonic/include/operator_/imax.hpp" #include "pythonic/include/operator_/imin.hpp" +#include "pythonic/include/operator_/imul.hpp" +#include "pythonic/include/operator_/ior.hpp" #include "pythonic/include/operator_/ixor.hpp" PYTHONIC_NS_BEGIN @@ -69,7 +69,7 @@ namespace utils template T const neutral::value = 0; -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/numpy_conversion.hpp b/pythran/pythonic/include/utils/numpy_conversion.hpp index da399d29e5..8fafd52d79 100644 --- a/pythran/pythonic/include/utils/numpy_conversion.hpp +++ b/pythran/pythonic/include/utils/numpy_conversion.hpp @@ -15,8 +15,8 @@ #else #define NUMPY_EXPR_TO_NDARRAY0_DECL(fname) \ template \ - auto fname(E const &expr, Types &&...others) \ - ->typename std::enable_if< \ + auto fname(E const &expr, Types &&...others) -> \ + typename std::enable_if< \ !types::is_ndarray::value && types::is_numexpr_arg::value, \ decltype(fname( \ types::ndarray{expr}, \ diff --git a/pythran/pythonic/include/utils/numpy_traits.hpp b/pythran/pythonic/include/utils/numpy_traits.hpp index 967d385a43..06a10ac799 100644 --- a/pythran/pythonic/include/utils/numpy_traits.hpp +++ b/pythran/pythonic/include/utils/numpy_traits.hpp @@ -172,7 +172,7 @@ namespace types static T get(...); using type = decltype(get(nullptr)); }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/seq.hpp b/pythran/pythonic/include/utils/seq.hpp index 470e9860ad..abb47fe97b 100644 --- a/pythran/pythonic/include/utils/seq.hpp +++ b/pythran/pythonic/include/utils/seq.hpp @@ -27,7 +27,7 @@ namespace utils struct make_integer_sequence { using type = integer_sequence; }; - } + } // namespace details template using make_integer_sequence = @@ -50,7 +50,7 @@ namespace utils struct make_reversed_integer_sequence { using type = integer_sequence; }; - } + } // namespace details template using make_reversed_integer_sequence = @@ -74,14 +74,14 @@ namespace utils struct repeated_type { using type = type_sequence; }; - } + } // namespace details template struct repeated_type : details::repeated_type { }; template using make_repeated_type = typename repeated_type::type; -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/include/utils/tags.hpp b/pythran/pythonic/include/utils/tags.hpp index 00687a6b18..593bfcdbd1 100644 --- a/pythran/pythonic/include/utils/tags.hpp +++ b/pythran/pythonic/include/utils/tags.hpp @@ -12,7 +12,7 @@ namespace purity struct pure_tag { }; -} +} // namespace purity template struct purity_of { diff --git a/pythran/pythonic/io/_io/TextIOWrapper/close.hpp b/pythran/pythonic/io/_io/TextIOWrapper/close.hpp index a6baf27edb..3bd77d7fdf 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/close.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/close.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_CLOSE_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_CLOSE_HPP -#include "pythonic/include/io/_io/TextIOWrapper/close.hpp" #include "pythonic/builtins/file/close.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/close.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp b/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp index 8df4ed963e..e00a67b2da 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp @@ -1,6 +1,6 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_FILENO_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_FILENO_HPP -#include "pythonic/include/io/_io/TextIOWrapper/fileno.hpp" #include "pythonic/builtins/file/fileno.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/fileno.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp b/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp index b082f39d25..3b7676e7ea 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp @@ -1,6 +1,6 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_FLUSH_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_FLUSH_HPP -#include "pythonic/include/io/_io/TextIOWrapper/flush.hpp" #include "pythonic/builtins/file/flush.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/flush.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp b/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp index 10c3faa4f3..9e393a649c 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp @@ -1,6 +1,6 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_ISATTY_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_ISATTY_HPP -#include "pythonic/include/io/_io/TextIOWrapper/isatty.hpp" #include "pythonic/builtins/file/isatty.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/isatty.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/next.hpp b/pythran/pythonic/io/_io/TextIOWrapper/next.hpp index f372876871..80356c8401 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/next.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/next.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_NEXT_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_NEXT_HPP -#include "pythonic/include/io/_io/TextIOWrapper/next.hpp" #include "pythonic/builtins/file/next.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/next.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/read.hpp b/pythran/pythonic/io/_io/TextIOWrapper/read.hpp index b684eb8a56..ed10885418 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/read.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/read.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_READ_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_READ_HPP -#include "pythonic/include/io/_io/TextIOWrapper/read.hpp" #include "pythonic/builtins/file/read.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/read.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp b/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp index 326bec25f8..0b47014dc4 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_READLINE_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_READLINE_HPP -#include "pythonic/include/io/_io/TextIOWrapper/readline.hpp" #include "pythonic/builtins/file/readline.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/readline.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp b/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp index d3aa0b1669..680dab661e 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_READLINES_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_READLINES_HPP -#include "pythonic/include/io/_io/TextIOWrapper/readlines.hpp" #include "pythonic/builtins/file/readlines.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/readlines.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp b/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp index ecc145890b..51b045754e 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_SEEK_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_SEEK_HPP -#include "pythonic/include/io/_io/TextIOWrapper/seek.hpp" #include "pythonic/builtins/file/seek.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/seek.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp b/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp index 616d5c4cd0..15e7c3898b 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_TELL_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_TELL_HPP -#include "pythonic/include/io/_io/TextIOWrapper/tell.hpp" #include "pythonic/builtins/file/tell.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/tell.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp b/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp index 26f1ad6322..d489e96b0b 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_TRUNCATE_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_TRUNCATE_HPP -#include "pythonic/include/io/_io/TextIOWrapper/truncate.hpp" #include "pythonic/builtins/file/truncate.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/truncate.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/write.hpp b/pythran/pythonic/io/_io/TextIOWrapper/write.hpp index 2a229ebcd3..1bd33acfec 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/write.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/write.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_WRITE_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_WRITE_HPP -#include "pythonic/include/io/_io/TextIOWrapper/write.hpp" #include "pythonic/builtins/file/write.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/write.hpp" #endif diff --git a/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp b/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp index f0749fd41a..00fb4dd3bd 100644 --- a/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp +++ b/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_IO__IO_TEXTIOWRAPPER_WRITELINES_HPP #define PYTHONIC_IO__IO_TEXTIOWRAPPER_WRITELINES_HPP -#include "pythonic/include/io/_io/TextIOWrapper/writelines.hpp" #include "pythonic/builtins/file/writelines.hpp" +#include "pythonic/include/io/_io/TextIOWrapper/writelines.hpp" #endif diff --git a/pythran/pythonic/itertools/islice.hpp b/pythran/pythonic/itertools/islice.hpp index f8bda4f878..5220c0f15d 100644 --- a/pythran/pythonic/itertools/islice.hpp +++ b/pythran/pythonic/itertools/islice.hpp @@ -1,10 +1,10 @@ #ifndef PYTHONIC_ITERTOOLS_ISLICE_HPP #define PYTHONIC_ITERTOOLS_ISLICE_HPP +#include "pythonic/builtins/range.hpp" #include "pythonic/include/itertools/islice.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/itertools/common.hpp" -#include "pythonic/builtins/range.hpp" +#include "pythonic/utils/functor.hpp" #include PYTHONIC_NS_BEGIN @@ -50,29 +50,29 @@ namespace itertools } template - bool islice_iterator:: - operator==(islice_iterator const &other) const + bool islice_iterator::operator==( + islice_iterator const &other) const { return (state == other.state); } template - bool islice_iterator:: - operator!=(islice_iterator const &other) const + bool islice_iterator::operator!=( + islice_iterator const &other) const { return state != other.state; } template - bool islice_iterator:: - operator<(islice_iterator const &other) const + bool islice_iterator::operator<( + islice_iterator const &other) const { return state != other.state; } template - int islice_iterator:: - operator-(islice_iterator const &other) const + int islice_iterator::operator-( + islice_iterator const &other) const { return state - other.state; } @@ -122,7 +122,7 @@ namespace itertools { return {iterable, builtins::range(0, stop, 1)}; } -} +} // namespace itertools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/itertools/permutations.hpp b/pythran/pythonic/itertools/permutations.hpp index 2dd2e4feab..cba48890fd 100644 --- a/pythran/pythonic/itertools/permutations.hpp +++ b/pythran/pythonic/itertools/permutations.hpp @@ -37,7 +37,8 @@ namespace itertools return res; } template - types::array init_permut_from(size_t n, types::array *) + types::array_tuple init_permut_from(size_t n, + types::array_tuple *) { assert(N == n && "consistent init"); return {}; @@ -60,9 +61,10 @@ namespace itertools return {begin, end}; } template - types::array init_permut_from(I begin, I end, types::array *) + types::array_tuple init_permut_from(I begin, I end, + types::array_tuple *) { - types::array res; + types::array_tuple res; std::copy(begin, end, res.begin()); return res; } @@ -167,7 +169,7 @@ namespace itertools } template - _permutations> + _permutations> permutations(T iter, std::integral_constant) { return {iter, N}; diff --git a/pythran/pythonic/itertools/product.hpp b/pythran/pythonic/itertools/product.hpp index db31e83c78..7572ed249f 100644 --- a/pythran/pythonic/itertools/product.hpp +++ b/pythran/pythonic/itertools/product.hpp @@ -2,11 +2,11 @@ #define PYTHONIC_ITERTOOLS_PRODUCT_HPP #include "pythonic/include/itertools/product.hpp" -#include "pythonic/utils/int_.hpp" -#include "pythonic/utils/seq.hpp" -#include "pythonic/utils/iterator.hpp" #include "pythonic/itertools/common.hpp" #include "pythonic/utils/functor.hpp" +#include "pythonic/utils/int_.hpp" +#include "pythonic/utils/iterator.hpp" +#include "pythonic/utils/seq.hpp" PYTHONIC_NS_BEGIN @@ -48,7 +48,7 @@ namespace itertools template types::make_tuple_t - product_iterator::operator*() const + product_iterator::operator*() const { return get_value(utils::make_index_sequence{}); } @@ -73,27 +73,27 @@ namespace itertools template product_iterator &product_iterator::operator++() { - advance(utils::int_{}); + advance(utils::int_{}); return *this; } template - bool product_iterator:: - operator==(product_iterator const &other) const + bool product_iterator::operator==( + product_iterator const &other) const { return end == other.end; } template - bool product_iterator:: - operator!=(product_iterator const &other) const + bool product_iterator::operator!=( + product_iterator const &other) const { return end != other.end; } template - bool product_iterator:: - operator<(product_iterator const &other) const + bool product_iterator::operator<( + product_iterator const &other) const { return end != other.end; } @@ -103,7 +103,7 @@ namespace itertools // FIXME: Iterators need to be evaluated as they may be used multiple // times template - product::product(Iters const &... _iters) + product::product(Iters const &..._iters) : utils::iterator_reminder(_iters...), iterator(this->values, utils::make_index_sequence{}), @@ -129,16 +129,16 @@ namespace itertools { return end_iter; } - } + } // namespace details template details::product::type>::type...> - product(Iter &&... iters) + product(Iter &&...iters) { return {std::forward(iters)...}; } -} +} // namespace itertools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/itertools/repeat.hpp b/pythran/pythonic/itertools/repeat.hpp index cbaffb8626..7e9f3ab674 100644 --- a/pythran/pythonic/itertools/repeat.hpp +++ b/pythran/pythonic/itertools/repeat.hpp @@ -2,8 +2,8 @@ #define PYTHONIC_ITERTOOLS_REPEAT_HPP #include "pythonic/include/itertools/repeat.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/list.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -30,20 +30,20 @@ namespace itertools } template - bool repeat_iterator:: - operator!=(repeat_iterator const &other) const + bool repeat_iterator::operator!=( + repeat_iterator const &other) const { return Endless || count_ != other.count_; } template - bool repeat_iterator:: - operator==(repeat_iterator const &other) const + bool repeat_iterator::operator==( + repeat_iterator const &other) const { return !Endless && count_ == other.count_; } template - bool repeat_iterator:: - operator<(repeat_iterator const &other) const + bool repeat_iterator::operator<( + repeat_iterator const &other) const { return !Endless && count_ < other.count_; } @@ -76,7 +76,7 @@ namespace itertools { return {value, -1}; } -} +} // namespace itertools PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/ceil.hpp b/pythran/pythonic/math/ceil.hpp index f39319198d..b29180fadc 100644 --- a/pythran/pythonic/math/ceil.hpp +++ b/pythran/pythonic/math/ceil.hpp @@ -15,7 +15,7 @@ namespace math { return std::ceil(x); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/degrees.hpp b/pythran/pythonic/math/degrees.hpp index b3d43b2a4d..5b79001046 100644 --- a/pythran/pythonic/math/degrees.hpp +++ b/pythran/pythonic/math/degrees.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/math/degrees.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/math/pi.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace math { return (x * 360.) / (2. * pi); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/factorial.hpp b/pythran/pythonic/math/factorial.hpp index 5b7b4d6384..dfb4963e96 100644 --- a/pythran/pythonic/math/factorial.hpp +++ b/pythran/pythonic/math/factorial.hpp @@ -18,7 +18,7 @@ namespace math res *= i; return res; } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/floor.hpp b/pythran/pythonic/math/floor.hpp index f30c2bac63..a7d88a5470 100644 --- a/pythran/pythonic/math/floor.hpp +++ b/pythran/pythonic/math/floor.hpp @@ -15,7 +15,7 @@ namespace math { return std::floor(x); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/frexp.hpp b/pythran/pythonic/math/frexp.hpp index 2a694c703d..36c0424931 100644 --- a/pythran/pythonic/math/frexp.hpp +++ b/pythran/pythonic/math/frexp.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/math/frexp.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/tuple.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -18,7 +18,7 @@ namespace math double sig = std::frexp(x, &exp); return std::tuple(sig, exp); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/gamma.hpp b/pythran/pythonic/math/gamma.hpp index caf5ed5c92..537ef39e76 100644 --- a/pythran/pythonic/math/gamma.hpp +++ b/pythran/pythonic/math/gamma.hpp @@ -14,7 +14,7 @@ namespace math { return std::tgamma(x); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/modf.hpp b/pythran/pythonic/math/modf.hpp index fef342fe01..26c62292c5 100644 --- a/pythran/pythonic/math/modf.hpp +++ b/pythran/pythonic/math/modf.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/math/modf.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/tuple.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -19,7 +19,7 @@ namespace math double frac = std::modf(x, &i); return std::make_tuple(frac, i); } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/radians.hpp b/pythran/pythonic/math/radians.hpp index e45ee692ed..14f81246fc 100644 --- a/pythran/pythonic/math/radians.hpp +++ b/pythran/pythonic/math/radians.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/math/radians.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/math/pi.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace math { return (x * 2. * pi) / 360.; } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/math/trunc.hpp b/pythran/pythonic/math/trunc.hpp index a45a7c7f1f..220ac4d514 100644 --- a/pythran/pythonic/math/trunc.hpp +++ b/pythran/pythonic/math/trunc.hpp @@ -15,7 +15,7 @@ namespace math { return x; } -} +} // namespace math PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/abs.hpp b/pythran/pythonic/numpy/abs.hpp index 3c13b5f5a9..779fee4360 100644 --- a/pythran/pythonic/numpy/abs.hpp +++ b/pythran/pythonic/numpy/abs.hpp @@ -13,7 +13,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME abs #define NUMPY_NARY_FUNC_SYM xsimd::abs #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/add.hpp b/pythran/pythonic/numpy/add.hpp index cfb74a8f3f..1a0352888c 100644 --- a/pythran/pythonic/numpy/add.hpp +++ b/pythran/pythonic/numpy/add.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/add.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/add.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/add.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME add #define NUMPY_NARY_FUNC_SYM pythonic::operator_::add #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/alen.hpp b/pythran/pythonic/numpy/alen.hpp index 0b34f03282..b5ef5ccc75 100644 --- a/pythran/pythonic/numpy/alen.hpp +++ b/pythran/pythonic/numpy/alen.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/alen.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy { return expr.template shape<0>(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/all.hpp b/pythran/pythonic/numpy/all.hpp index 3c4a8c750d..516e0dff9d 100644 --- a/pythran/pythonic/numpy/all.hpp +++ b/pythran/pythonic/numpy/all.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/all.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/multiply.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,9 +15,10 @@ namespace numpy template bool _all(E begin, E end, utils::int_<1>) { - return std::all_of(begin, end, - [](typename std::iterator_traits::value_type e) - -> bool { return e; }); + return std::all_of( + begin, end, [](typename std::iterator_traits::value_type e) -> bool { + return e; + }); } template @@ -67,7 +68,8 @@ namespace numpy template typename std::enable_if< E::value != 1, - types::ndarray>>::type + types::ndarray>>::type all(E const &array, long axis) { constexpr long N = E::value; @@ -75,24 +77,25 @@ namespace numpy if (axis < 0 || axis >= long(N)) throw types::ValueError("axis out of bounds"); if (axis == 0) { - types::array shp; + types::array_tuple shp; sutils::copy_shape<0, 1>(shp, array, utils::make_index_sequence()); - types::ndarray> out(shp, true); + types::ndarray> out(shp, true); return std::accumulate(array.begin(), array.end(), out, functor::multiply()); } else { - types::array shp; + types::array_tuple shp; sutils::copy_shape<0, 0>(shp, array, utils::make_index_sequence()); - types::ndarray> ally(shp, builtins::None); + types::ndarray> ally( + shp, builtins::None); std::transform( array.begin(), array.end(), ally.begin(), - [=](types::ndarray> const &other) { + [=](types::ndarray> const &other) { return all(other, axis - 1); }); return ally; } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/allclose.hpp b/pythran/pythonic/numpy/allclose.hpp index 3a78e441f0..d630a99ba2 100644 --- a/pythran/pythonic/numpy/allclose.hpp +++ b/pythran/pythonic/numpy/allclose.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/allclose.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/abs.hpp" #include "pythonic/numpy/isfinite.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -40,7 +40,7 @@ namespace numpy return false; return true; } - } + } // namespace template bool allclose(U const &u, V const &v, double rtol, double atol) @@ -48,7 +48,7 @@ namespace numpy return _allclose(u.begin(), u.end(), v.begin(), rtol, atol, utils::int_()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/alltrue.hpp b/pythran/pythonic/numpy/alltrue.hpp index 98674c88ef..296f63cb55 100644 --- a/pythran/pythonic/numpy/alltrue.hpp +++ b/pythran/pythonic/numpy/alltrue.hpp @@ -10,12 +10,11 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto alltrue(Types &&... types) - -> decltype(all(std::forward(types)...)) + auto alltrue(Types &&...types) -> decltype(all(std::forward(types)...)) { return all(std::forward(types)...); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/angle.hpp b/pythran/pythonic/numpy/angle.hpp index 78ef2fd7f5..eae62451b8 100644 --- a/pythran/pythonic/numpy/angle.hpp +++ b/pythran/pythonic/numpy/angle.hpp @@ -28,7 +28,7 @@ namespace numpy { return functor::angle_in_rad()(t); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/angle_in_deg.hpp b/pythran/pythonic/numpy/angle_in_deg.hpp index a77eb7e1b9..376a0111d0 100644 --- a/pythran/pythonic/numpy/angle_in_deg.hpp +++ b/pythran/pythonic/numpy/angle_in_deg.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/numpy/angle_in_deg.hpp" #include "pythonic/numpy/angle_in_rad.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/numpy/pi.hpp" +#include "pythonic/utils/numpy_traits.hpp" /* NOTE: angle_in_deg is not part of the official Numpy API, * this file is here only to split the angle function in two parts @@ -19,7 +19,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME angle_in_deg #define NUMPY_NARY_FUNC_SYM wrapper::angle_in_deg #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/angle_in_rad.hpp b/pythran/pythonic/numpy/angle_in_rad.hpp index 7e955d1a9f..5bcbfc39d8 100644 --- a/pythran/pythonic/numpy/angle_in_rad.hpp +++ b/pythran/pythonic/numpy/angle_in_rad.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/angle_in_rad.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/numpy/arctan.hpp" #include "pythonic/numpy/pi.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_traits.hpp" /* NOTE: angle_in_rad is not part of the official Numpy API, * this file is here only to split the angle function in two parts @@ -20,17 +20,17 @@ namespace numpy namespace wrapper { template - auto angle_in_rad(T const &t) - -> decltype(std::atan2(std::imag(t), std::real(t))) + auto angle_in_rad(T const &t) -> decltype(std::atan2(std::imag(t), + std::real(t))) { return std::atan2(std::imag(t), std::real(t)); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME angle_in_rad #define NUMPY_NARY_FUNC_SYM wrapper::angle_in_rad #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/any.hpp b/pythran/pythonic/numpy/any.hpp index 9f15c2d961..a234db5b37 100644 --- a/pythran/pythonic/numpy/any.hpp +++ b/pythran/pythonic/numpy/any.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/any.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/add.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -67,7 +67,8 @@ namespace numpy template typename std::enable_if< E::value != 1, - types::ndarray>>::type + types::ndarray>>::type any(E const &array, long axis) { constexpr long N = E::value; @@ -75,25 +76,26 @@ namespace numpy if (axis < 0 || axis >= long(N)) throw types::ValueError("axis out of bounds"); if (axis == 0) { - types::array shp; + types::array_tuple shp; shp[0] = 1; sutils::copy_shape<1, 0>(shp, array, utils::make_index_sequence()); - types::ndarray> out(shp, false); + types::ndarray> out(shp, false); return std::accumulate(array.begin(), array.end(), *out.begin(), numpy::functor::add()); } else { - types::array shp; + types::array_tuple shp; sutils::copy_shape<0, 0>(shp, array, utils::make_index_sequence()); - types::ndarray> anyy(shp, builtins::None); + types::ndarray> anyy( + shp, builtins::None); std::transform( array.begin(), array.end(), anyy.begin(), - [=](types::ndarray> const &other) { + [=](types::ndarray> const &other) { return any(other, axis - 1); }); return anyy; } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/append.hpp b/pythran/pythonic/numpy/append.hpp index c2d4590a72..82779af552 100644 --- a/pythran/pythonic/numpy/append.hpp +++ b/pythran/pythonic/numpy/append.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/append.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -24,7 +24,7 @@ namespace numpy types::ndarray< typename __combined::type>::type, types::pshape> - out(types::pshape(nsize), builtins::None); + out(types::pshape(nsize), builtins::None); auto out_back = std::copy(nto.fbegin(), nto.fend(), out.fbegin()); std::copy(ndata.fbegin(), ndata.fend(), out_back); return out; @@ -41,7 +41,7 @@ namespace numpy types::ndarray< typename __combined::type>::type, types::pshape> - out(types::pshape(nsize), builtins::None); + out(types::pshape(nsize), builtins::None); auto out_back = std::copy(nto.fbegin(), nto.fend(), out.fbegin()); *out_back = data; return out; @@ -55,7 +55,7 @@ namespace numpy { return append(numpy::functor::asarray{}(to), data); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arange.hpp b/pythran/pythonic/numpy/arange.hpp index 14e1d0ad44..a483e1dba3 100644 --- a/pythran/pythonic/numpy/arange.hpp +++ b/pythran/pythonic/numpy/arange.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/numpy/arange.hpp" #include "pythonic/operator_/pos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -32,7 +32,7 @@ namespace numpy { return arange>(T(0), end); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arccos.hpp b/pythran/pythonic/numpy/arccos.hpp index a1d827daa5..f323c65a26 100644 --- a/pythran/pythonic/numpy/arccos.hpp +++ b/pythran/pythonic/numpy/arccos.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arccos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arccos #define NUMPY_NARY_FUNC_SYM xsimd::acos #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/numpy/arccosh.hpp b/pythran/pythonic/numpy/arccosh.hpp index b915e8bbb5..d0e7bd18c9 100644 --- a/pythran/pythonic/numpy/arccosh.hpp +++ b/pythran/pythonic/numpy/arccosh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arccosh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arccosh #define NUMPY_NARY_FUNC_SYM xsimd::acosh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arcsin.hpp b/pythran/pythonic/numpy/arcsin.hpp index cbec9c2386..5a8d57bfd9 100644 --- a/pythran/pythonic/numpy/arcsin.hpp +++ b/pythran/pythonic/numpy/arcsin.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arcsin.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arcsin #define NUMPY_NARY_FUNC_SYM xsimd::asin #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arcsinh.hpp b/pythran/pythonic/numpy/arcsinh.hpp index 96edf5d252..d5d4313089 100644 --- a/pythran/pythonic/numpy/arcsinh.hpp +++ b/pythran/pythonic/numpy/arcsinh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arcsinh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arcsinh #define NUMPY_NARY_FUNC_SYM xsimd::asinh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arctan.hpp b/pythran/pythonic/numpy/arctan.hpp index c7239fcf46..e7e5080859 100644 --- a/pythran/pythonic/numpy/arctan.hpp +++ b/pythran/pythonic/numpy/arctan.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arctan.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" #include @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctan #define NUMPY_NARY_FUNC_SYM xsimd::atan #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arctan2.hpp b/pythran/pythonic/numpy/arctan2.hpp index 1c79695feb..40302bf911 100644 --- a/pythran/pythonic/numpy/arctan2.hpp +++ b/pythran/pythonic/numpy/arctan2.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/arctan2.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctan2 #define NUMPY_NARY_FUNC_SYM xsimd::atan2 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/arctanh.hpp b/pythran/pythonic/numpy/arctanh.hpp index 0b9d267dca..50a5716a6b 100644 --- a/pythran/pythonic/numpy/arctanh.hpp +++ b/pythran/pythonic/numpy/arctanh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/arctanh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME arctanh #define NUMPY_NARY_FUNC_SYM xsimd::atanh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/argmax.hpp b/pythran/pythonic/numpy/argmax.hpp index a2887c1630..4be4ce6044 100644 --- a/pythran/pythonic/numpy/argmax.hpp +++ b/pythran/pythonic/numpy/argmax.hpp @@ -36,8 +36,8 @@ namespace numpy } template - types::ndarray> argmax(E const &expr, - long axis) + types::ndarray> + argmax(E const &expr, long axis) { return argminmax>(expr, axis); } diff --git a/pythran/pythonic/numpy/argmin.hpp b/pythran/pythonic/numpy/argmin.hpp index 35652a89f2..e146da20d8 100644 --- a/pythran/pythonic/numpy/argmin.hpp +++ b/pythran/pythonic/numpy/argmin.hpp @@ -37,8 +37,8 @@ namespace numpy } template - types::ndarray> argmin(E const &expr, - long axis) + types::ndarray> + argmin(E const &expr, long axis) { return argminmax>(expr, axis); } diff --git a/pythran/pythonic/numpy/argminmax.hpp b/pythran/pythonic/numpy/argminmax.hpp index c1286d6348..11aca63b3a 100644 --- a/pythran/pythonic/numpy/argminmax.hpp +++ b/pythran/pythonic/numpy/argminmax.hpp @@ -225,7 +225,7 @@ namespace numpy _argminmax_head(T &&out, E const &expr, std::integral_constant) { static_assert(N > 1, "specialization ok"); - types::ndarray> val{ + types::ndarray> val{ sutils::getshape(out), Op::limit()}; long i = 0; for (auto &&elt : expr) { @@ -258,7 +258,7 @@ namespace numpy } template - types::ndarray> + types::ndarray> argminmax(E const &array, long axis) { if (axis < 0) @@ -266,11 +266,11 @@ namespace numpy if (axis < 0 || size_t(axis) >= E::value) throw types::ValueError("axis out of bounds"); auto shape = sutils::getshape(array); - types::array shp; + types::array_tuple shp; auto next = std::copy(shape.begin(), shape.begin() + axis, shp.begin()); std::copy(shape.begin() + axis + 1, shape.end(), next); - types::ndarray> out{shp, - builtins::None}; + types::ndarray> out{ + shp, builtins::None}; _argminmax_pick_axis(axis, out, array, utils::make_index_sequence()); return out; diff --git a/pythran/pythonic/numpy/argsort.hpp b/pythran/pythonic/numpy/argsort.hpp index 8ed208e9ac..68bf4b76fb 100644 --- a/pythran/pythonic/numpy/argsort.hpp +++ b/pythran/pythonic/numpy/argsort.hpp @@ -9,15 +9,16 @@ PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> argsort(E const &expr, - types::none_type, types::none_type) + types::ndarray> + argsort(E const &expr, types::none_type, types::none_type) { auto out = functor::array{}(expr).flat(); return argsort(out); } template - types::ndarray _argsort(types::ndarray const &a, long axis, Sorter sorter) + types::ndarray _argsort(types::ndarray const &a, long axis, + Sorter sorter) { constexpr auto N = std::tuple_size::value; if (axis < 0) @@ -36,7 +37,7 @@ namespace numpy std::iota(iter_indices, iter_indices + step, 0L); // sort the index using the value from a sorter(iter_indices, iter_indices + step, - [a_base](long i1, long i2) { return a_base[i1] < a_base[i2]; }); + [a_base](long i1, long i2) { return a_base[i1] < a_base[i2]; }); } } else { auto out_shape = sutils::getshape(a); @@ -54,9 +55,9 @@ namespace numpy for (long i = 0; i < n; i++) { auto a_base = a.fbegin() + ith; sorter(buffer, buffer + buffer_size, - [a_base, stepper](long i1, long i2) { - return a_base[i1 * stepper] < a_base[i2 * stepper]; - }); + [a_base, stepper](long i1, long i2) { + return a_base[i1 * stepper] < a_base[i2 * stepper]; + }); for (long j = 0; j < buffer_size; ++j) indices.buffer[ith + j * stepper] = buffer[j]; @@ -72,20 +73,23 @@ namespace numpy } template - types::ndarray argsort(types::ndarray const &a, long axis, types::none_type) { + types::ndarray argsort(types::ndarray const &a, long axis, + types::none_type) + { return _argsort(a, axis, ndarray::quicksorter()); } template - types::ndarray argsort(types::ndarray const &a, long axis, types::str const& kind) + types::ndarray argsort(types::ndarray const &a, long axis, + types::str const &kind) { - if (kind == "mergesort") - return _argsort(a, axis, ndarray::mergesorter()); - else if (kind == "heapsort") - return _argsort(a, axis, ndarray::heapsorter()); - else if (kind == "stable") - return _argsort(a, axis, ndarray::stablesorter()); - return _argsort(a, axis, ndarray::quicksorter()); + if (kind == "mergesort") + return _argsort(a, axis, ndarray::mergesorter()); + else if (kind == "heapsort") + return _argsort(a, axis, ndarray::heapsorter()); + else if (kind == "stable") + return _argsort(a, axis, ndarray::stablesorter()); + return _argsort(a, axis, ndarray::quicksorter()); } NUMPY_EXPR_TO_NDARRAY0_IMPL(argsort); diff --git a/pythran/pythonic/numpy/argwhere.hpp b/pythran/pythonic/numpy/argwhere.hpp index 30186da5d3..0a366decfb 100644 --- a/pythran/pythonic/numpy/argwhere.hpp +++ b/pythran/pythonic/numpy/argwhere.hpp @@ -3,16 +3,17 @@ #include "pythonic/include/numpy/argwhere.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - typename types::ndarray> argwhere(E const &expr) + typename types::ndarray> + argwhere(E const &expr) { constexpr long N = E::value; auto arr = asarray(expr); @@ -37,10 +38,10 @@ namespace numpy buffer_iter += N; } } - types::array shape = {real_sz, N}; + types::array_tuple shape = {real_sz, N}; return {buffer, shape}; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/around.hpp b/pythran/pythonic/numpy/around.hpp index 1b467e523b..920e53e92a 100644 --- a/pythran/pythonic/numpy/around.hpp +++ b/pythran/pythonic/numpy/around.hpp @@ -3,12 +3,12 @@ #include "pythonic/include/numpy/around.hpp" -#include "pythonic/numpy/rint.hpp" -#include "pythonic/numpy/power.hpp" #include "pythonic/numpy/asarray.hpp" -#include "pythonic/numpy/floor_divide.hpp" #include "pythonic/numpy/float64.hpp" +#include "pythonic/numpy/floor_divide.hpp" #include "pythonic/numpy/multiply.hpp" +#include "pythonic/numpy/power.hpp" +#include "pythonic/numpy/rint.hpp" PYTHONIC_NS_BEGIN @@ -23,15 +23,16 @@ namespace numpy // generic floating point version, pure numpy_expr template - auto around(E &&a, long decimals) -> typename std::enable_if< - !std::is_integral< - typename types::dtype_of::type>::type>::value, - decltype(functor::rint{}(functor::multiply{}( - std::forward(a), + auto around(E &&a, long decimals) -> + typename std::enable_if< + !std::is_integral::type>::type>::value, + decltype(functor::rint{}(functor::multiply{}( + std::forward(a), + std::declval::type>::type>())) / std::declval::type>::type>())) / - std::declval::type>::type>())>::type + typename std::decay::type>::type>())>::type { typename types::dtype_of::type>::type const fact = functor::power{}(10., decimals); @@ -41,15 +42,16 @@ namespace numpy // the integer version is only relevant when decimals < 0 template - auto around(E &&a, long decimals) -> typename std::enable_if< - std::is_integral< - typename types::dtype_of::type>::type>::value, - decltype(numpy::functor::floor_divide{}( - functor::float64{}(std::forward(a)), + auto around(E &&a, long decimals) -> + typename std::enable_if< + std::is_integral::type>::type>::value, + decltype(numpy::functor::floor_divide{}( + functor::float64{}(std::forward(a)), + std::declval::type>::type>()) * std::declval::type>::type>()) * - std::declval::type>::type>())>::type + typename std::decay::type>::type>())>::type { typename types::dtype_of::type>::type const fact = functor::power{}(10L, std::max(0L, -decimals)); @@ -57,7 +59,7 @@ namespace numpy functor::float64{}(std::forward(a)), fact) * fact; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/array.hpp b/pythran/pythonic/numpy/array.hpp index 284dbba8b4..2feaf5cd70 100644 --- a/pythran/pythonic/numpy/array.hpp +++ b/pythran/pythonic/numpy/array.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/array.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/nested_container.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -15,8 +15,9 @@ namespace numpy typename std::enable_if< types::has_size::type>::value, types::ndarray::type::value>>>::type - array(T &&iterable, dtype d) + types::array_tuple::type::value>>>:: + type + array(T &&iterable, dtype d) { return {std::forward(iterable)}; } @@ -25,8 +26,9 @@ namespace numpy !types::has_size::type>::value && !types::is_dtype::type>::value, types::ndarray::type::value>>>::type - array(T &&iterable, dtype d) + types::array_tuple::type::value>>>:: + type + array(T &&iterable, dtype d) { types::list::type::value_type> tmp{iterable.begin(), iterable.end()}; @@ -46,7 +48,7 @@ namespace numpy template types::ndarray>> - array(std::tuple<>, dtype) + array(std::tuple<>, dtype) { return {types::pshape>{}, types::none_type{}}; @@ -73,7 +75,7 @@ namespace numpy { return {std::move(a)}; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/array2string.hpp b/pythran/pythonic/numpy/array2string.hpp index d27984a8a1..d4c8cdbc7b 100644 --- a/pythran/pythonic/numpy/array2string.hpp +++ b/pythran/pythonic/numpy/array2string.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/array2string.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy oss << std::forward(a); return oss.str(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/array_equal.hpp b/pythran/pythonic/numpy/array_equal.hpp index 606444c675..962450002b 100644 --- a/pythran/pythonic/numpy/array_equal.hpp +++ b/pythran/pythonic/numpy/array_equal.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/array_equal.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/all.hpp" #include "pythonic/numpy/equal.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,7 +19,7 @@ namespace numpy return all(functor::equal{}(u, v)); return false; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/array_equiv.hpp b/pythran/pythonic/numpy/array_equiv.hpp index aa576deb69..77b45bae84 100644 --- a/pythran/pythonic/numpy/array_equiv.hpp +++ b/pythran/pythonic/numpy/array_equiv.hpp @@ -20,7 +20,7 @@ namespace numpy return false; return true; } - } + } // namespace template typename std::enable_if::type @@ -45,7 +45,7 @@ namespace numpy { return array_equiv(v, u); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/asarray.hpp b/pythran/pythonic/numpy/asarray.hpp index ceb8d68df0..a1e19f7121 100644 --- a/pythran/pythonic/numpy/asarray.hpp +++ b/pythran/pythonic/numpy/asarray.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/asarray.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/array.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy template template - auto _asarray::operator()(Types &&... args) + auto _asarray::operator()(Types &&...args) -> decltype(array(std::forward(args)...)) { return array(std::forward(args)...); @@ -28,9 +28,10 @@ namespace numpy } template - auto asarray(E &&e, types::none_type d) -> decltype( - _asarray::type, - typename types::dtype_of::type>::type>{}( + auto asarray(E &&e, types::none_type d) + -> decltype(_asarray::type, + typename types::dtype_of< + typename std::decay::type>::type>{}( std::forward(e))) { return _asarray< @@ -47,7 +48,7 @@ namespace numpy return _asarray::type, typename dtype::type>{}( std::forward(e), d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/asarray_chkfinite.hpp b/pythran/pythonic/numpy/asarray_chkfinite.hpp index 78df26bcf5..3454a7d9d8 100644 --- a/pythran/pythonic/numpy/asarray_chkfinite.hpp +++ b/pythran/pythonic/numpy/asarray_chkfinite.hpp @@ -4,9 +4,9 @@ #include "pythonic/include/numpy/asarray_chkfinite.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/numpy/isfinite.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/numpy/isfinite.hpp" PYTHONIC_NS_BEGIN @@ -22,12 +22,12 @@ namespace numpy throw types::ValueError("array must ! contain infs || NaNs"); return a; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME asarray_chkfinite #define NUMPY_NARY_FUNC_SYM wrapper::asarray_chkfinite #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/asfarray.hpp b/pythran/pythonic/numpy/asfarray.hpp index 4b1629c35a..6ca0bae10b 100644 --- a/pythran/pythonic/numpy/asfarray.hpp +++ b/pythran/pythonic/numpy/asfarray.hpp @@ -15,7 +15,7 @@ namespace numpy "expected a floating point type"); return asarray(std::forward(e), d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/asscalar.hpp b/pythran/pythonic/numpy/asscalar.hpp index 06631f0d62..23213ad439 100644 --- a/pythran/pythonic/numpy/asscalar.hpp +++ b/pythran/pythonic/numpy/asscalar.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/asscalar.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/numpy/asarray.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -20,7 +20,7 @@ namespace numpy "can only convert an array of size 1 to a Python scalar"); return *asarray(expr).fbegin(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/atleast_1d.hpp b/pythran/pythonic/numpy/atleast_1d.hpp index a154d9f7a8..f5d5c6c767 100644 --- a/pythran/pythonic/numpy/atleast_1d.hpp +++ b/pythran/pythonic/numpy/atleast_1d.hpp @@ -25,7 +25,7 @@ namespace numpy { return asarray(t); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/atleast_2d.hpp b/pythran/pythonic/numpy/atleast_2d.hpp index 6ff35ab3f4..e26f8abde9 100644 --- a/pythran/pythonic/numpy/atleast_2d.hpp +++ b/pythran/pythonic/numpy/atleast_2d.hpp @@ -22,30 +22,32 @@ namespace numpy } template - auto atleast_2d(T const &t) -> - typename std::enable_if < (!types::is_dtype::value) && - T::value<2, types::ndarray< - typename T::dtype, - types::pshape, - typename std::tuple_element< - 0, typename T::shape_t>::type>>>::type + auto atleast_2d(T const &t) -> + typename std::enable_if < (!types::is_dtype::value) && + T::value<2, + types::ndarray< + typename T::dtype, + types::pshape, + typename std::tuple_element< + 0, typename T::shape_t>::type>>>::type { return t.reshape(types::pshape< - std::integral_constant, - typename std::tuple_element<0, typename T::shape_t>::type>( + std::integral_constant, + typename std::tuple_element<0, typename T::shape_t>::type>( std::integral_constant(), t.template shape<0>())); } template - auto atleast_2d(T &&t) -> typename std::enable_if< - (!types::is_dtype::type>::type>::value) && - std::decay::type::value >= 2, - decltype(std::forward(t))>::type + auto atleast_2d(T &&t) -> + typename std::enable_if< + (!types::is_dtype::type>::type>::value) && + std::decay::type::value >= 2, + decltype(std::forward(t))>::type { return std::forward(t); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/atleast_3d.hpp b/pythran/pythonic/numpy/atleast_3d.hpp index 1ce01bf89b..3bf8a3fbe4 100644 --- a/pythran/pythonic/numpy/atleast_3d.hpp +++ b/pythran/pythonic/numpy/atleast_3d.hpp @@ -24,13 +24,14 @@ namespace numpy } template - auto atleast_3d(T const &t) -> typename std::enable_if< - (!types::is_dtype::value) && (T::value == 1), - types::ndarray, - typename std::tuple_element< - 0, typename T::shape_t>::type, - std::integral_constant>>>::type + auto atleast_3d(T const &t) -> + typename std::enable_if< + (!types::is_dtype::value) && (T::value == 1), + types::ndarray, + typename std::tuple_element< + 0, typename T::shape_t>::type, + std::integral_constant>>>::type { auto r = asarray(t); return r.reshape( @@ -42,14 +43,15 @@ namespace numpy } template - auto atleast_3d(T const &t) -> typename std::enable_if< - (!types::is_dtype::value) && (T::value == 2), - types::ndarray< - typename T::dtype, - types::pshape< - typename std::tuple_element<0, typename T::shape_t>::type, - typename std::tuple_element<1, typename T::shape_t>::type, - std::integral_constant>>>::type + auto atleast_3d(T const &t) -> + typename std::enable_if< + (!types::is_dtype::value) && (T::value == 2), + types::ndarray< + typename T::dtype, + types::pshape< + typename std::tuple_element<0, typename T::shape_t>::type, + typename std::tuple_element<1, typename T::shape_t>::type, + std::integral_constant>>>::type { auto r = asarray(t); return r.reshape( @@ -67,7 +69,7 @@ namespace numpy { return asarray(t); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/average.hpp b/pythran/pythonic/numpy/average.hpp index ff01b3a233..3be4975aa7 100644 --- a/pythran/pythonic/numpy/average.hpp +++ b/pythran/pythonic/numpy/average.hpp @@ -11,8 +11,8 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto average(E const &expr, types::none_type const &axis) - -> decltype(sum(expr, axis) / 1.) + auto average(E const &expr, + types::none_type const &axis) -> decltype(sum(expr, axis) / 1.) { return sum(expr, axis) / double(expr.flat_size()); } @@ -26,13 +26,13 @@ namespace numpy template auto average(E const &expr, types::none_type const &axis, W const &weights) - -> decltype(average(expr *asarray(weights) / average(asarray(weights)))) + -> decltype(average(expr * asarray(weights) / average(asarray(weights)))) { auto aweights = asarray(weights); auto weighted_expr = expr * aweights / average(aweights); return average(weighted_expr); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/base_repr.hpp b/pythran/pythonic/numpy/base_repr.hpp index a8e5fc6436..5c83c69b31 100644 --- a/pythran/pythonic/numpy/base_repr.hpp +++ b/pythran/pythonic/numpy/base_repr.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/base_repr.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -46,7 +46,7 @@ namespace numpy return res; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/bincount.hpp b/pythran/pythonic/numpy/bincount.hpp index 2402d0c096..0805a71ce0 100644 --- a/pythran/pythonic/numpy/bincount.hpp +++ b/pythran/pythonic/numpy/bincount.hpp @@ -42,10 +42,9 @@ namespace numpy length = std::max(length, 1 + max(expr)); typename std::enable_if< std::tuple_size::value == 1, - types::ndarray() * - std::declval()), - types::pshape>>::type - out(types::pshape(length), 0L); + types::ndarray< + decltype(std::declval() * std::declval()), + types::pshape>>::type out(types::pshape(length), 0L); auto iweight = weights.begin(); for (auto iter = expr.fbegin(), end = expr.fend(); iter != end; ++iter, ++iweight) @@ -54,7 +53,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(bincount); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/bitwise_and.hpp b/pythran/pythonic/numpy/bitwise_and.hpp index 51df6420e2..a692ccdc70 100644 --- a/pythran/pythonic/numpy/bitwise_and.hpp +++ b/pythran/pythonic/numpy/bitwise_and.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/bitwise_and.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/and_.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/and_.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_and #define NUMPY_NARY_FUNC_SYM pythonic::operator_::and_ #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/bitwise_or.hpp b/pythran/pythonic/numpy/bitwise_or.hpp index 17905110c2..0c737b9808 100644 --- a/pythran/pythonic/numpy/bitwise_or.hpp +++ b/pythran/pythonic/numpy/bitwise_or.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/bitwise_or.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/operator_/or_.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_or #define NUMPY_NARY_FUNC_SYM pythonic::operator_::or_ #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/bitwise_xor.hpp b/pythran/pythonic/numpy/bitwise_xor.hpp index ee95e63557..622990436a 100644 --- a/pythran/pythonic/numpy/bitwise_xor.hpp +++ b/pythran/pythonic/numpy/bitwise_xor.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/bitwise_xor.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/xor_.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/xor_.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME bitwise_xor #define NUMPY_NARY_FUNC_SYM pythonic::operator_::xor_ #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/broadcast_to.hpp b/pythran/pythonic/numpy/broadcast_to.hpp index 930b1e0e94..8498a767e5 100644 --- a/pythran/pythonic/numpy/broadcast_to.hpp +++ b/pythran/pythonic/numpy/broadcast_to.hpp @@ -2,9 +2,9 @@ #define PYTHONIC_NUMPY_BROADCAST_TO_HPP #include "pythonic/include/numpy/broadcast_to.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/empty.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -29,7 +29,7 @@ namespace numpy out, bexpr); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cbrt.hpp b/pythran/pythonic/numpy/cbrt.hpp index c8208e84c1..fc4e0b81da 100644 --- a/pythran/pythonic/numpy/cbrt.hpp +++ b/pythran/pythonic/numpy/cbrt.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/cbrt.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cbrt #define NUMPY_NARY_FUNC_SYM xsimd::cbrt #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ceil.hpp b/pythran/pythonic/numpy/ceil.hpp index b157d35803..557e054088 100644 --- a/pythran/pythonic/numpy/ceil.hpp +++ b/pythran/pythonic/numpy/ceil.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/ceil.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME ceil #define NUMPY_NARY_FUNC_SYM xsimd::ceil #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/clip.hpp b/pythran/pythonic/numpy/clip.hpp index 6a5efe4a97..94b59b3837 100644 --- a/pythran/pythonic/numpy/clip.hpp +++ b/pythran/pythonic/numpy/clip.hpp @@ -36,12 +36,12 @@ namespace numpy else return v; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME clip #define NUMPY_NARY_FUNC_SYM wrapper::clip #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/concatenate.hpp b/pythran/pythonic/numpy/concatenate.hpp index 9efd5cce07..9d49c83ba5 100644 --- a/pythran/pythonic/numpy/concatenate.hpp +++ b/pythran/pythonic/numpy/concatenate.hpp @@ -63,11 +63,12 @@ namespace numpy std::get(from).end(), out_iter), 1)...}; } else { - types::array + types::array_tuple ifroms = {std::get(from).begin()...}; for (auto &&iout : out) { - types::array< + types::array_tuple< typename std::iterator_traits< typename A::value_type::const_iterator>::value_type, sizeof...(I)> @@ -134,11 +135,11 @@ namespace numpy } // namespace details template - auto - concatenate(std::tuple const &args, long axis) -> types::ndarray< - typename __combined::type::dtype...>::type, - types::array>::type::value>> + auto concatenate(std::tuple const &args, long axis) + -> types::ndarray< + typename __combined::type::dtype...>::type, + types::array_tuple< + long, std::tuple_element<0, std::tuple>::type::value>> { using T = typename __combined::type::dtype...>::type; @@ -149,8 +150,8 @@ namespace numpy types::ndarray< typename __combined::type::dtype...>::type, - types::array(args))>::type::value>> + types::array_tuple< + long, std::decay(args))>::type::value>> result{shape, types::none_type{}}; details::concatenate_helper()( result, args, axis, utils::make_index_sequence{}); @@ -158,7 +159,7 @@ namespace numpy } template - types::ndarray> + types::ndarray> concatenate(types::array_base const &args, long axis) { using T = typename E::dtype; @@ -166,7 +167,7 @@ namespace numpy auto shape = sutils::getshape(std::get<0>(args)); shape[axis] = details::concatenate_axis_size( args, axis, utils::make_index_sequence{}); - types::ndarray> out( + types::ndarray> out( shape, types::none_type{}); details::concatenate_helper()(out, args, axis, utils::make_index_sequence{}); @@ -174,11 +175,11 @@ namespace numpy } template - types::ndarray> + types::ndarray> concatenate(types::list const &ai, long axis) { using return_type = - types::ndarray>; + types::ndarray>; using T = typename return_type::dtype; auto constexpr N = return_type::value; auto shape = sutils::getshape(ai[0]); diff --git a/pythran/pythonic/numpy/conjugate.hpp b/pythran/pythonic/numpy/conjugate.hpp index 0aa3804879..dd7fbe7a49 100644 --- a/pythran/pythonic/numpy/conjugate.hpp +++ b/pythran/pythonic/numpy/conjugate.hpp @@ -13,7 +13,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME conjugate #define NUMPY_NARY_FUNC_SYM wrapper::conjugate #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/convolve.hpp b/pythran/pythonic/numpy/convolve.hpp index 49ef2bd28e..d078d06702 100644 --- a/pythran/pythonic/numpy/convolve.hpp +++ b/pythran/pythonic/numpy/convolve.hpp @@ -2,9 +2,9 @@ #define PYTHONIC_NUMPY_CONVOLVE_HPP #include "pythonic/include/numpy/convolve.hpp" +#include "pythonic/numpy/conjugate.hpp" #include "pythonic/numpy/correlate.hpp" #include "pythonic/numpy/flip.hpp" -#include "pythonic/numpy/conjugate.hpp" #include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -31,7 +31,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(convolve) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/copy.hpp b/pythran/pythonic/numpy/copy.hpp index 0366015030..0b29116d81 100644 --- a/pythran/pythonic/numpy/copy.hpp +++ b/pythran/pythonic/numpy/copy.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/copy.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,8 @@ namespace numpy template typename std::enable_if< !types::is_array::value && !types::is_dtype::value, - types::ndarray>>::type + types::ndarray>>::type copy(E const &v) { return {v}; @@ -52,7 +53,7 @@ namespace numpy { return a.arg.copy(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/copysign.hpp b/pythran/pythonic/numpy/copysign.hpp index 35c44dafe0..6107ac20d7 100644 --- a/pythran/pythonic/numpy/copysign.hpp +++ b/pythran/pythonic/numpy/copysign.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/copysign.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME copysign #define NUMPY_NARY_FUNC_SYM xsimd::copysign #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/copyto.hpp b/pythran/pythonic/numpy/copyto.hpp index 1a455451a0..26fcbe3d50 100644 --- a/pythran/pythonic/numpy/copyto.hpp +++ b/pythran/pythonic/numpy/copyto.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_NUMPY_COPYTO_HPP #define PYTHONIC_NUMPY_COPYTO_HPP -#include "pythonic/include/numpy/copyto.hpp" #include "pythonic//numpy/asarray.hpp" +#include "pythonic/include/numpy/copyto.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -16,18 +16,21 @@ namespace numpy using out_type = types::ndarray; if (may_overlap(out, expr)) { auto aexpr = asarray(expr); - utils::broadcast_copy < out_type &, decltype(aexpr), out_type::value, - (int)out_type::value - (int)utils::dim_of::value, - out_type::is_vectorizable && - std::is_same::type>::value && - types::is_vectorizable::value > (out, aexpr); - } - else { - utils::broadcast_copy < out_type &, E, out_type::value, - (int)out_type::value - (int)utils::dim_of::value, - out_type::is_vectorizable && - std::is_same::type>::value && - types::is_vectorizable::value > (out, expr); + utils::broadcast_copy< + out_type &, decltype(aexpr), out_type::value, + (int)out_type::value - (int)utils::dim_of::value, + out_type::is_vectorizable && + std::is_same::type>::value && + types::is_vectorizable::value>(out, aexpr); + } else { + utils::broadcast_copy< + out_type &, E, out_type::value, + (int)out_type::value - (int)utils::dim_of::value, + out_type::is_vectorizable && + std::is_same::type>::value && + types::is_vectorizable::value>(out, expr); } return {}; } @@ -39,33 +42,38 @@ namespace numpy } template - types::none_type copyto(types::numpy_texpr> &out, E const &expr) + types::none_type copyto(types::numpy_texpr> &out, + E const &expr) { using out_type = types::numpy_texpr>; if (may_overlap(out, expr)) { auto aexpr = asarray(expr); - utils::broadcast_copy < out_type &, decltype(aexpr), out_type::value, - (int)out_type::value - (int)utils::dim_of::value, - out_type::is_vectorizable && - std::is_same::type>::value && - types::is_vectorizable::value > (out, aexpr); - } - else { - utils::broadcast_copy < out_type &, E, out_type::value, - (int)out_type::value - (int)utils::dim_of::value, - out_type::is_vectorizable && - std::is_same::type>::value && - types::is_vectorizable::value > (out, expr); + utils::broadcast_copy< + out_type &, decltype(aexpr), out_type::value, + (int)out_type::value - (int)utils::dim_of::value, + out_type::is_vectorizable && + std::is_same::type>::value && + types::is_vectorizable::value>(out, aexpr); + } else { + utils::broadcast_copy< + out_type &, E, out_type::value, + (int)out_type::value - (int)utils::dim_of::value, + out_type::is_vectorizable && + std::is_same::type>::value && + types::is_vectorizable::value>(out, expr); } return {}; } template - types::none_type copyto(types::numpy_texpr> &&out, E const &expr) + types::none_type copyto(types::numpy_texpr> &&out, + E const &expr) { return copyto(out, expr); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cos.hpp b/pythran/pythonic/numpy/cos.hpp index b433cfda55..401314aec4 100644 --- a/pythran/pythonic/numpy/cos.hpp +++ b/pythran/pythonic/numpy/cos.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/cos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cos #define NUMPY_NARY_FUNC_SYM xsimd::cos #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cosh.hpp b/pythran/pythonic/numpy/cosh.hpp index 92354b5560..8375d39d70 100644 --- a/pythran/pythonic/numpy/cosh.hpp +++ b/pythran/pythonic/numpy/cosh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/cosh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" #include @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME cosh #define NUMPY_NARY_FUNC_SYM xsimd::cosh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/count_nonzero.hpp b/pythran/pythonic/numpy/count_nonzero.hpp index 95d9294899..0fe9e6a132 100644 --- a/pythran/pythonic/numpy/count_nonzero.hpp +++ b/pythran/pythonic/numpy/count_nonzero.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/count_nonzero.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -45,7 +45,7 @@ namespace numpy utils::int_()); return count; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cross.hpp b/pythran/pythonic/numpy/cross.hpp index 574a87ff02..bb69d50af3 100644 --- a/pythran/pythonic/numpy/cross.hpp +++ b/pythran/pythonic/numpy/cross.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/cross.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -33,7 +33,7 @@ namespace numpy auto f0 = *fbegin; ++fbegin; auto f1 = *fbegin; - *obegin = e0 *f1 - e1 *f0; + *obegin = e0 * f1 - e1 * f0; } }; template <> @@ -50,11 +50,11 @@ namespace numpy auto f1 = *fbegin; ++fbegin; auto f2 = *fbegin; - *obegin = e1 *f2 - e2 *f1; + *obegin = e1 * f2 - e2 * f1; ++obegin; - *obegin = e2 *f0 - e0 *f2; + *obegin = e2 * f0 - e0 * f2; ++obegin; - *obegin = e0 *f1 - e1 *f0; + *obegin = e0 * f1 - e1 * f0; } }; template <> @@ -72,11 +72,11 @@ namespace numpy auto f1 = *fbegin; ++fbegin; auto f2 = *fbegin; - *obegin = e1 *f2 - e2 *f1; + *obegin = e1 * f2 - e2 * f1; ++obegin; - *obegin = e2 *f0 - e0 *f2; + *obegin = e2 * f0 - e0 * f2; ++obegin; - *obegin = e0 *f1 - e1 *f0; + *obegin = e0 * f1 - e1 * f0; } }; template <> @@ -93,35 +93,35 @@ namespace numpy ++fbegin; auto f1 = *fbegin; decltype(f1) f2 = 0; - *obegin = e1 *f2 - e2 *f1; + *obegin = e1 * f2 - e2 * f1; ++obegin; - *obegin = e2 *f0 - e0 *f2; + *obegin = e2 * f0 - e0 * f2; ++obegin; - *obegin = e0 *f1 - e1 *f0; + *obegin = e0 * f1 - e1 * f0; } }; template types::ndarray< typename __combined::type, - types::array> + types::array_tuple> cross(E const &e, F const &f) { using dtype = typename __combined::type; - types::array out_shape; + types::array_tuple out_shape; sutils::copy_shape<0, 0>(out_shape, e, utils::make_index_sequence()); if (e.template shape() == 2) { if (f.template shape() == 2) { out_shape[E::value - 1] = 1; - types::ndarray> out{ + types::ndarray> out{ out_shape, types::none_type{}}; _cross{}(out.begin(), out.end(), e.begin(), f.begin()); return out; } else { out_shape[E::value - 1] = 3; - types::ndarray> out{ + types::ndarray> out{ out_shape, types::none_type{}}; _cross{}(out.begin(), out.end(), e.begin(), f.begin()); return out; @@ -129,20 +129,20 @@ namespace numpy } else { if (f.template shape() == 2) { out_shape[E::value - 1] = 3; - types::ndarray> out{ + types::ndarray> out{ out_shape, types::none_type{}}; _cross{}(out.begin(), out.end(), e.begin(), f.begin()); return out; } else { out_shape[E::value - 1] = 3; - types::ndarray> out{ + types::ndarray> out{ out_shape, types::none_type{}}; _cross{}(out.begin(), out.end(), e.begin(), f.begin()); return out; } } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ctypeslib/as_array.hpp b/pythran/pythonic/numpy/ctypeslib/as_array.hpp index 5566ddc85b..7532bea562 100644 --- a/pythran/pythonic/numpy/ctypeslib/as_array.hpp +++ b/pythran/pythonic/numpy/ctypeslib/as_array.hpp @@ -25,8 +25,8 @@ namespace numpy { return as_array(ptr, types::pshape{size}); } - } -} + } // namespace ctypeslib +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cumprod.hpp b/pythran/pythonic/numpy/cumprod.hpp index d8685e4096..962871b833 100644 --- a/pythran/pythonic/numpy/cumprod.hpp +++ b/pythran/pythonic/numpy/cumprod.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/cumprod.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/partial_sum.hpp" #include "pythonic/operator_/imul.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,7 +13,7 @@ namespace numpy { template - auto cumprod(E &&e, Opts &&... opts) + auto cumprod(E &&e, Opts &&...opts) -> decltype(partial_sum( std::forward(e), std::forward(opts)...)) { @@ -22,7 +22,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(cumprod); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/cumsum.hpp b/pythran/pythonic/numpy/cumsum.hpp index 2415ff3c11..2f54a703b5 100644 --- a/pythran/pythonic/numpy/cumsum.hpp +++ b/pythran/pythonic/numpy/cumsum.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/cumsum.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/partial_sum.hpp" #include "pythonic/operator_/iadd.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,14 +13,14 @@ namespace numpy { template - auto cumsum(E &&e, Opts &&... opts) + auto cumsum(E &&e, Opts &&...opts) -> decltype(partial_sum( std::forward(e), std::forward(opts)...)) { return partial_sum(std::forward(e), std::forward(opts)...); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/deg2rad.hpp b/pythran/pythonic/numpy/deg2rad.hpp index 6fb4e5a982..8dab2e16b9 100644 --- a/pythran/pythonic/numpy/deg2rad.hpp +++ b/pythran/pythonic/numpy/deg2rad.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/deg2rad.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/numpy/pi.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/numpy/pi.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME deg2rad #define NUMPY_NARY_FUNC_SYM wrapper::deg2rad #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/delete_.hpp b/pythran/pythonic/numpy/delete_.hpp index b5ac3415c0..6520eae388 100644 --- a/pythran/pythonic/numpy/delete_.hpp +++ b/pythran/pythonic/numpy/delete_.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/delete_.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -43,7 +43,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(delete_); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/diag.hpp b/pythran/pythonic/numpy/diag.hpp index a5e12357b7..7f4dde7d5e 100644 --- a/pythran/pythonic/numpy/diag.hpp +++ b/pythran/pythonic/numpy/diag.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/diag.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/numpy/asarray.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/numpy/asarray.hpp" PYTHONIC_NS_BEGIN @@ -37,11 +37,12 @@ namespace numpy template typename std::enable_if::value == 1, - types::ndarray>>::type + types::ndarray>>::type diag(types::ndarray const &a, long k) { long n = a.flat_size() + std::abs(k); - types::ndarray> out(types::make_tuple(n, n), 0); + types::ndarray> out(types::make_tuple(n, n), + 0); if (k >= 0) for (long i = 0, j = k; i < n && j < n; ++i, ++j) out[i][j] = a[i]; @@ -58,7 +59,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(diag); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/diff.hpp b/pythran/pythonic/numpy/diff.hpp index 5863201ad1..763d1cefe5 100644 --- a/pythran/pythonic/numpy/diff.hpp +++ b/pythran/pythonic/numpy/diff.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/diff.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy namespace details { template - types::ndarray> + types::ndarray> diff(E const &arr, long n, long axis) { auto shape = sutils::getshape(arr); @@ -50,9 +50,9 @@ namespace numpy else return diff(out, n - 1, axis); } - } + } // namespace details template - types::ndarray> + types::ndarray> diff(E const &expr, long n, long axis) { if (axis < 0) @@ -60,7 +60,7 @@ namespace numpy // that's the only allocation that should happen return details::diff(array(expr), n, axis); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/digitize.hpp b/pythran/pythonic/numpy/digitize.hpp index e5e374f196..65655aba63 100644 --- a/pythran/pythonic/numpy/digitize.hpp +++ b/pythran/pythonic/numpy/digitize.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/digitize.hpp" -#include "pythonic/numpy/asarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/numpy/asarray.hpp" #include "pythonic/operator_/gt.hpp" #include "pythonic/operator_/lt.hpp" @@ -31,7 +31,7 @@ namespace numpy _digitize((*begin).begin(), (*begin).end(), out, bins, op, utils::int_()); } - } + } // namespace template types::ndarray> digitize(E const &expr, F const &b) @@ -50,7 +50,7 @@ namespace numpy operator_::functor::gt(), utils::int_()); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/divide.hpp b/pythran/pythonic/numpy/divide.hpp index 2be148fb07..d212dcce78 100644 --- a/pythran/pythonic/numpy/divide.hpp +++ b/pythran/pythonic/numpy/divide.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/divide.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/div.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/div.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME divide #define NUMPY_NARY_FUNC_SYM pythonic::operator_::div #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/dot.hpp b/pythran/pythonic/numpy/dot.hpp index 69ab120154..a0b7edd0ce 100644 --- a/pythran/pythonic/numpy/dot.hpp +++ b/pythran/pythonic/numpy/dot.hpp @@ -1329,8 +1329,8 @@ namespace numpy } }; template - struct blas_buffer_t> { - T const *operator()(types::array const &e) const + struct blas_buffer_t> { + T const *operator()(types::array_tuple const &e) const { return e.data(); } @@ -1616,7 +1616,7 @@ namespace numpy out(types::pshape{f.template shape<1>()}, 0); for (long i = 0; i < out.template shape<0>(); i++) for (long j = 0; j < f.template shape<0>(); j++) - out[i] += e[j] * f[types::array{{j, i}}]; + out[i] += e[j] * f[types::array_tuple{{j, i}}]; return out; } @@ -1638,7 +1638,7 @@ namespace numpy out(types::pshape{e.template shape<0>()}, 0); for (long i = 0; i < out.template shape<0>(); i++) for (long j = 0; j < f.template shape<0>(); j++) - out[i] += e[types::array{{i, j}}] * f[j]; + out[i] += e[types::array_tuple{{i, j}}] * f[j]; return out; } @@ -1670,14 +1670,14 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::ndarray const &a, types::ndarray const &b) { int n = b.template shape<1>(), m = a.template shape<0>(), k = b.template shape<0>(); - types::ndarray> out(types::array{{m, n}}, - builtins::None); + types::ndarray> out( + types::array_tuple{{m, n}}, builtins::None); mm(m, n, k, a.buffer, b.buffer, out.buffer); return out; } @@ -1723,15 +1723,15 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::numpy_texpr> const &a, types::ndarray const &b) { int n = b.template shape<1>(), m = a.template shape<0>(), k = b.template shape<0>(); - types::ndarray> out(types::array{{m, n}}, - builtins::None); + types::ndarray> out( + types::array_tuple{{m, n}}, builtins::None); tm(m, n, k, a.arg.buffer, b.buffer, out.buffer); return out; } @@ -1762,15 +1762,15 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::ndarray const &a, types::numpy_texpr> const &b) { int n = b.template shape<1>(), m = a.template shape<0>(), k = b.template shape<0>(); - types::ndarray> out(types::array{{m, n}}, - builtins::None); + types::ndarray> out( + types::array_tuple{{m, n}}, builtins::None); mt(m, n, k, a.buffer, b.arg.buffer, out.buffer); return out; } @@ -1800,15 +1800,15 @@ namespace numpy typename std::enable_if::value && std::tuple_size::value == 2 && std::tuple_size::value == 2, - types::ndarray>>::type + types::ndarray>>::type dot(types::numpy_texpr> const &a, types::numpy_texpr> const &b) { int n = b.template shape<1>(), m = a.template shape<0>(), k = b.template shape<0>(); - types::ndarray> out(types::array{{m, n}}, - builtins::None); + types::ndarray> out( + types::array_tuple{{m, n}}, builtins::None); tt(m, n, k, a.arg.buffer, b.arg.buffer, out.buffer); return out; } @@ -1827,7 +1827,7 @@ namespace numpy && E::value == 2 && F::value == 2, // And both are matrix types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f) { types::ndarray< @@ -1850,21 +1850,21 @@ namespace numpy E::value == 2 && F::value == 2, // And it is matrix / matrix types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f) { types::ndarray< typename __combined::type, - types::array> - out(types::array{{e.template shape<0>(), - f.template shape<1>()}}, + types::array_tuple> + out(types::array_tuple{{e.template shape<0>(), + f.template shape<1>()}}, 0); for (long i = 0; i < out.template shape<0>(); i++) for (long j = 0; j < out.template shape<1>(); j++) for (long k = 0; k < e.template shape<1>(); k++) - out[types::array{{i, j}}] += - e[types::array{{i, k}}] * - f[types::array{{k, j}}]; + out[types::array_tuple{{i, j}}] += + e[types::array_tuple{{i, k}}] * + f[types::array_tuple{{k, j}}]; return out; } @@ -1873,12 +1873,13 @@ namespace numpy (E::value >= 3 && F::value == 1), // And it is matrix / matrix types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f) { - auto out = dot( - e.reshape(types::array{{sutils::prod_head(e), f.size()}}), f); - types::array out_shape; + auto out = dot(e.reshape(types::array_tuple{ + {sutils::prod_head(e), f.size()}}), + f); + types::array_tuple out_shape; auto tmp = sutils::getshape(e); std::copy(tmp.begin(), tmp.end() - 1, out_shape.begin()); return out.reshape(out_shape); @@ -1889,7 +1890,7 @@ namespace numpy (E::value >= 3 && F::value >= 2), types::ndarray< typename __combined::type, - types::array>>::type + types::array_tuple>>::type dot(E const &e, F const &f) { static_assert(E::value == 0, "not implemented yet"); diff --git a/pythran/pythonic/numpy/double_.hpp b/pythran/pythonic/numpy/double_.hpp index e5fa42b3de..dd7c3dfccd 100644 --- a/pythran/pythonic/numpy/double_.hpp +++ b/pythran/pythonic/numpy/double_.hpp @@ -12,7 +12,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME double_ #define NUMPY_NARY_FUNC_SYM details::float64 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/dtype/type.hpp b/pythran/pythonic/numpy/dtype/type.hpp index 894286b938..7587ac5b31 100644 --- a/pythran/pythonic/numpy/dtype/type.hpp +++ b/pythran/pythonic/numpy/dtype/type.hpp @@ -15,8 +15,8 @@ namespace numpy { return t(v); } - } -} + } // namespace dtype +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/numpy/ediff1d.hpp b/pythran/pythonic/numpy/ediff1d.hpp index cbde610ee5..d194e4cb35 100644 --- a/pythran/pythonic/numpy/ediff1d.hpp +++ b/pythran/pythonic/numpy/ediff1d.hpp @@ -28,7 +28,7 @@ namespace numpy { return ediff1d(asarray(expr)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/empty.hpp b/pythran/pythonic/numpy/empty.hpp index 1005c35181..373f5f4dad 100644 --- a/pythran/pythonic/numpy/empty.hpp +++ b/pythran/pythonic/numpy/empty.hpp @@ -3,16 +3,15 @@ #include "pythonic/include/numpy/empty.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - typename dtype::type - empty(types::pshape<> const &shape, dtype) + typename dtype::type empty(types::pshape<> const &shape, dtype) { return {}; } @@ -38,7 +37,7 @@ namespace numpy { return empty(types::pshape>({}), d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/empty_like.hpp b/pythran/pythonic/numpy/empty_like.hpp index f0e742cdb4..d1776b0def 100644 --- a/pythran/pythonic/numpy/empty_like.hpp +++ b/pythran/pythonic/numpy/empty_like.hpp @@ -3,16 +3,16 @@ #include "pythonic/include/numpy/empty_like.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/empty.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto empty_like(E const &expr, dtype d) - -> decltype(empty(sutils::getshape(expr), d)) + auto empty_like(E const &expr, + dtype d) -> decltype(empty(sutils::getshape(expr), d)) { return empty(sutils::getshape(expr), d); } @@ -24,7 +24,7 @@ namespace numpy { return empty(sutils::getshape(expr), types::dtype_t()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/equal.hpp b/pythran/pythonic/numpy/equal.hpp index ba51ed6d7d..1cf4d7cb44 100644 --- a/pythran/pythonic/numpy/equal.hpp +++ b/pythran/pythonic/numpy/equal.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/equal.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/eq.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/eq.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::eq #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/exp.hpp b/pythran/pythonic/numpy/exp.hpp index 4c4ecc3415..72ce335fc4 100644 --- a/pythran/pythonic/numpy/exp.hpp +++ b/pythran/pythonic/numpy/exp.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/exp.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME exp #define NUMPY_NARY_FUNC_SYM xsimd::exp #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/expand_dims.hpp b/pythran/pythonic/numpy/expand_dims.hpp index 1a7501b7a9..3dd5b25050 100644 --- a/pythran/pythonic/numpy/expand_dims.hpp +++ b/pythran/pythonic/numpy/expand_dims.hpp @@ -2,22 +2,22 @@ #define PYTHONIC_NUMPY_EXPAND_DIMS_HPP #include "pythonic/include/numpy/expand_dims.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray> + types::ndarray> expand_dims(T const &input, int axis) { const long N = T::value; if (axis == -1) axis += N + 1; - types::array dim_array; + types::array_tuple dim_array; auto in_shape = sutils::getshape(input); long ii, jj; for (ii = jj = 0; ii < N + 1; ii++) { @@ -30,7 +30,7 @@ namespace numpy return numpy::functor::asarray{}(input).reshape(dim_array); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/expm1.hpp b/pythran/pythonic/numpy/expm1.hpp index eee79f19ac..208d9bfc8e 100644 --- a/pythran/pythonic/numpy/expm1.hpp +++ b/pythran/pythonic/numpy/expm1.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/expm1.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME expm1 #define NUMPY_NARY_FUNC_SYM xsimd::expm1 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/eye.hpp b/pythran/pythonic/numpy/eye.hpp index 8bed2d4a33..816a335178 100644 --- a/pythran/pythonic/numpy/eye.hpp +++ b/pythran/pythonic/numpy/eye.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/eye.hpp" -#include "pythonic/numpy/zeros.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/numpy/zeros.hpp" PYTHONIC_NS_BEGIN @@ -12,10 +12,10 @@ namespace numpy { template - types::ndarray> + types::ndarray> eye(long N, long M, long k, dtype d) { - types::ndarray> out = + types::ndarray> out = zeros(types::make_tuple(N, M), d); if (k >= 0) for (int i = 0, j = k; i < N && j < M; ++i, ++j) @@ -27,12 +27,12 @@ namespace numpy } template - types::ndarray> + types::ndarray> eye(long N, types::none_type M, long k, dtype d) { return eye(N, N, k, d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/c2c.hpp b/pythran/pythonic/numpy/fft/c2c.hpp index aae6de6315..bb84da4eaa 100644 --- a/pythran/pythonic/numpy/fft/c2c.hpp +++ b/pythran/pythonic/numpy/fft/c2c.hpp @@ -1,18 +1,18 @@ #ifndef PYTHONIC_NUMPY_FFT_C2C_HPP #define PYTHONIC_NUMPY_FFT_C2C_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/c2c.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/concatenate.hpp" -#include "pythonic/numpy/zeros.hpp" #include "pythonic/numpy/empty.hpp" +#include "pythonic/numpy/zeros.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include -#include #include +#include #include "pythonic/numpy/fft/pocketfft.hpp" @@ -22,8 +22,8 @@ namespace numpy { namespace fft { - using pocketfft::stride_t; using pocketfft::shape_t; + using pocketfft::stride_t; using ldbl_t = typename std::conditional::type; @@ -31,7 +31,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, double>::type, - types::array::value>> + types::array_tuple::value>> _copy_to_double(types::ndarray const &in_array) { auto out_shape = sutils::getshape(in_array); @@ -44,7 +44,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> _copy_to_complex(types::ndarray const &in_array) { auto out_shape = sutils::getshape(in_array); @@ -58,7 +58,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> _copy_to_complex(types::ndarray const &in_array) { auto out_shape = sutils::getshape(in_array); @@ -94,7 +94,7 @@ namespace numpy case Inorm::backward: return T(1 / ldbl_t(N)); case Inorm::explicit_forward: - return T(1./N); + return T(1. / N); default: assert(false && "unreachable"); return T(0); @@ -128,16 +128,17 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> _pad_in_array(types::ndarray const &in_array, long axis, long n) { - types::ndarray::value>> + types::ndarray::value>> extended_array; auto tmp_shape = sutils::getshape(in_array); tmp_shape[axis] = n; auto tmp_array = zeros(tmp_shape, types::dtype_t()); types::list::value>>> bi(0); + T, types::array_tuple::value>>> + bi(0); bi.push_back(in_array); bi.push_back(tmp_array); extended_array = concatenate(bi, axis); @@ -145,7 +146,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> c2r(types::ndarray, pS> const &in_array, long n, long axis, types::str const &norm, bool forward) { @@ -160,11 +161,11 @@ namespace numpy auto out_shape = sutils::getshape(in_array); out_shape[axis] = n; // Create output array. - types::ndarray::value>> + types::ndarray::value>> out_array(out_shape, builtins::None); std::complex *d_in; types::ndarray, - types::array::value>> + types::array_tuple::value>> extended_array; stride_t in_strides; auto out_strides = create_strides(out_array); @@ -192,7 +193,7 @@ namespace numpy template types::ndarray, - types::array::value>> + types::array_tuple::value>> c2c(types::ndarray, pS> const &in_array, long n, long axis, types::str const &norm, bool forward) { @@ -208,11 +209,11 @@ namespace numpy out_shape[axis] = n; // Create output array. types::ndarray, - types::array::value>> + types::array_tuple::value>> out_array(out_shape, builtins::None); std::complex *d_in; types::ndarray, - types::array::value>> + types::array_tuple::value>> extended_array; stride_t in_strides; if (n > npts) { @@ -242,7 +243,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> r2c(types::ndarray const &in_array, long n, long axis, types::str const &norm, bool forward, bool extend = true) { @@ -262,10 +263,10 @@ namespace numpy } // Create output array. types::ndarray, - types::array::value>> + types::array_tuple::value>> out_array(out_shape, builtins::None); T *d_in; - types::ndarray::value>> + types::ndarray::value>> extended_array; shape_t shapes = shape_t(size_t(N)); stride_t in_strides; @@ -303,8 +304,8 @@ namespace numpy } return out_array; } - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/fft.hpp b/pythran/pythonic/numpy/fft/fft.hpp index d8eed26b82..87d093367a 100644 --- a/pythran/pythonic/numpy/fft/fft.hpp +++ b/pythran/pythonic/numpy/fft/fft.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_NUMPY_FFT_FFT_HPP #define PYTHONIC_NUMPY_FFT_FFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/fft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -36,33 +36,35 @@ namespace numpy { return n; } - } + } // namespace details template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> - fft(types::ndarray const &in_array, N const& n, long axis, + types::array_tuple::value>> + fft(types::ndarray const &in_array, N const &n, long axis, Norm const &norm) { - return c2c(in_array, details::normalize_n(n), axis, details::normalize_norm(norm), true); + return c2c(in_array, details::normalize_n(n), axis, + details::normalize_norm(norm), true); } template types::ndarray::value, std::complex>::type, - types::array::value>> - fft(types::ndarray const &in_array, N const & n, long axis, + types::array_tuple::value>> + fft(types::ndarray const &in_array, N const &n, long axis, Norm const &norm) { - return r2c(in_array, details::normalize_n(n), axis, details::normalize_norm(norm), true, true); + return r2c(in_array, details::normalize_n(n), axis, + details::normalize_norm(norm), true, true); } template types::ndarray::value, std::complex>::type, - types::array::value>> - fft(types::ndarray const &in_array, N const& n, long axis, + types::array_tuple::value>> + fft(types::ndarray const &in_array, N const &n, long axis, Norm const &norm) { auto tmp_array = _copy_to_double(in_array); @@ -70,8 +72,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(fft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/fftn.hpp b/pythran/pythonic/numpy/fft/fftn.hpp index 37cf60a748..28ce369592 100644 --- a/pythran/pythonic/numpy/fft/fftn.hpp +++ b/pythran/pythonic/numpy/fft/fftn.hpp @@ -27,12 +27,12 @@ namespace numpy } template - types::array < long, + types::array_tuple < long, K normalize_axes(types::none_type const &) { if (S == 1) return {-1}; // FIXME: understand why this is needed - types::array < long, K result; + types::array_tuple < long, K result; for (size_t i = 0; i < std::min(K, S); ++i) result[i] = (long)i; return result; @@ -50,7 +50,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &in_array, types::none_type s, Axes const &axes, Norm const &norm) { @@ -61,7 +61,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &in_array, types::none_type s, Axes const &axes, Norm const &norm) { @@ -76,7 +76,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &in_array, types::none_type s, Axes const &axes, Norm const &norm) { @@ -93,7 +93,7 @@ namespace numpy class Norm> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes, Norm const &norm) { @@ -105,7 +105,7 @@ namespace numpy class Norm> types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes, Norm const &norm) { @@ -123,7 +123,7 @@ namespace numpy class Norm> types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> fftn(types::ndarray const &a, types::array_base const &s, Axes const &axes, Norm const &norm) { diff --git a/pythran/pythonic/numpy/fft/hfft.hpp b/pythran/pythonic/numpy/fft/hfft.hpp index 3820ba44a1..bf230a19bf 100644 --- a/pythran/pythonic/numpy/fft/hfft.hpp +++ b/pythran/pythonic/numpy/fft/hfft.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_NUMPY_FFT_HFFT_HPP #define PYTHONIC_NUMPY_FFT_HFFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/hfft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -24,7 +24,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -32,7 +32,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &in_array, long n, long axis, types::none_type norm) { @@ -40,7 +40,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> hfft(types::ndarray, pS> const &in_array, long n, long axis, types::str const &norm) { @@ -52,7 +52,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -65,7 +65,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -78,7 +78,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -91,7 +91,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> hfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -100,8 +100,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(hfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/ifft.hpp b/pythran/pythonic/numpy/fft/ifft.hpp index 23aad1d0c7..743615e992 100644 --- a/pythran/pythonic/numpy/fft/ifft.hpp +++ b/pythran/pythonic/numpy/fft/ifft.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_NUMPY_FFT_IFFT_HPP #define PYTHONIC_NUMPY_FFT_IFFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/ifft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -28,7 +28,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -38,7 +38,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -48,7 +48,7 @@ namespace numpy template types::ndarray< typename std::enable_if::value, T>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -58,7 +58,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -68,7 +68,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -78,7 +78,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -88,7 +88,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -98,7 +98,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -109,7 +109,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -120,7 +120,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -131,7 +131,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ifft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -140,8 +140,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(ifft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/ihfft.hpp b/pythran/pythonic/numpy/fft/ihfft.hpp index 44fe008bb5..e8c1fed129 100644 --- a/pythran/pythonic/numpy/fft/ihfft.hpp +++ b/pythran/pythonic/numpy/fft/ihfft.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_NUMPY_FFT_IHFFT_HPP #define PYTHONIC_NUMPY_FFT_IHFFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/ihfft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -27,7 +27,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -37,7 +37,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -47,7 +47,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -57,7 +57,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -68,7 +68,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -79,7 +79,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -90,7 +90,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> ihfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -99,8 +99,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(ihfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/irfft.hpp b/pythran/pythonic/numpy/fft/irfft.hpp index acc24765e2..6d3c5a9711 100644 --- a/pythran/pythonic/numpy/fft/irfft.hpp +++ b/pythran/pythonic/numpy/fft/irfft.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_NUMPY_FFT_IRFFT_HPP #define PYTHONIC_NUMPY_FFT_IRFFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/irfft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -24,7 +24,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -32,7 +32,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &in_array, long n, long axis, types::none_type norm) { @@ -40,7 +40,7 @@ namespace numpy } template - types::ndarray::value>> + types::ndarray::value>> irfft(types::ndarray, pS> const &in_array, long n, long axis, types::str const &norm) { @@ -52,7 +52,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -65,7 +65,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -78,7 +78,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -91,7 +91,7 @@ namespace numpy !types::is_complex::value, typename std::conditional::value, double, T>::type>::type, - types::array::value>> + types::array_tuple::value>> irfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -100,8 +100,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(irfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fft/pocketfft.hpp b/pythran/pythonic/numpy/fft/pocketfft.hpp index be696d0d3d..3ad32f425d 100644 --- a/pythran/pythonic/numpy/fft/pocketfft.hpp +++ b/pythran/pythonic/numpy/fft/pocketfft.hpp @@ -53,24 +53,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #include -#include +#include #include -#include +#include #include +#include #include -#include #if POCKETFFT_CACHE_SIZE != 0 #include #include #endif #ifndef POCKETFFT_NO_MULTITHREADING -#include -#include -#include -#include #include +#include #include +#include +#include +#include #ifdef POCKETFFT_PTHREADS #include @@ -93,8 +93,8 @@ namespace pocketfft namespace detail { - using std::size_t; using std::ptrdiff_t; + using std::size_t; // Always use std:: for functions template @@ -145,7 +145,7 @@ namespace pocketfft struct VLEN { static constexpr size_t val = 8; }; -#elif(defined(__AVX__)) +#elif (defined(__AVX__)) template <> struct VLEN { static constexpr size_t val = 8; @@ -154,7 +154,7 @@ namespace pocketfft struct VLEN { static constexpr size_t val = 4; }; -#elif(defined(__SSE2__)) +#elif (defined(__SSE2__)) template <> struct VLEN { static constexpr size_t val = 4; @@ -163,7 +163,7 @@ namespace pocketfft struct VLEN { static constexpr size_t val = 2; }; -#elif(defined(__VSX__)) +#elif (defined(__VSX__)) template <> struct VLEN { static constexpr size_t val = 4; @@ -199,7 +199,7 @@ namespace pocketfft free(ptr); } // C++17 in principle has "aligned_alloc", but unfortunately not everywhere ... -#elif(__cplusplus >= 201703L) && \ +#elif (__cplusplus >= 201703L) && \ ((!defined(__MINGW32__)) || defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)) && \ (!defined(__APPLE__)) static T *ralloc(size_t num) @@ -340,31 +340,31 @@ namespace pocketfft return *this; } template - auto operator*(const T2 &other) const -> cmplx + auto operator*(const T2 &other) const -> cmplx { return {r * other, i * other}; } template - auto operator+(const cmplx &other) const - -> cmplx + auto + operator+(const cmplx &other) const -> cmplx { return {r + other.r, i + other.i}; } template - auto operator-(const cmplx &other) const - -> cmplx + auto + operator-(const cmplx &other) const -> cmplx { return {r - other.r, i - other.i}; } template - auto operator*(const cmplx &other) const - -> cmplx + auto + operator*(const cmplx &other) const -> cmplx { return {r * other.r - i * other.i, r * other.i + i * other.r}; } template - auto special_mul(const cmplx &other) const - -> cmplx + auto + special_mul(const cmplx &other) const -> cmplx { using Tres = cmplx; return fwd ? Tres(r * other.r + i * other.i, i * other.r - r * other.i) @@ -508,7 +508,7 @@ namespace pocketfft }; struct util // hack to avoid duplicate symbols - { + { static POCKETFFT_NOINLINE size_t largest_prime_factor(size_t n) { size_t res = 1; @@ -859,10 +859,11 @@ namespace pocketfft #ifdef POCKETFFT_PTHREADS static std::once_flag f; std::call_once(f, [] { - pthread_atfork(+[] { get_pool().shutdown(); }, // prepare - +[] { get_pool().restart(); }, // parent - +[] { get_pool().restart(); } // child - ); + pthread_atfork( + +[] { get_pool().shutdown(); }, // prepare + +[] { get_pool().restart(); }, // parent + +[] { get_pool().restart(); } // child + ); }); #endif @@ -904,7 +905,7 @@ namespace pocketfft } #endif - } + } // namespace threading // // complex FFTPACK transforms @@ -933,12 +934,15 @@ namespace pocketfft T *POCKETFFT_RESTRICT ch, const cmplx *POCKETFFT_RESTRICT wa) const { - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 2 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 2 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -983,12 +987,15 @@ namespace pocketfft tw1i = (fwd ? -1 : 1) * T0(0.8660254037844386467637231707529362L); - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 3 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 3 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1017,12 +1024,15 @@ namespace pocketfft T *POCKETFFT_RESTRICT ch, const cmplx *POCKETFFT_RESTRICT wa) const { - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 4 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 4 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1097,12 +1107,15 @@ namespace pocketfft tw2i = (fwd ? -1 : 1) * T0(0.5877852522924731291687059546390728L); - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 5 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 5 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1172,12 +1185,15 @@ namespace pocketfft tw3i = (fwd ? -1 : 1) * T0(0.433883739117558120475768332848359L); - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 7 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 7 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1246,12 +1262,15 @@ namespace pocketfft T *POCKETFFT_RESTRICT ch, const cmplx *POCKETFFT_RESTRICT wa) const { - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 8 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 8 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1370,12 +1389,15 @@ namespace pocketfft tw5r = T0(-0.9594929736144973898903680570663277L), tw5i = (fwd ? -1 : 1) * T0(0.2817325568414296977114179153466169L); - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 11 * c)]; }; - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i - 1 + x * (ido - 1)]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 11 * c)]; + }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i - 1 + x * (ido - 1)]; + }; if (ido == 1) for (size_t k = 0; k < l1; ++k) { @@ -1441,16 +1463,21 @@ namespace pocketfft size_t ipph = (ip + 1) / 2; size_t idl1 = ido * l1; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + cdim * c)]; }; - auto CX = [cc, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return cc[a + ido * (b + l1 * c)]; }; - auto CX2 = - [cc, idl1](size_t a, size_t b) -> T &{ return cc[a + idl1 * b]; }; - auto CH2 = [ch, idl1](size_t a, size_t b) - -> const T &{ return ch[a + idl1 * b]; }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + cdim * c)]; + }; + auto CX = [cc, ido, l1](size_t a, size_t b, size_t c) -> T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto CX2 = [cc, idl1](size_t a, size_t b) -> T & { + return cc[a + idl1 * b]; + }; + auto CH2 = [ch, idl1](size_t a, size_t b) -> const T & { + return ch[a + idl1 * b]; + }; arr> wal(ip); wal[0] = cmplx(1., 0.); @@ -1708,12 +1735,15 @@ namespace pocketfft T *POCKETFFT_RESTRICT ch, const T0 *POCKETFFT_RESTRICT wa) const { - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + l1 * c)]; }; - auto CH = [ch, ido](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + 2 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto CH = [ch, ido](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + 2 * c)]; + }; for (size_t k = 0; k < l1; k++) PM(CH(0, 0, k), CH(ido - 1, 1, k), CC(0, k, 0), CC(0, k, 1)); @@ -1753,12 +1783,15 @@ namespace pocketfft constexpr T0 taur = -0.5, taui = T0(0.8660254037844386467637231707529362L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + l1 * c)]; }; - auto CH = [ch, ido](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + 3 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto CH = [ch, ido](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + 3 * c)]; + }; for (size_t k = 0; k < l1; k++) { T cr2 = CC(0, k, 1) + CC(0, k, 2); @@ -1795,12 +1828,15 @@ namespace pocketfft { constexpr T0 hsqt2 = T0(0.707106781186547524400844362104849L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + l1 * c)]; }; - auto CH = [ch, ido](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + 4 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto CH = [ch, ido](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + 4 * c)]; + }; for (size_t k = 0; k < l1; k++) { T tr1, tr2; @@ -1849,12 +1885,15 @@ namespace pocketfft tr12 = T0(-0.8090169943749474241022934171828191L), ti12 = T0(0.5877852522924731291687059546390728L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + l1 * c)]; }; - auto CH = [ch, ido](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + 5 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto CH = [ch, ido](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + 5 * c)]; + }; for (size_t k = 0; k < l1; k++) { T cr2, cr3, ci4, ci5; @@ -1909,16 +1948,21 @@ namespace pocketfft size_t ipph = (ip + 1) / 2; size_t idl1 = ido * l1; - auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) - -> T &{ return cc[a + ido * (b + cdim * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return ch[a + ido * (b + l1 * c)]; }; - auto C1 = [cc, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return cc[a + ido * (b + l1 * c)]; }; - auto C2 = - [cc, idl1](size_t a, size_t b) -> T &{ return cc[a + idl1 * b]; }; - auto CH2 = - [ch, idl1](size_t a, size_t b) -> T &{ return ch[a + idl1 * b]; }; + auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) -> T & { + return cc[a + ido * (b + cdim * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto C1 = [cc, ido, l1](size_t a, size_t b, size_t c) -> T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto C2 = [cc, idl1](size_t a, size_t b) -> T & { + return cc[a + idl1 * b]; + }; + auto CH2 = [ch, idl1](size_t a, size_t b) -> T & { + return ch[a + idl1 * b]; + }; if (ido > 1) { for (size_t j = 1, jc = ip - 1; j < ipph; ++j, --jc) // 114 @@ -2064,12 +2108,15 @@ namespace pocketfft T *POCKETFFT_RESTRICT ch, const T0 *POCKETFFT_RESTRICT wa) const { - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 2 * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 2 * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; for (size_t k = 0; k < l1; k++) PM(CH(0, k, 0), CH(0, k, 1), CC(0, 0, k), CC(ido - 1, 1, k)); @@ -2099,12 +2146,15 @@ namespace pocketfft constexpr T0 taur = -0.5, taui = T0(0.8660254037844386467637231707529362L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 3 * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 3 * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; for (size_t k = 0; k < l1; k++) { T tr2 = 2 * CC(ido - 1, 1, k); @@ -2144,12 +2194,15 @@ namespace pocketfft { constexpr T0 sqrt2 = T0(1.414213562373095048801688724209698L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 4 * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 4 * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; for (size_t k = 0; k < l1; k++) { T tr1, tr2; @@ -2203,12 +2256,15 @@ namespace pocketfft tr12 = T0(-0.8090169943749474241022934171828191L), ti12 = T0(0.5877852522924731291687059546390728L); - auto WA = - [wa, ido](size_t x, size_t i) { return wa[i + x * (ido - 1)]; }; - auto CC = [cc, ido](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + 5 * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; + auto WA = [wa, ido](size_t x, size_t i) { + return wa[i + x * (ido - 1)]; + }; + auto CC = [cc, ido](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + 5 * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; for (size_t k = 0; k < l1; k++) { T ti5 = CC(0, 2, k) + CC(0, 2, k); @@ -2266,16 +2322,21 @@ namespace pocketfft size_t ipph = (ip + 1) / 2; size_t idl1 = ido * l1; - auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + cdim * c)]; }; - auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) - -> T &{ return ch[a + ido * (b + l1 * c)]; }; - auto C1 = [cc, ido, l1](size_t a, size_t b, size_t c) - -> const T &{ return cc[a + ido * (b + l1 * c)]; }; - auto C2 = - [cc, idl1](size_t a, size_t b) -> T &{ return cc[a + idl1 * b]; }; - auto CH2 = - [ch, idl1](size_t a, size_t b) -> T &{ return ch[a + idl1 * b]; }; + auto CC = [cc, ido, cdim](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + cdim * c)]; + }; + auto CH = [ch, ido, l1](size_t a, size_t b, size_t c) -> T & { + return ch[a + ido * (b + l1 * c)]; + }; + auto C1 = [cc, ido, l1](size_t a, size_t b, size_t c) -> const T & { + return cc[a + ido * (b + l1 * c)]; + }; + auto C2 = [cc, idl1](size_t a, size_t b) -> T & { + return cc[a + idl1 * b]; + }; + auto CH2 = [ch, idl1](size_t a, size_t b) -> T & { + return ch[a + idl1 * b]; + }; for (size_t k = 0; k < l1; ++k) // 102 for (size_t i = 0; i < ido; ++i) // 101 @@ -3338,8 +3399,8 @@ namespace pocketfft #ifndef POCKETFFT_NO_VECTORS template <> struct VTYPE { - using type = float - __attribute__((vector_size(VLEN::val * sizeof(float)))); + using type = + float __attribute__((vector_size(VLEN::val * sizeof(float)))); }; template <> struct VTYPE { @@ -3348,9 +3409,8 @@ namespace pocketfft }; template <> struct VTYPE { - using type = long double - __attribute__((vector_size(VLEN::val * - sizeof(long double)))); + using type = long double __attribute__(( + vector_size(VLEN::val * sizeof(long double)))); }; #endif @@ -3911,18 +3971,18 @@ namespace pocketfft } // namespace detail - using detail::FORWARD; using detail::BACKWARD; - using detail::shape_t; - using detail::stride_t; using detail::c2c; using detail::c2r; + using detail::dct; + using detail::dst; + using detail::FORWARD; using detail::r2c; using detail::r2r_fftpack; - using detail::r2r_separable_hartley; using detail::r2r_genuine_hartley; - using detail::dct; - using detail::dst; + using detail::r2r_separable_hartley; + using detail::shape_t; + using detail::stride_t; } // namespace pocketfft diff --git a/pythran/pythonic/numpy/fft/rfft.hpp b/pythran/pythonic/numpy/fft/rfft.hpp index 91e6fab829..84d1300c8d 100644 --- a/pythran/pythonic/numpy/fft/rfft.hpp +++ b/pythran/pythonic/numpy/fft/rfft.hpp @@ -1,11 +1,11 @@ #ifndef PYTHONIC_NUMPY_FFT_RFFT_HPP #define PYTHONIC_NUMPY_FFT_RFFT_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/fft/rfft.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/include/utils/array_helper.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" #include "pythonic/numpy/fft/c2c.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -27,7 +27,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -37,7 +37,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -47,7 +47,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -57,7 +57,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, types::none_type n, long axis, types::str const &norm) { @@ -68,7 +68,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, types::none_type n, long axis, types::none_type norm) { @@ -79,7 +79,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, long n, long axis, types::none_type norm) { @@ -90,7 +90,7 @@ namespace numpy template types::ndarray::value, std::complex>::type, - types::array::value>> + types::array_tuple::value>> rfft(types::ndarray const &in_array, long n, long axis, types::str const &norm) { @@ -99,8 +99,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(rfft); - } -} + } // namespace fft +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fill_diagonal.hpp b/pythran/pythonic/numpy/fill_diagonal.hpp index 5be8b09d21..dd5bc0889b 100644 --- a/pythran/pythonic/numpy/fill_diagonal.hpp +++ b/pythran/pythonic/numpy/fill_diagonal.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/fill_diagonal.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/NoneType.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,14 +15,14 @@ namespace numpy typename std::decay::type::dtype fill_value) { constexpr auto N = std::decay::type::value; - types::array indices; + types::array_tuple indices; for (long i = 0, n = sutils::min(expr); i < n; ++i) { std::fill(indices.begin(), indices.end(), i); expr.fast(indices) = fill_value; } return {}; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/finfo.hpp b/pythran/pythonic/numpy/finfo.hpp index cb9c2b10ba..cb13966269 100644 --- a/pythran/pythonic/numpy/finfo.hpp +++ b/pythran/pythonic/numpy/finfo.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/finfo.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/finfo.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy { return types::finfo(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fix.hpp b/pythran/pythonic/numpy/fix.hpp index 5b1b020dc2..2df1a9a141 100644 --- a/pythran/pythonic/numpy/fix.hpp +++ b/pythran/pythonic/numpy/fix.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/fix.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME fix #define NUMPY_NARY_FUNC_SYM std::trunc #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/flatnonzero.hpp b/pythran/pythonic/numpy/flatnonzero.hpp index 221574cb59..987a206900 100644 --- a/pythran/pythonic/numpy/flatnonzero.hpp +++ b/pythran/pythonic/numpy/flatnonzero.hpp @@ -26,7 +26,7 @@ namespace numpy _flatnonzero((*begin).begin(), (*begin).end(), out, i, utils::int_()); } - } + } // namespace template types::ndarray> flatnonzero(E const &expr) { @@ -38,7 +38,7 @@ namespace numpy types::pshape shape = iter - buffer->data; return types::ndarray>(std::move(buffer), shape); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/flip.hpp b/pythran/pythonic/numpy/flip.hpp index 27241f061d..3bcdaf7f19 100644 --- a/pythran/pythonic/numpy/flip.hpp +++ b/pythran/pythonic/numpy/flip.hpp @@ -14,12 +14,12 @@ namespace numpy namespace details { template - auto flip(E const &expr, S const &slices, utils::index_sequence) - -> decltype(expr(slices[I]...)) + auto flip(E const &expr, S const &slices, + utils::index_sequence) -> decltype(expr(slices[I]...)) { return expr(slices[I]...); } - } + } // namespace details template auto flip(E const &expr, long axis) @@ -30,7 +30,7 @@ namespace numpy slices[axis].step = -1; return details::flip(expr, slices, utils::make_index_sequence{}); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fliplr.hpp b/pythran/pythonic/numpy/fliplr.hpp index e7354ff215..d19474358f 100644 --- a/pythran/pythonic/numpy/fliplr.hpp +++ b/pythran/pythonic/numpy/fliplr.hpp @@ -11,9 +11,10 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto fliplr(E &&expr) -> decltype(std::forward(expr)( - types::cstride_slice<1>{builtins::None, builtins::None}, - types::slice{builtins::None, builtins::None, -1})) + auto + fliplr(E &&expr) -> decltype(std::forward(expr)( + types::cstride_slice<1>{builtins::None, builtins::None}, + types::slice{builtins::None, builtins::None, -1})) { return std::forward(expr)( types::cstride_slice<1>{builtins::None, builtins::None}, diff --git a/pythran/pythonic/numpy/flipud.hpp b/pythran/pythonic/numpy/flipud.hpp index 3e2799dd94..a5a0331f8a 100644 --- a/pythran/pythonic/numpy/flipud.hpp +++ b/pythran/pythonic/numpy/flipud.hpp @@ -3,21 +3,22 @@ #include "pythonic/include/numpy/flipud.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto flipud(E &&expr) -> decltype( - std::forward(expr)[types::slice{builtins::None, builtins::None, -1}]) + auto + flipud(E &&expr) -> decltype(std::forward( + expr)[types::slice{builtins::None, builtins::None, -1}]) { return std::forward( expr)[types::slice{builtins::None, builtins::None, -1}]; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/float_.hpp b/pythran/pythonic/numpy/float_.hpp index 356ae7d1a8..721101c1b8 100644 --- a/pythran/pythonic/numpy/float_.hpp +++ b/pythran/pythonic/numpy/float_.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_NUMPY_FLOAT_HPP #define PYTHONIC_NUMPY_FLOAT_HPP -#include "pythonic/include/numpy/float_.hpp" #include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/numpy/float_.hpp" PYTHONIC_NS_BEGIN @@ -12,7 +12,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME float_ #define NUMPY_NARY_FUNC_SYM details::float64 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/floor.hpp b/pythran/pythonic/numpy/floor.hpp index 121f5c03eb..c359bc9c93 100644 --- a/pythran/pythonic/numpy/floor.hpp +++ b/pythran/pythonic/numpy/floor.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/floor.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME floor #define NUMPY_NARY_FUNC_SYM xsimd::floor #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/floor_divide.hpp b/pythran/pythonic/numpy/floor_divide.hpp index f68d2fca1b..6f7f551e07 100644 --- a/pythran/pythonic/numpy/floor_divide.hpp +++ b/pythran/pythonic/numpy/floor_divide.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/floor_divide.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/numpy/floor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/numpy/floor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME floor_divide #define NUMPY_NARY_FUNC_SYM wrapper::divfloor #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fmod.hpp b/pythran/pythonic/numpy/fmod.hpp index cfb9ecc66c..bc10249724 100644 --- a/pythran/pythonic/numpy/fmod.hpp +++ b/pythran/pythonic/numpy/fmod.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/fmod.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME fmod #define NUMPY_NARY_FUNC_SYM xsimd::fmod #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/frexp.hpp b/pythran/pythonic/numpy/frexp.hpp index 1d9bc10243..57bf14cd1e 100644 --- a/pythran/pythonic/numpy/frexp.hpp +++ b/pythran/pythonic/numpy/frexp.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/frexp.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/types/traits.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/traits.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -39,7 +39,7 @@ namespace numpy _frexp((*begin).begin(), (*begin).end(), (*significands_iter).begin(), (*exps_iter).begin(), utils::int_()); } - } + } // namespace template typename std::enable_if< @@ -56,7 +56,7 @@ namespace numpy utils::int_()); return std::make_tuple(significands, exps); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fromfile.hpp b/pythran/pythonic/numpy/fromfile.hpp index ea8c4aa7ce..771062f49e 100644 --- a/pythran/pythonic/numpy/fromfile.hpp +++ b/pythran/pythonic/numpy/fromfile.hpp @@ -45,7 +45,7 @@ namespace numpy fs.read((char *)res.buffer, sizeof(typename dtype::type) * count); return res; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fromfunction.hpp b/pythran/pythonic/numpy/fromfunction.hpp index 1d60afb647..857ecf35cc 100644 --- a/pythran/pythonic/numpy/fromfunction.hpp +++ b/pythran/pythonic/numpy/fromfunction.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/fromfunction.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/tags.hpp" PYTHONIC_NS_BEGIN @@ -19,12 +19,15 @@ namespace numpy template types::ndarray::type>::type>::type, - pS> fromfunction_helper:: - operator()(F &&f, pS const &shape, dtype d) + pS> + fromfunction_helper::operator()(F &&f, + pS const &shape, + dtype d) { types::ndarray::type>::type>::type, - pS> out(shape, builtins::None); + pS> + out(shape, builtins::None); long n = out.template shape<0>(); for (long i = 0; i < n; ++i) out[i] = f(i); @@ -36,13 +39,16 @@ namespace numpy types::ndarray< typename std::remove_cv::type>::type>::type, - pS> fromfunction_helper:: - operator()(F &&f, pS const &shape, dtype d) + pS> + fromfunction_helper::operator()(F &&f, + pS const &shape, + dtype d) { types::ndarray< typename std::remove_cv::type>::type>::type, - pS> out(shape, builtins::None); + pS> + out(shape, builtins::None); long n = out.template shape<0>(); long m = out.template shape<1>(); for (long i = 0; i < n; ++i) @@ -63,7 +69,7 @@ namespace numpy } /* TODO: must specialize for higher order */ -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fromiter.hpp b/pythran/pythonic/numpy/fromiter.hpp index f2b31e6f1e..7bbe112370 100644 --- a/pythran/pythonic/numpy/fromiter.hpp +++ b/pythran/pythonic/numpy/fromiter.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/fromiter.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -25,11 +25,11 @@ namespace numpy } else { utils::shared_ref> buffer(count); std::copy_n(iterable.begin(), count, buffer->data); - types::array shape = {count}; + types::array_tuple shape = {count}; return {buffer, shape}; } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/fromstring.hpp b/pythran/pythonic/numpy/fromstring.hpp index c7e548bff5..d744824deb 100644 --- a/pythran/pythonic/numpy/fromstring.hpp +++ b/pythran/pythonic/numpy/fromstring.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/fromstring.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/types/list.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" #include #include @@ -50,7 +50,7 @@ namespace numpy return {buffer, shape}; } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/full.hpp b/pythran/pythonic/numpy/full.hpp index 9153abd871..cca0749954 100644 --- a/pythran/pythonic/numpy/full.hpp +++ b/pythran/pythonic/numpy/full.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/full.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -55,7 +55,7 @@ namespace numpy return full(types::pshape>({}), fill_value, nt); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/full_like.hpp b/pythran/pythonic/numpy/full_like.hpp index 75421404f5..721893baa4 100644 --- a/pythran/pythonic/numpy/full_like.hpp +++ b/pythran/pythonic/numpy/full_like.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/full_like.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/full.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -26,7 +26,7 @@ namespace numpy return full(sutils::getshape(expr), fill_value, types::dtype_t()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/greater.hpp b/pythran/pythonic/numpy/greater.hpp index 687d8d546f..c283d575da 100644 --- a/pythran/pythonic/numpy/greater.hpp +++ b/pythran/pythonic/numpy/greater.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/greater.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/gt.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/gt.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME greater #define NUMPY_NARY_FUNC_SYM pythonic::operator_::gt #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/greater_equal.hpp b/pythran/pythonic/numpy/greater_equal.hpp index d19a51054d..09cde4949f 100644 --- a/pythran/pythonic/numpy/greater_equal.hpp +++ b/pythran/pythonic/numpy/greater_equal.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/greater_equal.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/operator_/ge.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME greater_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::ge #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/heaviside.hpp b/pythran/pythonic/numpy/heaviside.hpp index 0bec76ec7d..bb33f5381e 100644 --- a/pythran/pythonic/numpy/heaviside.hpp +++ b/pythran/pythonic/numpy/heaviside.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/cos.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -26,12 +26,12 @@ namespace numpy return 1; return x0; // NaN } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME heaviside #define NUMPY_NARY_FUNC_SYM details::heaviside #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/hstack.hpp b/pythran/pythonic/numpy/hstack.hpp index b707c41f1c..de2e6f6937 100644 --- a/pythran/pythonic/numpy/hstack.hpp +++ b/pythran/pythonic/numpy/hstack.hpp @@ -18,7 +18,7 @@ namespace numpy 1); return concatenate(std::forward(seq), concatenate_axis); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/hypot.hpp b/pythran/pythonic/numpy/hypot.hpp index 366ab8bbbb..9ae4a9eb36 100644 --- a/pythran/pythonic/numpy/hypot.hpp +++ b/pythran/pythonic/numpy/hypot.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/hypot.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME hypot #define NUMPY_NARY_FUNC_SYM xsimd::hypot #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/identity.hpp b/pythran/pythonic/numpy/identity.hpp index e065c30707..4f0e7e454b 100644 --- a/pythran/pythonic/numpy/identity.hpp +++ b/pythran/pythonic/numpy/identity.hpp @@ -14,7 +14,7 @@ namespace numpy { return eye(n, n, 0, d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/imag.hpp b/pythran/pythonic/numpy/imag.hpp index b27c313eaa..d974c4c7cd 100644 --- a/pythran/pythonic/numpy/imag.hpp +++ b/pythran/pythonic/numpy/imag.hpp @@ -3,18 +3,18 @@ #include "pythonic/include/numpy/imag.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/asarray.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/types/list.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto imag(E &&expr) - -> decltype(builtins::getattr(types::attr::IMAG{}, std::forward(expr))) + auto imag(E &&expr) -> decltype(builtins::getattr(types::attr::IMAG{}, + std::forward(expr))) { return builtins::getattr(types::attr::IMAG{}, std::forward(expr)); } @@ -25,7 +25,7 @@ namespace numpy { return imag(numpy::functor::asarray{}(expr)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/indices.hpp b/pythran/pythonic/numpy/indices.hpp index 01b6dc7994..d22b05549a 100644 --- a/pythran/pythonic/numpy/indices.hpp +++ b/pythran/pythonic/numpy/indices.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/indices.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -43,7 +43,7 @@ namespace numpy } return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/insert.hpp b/pythran/pythonic/numpy/insert.hpp index ea09fade89..8b71eda74d 100644 --- a/pythran/pythonic/numpy/insert.hpp +++ b/pythran/pythonic/numpy/insert.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/insert.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/builtins/None.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/traits.hpp" -#include "pythonic/builtins/None.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -73,7 +73,7 @@ namespace numpy { throw std::runtime_error("insert only partially supported"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/invert.hpp b/pythran/pythonic/numpy/invert.hpp index 0bccba8bf0..631703ef45 100644 --- a/pythran/pythonic/numpy/invert.hpp +++ b/pythran/pythonic/numpy/invert.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/invert.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/invert.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/invert.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME invert #define NUMPY_NARY_FUNC_SYM operator_::invert #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isclose.hpp b/pythran/pythonic/numpy/isclose.hpp index 84d5068ead..c48e000620 100644 --- a/pythran/pythonic/numpy/isclose.hpp +++ b/pythran/pythonic/numpy/isclose.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/isclose.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/abs.hpp" #include "pythonic/numpy/isfinite.hpp" #include "pythonic/numpy/isnan.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy @@ -26,11 +26,11 @@ namespace numpy else return (u == v); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isclose #define NUMPY_NARY_FUNC_SYM wrapper::isclose #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/iscomplex.hpp b/pythran/pythonic/numpy/iscomplex.hpp index 3d0b836191..b2b529b73f 100644 --- a/pythran/pythonic/numpy/iscomplex.hpp +++ b/pythran/pythonic/numpy/iscomplex.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/iscomplex.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/types/traits.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -28,12 +28,12 @@ namespace numpy { return false; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME iscomplex #define NUMPY_NARY_FUNC_SYM wrapper::iscomplex #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isfinite.hpp b/pythran/pythonic/numpy/isfinite.hpp index fd07a6abc7..6ed26423b9 100644 --- a/pythran/pythonic/numpy/isfinite.hpp +++ b/pythran/pythonic/numpy/isfinite.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/isfinite.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME isfinite #define NUMPY_NARY_FUNC_SYM wrapper::isfinite #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isinf.hpp b/pythran/pythonic/numpy/isinf.hpp index c17e9277da..eb684dc1bb 100644 --- a/pythran/pythonic/numpy/isinf.hpp +++ b/pythran/pythonic/numpy/isinf.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/isinf.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -23,11 +23,11 @@ namespace numpy { return std::isinf(v.real()) || std::isinf(v.imag()); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isinf #define NUMPY_NARY_FUNC_SYM wrapper::isinf #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isnan.hpp b/pythran/pythonic/numpy/isnan.hpp index 781907281c..a946eeeee7 100644 --- a/pythran/pythonic/numpy/isnan.hpp +++ b/pythran/pythonic/numpy/isnan.hpp @@ -20,25 +20,28 @@ namespace numpy } template - auto isnan(T const &v) -> typename std::enable_if< - std::is_floating_point::type>::value, bool>::type + auto isnan(T const &v) -> + typename std::enable_if< + std::is_floating_point::type>::value, + bool>::type { return std::isnan(v); } template - auto isnan(T const &v) -> typename std::enable_if< - !std::is_floating_point::type>::value, - bool>::type + auto isnan(T const &v) -> + typename std::enable_if< + !std::is_floating_point::type>::value, + bool>::type { return false; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isnan #define NUMPY_NARY_FUNC_SYM wrapper::isnan #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isneginf.hpp b/pythran/pythonic/numpy/isneginf.hpp index e6fdc78132..79a55fea1e 100644 --- a/pythran/pythonic/numpy/isneginf.hpp +++ b/pythran/pythonic/numpy/isneginf.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/isneginf.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic//numpy/isinf.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic//numpy/isinf.hpp" PYTHONIC_NS_BEGIN @@ -19,12 +19,12 @@ namespace numpy { return functor::isinf{}(t) && (t < 0); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isneginf #define NUMPY_NARY_FUNC_SYM wrapper::isneginf #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isposinf.hpp b/pythran/pythonic/numpy/isposinf.hpp index b1952a792e..c54dfae02f 100644 --- a/pythran/pythonic/numpy/isposinf.hpp +++ b/pythran/pythonic/numpy/isposinf.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/isposinf.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" #include "pythonic/numpy/isinf.hpp" @@ -20,11 +20,11 @@ namespace numpy { return functor::isinf{}(t) && t >= 0; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isposinf #define NUMPY_NARY_FUNC_SYM wrapper::isposinf #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isreal.hpp b/pythran/pythonic/numpy/isreal.hpp index 2e3e17d2d8..134fdc307d 100644 --- a/pythran/pythonic/numpy/isreal.hpp +++ b/pythran/pythonic/numpy/isreal.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/isreal.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/types/traits.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -28,12 +28,12 @@ namespace numpy { return true; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME isreal #define NUMPY_NARY_FUNC_SYM wrapper::isreal #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isrealobj.hpp b/pythran/pythonic/numpy/isrealobj.hpp index f8207f9a98..92a1f29ff0 100644 --- a/pythran/pythonic/numpy/isrealobj.hpp +++ b/pythran/pythonic/numpy/isrealobj.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/isrealobj.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/traits.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy { return !types::is_complex::value; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/isscalar.hpp b/pythran/pythonic/numpy/isscalar.hpp index 56b5fcc289..a06887f991 100644 --- a/pythran/pythonic/numpy/isscalar.hpp +++ b/pythran/pythonic/numpy/isscalar.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/isscalar.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/traits.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/types/traits.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -18,7 +18,7 @@ namespace numpy { return types::is_dtype::value || std::is_same::value; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/issctype.hpp b/pythran/pythonic/numpy/issctype.hpp index 368fbd02d3..45fdedec58 100644 --- a/pythran/pythonic/numpy/issctype.hpp +++ b/pythran/pythonic/numpy/issctype.hpp @@ -26,7 +26,7 @@ namespace numpy { return false; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ldexp.hpp b/pythran/pythonic/numpy/ldexp.hpp index 3671315d6e..4764037d18 100644 --- a/pythran/pythonic/numpy/ldexp.hpp +++ b/pythran/pythonic/numpy/ldexp.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/ldexp.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME ldexp #define NUMPY_NARY_FUNC_SYM std::ldexp #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/left_shift.hpp b/pythran/pythonic/numpy/left_shift.hpp index c4b2c74763..078bc62af4 100644 --- a/pythran/pythonic/numpy/left_shift.hpp +++ b/pythran/pythonic/numpy/left_shift.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/left_shift.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/operator_/lshift.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME left_shift #define NUMPY_NARY_FUNC_SYM pythonic::operator_::lshift #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/less.hpp b/pythran/pythonic/numpy/less.hpp index e1ef9744f6..654b1e043d 100644 --- a/pythran/pythonic/numpy/less.hpp +++ b/pythran/pythonic/numpy/less.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/less.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/lt.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/lt.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME less #define NUMPY_NARY_FUNC_SYM pythonic::operator_::lt #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/less_equal.hpp b/pythran/pythonic/numpy/less_equal.hpp index 258e83108e..19b4a65d33 100644 --- a/pythran/pythonic/numpy/less_equal.hpp +++ b/pythran/pythonic/numpy/less_equal.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/less_equal.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/le.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/le.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME less_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::le #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/lexsort.hpp b/pythran/pythonic/numpy/lexsort.hpp index eef50a93fd..c8b1afa04b 100644 --- a/pythran/pythonic/numpy/lexsort.hpp +++ b/pythran/pythonic/numpy/lexsort.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/lexsort.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/pdqsort.hpp" PYTHONIC_NS_BEGIN @@ -48,7 +48,7 @@ namespace numpy return lexcmp_nth::value>{}(keys, i0, i1); } }; - } + } // namespace details template types::ndarray> lexsort(pS const &keys) @@ -62,7 +62,7 @@ namespace numpy pdqsort(out.buffer, out.buffer + n, details::lexcmp(keys)); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/linalg/matrix_power.hpp b/pythran/pythonic/numpy/linalg/matrix_power.hpp index 7c76b77df2..7d873ab274 100644 --- a/pythran/pythonic/numpy/linalg/matrix_power.hpp +++ b/pythran/pythonic/numpy/linalg/matrix_power.hpp @@ -5,8 +5,8 @@ #include "pythonic/numpy/array.hpp" #include "pythonic/numpy/asarray.hpp" -#include "pythonic/numpy/identity.hpp" #include "pythonic/numpy/dot.hpp" +#include "pythonic/numpy/identity.hpp" #include "pythonic/builtins/NotImplementedError.hpp" PYTHONIC_NS_BEGIN @@ -40,11 +40,11 @@ namespace numpy return numpy::functor::dot{}(tmp, tmp); } } - } + } // namespace details template - auto matrix_power(E const &expr, long n) - -> decltype(numpy::functor::array{}(expr)) + auto matrix_power(E const &expr, + long n) -> decltype(numpy::functor::array{}(expr)) { if (n == 0) return numpy::functor::identity{}(expr.template shape<0>(), @@ -55,8 +55,8 @@ namespace numpy } throw pythonic::builtins::NotImplementedError("negative power"); } - } -} + } // namespace linalg +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/linalg/norm.hpp b/pythran/pythonic/numpy/linalg/norm.hpp index 4a9c5aa13c..1f24579776 100644 --- a/pythran/pythonic/numpy/linalg/norm.hpp +++ b/pythran/pythonic/numpy/linalg/norm.hpp @@ -1,18 +1,18 @@ #ifndef PYTHONIC_NUMPY_LINALG_NORM_HPP #define PYTHONIC_NUMPY_LINALG_NORM_HPP +#include "pythonic/builtins/NotImplementedError.hpp" +#include "pythonic/builtins/pythran/abssqr.hpp" #include "pythonic/include/numpy/linalg/norm.hpp" #include "pythonic/numpy/abs.hpp" -#include "pythonic/numpy/conj.hpp" #include "pythonic/numpy/asfarray.hpp" +#include "pythonic/numpy/conj.hpp" #include "pythonic/numpy/inf.hpp" #include "pythonic/numpy/max.hpp" #include "pythonic/numpy/min.hpp" #include "pythonic/numpy/power.hpp" #include "pythonic/numpy/real.hpp" #include "pythonic/numpy/sqrt.hpp" -#include "pythonic/builtins/pythran/abssqr.hpp" #include "pythonic/numpy/sum.hpp" -#include "pythonic/builtins/NotImplementedError.hpp" PYTHONIC_NS_BEGIN namespace numpy { @@ -20,8 +20,8 @@ namespace numpy { template auto norm(Array &&array, types::none_type ord, types::none_type axis) - -> decltype( - pythonic::numpy::functor::sqrt{}(pythonic::numpy::functor::sum{}( + -> decltype(pythonic::numpy::functor::sqrt{}( + pythonic::numpy::functor::sum{}( pythonic::builtins::pythran::functor::abssqr{}( std::forward(array))))) { @@ -38,7 +38,7 @@ namespace numpy return norm(std::forward(x), ord, 0L); case 2: return norm(std::forward(x), ord, - types::array{{0L, 1L}}); + types::array_tuple{{0L, 1L}}); default: throw pythonic::builtins::NotImplementedError( "Invalid norm order for matrices."); @@ -80,17 +80,18 @@ namespace numpy return norm(std::forward(x), 2., axis); } template - norm_t norm(Array &&x, double ord, types::array axis) + norm_t norm(Array &&x, double ord, types::array_tuple axis) { return norm(std::forward(x), ord, axis[0]); } template - norm_t norm(Array &&array, double ord, types::array axis) + norm_t norm(Array &&array, double ord, + types::array_tuple axis) { throw pythonic::builtins::NotImplementedError("We need more dev!"); } - } -} + } // namespace linalg +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/linspace.hpp b/pythran/pythonic/numpy/linspace.hpp index 9d08a98426..9ee28f1276 100644 --- a/pythran/pythonic/numpy/linspace.hpp +++ b/pythran/pythonic/numpy/linspace.hpp @@ -22,7 +22,7 @@ namespace numpy else return arange(start, stop + (endpoint ? step * .5 : 0), step, d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/log.hpp b/pythran/pythonic/numpy/log.hpp index c21b213e4d..e7b198c853 100644 --- a/pythran/pythonic/numpy/log.hpp +++ b/pythran/pythonic/numpy/log.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/log.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log #define NUMPY_NARY_FUNC_SYM xsimd::log #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/log10.hpp b/pythran/pythonic/numpy/log10.hpp index 6548a7bc39..758b861909 100644 --- a/pythran/pythonic/numpy/log10.hpp +++ b/pythran/pythonic/numpy/log10.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/log10.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log10 #define NUMPY_NARY_FUNC_SYM xsimd::log10 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/log1p.hpp b/pythran/pythonic/numpy/log1p.hpp index 68622caf83..031a0506ed 100644 --- a/pythran/pythonic/numpy/log1p.hpp +++ b/pythran/pythonic/numpy/log1p.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/log1p.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log1p #define NUMPY_NARY_FUNC_SYM xsimd::log1p #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/log2.hpp b/pythran/pythonic/numpy/log2.hpp index ff251e7766..74c7c43ee9 100644 --- a/pythran/pythonic/numpy/log2.hpp +++ b/pythran/pythonic/numpy/log2.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/log2.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME log2 #define NUMPY_NARY_FUNC_SYM xsimd::log2 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logaddexp.hpp b/pythran/pythonic/numpy/logaddexp.hpp index 6db4baa5d4..f198ee7fa2 100644 --- a/pythran/pythonic/numpy/logaddexp.hpp +++ b/pythran/pythonic/numpy/logaddexp.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/logaddexp.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/numpy/exp.hpp" +#include "pythonic/numpy/log.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/numpy/log.hpp" -#include "pythonic/numpy/exp.hpp" PYTHONIC_NS_BEGIN @@ -21,12 +21,12 @@ namespace numpy { return functor::log{}(functor::exp{}(t0) + functor::exp{}(t1)); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logaddexp #define NUMPY_NARY_FUNC_SYM wrapper::logaddexp #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logaddexp2.hpp b/pythran/pythonic/numpy/logaddexp2.hpp index 5a210edf6a..b776d5e01a 100644 --- a/pythran/pythonic/numpy/logaddexp2.hpp +++ b/pythran/pythonic/numpy/logaddexp2.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/logaddexp2.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" #include "pythonic/numpy/log2.hpp" @@ -25,12 +25,12 @@ namespace numpy return functor::log2{}(functor::power{}(T0(2), t0) + functor::power{}(T1(2), t1)); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logaddexp2 #define NUMPY_NARY_FUNC_SYM wrapper::logaddexp2 #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logical_and.hpp b/pythran/pythonic/numpy/logical_and.hpp index c9b92e52fd..1d70dca302 100644 --- a/pythran/pythonic/numpy/logical_and.hpp +++ b/pythran/pythonic/numpy/logical_and.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/logical_and.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -16,16 +16,16 @@ namespace numpy namespace wrapper { template - auto logical_and(T0 const &t0, T1 const &t1) -> decltype(t0 &&t1) + auto logical_and(T0 const &t0, T1 const &t1) -> decltype(t0 && t1) { return t0 && t1; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logical_and #define NUMPY_NARY_FUNC_SYM wrapper::logical_and #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logical_not.hpp b/pythran/pythonic/numpy/logical_not.hpp index 00b1e63a28..efd9911616 100644 --- a/pythran/pythonic/numpy/logical_not.hpp +++ b/pythran/pythonic/numpy/logical_not.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/logical_not.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/not_.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/not_.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME logical_not #define NUMPY_NARY_FUNC_SYM pythonic::operator_::not_ #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logical_or.hpp b/pythran/pythonic/numpy/logical_or.hpp index 5c8614bbbd..3aa92f6b2a 100644 --- a/pythran/pythonic/numpy/logical_or.hpp +++ b/pythran/pythonic/numpy/logical_or.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/logical_or.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -19,12 +19,12 @@ namespace numpy { return t0 || t1; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logical_or #define NUMPY_NARY_FUNC_SYM wrapper::logical_or #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logical_xor.hpp b/pythran/pythonic/numpy/logical_xor.hpp index a01ac9d30e..6758609df3 100644 --- a/pythran/pythonic/numpy/logical_xor.hpp +++ b/pythran/pythonic/numpy/logical_xor.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/logical_xor.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,17 +15,17 @@ namespace numpy namespace wrapper { template - auto logical_xor(T0 const &t0, T1 const &t1) - -> decltype((t0 && !t1) || (t1 && !t0)) + auto logical_xor(T0 const &t0, + T1 const &t1) -> decltype((t0 && !t1) || (t1 && !t0)) { return (t0 && !t1) || (t1 && !t0); } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME logical_xor #define NUMPY_NARY_FUNC_SYM wrapper::logical_xor #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/logspace.hpp b/pythran/pythonic/numpy/logspace.hpp index a9e9a5e656..8f33b1c38f 100644 --- a/pythran/pythonic/numpy/logspace.hpp +++ b/pythran/pythonic/numpy/logspace.hpp @@ -17,7 +17,7 @@ namespace numpy return functor::power()(base, functor::linspace()(start, stop, num, endpoint)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/max.hpp b/pythran/pythonic/numpy/max.hpp index 27012a4f14..6286642752 100644 --- a/pythran/pythonic/numpy/max.hpp +++ b/pythran/pythonic/numpy/max.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/max.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/reduce.hpp" #include "pythonic/operator_/imax.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,12 +13,12 @@ namespace numpy { template - auto max(Args &&... args) + auto max(Args &&...args) -> decltype(reduce(std::forward(args)...)) { return reduce(std::forward(args)...); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/maximum.hpp b/pythran/pythonic/numpy/maximum.hpp index c53d7f070f..568d2e8439 100644 --- a/pythran/pythonic/numpy/maximum.hpp +++ b/pythran/pythonic/numpy/maximum.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/maximum.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME maximum #define NUMPY_NARY_FUNC_SYM xsimd::max #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/mean.hpp b/pythran/pythonic/numpy/mean.hpp index 5553f9e228..a4266b7633 100644 --- a/pythran/pythonic/numpy/mean.hpp +++ b/pythran/pythonic/numpy/mean.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_NUMPY_MEAN_HPP #define PYTHONIC_NUMPY_MEAN_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/numpy/mean.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/asarray.hpp" #include "pythonic/numpy/expand_dims.hpp" #include "pythonic/numpy/sum.hpp" -#include "pythonic/builtins/None.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -48,7 +48,7 @@ namespace numpy { return expand_dims(mean(expr, axis, d), axis); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/median.hpp b/pythran/pythonic/numpy/median.hpp index f25ac303a1..939d2a3dd1 100644 --- a/pythran/pythonic/numpy/median.hpp +++ b/pythran/pythonic/numpy/median.hpp @@ -85,21 +85,22 @@ namespace numpy template typename std::enable_if< std::tuple_size::value != 1, - types::ndarray() + 1.), - types::array::value - 1>>>::type + types::ndarray< + decltype(std::declval() + 1.), + types::array_tuple::value - 1>>>::type median(types::ndarray const &arr, long axis) { constexpr auto N = std::tuple_size::value; if (axis < 0) axis += N; - types::array::value - 1> shp; + types::array_tuple::value - 1> shp; auto stmp = sutils::getshape(arr); auto next = std::copy(stmp.begin(), stmp.begin() + axis, shp.begin()); std::copy(stmp.begin() + axis + 1, stmp.end(), next); types::ndarray() + 1.), - types::array::value - 1>> + types::array_tuple::value - 1>> out(shp, types::none_type{}); _median(out.buffer, arr, axis); return out; diff --git a/pythran/pythonic/numpy/min.hpp b/pythran/pythonic/numpy/min.hpp index aef1293633..3bff120ae6 100644 --- a/pythran/pythonic/numpy/min.hpp +++ b/pythran/pythonic/numpy/min.hpp @@ -13,12 +13,12 @@ namespace numpy { template - auto min(Args &&... args) + auto min(Args &&...args) -> decltype(reduce(std::forward(args)...)) { return reduce(std::forward(args)...); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/minimum.hpp b/pythran/pythonic/numpy/minimum.hpp index 503c7573da..851e5e8e64 100644 --- a/pythran/pythonic/numpy/minimum.hpp +++ b/pythran/pythonic/numpy/minimum.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/minimum.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME minimum #define NUMPY_NARY_FUNC_SYM xsimd::min #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/multiply.hpp b/pythran/pythonic/numpy/multiply.hpp index a62644f9c3..10aef3f9a2 100644 --- a/pythran/pythonic/numpy/multiply.hpp +++ b/pythran/pythonic/numpy/multiply.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/multiply.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/mul.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/mul.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME multiply #define NUMPY_NARY_FUNC_SYM pythonic::operator_::mul #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nan_to_num.hpp b/pythran/pythonic/numpy/nan_to_num.hpp index 0a4bbe2ba4..91bee3ecee 100644 --- a/pythran/pythonic/numpy/nan_to_num.hpp +++ b/pythran/pythonic/numpy/nan_to_num.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/nan_to_num.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/numpy/isinf.hpp" #include "pythonic/numpy/isnan.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_traits.hpp" #include @@ -31,12 +31,12 @@ namespace numpy else return a; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME nan_to_num #define NUMPY_NARY_FUNC_SYM wrapper::nan_to_num #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nanargmax.hpp b/pythran/pythonic/numpy/nanargmax.hpp index a64f8cbb31..931e14a212 100644 --- a/pythran/pythonic/numpy/nanargmax.hpp +++ b/pythran/pythonic/numpy/nanargmax.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/nanargmax.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/isnan.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -35,7 +35,7 @@ namespace numpy _nanargmax((*begin).begin(), (*begin).end(), max, index, where, utils::int_()); } - } + } // namespace template long nanargmax(E const &expr) @@ -50,7 +50,7 @@ namespace numpy else throw types::ValueError("empty sequence"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nanargmin.hpp b/pythran/pythonic/numpy/nanargmin.hpp index 3ea1be2129..5a1ec07557 100644 --- a/pythran/pythonic/numpy/nanargmin.hpp +++ b/pythran/pythonic/numpy/nanargmin.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/nanargmin.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/isnan.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -36,7 +36,7 @@ namespace numpy _nanargmin((*begin).begin(), (*begin).end(), min, index, where, utils::int_()); } - } + } // namespace template long nanargmin(E const &expr) @@ -51,7 +51,7 @@ namespace numpy else throw types::ValueError("empty sequence"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nanmax.hpp b/pythran/pythonic/numpy/nanmax.hpp index 618fba3ae5..ed69f52f52 100644 --- a/pythran/pythonic/numpy/nanmax.hpp +++ b/pythran/pythonic/numpy/nanmax.hpp @@ -37,7 +37,7 @@ namespace numpy utils::int_()); return found; } - } + } // namespace template typename E::dtype nanmax(E const &expr) @@ -49,7 +49,7 @@ namespace numpy max = std::numeric_limits::quiet_NaN(); return max; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nanmin.hpp b/pythran/pythonic/numpy/nanmin.hpp index f80f98086e..6f06df15ac 100644 --- a/pythran/pythonic/numpy/nanmin.hpp +++ b/pythran/pythonic/numpy/nanmin.hpp @@ -37,7 +37,7 @@ namespace numpy utils::int_()); return found; } - } + } // namespace template typename E::dtype nanmin(E const &expr) @@ -49,7 +49,7 @@ namespace numpy min = std::numeric_limits::quiet_NaN(); return min; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nansum.hpp b/pythran/pythonic/numpy/nansum.hpp index 65b2e1508b..abd2790cb0 100644 --- a/pythran/pythonic/numpy/nansum.hpp +++ b/pythran/pythonic/numpy/nansum.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/nansum.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/isnan.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -34,7 +34,7 @@ namespace numpy _nansum(expr.begin(), expr.end(), s, utils::int_()); return s; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray.hpp b/pythran/pythonic/numpy/ndarray.hpp index 663cc823d3..cf84d27eab 100644 --- a/pythran/pythonic/numpy/ndarray.hpp +++ b/pythran/pythonic/numpy/ndarray.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/ndarray.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/nested_container.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -32,7 +32,7 @@ namespace numpy { return ndarray(types::pshape>({}), d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/astype.hpp b/pythran/pythonic/numpy/ndarray/astype.hpp index d054f80a68..5b48d3ae0a 100644 --- a/pythran/pythonic/numpy/ndarray/astype.hpp +++ b/pythran/pythonic/numpy/ndarray/astype.hpp @@ -16,8 +16,8 @@ namespace numpy { return asarray(std::forward(e), d); } - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/fill.hpp b/pythran/pythonic/numpy/ndarray/fill.hpp index f4690a3ffc..a69e1e84e3 100644 --- a/pythran/pythonic/numpy/ndarray/fill.hpp +++ b/pythran/pythonic/numpy/ndarray/fill.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/ndarray/fill.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -27,8 +27,8 @@ namespace numpy std::fill(e.fbegin(), e.fend(), f); return builtins::None; } - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/flatten.hpp b/pythran/pythonic/numpy/ndarray/flatten.hpp index 6e0afe6fb3..1c260db223 100644 --- a/pythran/pythonic/numpy/ndarray/flatten.hpp +++ b/pythran/pythonic/numpy/ndarray/flatten.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/ndarray/flatten.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -21,8 +21,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(flatten); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/item.hpp b/pythran/pythonic/numpy/ndarray/item.hpp index cb2ba3626b..e08caf0698 100644 --- a/pythran/pythonic/numpy/ndarray/item.hpp +++ b/pythran/pythonic/numpy/ndarray/item.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/ndarray/item.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -24,7 +24,8 @@ namespace numpy } template - auto item(E &&expr, types::array const &i) -> decltype(expr[i]) + auto item(E &&expr, + types::array_tuple const &i) -> decltype(expr[i]) { return expr[i]; } @@ -37,7 +38,7 @@ namespace numpy i += expr.flat_size(); return asarray(std::forward(expr)).flat()[i]; } - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/reshape.hpp b/pythran/pythonic/numpy/ndarray/reshape.hpp index b8b6cc68d3..9e0c29678d 100644 --- a/pythran/pythonic/numpy/ndarray/reshape.hpp +++ b/pythran/pythonic/numpy/ndarray/reshape.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/ndarray/reshape.hpp" +#include "pythonic/builtins/ValueError.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/ValueError.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy (void)std::initializer_list{ (i == Is && (sutils::assign(std::get(p), v), true))...}; } - } + } // namespace misc template typename std::enable_if::value, types::ndarray>::type @@ -84,7 +84,7 @@ namespace numpy template auto reshape(types::ndarray const &expr, S0 i0, S1 i1, - S const &... indices) + S const &...indices) -> decltype(reshape(expr, types::pshape{i0, i1, indices...})) { @@ -92,8 +92,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(reshape); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/tofile.hpp b/pythran/pythonic/numpy/ndarray/tofile.hpp index 8a10719f73..8c64f1cde1 100644 --- a/pythran/pythonic/numpy/ndarray/tofile.hpp +++ b/pythran/pythonic/numpy/ndarray/tofile.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_NUMPY_NDARRAY_TOFILE_HPP #define PYTHONIC_NUMPY_NDARRAY_TOFILE_HPP -#include "pythonic/include/numpy/ndarray/tofile.hpp" #include "pythonic/builtins/FileNotFoundError.hpp" +#include "pythonic/include/numpy/ndarray/tofile.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" @@ -35,8 +35,8 @@ namespace numpy fs.write((char *)expr.buffer, sizeof(T) * expr.flat_size()); } NUMPY_EXPR_TO_NDARRAY0_IMPL(tofile); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/numpy/ndarray/tolist.hpp b/pythran/pythonic/numpy/ndarray/tolist.hpp index e7b07052f0..8731ca8754 100644 --- a/pythran/pythonic/numpy/ndarray/tolist.hpp +++ b/pythran/pythonic/numpy/ndarray/tolist.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/ndarray/tolist.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -36,8 +36,8 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(tolist); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndarray/tostring.hpp b/pythran/pythonic/numpy/ndarray/tostring.hpp index bb04b615df..9b01099a71 100644 --- a/pythran/pythonic/numpy/ndarray/tostring.hpp +++ b/pythran/pythonic/numpy/ndarray/tostring.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/ndarray/tostring.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy expr.flat_size() * sizeof(T)); } NUMPY_EXPR_TO_NDARRAY0_IMPL(tostring); - } -} + } // namespace ndarray +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndenumerate.hpp b/pythran/pythonic/numpy/ndenumerate.hpp index 150edfda89..5ef52f452c 100644 --- a/pythran/pythonic/numpy/ndenumerate.hpp +++ b/pythran/pythonic/numpy/ndenumerate.hpp @@ -21,10 +21,10 @@ namespace numpy } template - std::tuple, typename E::dtype> - ndenumerate_iterator::operator*() const + std::tuple, typename E::dtype> + ndenumerate_iterator::operator*() const { - types::array out; + types::array_tuple out; auto shape = sutils::getshape(expr); long mult = 1; for (long j = E::value - 1; j > 0; j--) { @@ -32,8 +32,8 @@ namespace numpy mult *= shape[j]; } out[0] = index / mult; - return std::tuple, typename E::dtype>{out, - *iter}; + return std::tuple, typename E::dtype>{ + out, *iter}; } template @@ -51,22 +51,22 @@ namespace numpy } template - bool ndenumerate_iterator:: - operator!=(ndenumerate_iterator const &other) const + bool ndenumerate_iterator::operator!=( + ndenumerate_iterator const &other) const { return index != other.index; } template - bool ndenumerate_iterator:: - operator<(ndenumerate_iterator const &other) const + bool + ndenumerate_iterator::operator<(ndenumerate_iterator const &other) const { return index < other.index; } template - long ndenumerate_iterator:: - operator-(ndenumerate_iterator const &other) const + long + ndenumerate_iterator::operator-(ndenumerate_iterator const &other) const { return index - other.index; } @@ -109,7 +109,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(ndenumerate); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndim.hpp b/pythran/pythonic/numpy/ndim.hpp index 1455284a57..34ddfb3d59 100644 --- a/pythran/pythonic/numpy/ndim.hpp +++ b/pythran/pythonic/numpy/ndim.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/ndim.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy { return std::tuple_size::value; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ndindex.hpp b/pythran/pythonic/numpy/ndindex.hpp index 24010dc5b3..e32e6bab84 100644 --- a/pythran/pythonic/numpy/ndindex.hpp +++ b/pythran/pythonic/numpy/ndindex.hpp @@ -17,16 +17,16 @@ namespace numpy } template - ndindex_iterator::ndindex_iterator(types::array const &shape, - long first) + ndindex_iterator::ndindex_iterator( + types::array_tuple const &shape, long first) : index(first), shape(shape) { } template - types::array ndindex_iterator::operator*() const + types::array_tuple ndindex_iterator::operator*() const { - types::array out; + types::array_tuple out; long mult = 1; for (long j = N - 1; j > 0; j--) { out[j] = (index / mult) % shape[j]; @@ -74,7 +74,7 @@ namespace numpy } template - _ndindex::_ndindex(types::array const &shape) + _ndindex::_ndindex(types::array_tuple const &shape) : ndindex_iterator(shape, 0), shape(shape), end_iter(shape, std::accumulate(shape.begin(), shape.end(), 1L, std::multiplies())) @@ -106,7 +106,7 @@ namespace numpy } template - _ndindex ndindex(types::array const &args) + _ndindex ndindex(types::array_tuple const &args) { return {args}; } @@ -115,7 +115,7 @@ namespace numpy { return {args}; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/negative.hpp b/pythran/pythonic/numpy/negative.hpp index bce0f54d22..f4aed3ff21 100644 --- a/pythran/pythonic/numpy/negative.hpp +++ b/pythran/pythonic/numpy/negative.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/negative.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/neg.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/neg.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME negative #define NUMPY_NARY_FUNC_SYM pythonic::operator_::neg #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nextafter.hpp b/pythran/pythonic/numpy/nextafter.hpp index cb2406107f..6dab2b00b5 100644 --- a/pythran/pythonic/numpy/nextafter.hpp +++ b/pythran/pythonic/numpy/nextafter.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/nextafter.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME nextafter #define NUMPY_NARY_FUNC_SYM std::nextafter #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/nonzero.hpp b/pythran/pythonic/numpy/nonzero.hpp index 401b7ce6e2..5b22e8ba57 100644 --- a/pythran/pythonic/numpy/nonzero.hpp +++ b/pythran/pythonic/numpy/nonzero.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/nonzero.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy namespace { template - void _nonzero(I begin, I end, O &out, types::array &curr, + void _nonzero(I begin, I end, O &out, types::array_tuple &curr, utils::int_<1>) { I start = begin; @@ -29,7 +29,7 @@ namespace numpy } template - void _nonzero(I begin, I end, O &out, types::array &curr, + void _nonzero(I begin, I end, O &out, types::array_tuple &curr, utils::int_) { I start = begin; @@ -39,10 +39,10 @@ namespace numpy utils::int_()); } } - } + } // namespace template - types::array>, sizeof...(Is)> + types::array_tuple>, sizeof...(Is)> init_buffers(long sz, utils::index_sequence) { auto fwd = [](long ret, long) { return ret; }; // just to avoid a warning @@ -51,33 +51,35 @@ namespace numpy template auto nonzero(E const &expr) - -> types::array>, E::value> + -> types::array_tuple>, + E::value> { constexpr long N = E::value; - typedef types::array>, E::value> + typedef types::array_tuple< + types::ndarray>, E::value> out_type; long sz = expr.flat_size(); - types::array>, N> out_buffers = - init_buffers(sz, utils::make_index_sequence()); - types::array out_iters; + types::array_tuple>, N> + out_buffers = init_buffers(sz, utils::make_index_sequence()); + types::array_tuple out_iters; for (size_t i = 0; i < N; ++i) out_iters[i] = out_buffers[i]->data; - types::array indices; + types::array_tuple indices; _nonzero(expr.begin(), expr.end(), out_iters, indices, utils::int_()); - types::array shape = { + types::array_tuple shape = { {(long)(out_iters[0] - out_buffers[0]->data)}}; out_type out; for (size_t i = 0; i < N; ++i) - out[i] = types::ndarray>( + out[i] = types::ndarray>( std::move(out_buffers[i]), shape); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/not_equal.hpp b/pythran/pythonic/numpy/not_equal.hpp index 27fafd6633..6ca0a4513a 100644 --- a/pythran/pythonic/numpy/not_equal.hpp +++ b/pythran/pythonic/numpy/not_equal.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/not_equal.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/ne.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/ne.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME not_equal #define NUMPY_NARY_FUNC_SYM pythonic::operator_::ne #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ones.hpp b/pythran/pythonic/numpy/ones.hpp index e7db4e7c01..13a9410980 100644 --- a/pythran/pythonic/numpy/ones.hpp +++ b/pythran/pythonic/numpy/ones.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/ones.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,8 +12,7 @@ namespace numpy { template - typename dtype::type - ones(std::tuple<> const &shape, dtype d) + typename dtype::type ones(std::tuple<> const &shape, dtype d) { return static_cast(1); } @@ -39,7 +38,7 @@ namespace numpy { return ones(types::pshape>({}), d); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ones_like.hpp b/pythran/pythonic/numpy/ones_like.hpp index fff0667d25..b6070aa733 100644 --- a/pythran/pythonic/numpy/ones_like.hpp +++ b/pythran/pythonic/numpy/ones_like.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/ones_like.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/ones.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,8 +12,8 @@ namespace numpy { template - auto ones_like(E const &expr, dtype d) - -> decltype(ones(sutils::getshape(expr), d)) + auto ones_like(E const &expr, + dtype d) -> decltype(ones(sutils::getshape(expr), d)) { return ones(sutils::getshape(expr), d); } @@ -25,7 +25,7 @@ namespace numpy { return ones(sutils::getshape(expr), types::dtype_t()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/outer.hpp b/pythran/pythonic/numpy/outer.hpp index 53da26e133..99d9983bff 100644 --- a/pythran/pythonic/numpy/outer.hpp +++ b/pythran/pythonic/numpy/outer.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/outer.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -19,8 +19,8 @@ namespace numpy { types::ndarray() + std::declval()), types::pshape> - out(types::pshape{a.flat_size(), b.flat_size()}, - builtins::None); + out(types::pshape{a.flat_size(), b.flat_size()}, + builtins::None); auto iter = out.fbegin(); for (auto iter_a = a.fbegin(), end_a = a.fend(); iter_a != end_a; ++iter_a) { @@ -32,26 +32,26 @@ namespace numpy } template - auto outer(types::ndarray const &a, E1 const &b) - -> decltype(outer(a, asarray(b))) + auto outer(types::ndarray const &a, + E1 const &b) -> decltype(outer(a, asarray(b))) { return outer(a, asarray(b)); } template - auto outer(E0 const &a, types::ndarray const &b) - -> decltype(outer(asarray(a), b)) + auto outer(E0 const &a, + types::ndarray const &b) -> decltype(outer(asarray(a), b)) { return outer(asarray(a), b); } template - auto outer(E0 const &a, E1 const &b) - -> decltype(outer(asarray(a), asarray(b))) + auto outer(E0 const &a, + E1 const &b) -> decltype(outer(asarray(a), asarray(b))) { return outer(asarray(a), asarray(b)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/partial_sum.hpp b/pythran/pythonic/numpy/partial_sum.hpp index baf029c0d1..2074d7ca0f 100644 --- a/pythran/pythonic/numpy/partial_sum.hpp +++ b/pythran/pythonic/numpy/partial_sum.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/partial_sum.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -70,7 +70,7 @@ namespace numpy return acc; } }; - } + } // namespace template types::ndarray> @@ -109,13 +109,13 @@ namespace numpy } else { std::transform( expr.begin(), expr.end(), the_partial_sum.begin(), - [axis, d]( - typename std::iterator_traits::value_type + [axis, + d](typename std::iterator_traits::value_type other) { return partial_sum(other, axis - 1, d); }); } return the_partial_sum; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/place.hpp b/pythran/pythonic/numpy/place.hpp index 5e21e7f8af..5cf1da62ca 100644 --- a/pythran/pythonic/numpy/place.hpp +++ b/pythran/pythonic/numpy/place.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/place.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -45,7 +45,7 @@ namespace numpy { throw std::runtime_error("place only partially implemented"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/power.hpp b/pythran/pythonic/numpy/power.hpp index b50a6c84a9..ef3c9e04bb 100644 --- a/pythran/pythonic/numpy/power.hpp +++ b/pythran/pythonic/numpy/power.hpp @@ -15,7 +15,7 @@ namespace numpy // no need to adapt_type here, as it may turn a**2 into a**2.f #define NUMPY_NARY_RESHAPE_MODE reshape_type #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/prod.hpp b/pythran/pythonic/numpy/prod.hpp index 428c039daa..d6409da68f 100644 --- a/pythran/pythonic/numpy/prod.hpp +++ b/pythran/pythonic/numpy/prod.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/prod.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/reduce.hpp" #include "pythonic/operator_/imul.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -13,12 +13,12 @@ namespace numpy { template - auto prod(Args &&... args) + auto prod(Args &&...args) -> decltype(reduce(std::forward(args)...)) { return reduce(std::forward(args)...); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ptp.hpp b/pythran/pythonic/numpy/ptp.hpp index 572f7b2e23..5db6f7036f 100644 --- a/pythran/pythonic/numpy/ptp.hpp +++ b/pythran/pythonic/numpy/ptp.hpp @@ -3,16 +3,16 @@ #include "pythonic/include/numpy/ptp.hpp" -#include "pythonic/numpy/min.hpp" #include "pythonic/numpy/max.hpp" +#include "pythonic/numpy/min.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto ptp(E const &expr, long axis) - -> decltype(max(expr, axis) - min(expr, axis)) + auto ptp(E const &expr, + long axis) -> decltype(max(expr, axis) - min(expr, axis)) { return max(expr, axis) - min(expr, axis); } @@ -22,7 +22,7 @@ namespace numpy { return max(expr) - min(expr); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/put.hpp b/pythran/pythonic/numpy/put.hpp index 627c07992b..fc7b27d34a 100644 --- a/pythran/pythonic/numpy/put.hpp +++ b/pythran/pythonic/numpy/put.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/put.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" +#include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/builtins/ValueError.hpp" PYTHONIC_NS_BEGIN @@ -43,7 +43,7 @@ namespace numpy { throw std::runtime_error("put only partially implemented"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/putmask.hpp b/pythran/pythonic/numpy/putmask.hpp index 1640cbed4a..8b9b9f14aa 100644 --- a/pythran/pythonic/numpy/putmask.hpp +++ b/pythran/pythonic/numpy/putmask.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/putmask.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/numpy/asarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -31,7 +31,7 @@ namespace numpy { throw std::runtime_error("putmask only partially implemented"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/rad2deg.hpp b/pythran/pythonic/numpy/rad2deg.hpp index 977848da0c..6eb74de1f8 100644 --- a/pythran/pythonic/numpy/rad2deg.hpp +++ b/pythran/pythonic/numpy/rad2deg.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/numpy/rad2deg.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/numpy/pi.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/numpy/pi.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME rad2deg #define NUMPY_NARY_FUNC_SYM wrapper::rad2deg #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/random/binomial.hpp b/pythran/pythonic/numpy/random/binomial.hpp index 5d9dbda7ca..b0b556bc11 100644 --- a/pythran/pythonic/numpy/random/binomial.hpp +++ b/pythran/pythonic/numpy/random/binomial.hpp @@ -38,9 +38,9 @@ namespace numpy } inline auto binomial(double n, double p, long size) - -> decltype(binomial(n, p, types::array{{size}})) + -> decltype(binomial(n, p, types::array_tuple{{size}})) { - return binomial(n, p, types::array{{size}}); + return binomial(n, p, types::array_tuple{{size}}); } inline long binomial(double n, double p, types::none_type d) diff --git a/pythran/pythonic/numpy/random/chisquare.hpp b/pythran/pythonic/numpy/random/chisquare.hpp index d66fd816ab..b2292f93bd 100644 --- a/pythran/pythonic/numpy/random/chisquare.hpp +++ b/pythran/pythonic/numpy/random/chisquare.hpp @@ -29,10 +29,10 @@ namespace numpy } inline auto chisquare(double df, long size) - -> decltype(chisquare(df, types::array{{size}})) + -> decltype(chisquare(df, types::array_tuple{{size}})) { - return chisquare(df, types::array{{size}}); + return chisquare(df, types::array_tuple{{size}}); } inline double chisquare(double df, types::none_type d) diff --git a/pythran/pythonic/numpy/random/choice.hpp b/pythran/pythonic/numpy/random/choice.hpp index 680789cde0..1027cd8113 100644 --- a/pythran/pythonic/numpy/random/choice.hpp +++ b/pythran/pythonic/numpy/random/choice.hpp @@ -46,8 +46,8 @@ namespace numpy } template - auto choice(long max, T &&size) - -> decltype(randint(0, max, std::forward(size))) + auto choice(long max, + T &&size) -> decltype(randint(0, max, std::forward(size))) { return randint(0, max, std::forward(size)); } diff --git a/pythran/pythonic/numpy/random/dirichlet.hpp b/pythran/pythonic/numpy/random/dirichlet.hpp index 0eea6cf827..dcebd4199f 100644 --- a/pythran/pythonic/numpy/random/dirichlet.hpp +++ b/pythran/pythonic/numpy/random/dirichlet.hpp @@ -29,10 +29,10 @@ namespace numpy } inline auto dirichlet(double alpha, long size) - -> decltype(dirichlet(alpha, types::array{{size}})) + -> decltype(dirichlet(alpha, types::array_tuple{{size}})) { - return dirichlet(alpha, types::array{{size}}); + return dirichlet(alpha, types::array_tuple{{size}}); } inline double dirichlet(double alpha, types::none_type d) diff --git a/pythran/pythonic/numpy/random/exponential.hpp b/pythran/pythonic/numpy/random/exponential.hpp index 37d2d019d1..ae3abd473f 100644 --- a/pythran/pythonic/numpy/random/exponential.hpp +++ b/pythran/pythonic/numpy/random/exponential.hpp @@ -29,10 +29,10 @@ namespace numpy } inline auto exponential(double scale, long size) - -> decltype(exponential(scale, types::array{{size}})) + -> decltype(exponential(scale, types::array_tuple{{size}})) { - return exponential(scale, types::array{{size}}); + return exponential(scale, types::array_tuple{{size}}); } inline double exponential(double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/f.hpp b/pythran/pythonic/numpy/random/f.hpp index fbc4322856..d6dcf1bcd5 100644 --- a/pythran/pythonic/numpy/random/f.hpp +++ b/pythran/pythonic/numpy/random/f.hpp @@ -31,10 +31,11 @@ namespace numpy return result; } - inline auto f(double dfnum, double dfden, long size) - -> decltype(f(dfnum, dfden, types::array{{size}})) + inline auto f(double dfnum, double dfden, + long size) -> decltype(f(dfnum, dfden, + types::array_tuple{{size}})) { - return f(dfnum, dfden, types::array{{size}}); + return f(dfnum, dfden, types::array_tuple{{size}}); } inline double f(double dfnum, double dfden, types::none_type d) diff --git a/pythran/pythonic/numpy/random/gamma.hpp b/pythran/pythonic/numpy/random/gamma.hpp index 55bbe5a7a2..9d6cc1fb83 100644 --- a/pythran/pythonic/numpy/random/gamma.hpp +++ b/pythran/pythonic/numpy/random/gamma.hpp @@ -30,9 +30,9 @@ namespace numpy } inline auto gamma(double shape, double scale, long size) - -> decltype(gamma(shape, scale, types::array{{size}})) + -> decltype(gamma(shape, scale, types::array_tuple{{size}})) { - return gamma(shape, scale, types::array{{size}}); + return gamma(shape, scale, types::array_tuple{{size}}); } inline double gamma(double shape, double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/geometric.hpp b/pythran/pythonic/numpy/random/geometric.hpp index b1f661f86e..fffb8ce8e9 100644 --- a/pythran/pythonic/numpy/random/geometric.hpp +++ b/pythran/pythonic/numpy/random/geometric.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto geometric(double p, long size) - -> decltype(geometric(p, types::array{{size}})) + -> decltype(geometric(p, types::array_tuple{{size}})) { - return geometric(p, types::array{{size}}); + return geometric(p, types::array_tuple{{size}}); } inline double geometric(double p, types::none_type d) diff --git a/pythran/pythonic/numpy/random/gumbel.hpp b/pythran/pythonic/numpy/random/gumbel.hpp index d74adeb349..666c6906f9 100644 --- a/pythran/pythonic/numpy/random/gumbel.hpp +++ b/pythran/pythonic/numpy/random/gumbel.hpp @@ -28,9 +28,9 @@ namespace numpy } inline auto gumbel(double loc, double scale, long size) - -> decltype(gumbel(loc, scale, types::array{{size}})) + -> decltype(gumbel(loc, scale, types::array_tuple{{size}})) { - return gumbel(loc, scale, types::array{{size}}); + return gumbel(loc, scale, types::array_tuple{{size}}); } inline double gumbel(double loc, double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/laplace.hpp b/pythran/pythonic/numpy/random/laplace.hpp index ce2eac46f0..a000332971 100644 --- a/pythran/pythonic/numpy/random/laplace.hpp +++ b/pythran/pythonic/numpy/random/laplace.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto laplace(double loc, double scale, long size) - -> decltype(laplace(loc, scale, types::array{{size}})) + -> decltype(laplace(loc, scale, types::array_tuple{{size}})) { - return laplace(loc, scale, types::array{{size}}); + return laplace(loc, scale, types::array_tuple{{size}}); } inline double laplace(double loc, double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/logistic.hpp b/pythran/pythonic/numpy/random/logistic.hpp index 6537964c3f..bb9cbb4e66 100644 --- a/pythran/pythonic/numpy/random/logistic.hpp +++ b/pythran/pythonic/numpy/random/logistic.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto logistic(double loc, double scale, long size) - -> decltype(logistic(loc, scale, types::array{{size}})) + -> decltype(logistic(loc, scale, types::array_tuple{{size}})) { - return logistic(loc, scale, types::array{{size}}); + return logistic(loc, scale, types::array_tuple{{size}}); } inline double logistic(double loc, double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/lognormal.hpp b/pythran/pythonic/numpy/random/lognormal.hpp index 91d2843b1d..be6b570571 100644 --- a/pythran/pythonic/numpy/random/lognormal.hpp +++ b/pythran/pythonic/numpy/random/lognormal.hpp @@ -30,9 +30,9 @@ namespace numpy } inline auto lognormal(double mean, double sigma, long size) - -> decltype(lognormal(mean, sigma, types::array{{size}})) + -> decltype(lognormal(mean, sigma, types::array_tuple{{size}})) { - return lognormal(mean, sigma, types::array{{size}}); + return lognormal(mean, sigma, types::array_tuple{{size}}); } inline double lognormal(double mean, double sigma, types::none_type d) diff --git a/pythran/pythonic/numpy/random/logseries.hpp b/pythran/pythonic/numpy/random/logseries.hpp index c99fb95a63..89bf6d377b 100644 --- a/pythran/pythonic/numpy/random/logseries.hpp +++ b/pythran/pythonic/numpy/random/logseries.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto logseries(double p, long size) - -> decltype(logseries(p, types::array{{size}})) + -> decltype(logseries(p, types::array_tuple{{size}})) { - return logseries(p, types::array{{size}}); + return logseries(p, types::array_tuple{{size}}); } inline double logseries(double p, types::none_type d) diff --git a/pythran/pythonic/numpy/random/negative_binomial.hpp b/pythran/pythonic/numpy/random/negative_binomial.hpp index 3f015f3f5d..1e09660f81 100644 --- a/pythran/pythonic/numpy/random/negative_binomial.hpp +++ b/pythran/pythonic/numpy/random/negative_binomial.hpp @@ -30,9 +30,10 @@ namespace numpy } inline auto negative_binomial(long n, double p, long size) - -> decltype(negative_binomial(n, p, types::array{{size}})) + -> decltype(negative_binomial(n, p, + types::array_tuple{{size}})) { - return negative_binomial(n, p, types::array{{size}}); + return negative_binomial(n, p, types::array_tuple{{size}}); } inline long negative_binomial(long n, double p, types::none_type d) diff --git a/pythran/pythonic/numpy/random/normal.hpp b/pythran/pythonic/numpy/random/normal.hpp index 3c755d1432..962ec6c5e4 100644 --- a/pythran/pythonic/numpy/random/normal.hpp +++ b/pythran/pythonic/numpy/random/normal.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto normal(double loc, double scale, long size) - -> decltype(normal(loc, scale, types::array{{size}})) + -> decltype(normal(loc, scale, types::array_tuple{{size}})) { - return normal(loc, scale, types::array{{size}}); + return normal(loc, scale, types::array_tuple{{size}}); } inline double normal(double loc, double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/pareto.hpp b/pythran/pythonic/numpy/random/pareto.hpp index 3cd7349d37..8900b2a5c5 100644 --- a/pythran/pythonic/numpy/random/pareto.hpp +++ b/pythran/pythonic/numpy/random/pareto.hpp @@ -30,10 +30,10 @@ namespace numpy } inline auto pareto(double a, long size) - -> decltype(pareto(a, types::array{{size}})) + -> decltype(pareto(a, types::array_tuple{{size}})) { - return pareto(a, types::array{{size}}); + return pareto(a, types::array_tuple{{size}}); } inline double pareto(double a, types::none_type d) diff --git a/pythran/pythonic/numpy/random/poisson.hpp b/pythran/pythonic/numpy/random/poisson.hpp index 27249929bd..d52671aa6b 100644 --- a/pythran/pythonic/numpy/random/poisson.hpp +++ b/pythran/pythonic/numpy/random/poisson.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto poisson(double lam, long size) - -> decltype(poisson(lam, types::array{{size}})) + -> decltype(poisson(lam, types::array_tuple{{size}})) { - return poisson(lam, types::array{{size}}); + return poisson(lam, types::array_tuple{{size}}); } inline double poisson(double lam, types::none_type d) diff --git a/pythran/pythonic/numpy/random/power.hpp b/pythran/pythonic/numpy/random/power.hpp index 8178ff4f96..36db5bcdd4 100644 --- a/pythran/pythonic/numpy/random/power.hpp +++ b/pythran/pythonic/numpy/random/power.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto power(double a, long size) - -> decltype(power(a, types::array{{size}})) + -> decltype(power(a, types::array_tuple{{size}})) { - return power(a, types::array{{size}}); + return power(a, types::array_tuple{{size}}); } inline double power(double a, types::none_type d) diff --git a/pythran/pythonic/numpy/random/rand.hpp b/pythran/pythonic/numpy/random/rand.hpp index 234e32f31a..677fd5e6ff 100644 --- a/pythran/pythonic/numpy/random/rand.hpp +++ b/pythran/pythonic/numpy/random/rand.hpp @@ -15,9 +15,10 @@ namespace numpy { template - types::ndarray> rand(T... shape) + types::ndarray> + rand(T... shape) { - return random(types::array{{shape...}}); + return random(types::array_tuple{{shape...}}); } inline double rand() diff --git a/pythran/pythonic/numpy/random/randint.hpp b/pythran/pythonic/numpy/random/randint.hpp index bed34f861c..9911415453 100644 --- a/pythran/pythonic/numpy/random/randint.hpp +++ b/pythran/pythonic/numpy/random/randint.hpp @@ -37,16 +37,16 @@ namespace numpy } template - auto randint(long max, types::none_type, pS const &shape) - -> decltype(randint(0, max, shape)) + auto randint(long max, types::none_type, + pS const &shape) -> decltype(randint(0, max, shape)) { return randint(0, max, shape); } inline auto randint(long min, long max, long size) - -> decltype(randint(min, max, types::array{{size}})) + -> decltype(randint(min, max, types::array_tuple{{size}})) { - return randint(min, max, types::array{{size}}); + return randint(min, max, types::array_tuple{{size}}); } inline long randint(long max, types::none_type) diff --git a/pythran/pythonic/numpy/random/randn.hpp b/pythran/pythonic/numpy/random/randn.hpp index 75198a9c51..c732058fd3 100644 --- a/pythran/pythonic/numpy/random/randn.hpp +++ b/pythran/pythonic/numpy/random/randn.hpp @@ -15,9 +15,11 @@ namespace numpy { template - types::ndarray> randn(T... shape) + types::ndarray> + randn(T... shape) { - return standard_normal(types::array{{shape...}}); + return standard_normal( + types::array_tuple{{shape...}}); } inline double randn() diff --git a/pythran/pythonic/numpy/random/random.hpp b/pythran/pythonic/numpy/random/random.hpp index 6c131c10f7..7bd6e85e9e 100644 --- a/pythran/pythonic/numpy/random/random.hpp +++ b/pythran/pythonic/numpy/random/random.hpp @@ -28,10 +28,10 @@ namespace numpy return result; } - inline auto random(long size) - -> decltype(random(types::array{{size}})) + inline auto + random(long size) -> decltype(random(types::array_tuple{{size}})) { - return random(types::array{{size}}); + return random(types::array_tuple{{size}}); } inline double random(types::none_type d) diff --git a/pythran/pythonic/numpy/random/rayleigh.hpp b/pythran/pythonic/numpy/random/rayleigh.hpp index c8f5d44a89..659d2d66d7 100644 --- a/pythran/pythonic/numpy/random/rayleigh.hpp +++ b/pythran/pythonic/numpy/random/rayleigh.hpp @@ -29,9 +29,9 @@ namespace numpy } inline auto rayleigh(double scale, long size) - -> decltype(rayleigh(scale, types::array{{size}})) + -> decltype(rayleigh(scale, types::array_tuple{{size}})) { - return rayleigh(scale, types::array{{size}}); + return rayleigh(scale, types::array_tuple{{size}}); } inline double rayleigh(double scale, types::none_type d) diff --git a/pythran/pythonic/numpy/random/shuffle.hpp b/pythran/pythonic/numpy/random/shuffle.hpp index 13e1451b82..e42200ef61 100644 --- a/pythran/pythonic/numpy/random/shuffle.hpp +++ b/pythran/pythonic/numpy/random/shuffle.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/random/shuffle.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -18,8 +18,8 @@ namespace numpy std::shuffle(seq.begin(), seq.end(), details::generator); return builtins::None; } - } -} + } // namespace random +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/numpy/random/standard_exponential.hpp b/pythran/pythonic/numpy/random/standard_exponential.hpp index f7c57b4dca..7aa72c55b4 100644 --- a/pythran/pythonic/numpy/random/standard_exponential.hpp +++ b/pythran/pythonic/numpy/random/standard_exponential.hpp @@ -26,9 +26,9 @@ namespace numpy } inline auto standard_exponential(long size) - -> decltype(standard_exponential(types::array{{size}})) + -> decltype(standard_exponential(types::array_tuple{{size}})) { - return standard_exponential(types::array{{size}}); + return standard_exponential(types::array_tuple{{size}}); } inline double standard_exponential(types::none_type d) diff --git a/pythran/pythonic/numpy/random/standard_gamma.hpp b/pythran/pythonic/numpy/random/standard_gamma.hpp index 8deed136a9..ffe82446db 100644 --- a/pythran/pythonic/numpy/random/standard_gamma.hpp +++ b/pythran/pythonic/numpy/random/standard_gamma.hpp @@ -26,9 +26,9 @@ namespace numpy } inline auto standard_gamma(double s, long size) - -> decltype(standard_gamma(s, types::array{{size}})) + -> decltype(standard_gamma(s, types::array_tuple{{size}})) { - return standard_gamma(s, types::array{{size}}); + return standard_gamma(s, types::array_tuple{{size}}); } inline double standard_gamma(double s, types::none_type d) diff --git a/pythran/pythonic/numpy/random/standard_normal.hpp b/pythran/pythonic/numpy/random/standard_normal.hpp index fb7b40712e..3b983ffae1 100644 --- a/pythran/pythonic/numpy/random/standard_normal.hpp +++ b/pythran/pythonic/numpy/random/standard_normal.hpp @@ -26,9 +26,9 @@ namespace numpy } inline auto standard_normal(long size) - -> decltype(standard_normal(types::array{{size}})) + -> decltype(standard_normal(types::array_tuple{{size}})) { - return standard_normal(types::array{{size}}); + return standard_normal(types::array_tuple{{size}}); } inline double standard_normal(types::none_type d) diff --git a/pythran/pythonic/numpy/random/uniform.hpp b/pythran/pythonic/numpy/random/uniform.hpp index cedfd74eca..29df0df1b5 100644 --- a/pythran/pythonic/numpy/random/uniform.hpp +++ b/pythran/pythonic/numpy/random/uniform.hpp @@ -30,9 +30,9 @@ namespace numpy } inline auto uniform(double low, double high, long size) - -> decltype(uniform(low, high, types::array{{size}})) + -> decltype(uniform(low, high, types::array_tuple{{size}})) { - return uniform(low, high, types::array{{size}}); + return uniform(low, high, types::array_tuple{{size}}); } inline double uniform(double low, double high, types::none_type d) diff --git a/pythran/pythonic/numpy/random/weibull.hpp b/pythran/pythonic/numpy/random/weibull.hpp index ee5b603032..2a78f0fe0d 100644 --- a/pythran/pythonic/numpy/random/weibull.hpp +++ b/pythran/pythonic/numpy/random/weibull.hpp @@ -29,10 +29,10 @@ namespace numpy } inline auto weibull(double a, long size) - -> decltype(weibull(a, types::array{{size}})) + -> decltype(weibull(a, types::array_tuple{{size}})) { - return weibull(a, types::array{{size}}); + return weibull(a, types::array_tuple{{size}}); } inline double weibull(double a, types::none_type d) diff --git a/pythran/pythonic/numpy/ravel.hpp b/pythran/pythonic/numpy/ravel.hpp index ae5b256f54..f8257fa399 100644 --- a/pythran/pythonic/numpy/ravel.hpp +++ b/pythran/pythonic/numpy/ravel.hpp @@ -18,7 +18,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(ravel); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/real.hpp b/pythran/pythonic/numpy/real.hpp index afa77bf773..28a4143ff8 100644 --- a/pythran/pythonic/numpy/real.hpp +++ b/pythran/pythonic/numpy/real.hpp @@ -3,18 +3,18 @@ #include "pythonic/include/numpy/real.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/asarray.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/types/list.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto real(E &&expr) - -> decltype(builtins::getattr(types::attr::REAL{}, std::forward(expr))) + auto real(E &&expr) -> decltype(builtins::getattr(types::attr::REAL{}, + std::forward(expr))) { return builtins::getattr(types::attr::REAL{}, std::forward(expr)); } @@ -25,7 +25,7 @@ namespace numpy { return real(numpy::functor::asarray{}(expr)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/reciprocal.hpp b/pythran/pythonic/numpy/reciprocal.hpp index 8d2286fc26..62c8b883b4 100644 --- a/pythran/pythonic/numpy/reciprocal.hpp +++ b/pythran/pythonic/numpy/reciprocal.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/reciprocal.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME reciprocal #define NUMPY_NARY_FUNC_SYM wrapper::reciprocal #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/reduce.hpp b/pythran/pythonic/numpy/reduce.hpp index a42f3bc332..e1b2588f14 100644 --- a/pythran/pythonic/numpy/reduce.hpp +++ b/pythran/pythonic/numpy/reduce.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/reduce.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/neutral.hpp" #ifdef USE_XSIMD @@ -277,7 +277,7 @@ namespace numpy axis += E::value; if (axis < 0 || size_t(axis) >= E::value) throw types::ValueError("axis out of bounds"); - types::array shp; + types::array_tuple shp; auto tmp = sutils::getshape(array); auto next = std::copy(tmp.begin(), tmp.begin() + axis, shp.begin()); std::copy(tmp.begin() + axis + 1, tmp.end(), next); @@ -315,7 +315,7 @@ namespace numpy } } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/remainder.hpp b/pythran/pythonic/numpy/remainder.hpp index cd7e8b683c..ddb1e6e750 100644 --- a/pythran/pythonic/numpy/remainder.hpp +++ b/pythran/pythonic/numpy/remainder.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/remainder.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME remainder #define NUMPY_NARY_FUNC_SYM wrapper::remainder #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/repeat.hpp b/pythran/pythonic/numpy/repeat.hpp index 5ea1085dac..a7acb2d906 100644 --- a/pythran/pythonic/numpy/repeat.hpp +++ b/pythran/pythonic/numpy/repeat.hpp @@ -3,17 +3,17 @@ #include "pythonic/include/numpy/repeat.hpp" +#include "pythonic/builtins/None.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/None.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> repeat(types::ndarray const &expr, long repeats, long axis) { constexpr auto N = std::tuple_size::value; @@ -25,7 +25,7 @@ namespace numpy 1L, std::multiplies()); shape[axis] *= repeats; - types::ndarray::value>> out( + types::ndarray::value>> out( shape, builtins::None); auto out_iter = out.fbegin(); for (auto iter = expr.fbegin(), end = expr.fend(); iter != end; @@ -48,7 +48,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(repeat); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/resize.hpp b/pythran/pythonic/numpy/resize.hpp index 2a247c516b..31c41e2bd8 100644 --- a/pythran/pythonic/numpy/resize.hpp +++ b/pythran/pythonic/numpy/resize.hpp @@ -3,7 +3,7 @@ #include "pythonic/include/numpy/resize.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/ndarray/reshape.hpp" +#include "pythonic/utils/functor.hpp" #endif diff --git a/pythran/pythonic/numpy/right_shift.hpp b/pythran/pythonic/numpy/right_shift.hpp index bf81419626..554e80de7d 100644 --- a/pythran/pythonic/numpy/right_shift.hpp +++ b/pythran/pythonic/numpy/right_shift.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/right_shift.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" #include "pythonic/operator_/rshift.hpp" @@ -17,7 +17,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME right_shift #define NUMPY_NARY_FUNC_SYM operator_::rshift #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/rint.hpp b/pythran/pythonic/numpy/rint.hpp index 8fe7e61350..b85810c9b5 100644 --- a/pythran/pythonic/numpy/rint.hpp +++ b/pythran/pythonic/numpy/rint.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/rint.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -23,11 +23,11 @@ namespace numpy { return {std::nearbyint(v.real()), std::nearbyint(v.imag())}; } - } + } // namespace wrapper #define NUMPY_NARY_FUNC_NAME rint #define NUMPY_NARY_FUNC_SYM wrapper::rint #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/roll.hpp b/pythran/pythonic/numpy/roll.hpp index ef9d71e358..a17d1db88d 100644 --- a/pythran/pythonic/numpy/roll.hpp +++ b/pythran/pythonic/numpy/roll.hpp @@ -32,7 +32,7 @@ namespace numpy { template To _roll(To to, From from, long shift, long axis, - types::array const &shape, utils::int_) + types::array_tuple const &shape, utils::int_) { long dim = shape[N - 1]; if (axis == N - 1) { @@ -47,7 +47,7 @@ namespace numpy template typename std::enable_if::type _roll(To to, From from, long shift, long axis, - types::array const &shape, utils::int_) + types::array_tuple const &shape, utils::int_) { long dim = shape[M]; long offset = std::accumulate(shape.begin() + M + 1, shape.end(), 1L, @@ -90,7 +90,7 @@ namespace numpy { template To _rolls(To to, From from, long shifts[N], - types::array const &shape, utils::int_) + types::array_tuple const &shape, utils::int_) { long dim = shape[N - 1]; if (long shift = shifts[N - 1]) { @@ -104,8 +104,8 @@ namespace numpy template typename std::enable_if::type - _rolls(To to, From from, long shifts[N], types::array const &shape, - utils::int_) + _rolls(To to, From from, long shifts[N], + types::array_tuple const &shape, utils::int_) { long dim = shape[M]; long offset = std::accumulate(shape.begin() + M + 1, shape.end(), 1L, @@ -128,8 +128,8 @@ namespace numpy template types::ndarray roll(types::ndarray const &expr, - types::array shifts, - types::array axes) + types::array_tuple shifts, + types::array_tuple axes) { constexpr long ndim = types::ndarray::value; auto expr_shape = sutils::array(expr._shape); diff --git a/pythran/pythonic/numpy/rollaxis.hpp b/pythran/pythonic/numpy/rollaxis.hpp index 3c034b0e1b..63da505b58 100644 --- a/pythran/pythonic/numpy/rollaxis.hpp +++ b/pythran/pythonic/numpy/rollaxis.hpp @@ -3,15 +3,15 @@ #include "pythonic/include/numpy/rollaxis.hpp" -#include "pythonic/numpy/transpose.hpp" #include "pythonic/numpy/copy.hpp" +#include "pythonic/numpy/transpose.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> rollaxis(types::ndarray const &a, long axis, long start) { long constexpr N = std::tuple_size::value; @@ -37,7 +37,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(rollaxis); -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/rot90.hpp b/pythran/pythonic/numpy/rot90.hpp index 584ed5229c..6650d2d14a 100644 --- a/pythran/pythonic/numpy/rot90.hpp +++ b/pythran/pythonic/numpy/rot90.hpp @@ -3,26 +3,26 @@ #include "pythonic/include/numpy/rot90.hpp" +#include "pythonic/numpy/copy.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/numpy/copy.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::ndarray::value>> + types::ndarray::value>> rot90(types::ndarray const &expr, int k) { auto constexpr N = std::tuple_size::value; if (k % 4 == 0) return copy(expr); - types::array shape = sutils::getshape(expr); + types::array_tuple shape = sutils::getshape(expr); if (k % 4 != 2) std::swap(shape[0], shape[1]); - types::ndarray> out(shape, builtins::None); + types::ndarray> out(shape, builtins::None); if (k % 4 == 1) { for (int i = 0; i < shape[1]; ++i) for (int j = 0; j < shape[0]; ++j) @@ -40,7 +40,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(rot90) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/searchsorted.hpp b/pythran/pythonic/numpy/searchsorted.hpp index 3346ca06ce..fc88ab0f1b 100644 --- a/pythran/pythonic/numpy/searchsorted.hpp +++ b/pythran/pythonic/numpy/searchsorted.hpp @@ -3,14 +3,14 @@ #include "pythonic/include/numpy/searchsorted.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/utils/int_.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/types/str.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/builtins/ValueError.hpp" #include "pythonic/numpy/asarray.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" +#include "pythonic/utils/int_.hpp" +#include "pythonic/utils/numpy_conversion.hpp" #include @@ -39,7 +39,7 @@ namespace numpy throw types::ValueError("'" + side + "' is an invalid value for keyword 'side'"); } - } + } // namespace details template typename std::enable_if::value, long>::type @@ -67,25 +67,25 @@ namespace numpy _search_sorted(a, (*ibegin).begin(), (*ibegin).end(), (*obegin).begin(), left, utils::int_()); } - } + } // namespace template typename std::enable_if< types::is_numexpr_arg::value, - types::ndarray>>::type + types::ndarray>>::type searchsorted(T const &a, E const &v, types::str const &side) { static_assert(T::value == 1, "Not Implemented : searchsorted for dimension != 1"); bool left = details::issearchsortedleft(side); - types::ndarray> out(asarray(v)._shape, - builtins::None); + types::ndarray> out( + asarray(v)._shape, builtins::None); _search_sorted(a, v.begin(), v.end(), out.begin(), left, utils::int_()); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/select.hpp b/pythran/pythonic/numpy/select.hpp index 0d76091acd..3b00ce46ef 100644 --- a/pythran/pythonic/numpy/select.hpp +++ b/pythran/pythonic/numpy/select.hpp @@ -44,17 +44,17 @@ namespace numpy utils::int_()); return size; } - } + } // namespace template - types::ndarray> + types::ndarray> select(C const &condlist, L const &choicelist, typename L::dtype _default) { constexpr size_t N = L::value - 1; auto &&choicelist0_shape = sutils::getshape(choicelist[0]); - types::ndarray> out( + types::ndarray> out( choicelist0_shape, _default); - types::ndarray> selected( + types::ndarray> selected( choicelist0_shape, false); long size = selected.flat_size(); for (long i = 0; i < condlist.size() && size != 0; i++) @@ -117,7 +117,7 @@ namespace numpy { return select_helper(condlist, choicelist, _default); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/shape.hpp b/pythran/pythonic/numpy/shape.hpp index 630e53aa22..e4e73f7504 100644 --- a/pythran/pythonic/numpy/shape.hpp +++ b/pythran/pythonic/numpy/shape.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/shape.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -22,7 +22,7 @@ namespace numpy { return sutils::getshape(e); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/sin.hpp b/pythran/pythonic/numpy/sin.hpp index 2034ed5248..00930fb9c5 100644 --- a/pythran/pythonic/numpy/sin.hpp +++ b/pythran/pythonic/numpy/sin.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/sin.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sin #define NUMPY_NARY_FUNC_SYM xsimd::sin #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/sinh.hpp b/pythran/pythonic/numpy/sinh.hpp index be22034ec8..c38c5833f7 100644 --- a/pythran/pythonic/numpy/sinh.hpp +++ b/pythran/pythonic/numpy/sinh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/sinh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sinh #define NUMPY_NARY_FUNC_SYM xsimd::sinh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/size.hpp b/pythran/pythonic/numpy/size.hpp index 813bc257e3..88e288828e 100644 --- a/pythran/pythonic/numpy/size.hpp +++ b/pythran/pythonic/numpy/size.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/size.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy { return e.flat_size(); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/sort.hpp b/pythran/pythonic/numpy/sort.hpp index 2f0a58b603..1fb91dccdc 100644 --- a/pythran/pythonic/numpy/sort.hpp +++ b/pythran/pythonic/numpy/sort.hpp @@ -9,7 +9,7 @@ namespace numpy { template - types::ndarray> + types::ndarray> sort(E const &expr, long axis) { auto out = functor::array{}(expr); @@ -18,7 +18,7 @@ namespace numpy } template - types::ndarray> + types::ndarray> sort(E const &expr, types::none_type) { auto out = functor::array{}(expr).flat(); @@ -27,14 +27,14 @@ namespace numpy } template - types::ndarray> + types::ndarray> sort(E const &expr, long axis, types::str const &kind) { auto out = functor::array{}(expr); ndarray::sort(out, axis, kind); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/sort_complex.hpp b/pythran/pythonic/numpy/sort_complex.hpp index 3bb53b2837..ad737e4cb7 100644 --- a/pythran/pythonic/numpy/sort_complex.hpp +++ b/pythran/pythonic/numpy/sort_complex.hpp @@ -3,7 +3,7 @@ #include "pythonic/include/numpy/sort_complex.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/sort.hpp" +#include "pythonic/utils/functor.hpp" #endif diff --git a/pythran/pythonic/numpy/spacing.hpp b/pythran/pythonic/numpy/spacing.hpp index 11bb465f6a..064298d18a 100644 --- a/pythran/pythonic/numpy/spacing.hpp +++ b/pythran/pythonic/numpy/spacing.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/spacing.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME spacing #define NUMPY_NARY_FUNC_SYM wrapper::spacing #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/split.hpp b/pythran/pythonic/numpy/split.hpp index 03436e9d7d..9e22cef39d 100644 --- a/pythran/pythonic/numpy/split.hpp +++ b/pythran/pythonic/numpy/split.hpp @@ -3,15 +3,16 @@ #include "pythonic/include/numpy/split.hpp" -#include "pythonic/numpy/array_split.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/numpy/array_split.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - types::list::value>>> + types::list< + types::ndarray::value>>> split(types::ndarray const &a, long nb_split) { if (a.flat_size() % nb_split != 0) @@ -23,19 +24,20 @@ namespace numpy typename std::enable_if< types::is_iterable::value, types::list::value>>>>::type + T, types::array_tuple::value>>>>::type split(types::ndarray const &a, I const &split_mask) { return array_split(a, split_mask); } template - types::list>> + types::list< + types::ndarray>> split(E const &a, I const &) { throw std::runtime_error("split only partially implemented"); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/sqrt.hpp b/pythran/pythonic/numpy/sqrt.hpp index fc22aac4d6..86e5c90695 100644 --- a/pythran/pythonic/numpy/sqrt.hpp +++ b/pythran/pythonic/numpy/sqrt.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/sqrt.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME sqrt #define NUMPY_NARY_FUNC_SYM xsimd::sqrt #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/square.hpp b/pythran/pythonic/numpy/square.hpp index 1fd8c68a2b..d166285e82 100644 --- a/pythran/pythonic/numpy/square.hpp +++ b/pythran/pythonic/numpy/square.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/numpy/square.hpp" #include "pythonic/types/numpy_op_helper.hpp" -#include "pythonic/utils/numpy_traits.hpp" #include "pythonic/utils/functor.hpp" +#include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME square #define NUMPY_NARY_FUNC_SYM wrapper::square #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/stack.hpp b/pythran/pythonic/numpy/stack.hpp index f5a6b96856..2d5de6b709 100644 --- a/pythran/pythonic/numpy/stack.hpp +++ b/pythran/pythonic/numpy/stack.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_NUMPY_STACK_HPP #define PYTHONIC_NUMPY_STACK_HPP -#include "pythonic/builtins/len.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/builtins/len.hpp" #include #include @@ -13,17 +13,18 @@ namespace numpy template types::ndarray> + types::array_tuple> stack(ArraySequence const &args, long axis) { if (builtins::len(args) == 0) throw pythonic::types::ValueError("need at least one array to stack"); auto shape = sutils::getshape(args[0]); - constexpr long N = std::tuple_size::value; // The length of the shape array. + constexpr long N = + std::tuple_size::value; // The length of the shape + // array. auto values = sutils::array( shape); // You can't do shape[i] but you can do shape.array()[i] - types::array + types::array_tuple new_shape; // A new array that's 1 element longer than shape. // Insert a "0" at the position indicated by axis. for (long i = 0; i < N + 1; i++) { @@ -38,7 +39,8 @@ namespace numpy // Create a new empty list. types::list>> bi(0); + types::array_tuple>> + bi(0); // Push the resized arrays into the list. for (auto &&arg : args) { bi.push_back(arg.reshape(new_shape)); @@ -47,26 +49,29 @@ namespace numpy return concatenate(bi, axis); } template - types::ndarray::dtype, - types::array::value + 1>> + types::ndarray< + typename details::stack_helper_t::dtype, + types::array_tuple::value + 1>> stack(std::tuple const &args, long axis, utils::index_sequence) { - types::array< + types::array_tuple< types::ndarray< typename details::stack_helper_t::dtype, - types::array::value>>, - sizeof...(Tys)> vargs{{std::get(args)...}}; + types::array_tuple::value>>, + sizeof...(Tys)> + vargs{{std::get(args)...}}; return stack(vargs, axis); } template - types::ndarray::dtype, - types::array::value + 1>> + types::ndarray< + typename details::stack_helper_t::dtype, + types::array_tuple::value + 1>> stack(std::tuple const &args, long axis) { return stack(args, axis, utils::make_index_sequence()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/std_.hpp b/pythran/pythonic/numpy/std_.hpp index 5ff8a402c7..76be6d48b3 100644 --- a/pythran/pythonic/numpy/std_.hpp +++ b/pythran/pythonic/numpy/std_.hpp @@ -2,20 +2,20 @@ #define PYTHONIC_NUMPY_STD_HPP #include "pythonic/include/numpy/std_.hpp" -#include "pythonic/numpy/var.hpp" #include "pythonic/numpy/sqrt.hpp" +#include "pythonic/numpy/var.hpp" PYTHONIC_NS_BEGIN namespace numpy { template - auto std_(Args &&... args) + auto std_(Args &&...args) -> decltype(functor::sqrt{}(var(std::forward(args)...))) { return functor::sqrt{}(var(std::forward(args)...)); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/subtract.hpp b/pythran/pythonic/numpy/subtract.hpp index 335aff7424..dea8af22df 100644 --- a/pythran/pythonic/numpy/subtract.hpp +++ b/pythran/pythonic/numpy/subtract.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/subtract.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/sub.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/sub.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME subtract #define NUMPY_NARY_FUNC_SYM pythonic::operator_::sub #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/swapaxes.hpp b/pythran/pythonic/numpy/swapaxes.hpp index 0148bfde46..bc83a64a45 100644 --- a/pythran/pythonic/numpy/swapaxes.hpp +++ b/pythran/pythonic/numpy/swapaxes.hpp @@ -10,18 +10,19 @@ PYTHONIC_NS_BEGIN namespace numpy { template - auto swapaxes(T &&a, int axis1, int axis2) -> decltype(functor::transpose{}( - std::forward(a), - std::declval::type::value>>())) + auto swapaxes(T &&a, int axis1, int axis2) + -> decltype(functor::transpose{}( + std::forward(a), + std::declval::type::value>>())) { constexpr long N = std::decay::type::value; - types::array t; + types::array_tuple t; for (unsigned long i = 0; i < N; ++i) t[i] = i; std::swap(t[axis1], t[axis2]); return functor::transpose{}(std::forward(a), t); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/take.hpp b/pythran/pythonic/numpy/take.hpp index ed39c7cc9b..7ab952f870 100644 --- a/pythran/pythonic/numpy/take.hpp +++ b/pythran/pythonic/numpy/take.hpp @@ -13,7 +13,7 @@ namespace numpy { return expr[indices]; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/tan.hpp b/pythran/pythonic/numpy/tan.hpp index fb53ab091b..5f416f5589 100644 --- a/pythran/pythonic/numpy/tan.hpp +++ b/pythran/pythonic/numpy/tan.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/tan.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME tan #define NUMPY_NARY_FUNC_SYM xsimd::tan #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/tanh.hpp b/pythran/pythonic/numpy/tanh.hpp index e2bb22c7fa..3332e3f866 100644 --- a/pythran/pythonic/numpy/tanh.hpp +++ b/pythran/pythonic/numpy/tanh.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/tanh.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME tanh #define NUMPY_NARY_FUNC_SYM xsimd::tanh #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/tile.hpp b/pythran/pythonic/numpy/tile.hpp index 2eb0a52f44..a9590003a3 100644 --- a/pythran/pythonic/numpy/tile.hpp +++ b/pythran/pythonic/numpy/tile.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/tile.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -25,15 +25,15 @@ namespace numpy for (; begin != end; ++begin) _tile((*begin).begin(), (*begin).end(), out, rep, utils::int_()); } - } + } // namespace template - types::ndarray> + types::ndarray> tile(E const &expr, long reps) { size_t n = expr.flat_size(); - types::ndarray> out( - types::array{{long(n * reps)}}, builtins::None); + types::ndarray> out( + types::array_tuple{{long(n * reps)}}, builtins::None); auto out_iter = out.fbegin(); _tile(expr.begin(), expr.end(), out_iter, 1, utils::int_()); for (long i = 1; i < reps; ++i) @@ -42,27 +42,27 @@ namespace numpy } template - types::array + types::array_tuple tile_init_shape(R const &reps, S const &expr_shape, utils::index_sequence) { constexpr size_t M = S::value; return { - {(reps[Is] * ((Is < Shift) ? 1 : expr_shape.template shape < (Is < M) - ? Is - : 0 > ()))...}}; + {(reps[Is] * ((Is < Shift) ? 1 + : expr_shape.template shape < (Is < M) ? Is + : 0 > ()))...}}; } template - types::ndarray> - tile(E const &expr, types::array const &reps) + types::ndarray> + tile(E const &expr, types::array_tuple const &reps) { size_t n = expr.flat_size(); - types::array shape = tile_init_shape( + types::array_tuple shape = tile_init_shape( reps, expr, utils::make_index_sequence()); long last_rep = (E::value == N) ? std::get(reps) : 1; - types::ndarray> out( + types::ndarray> out( shape, builtins::None); auto out_iter = out.fbegin(); _tile(expr.begin(), expr.end(), out_iter, last_rep, @@ -73,7 +73,7 @@ namespace numpy out_iter = std::copy(out.fbegin(), out.fbegin() + n, out_iter); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/trace.hpp b/pythran/pythonic/numpy/trace.hpp index 2677331529..9ec8b874a0 100644 --- a/pythran/pythonic/numpy/trace.hpp +++ b/pythran/pythonic/numpy/trace.hpp @@ -31,7 +31,7 @@ namespace numpy res += expr.fast(i).fast(i); return res; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/transpose.hpp b/pythran/pythonic/numpy/transpose.hpp index 348cd9bddf..36f5fdba80 100644 --- a/pythran/pythonic/numpy/transpose.hpp +++ b/pythran/pythonic/numpy/transpose.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/transpose.hpp" +#include "pythonic/builtins/ValueError.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" -#include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/utils/nested_container.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/builtins/ValueError.hpp" +#include "pythonic/utils/numpy_conversion.hpp" PYTHONIC_NS_BEGIN @@ -44,35 +44,36 @@ namespace numpy return iter; } template - types::ndarray::value>> + types::ndarray::value>> _transposer(types::ndarray const &a, long const l[std::tuple_size::value]) { auto shape = sutils::getshape(a); - types::array::value> shp; + types::array_tuple::value> shp; for (unsigned long i = 0; i < std::tuple_size::value; ++i) shp[i] = shape[l[i]]; - types::array::value> perm; + types::array_tuple::value> perm; for (std::size_t i = 0; i < std::tuple_size::value; ++i) perm[l[i]] = i; - types::ndarray::value>> + types::ndarray::value>> new_array(shp, builtins::None); auto const *iter = a.buffer; - types::array::value> indices; + types::array_tuple::value> indices; _transposer(new_array, iter, indices, shape, perm, utils::int_<0>{}); return new_array; } - } + } // namespace template typename std::enable_if< (std::tuple_size::value > 2), - types::ndarray::value>>>::type - transpose(types::ndarray const &a) + types::ndarray::value>>>:: + type + transpose(types::ndarray const &a) { long t[std::tuple_size::value]; for (unsigned long i = 0; i < std::tuple_size::value; ++i) @@ -81,8 +82,9 @@ namespace numpy } template - types::ndarray::value>> - transpose(types::ndarray const &a, types::array const &t) + types::ndarray::value>> + transpose(types::ndarray const &a, + types::array_tuple const &t) { static_assert(std::tuple_size::value == M, "axes don't match array"); @@ -91,7 +93,7 @@ namespace numpy throw types::ValueError("invalid axis for this array"); return _transposer(a, &t[0]); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/tri.hpp b/pythran/pythonic/numpy/tri.hpp index fb39c9ca58..8e42ba0e0b 100644 --- a/pythran/pythonic/numpy/tri.hpp +++ b/pythran/pythonic/numpy/tri.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/tri.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -24,7 +24,7 @@ namespace numpy out[i][j] = 1; return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/tril.hpp b/pythran/pythonic/numpy/tril.hpp index d6e9a12d5d..44d92ee972 100644 --- a/pythran/pythonic/numpy/tril.hpp +++ b/pythran/pythonic/numpy/tril.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/tril.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -28,7 +28,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(tril) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/triu.hpp b/pythran/pythonic/numpy/triu.hpp index b02116d0aa..3f6ce9b95d 100644 --- a/pythran/pythonic/numpy/triu.hpp +++ b/pythran/pythonic/numpy/triu.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/numpy/triu.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_conversion.hpp" -#include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN @@ -25,7 +25,7 @@ namespace numpy } NUMPY_EXPR_TO_NDARRAY0_IMPL(triu) -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/true_divide.hpp b/pythran/pythonic/numpy/true_divide.hpp index 0aedca78e1..6c78a12791 100644 --- a/pythran/pythonic/numpy/true_divide.hpp +++ b/pythran/pythonic/numpy/true_divide.hpp @@ -3,11 +3,11 @@ #include "pythonic/include/numpy/true_divide.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/operator_/div.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" -#include "pythonic/operator_/div.hpp" PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME true_divide #define NUMPY_NARY_FUNC_SYM pythonic::operator_::div #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/trunc.hpp b/pythran/pythonic/numpy/trunc.hpp index d5e42e1fb4..46d7b9c595 100644 --- a/pythran/pythonic/numpy/trunc.hpp +++ b/pythran/pythonic/numpy/trunc.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/trunc.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace numpy #define NUMPY_NARY_FUNC_NAME trunc #define NUMPY_NARY_FUNC_SYM xsimd::trunc #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/ufunc_accumulate.hpp b/pythran/pythonic/numpy/ufunc_accumulate.hpp index 295d45b9e3..601fbd9801 100644 --- a/pythran/pythonic/numpy/ufunc_accumulate.hpp +++ b/pythran/pythonic/numpy/ufunc_accumulate.hpp @@ -5,8 +5,8 @@ // clang-format off #include INCLUDE_FILE(pythonic/numpy,UFUNC_NAME) // clang-format on -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN namespace numpy @@ -21,6 +21,6 @@ namespace numpy return partial_sum(std::forward(a), axis, d); } - } -} + } // namespace UFUNC_NAME +} // namespace numpy PYTHONIC_NS_END diff --git a/pythran/pythonic/numpy/union1d.hpp b/pythran/pythonic/numpy/union1d.hpp index 275d4d816b..e9e7ff6777 100644 --- a/pythran/pythonic/numpy/union1d.hpp +++ b/pythran/pythonic/numpy/union1d.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/union1d.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -27,7 +27,7 @@ namespace numpy for (; begin != end; ++begin) _union1d((*begin).begin(), (*begin).end(), out, utils::int_()); } - } + } // namespace template types::ndarray< @@ -41,7 +41,7 @@ namespace numpy _union1d(f.begin(), f.end(), res, utils::int_()); return {res}; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/unravel_index.hpp b/pythran/pythonic/numpy/unravel_index.hpp index e72ef8e48b..8c885aad4e 100644 --- a/pythran/pythonic/numpy/unravel_index.hpp +++ b/pythran/pythonic/numpy/unravel_index.hpp @@ -1,8 +1,8 @@ #ifndef PYTHONIC_NUMPY_UNRAVEL_INDEX_HPP #define PYTHONIC_NUMPY_UNRAVEL_INDEX_HPP -#include "pythonic/include/numpy/unravel_index.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/include/numpy/unravel_index.hpp" PYTHONIC_NS_BEGIN @@ -16,20 +16,21 @@ namespace numpy while (shape_it != end_it) { auto &v = *shape_it; auto tmp = expr / v; - *ret_it = expr - v *tmp; + *ret_it = expr - v * tmp; expr = tmp; ++shape_it; ++ret_it; } } - } + } // namespace template - typename std::enable_if::value, - types::array::value>>::type + typename std::enable_if< + std::is_scalar::value, + types::array_tuple::value>>::type unravel_index(E const &expr, S const &shape, types::str const &order) { - types::array::value> ret; + types::array_tuple::value> ret; if (order[0] == "C") { _unravel_index(expr, shape.rbegin(), shape.rend(), ret.rbegin()); } else if (order[0] == "F") { @@ -39,7 +40,7 @@ namespace numpy } return ret; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/unwrap.hpp b/pythran/pythonic/numpy/unwrap.hpp index 3eee207737..23da0b6a7a 100644 --- a/pythran/pythonic/numpy/unwrap.hpp +++ b/pythran/pythonic/numpy/unwrap.hpp @@ -3,13 +3,13 @@ #include "pythonic/include/numpy/unwrap.hpp" +#include "pythonic/numpy/pi.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/int_.hpp" -#include "pythonic/types/ndarray.hpp" -#include "pythonic/numpy/pi.hpp" -#include #include +#include #include PYTHONIC_NS_BEGIN @@ -40,7 +40,7 @@ namespace numpy _unwrap((*ibegin).begin(), (*ibegin).end(), (*obegin).begin(), discont, utils::int_()); } - } + } // namespace template types::ndarray unwrap(E const &expr, @@ -53,7 +53,7 @@ namespace numpy utils::int_()); return out; } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/var.hpp b/pythran/pythonic/numpy/var.hpp index fcfba97ab3..981b6678d9 100644 --- a/pythran/pythonic/numpy/var.hpp +++ b/pythran/pythonic/numpy/var.hpp @@ -3,17 +3,17 @@ #include "pythonic/include/numpy/var.hpp" -#include "pythonic/utils/functor.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/builtins/pythran/abssqr.hpp" #include "pythonic/numpy/add.hpp" #include "pythonic/numpy/conjugate.hpp" -#include "pythonic/numpy/subtract.hpp" +#include "pythonic/numpy/empty_like.hpp" #include "pythonic/numpy/mean.hpp" -#include "pythonic/builtins/pythran/abssqr.hpp" +#include "pythonic/numpy/subtract.hpp" #include "pythonic/numpy/sum.hpp" -#include "pythonic/numpy/empty_like.hpp" +#include "pythonic/types/ndarray.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -24,8 +24,8 @@ namespace numpy template auto var(E const &expr, types::none_type axis, types::none_type dtype, - types::none_type out, long ddof) - -> decltype(var_type(std::real(mean(expr)))) + types::none_type out, + long ddof) -> decltype(var_type(std::real(mean(expr)))) { auto m = mean(expr); auto t = pythonic::numpy::functor::subtract{}(expr, m); @@ -57,7 +57,7 @@ namespace numpy _enlarge_copy_minus(t.fast(i), e.fast(i), m.fast(j), axis, utils::int_()); } - } + } // namespace template auto var(E const &expr, long axis, types::none_type dtype, @@ -70,7 +70,7 @@ namespace numpy return sum(builtins::pythran::functor::abssqr{}(t), axis) /= var_type(expr.template shape<0>() - ddof); } else { - types::array shp = sutils::getshape(expr); + types::array_tuple shp = sutils::getshape(expr); shp[axis] = 1; auto mp = m.reshape(shp); @@ -80,7 +80,7 @@ namespace numpy var_type(sutils::getshape(expr)[axis] - ddof); } } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/vectorize.hpp b/pythran/pythonic/numpy/vectorize.hpp index 8452922d1d..4b0836a6b6 100644 --- a/pythran/pythonic/numpy/vectorize.hpp +++ b/pythran/pythonic/numpy/vectorize.hpp @@ -12,9 +12,10 @@ namespace numpy { template template - auto vectorized::operator()(T &&...args) const -> typename std::enable_if< - !types::valid_numexpr_parameters::type...>::value, - decltype(F{}(std::forward(args)...))>::type + auto vectorized::operator()(T &&...args) const -> + typename std::enable_if::type...>::value, + decltype(F{}(std::forward(args)...))>::type { return F{}(std::forward(args)...); } diff --git a/pythran/pythonic/numpy/vstack.hpp b/pythran/pythonic/numpy/vstack.hpp index ac933cead5..3b4de4a0df 100644 --- a/pythran/pythonic/numpy/vstack.hpp +++ b/pythran/pythonic/numpy/vstack.hpp @@ -19,17 +19,18 @@ namespace numpy } template - auto vstack(ArraySequence &&seq) -> typename std::enable_if< - (impl::vstack_helper::value == 1), - decltype(std::declval>().reshape( - std::declval>()))>::type + auto vstack(ArraySequence &&seq) -> + typename std::enable_if< + (impl::vstack_helper::value == 1), + decltype(std::declval>().reshape( + std::declval>()))>::type { auto &&temp = concatenate(std::forward(seq), 0); long const seq_size = seq.size(), temp_size = temp.size(); - types::array new_shape{{seq_size, temp_size / seq_size}}; + types::array_tuple new_shape{{seq_size, temp_size / seq_size}}; return temp.reshape(new_shape); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/where.hpp b/pythran/pythonic/numpy/where.hpp index fd5ee99802..7d91756294 100644 --- a/pythran/pythonic/numpy/where.hpp +++ b/pythran/pythonic/numpy/where.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/numpy/where.hpp" #include "pythonic/numpy/asarray.hpp" -#include "pythonic/numpy/nonzero.hpp" #include "pythonic/numpy/copy.hpp" +#include "pythonic/numpy/nonzero.hpp" PYTHONIC_NS_BEGIN @@ -22,13 +22,13 @@ namespace numpy else return false_; } - } + } // namespace impl #define NUMPY_NARY_FUNC_NAME where #define NUMPY_NARY_FUNC_SYM impl::where #define NUMPY_NARY_RESHAPE_MODE reshape_type #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy namespace types { @@ -65,7 +65,7 @@ namespace types return numpy::functor::where{}(*std::get(iters)...); } }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/numpy/zeros_like.hpp b/pythran/pythonic/numpy/zeros_like.hpp index 38024b1d15..435089004c 100644 --- a/pythran/pythonic/numpy/zeros_like.hpp +++ b/pythran/pythonic/numpy/zeros_like.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/numpy/zeros_like.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/zeros.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,8 +12,8 @@ namespace numpy { template - auto zeros_like(E const &expr, dtype d) - -> decltype(zeros(sutils::getshape(expr), d)) + auto zeros_like(E const &expr, + dtype d) -> decltype(zeros(sutils::getshape(expr), d)) { return zeros(sutils::getshape(expr), d); } @@ -25,7 +25,7 @@ namespace numpy { return zeros(sutils::getshape(expr), types::dtype_t()); } -} +} // namespace numpy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/get_num_threads.hpp b/pythran/pythonic/omp/get_num_threads.hpp index 73b81f0a9c..aea6b54d67 100644 --- a/pythran/pythonic/omp/get_num_threads.hpp +++ b/pythran/pythonic/omp/get_num_threads.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/get_num_threads.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace omp { return omp_get_num_threads(); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/get_thread_num.hpp b/pythran/pythonic/omp/get_thread_num.hpp index 652684eafe..5598a04a70 100644 --- a/pythran/pythonic/omp/get_thread_num.hpp +++ b/pythran/pythonic/omp/get_thread_num.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/get_thread_num.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp { return omp_get_thread_num(); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/get_wtick.hpp b/pythran/pythonic/omp/get_wtick.hpp index c31f1e25db..c9e4242ebd 100644 --- a/pythran/pythonic/omp/get_wtick.hpp +++ b/pythran/pythonic/omp/get_wtick.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/get_wtick.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace omp { return omp_get_wtick(); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/get_wtime.hpp b/pythran/pythonic/omp/get_wtime.hpp index c45c7de5f6..0131962811 100644 --- a/pythran/pythonic/omp/get_wtime.hpp +++ b/pythran/pythonic/omp/get_wtime.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/get_wtime.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp { return omp_get_wtime(); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/in_parallel.hpp b/pythran/pythonic/omp/in_parallel.hpp index 80f053f5d6..731da8f786 100644 --- a/pythran/pythonic/omp/in_parallel.hpp +++ b/pythran/pythonic/omp/in_parallel.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/in_parallel.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp { return omp_in_parallel(); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/set_nested.hpp b/pythran/pythonic/omp/set_nested.hpp index 3d5228de05..4a246a6c3b 100644 --- a/pythran/pythonic/omp/set_nested.hpp +++ b/pythran/pythonic/omp/set_nested.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/set_nested.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp { return omp_set_nested(val); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/omp/set_num_threads.hpp b/pythran/pythonic/omp/set_num_threads.hpp index 305d88a1d3..30e41caa1f 100644 --- a/pythran/pythonic/omp/set_num_threads.hpp +++ b/pythran/pythonic/omp/set_num_threads.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/omp/set_num_threads.hpp" -#include #include "pythonic/utils/functor.hpp" +#include PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace omp { return omp_set_num_threads(num_threads); } -} +} // namespace omp PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/__abs__.hpp b/pythran/pythonic/operator_/__abs__.hpp index a8c386ae6b..318cfdf472 100644 --- a/pythran/pythonic/operator_/__abs__.hpp +++ b/pythran/pythonic/operator_/__abs__.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_OPERATOR_ABS__HPP #define PYTHONIC_OPERATOR_ABS__HPP -#include "pythonic/include/operator_/__abs__.hpp" #include "pythonic/builtins/abs.hpp" +#include "pythonic/include/operator_/__abs__.hpp" #endif diff --git a/pythran/pythonic/operator_/__xor__.hpp b/pythran/pythonic/operator_/__xor__.hpp index 0bc39c59af..f875024a0a 100644 --- a/pythran/pythonic/operator_/__xor__.hpp +++ b/pythran/pythonic/operator_/__xor__.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_OPERATOR_XOR__HPP #define PYTHONIC_OPERATOR_XOR__HPP -#include "pythonic/include/operator_/__xor__.hpp" #include "pythonic//operator_/xor_.hpp" +#include "pythonic/include/operator_/__xor__.hpp" #endif diff --git a/pythran/pythonic/operator_/abs.hpp b/pythran/pythonic/operator_/abs.hpp index 47ee998c25..b800208785 100644 --- a/pythran/pythonic/operator_/abs.hpp +++ b/pythran/pythonic/operator_/abs.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_OPERATOR_ABS_HPP #define PYTHONIC_OPERATOR_ABS_HPP -#include "pythonic/include/operator_/abs.hpp" #include "pythonic/builtins/abs.hpp" +#include "pythonic/include/operator_/abs.hpp" #endif diff --git a/pythran/pythonic/operator_/add.hpp b/pythran/pythonic/operator_/add.hpp index d234f366fa..1e594a143a 100644 --- a/pythran/pythonic/operator_/add.hpp +++ b/pythran/pythonic/operator_/add.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/add.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/operator_/overloads.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,9 +17,10 @@ namespace operator_ } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL( - add, +, (((b >= 0) ? (a <= std::numeric_limits::max() - b) - : (std::numeric_limits::min() - b <= a)))) -} + add, +, + (((b >= 0) ? (a <= std::numeric_limits::max() - b) + : (std::numeric_limits::min() - b <= a)))) +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/and_.hpp b/pythran/pythonic/operator_/and_.hpp index f81e104c16..77da5249f7 100644 --- a/pythran/pythonic/operator_/and_.hpp +++ b/pythran/pythonic/operator_/and_.hpp @@ -17,7 +17,7 @@ namespace operator_ } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL(and_, &, true) -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/concat.hpp b/pythran/pythonic/operator_/concat.hpp index 17e8e81778..3df3c7163c 100644 --- a/pythran/pythonic/operator_/concat.hpp +++ b/pythran/pythonic/operator_/concat.hpp @@ -15,7 +15,7 @@ namespace operator_ { return std::forward(a) + std::forward(b); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/contains.hpp b/pythran/pythonic/operator_/contains.hpp index 9da329f31e..d1f739c7de 100644 --- a/pythran/pythonic/operator_/contains.hpp +++ b/pythran/pythonic/operator_/contains.hpp @@ -3,20 +3,20 @@ #include "pythonic/include/operator_/contains.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/builtins/in.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto contains(A &&a, B &&b) - -> decltype(in(std::forward(a), std::forward(b))) + auto contains(A &&a, + B &&b) -> decltype(in(std::forward(a), std::forward(b))) { return in(std::forward(a), std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/countOf.hpp b/pythran/pythonic/operator_/countOf.hpp index a3f4203bd6..718416c921 100644 --- a/pythran/pythonic/operator_/countOf.hpp +++ b/pythran/pythonic/operator_/countOf.hpp @@ -15,7 +15,7 @@ namespace operator_ { return std::count(a.begin(), a.end(), std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/delitem.hpp b/pythran/pythonic/operator_/delitem.hpp index 0a44fa1c82..daf5c2cffb 100644 --- a/pythran/pythonic/operator_/delitem.hpp +++ b/pythran/pythonic/operator_/delitem.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/delitem.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/builtins/None.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace operator_ std::forward(a).remove(std::forward(b)); return builtins::None; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/getitem.hpp b/pythran/pythonic/operator_/getitem.hpp index 1d5b21347e..f3362b0328 100644 --- a/pythran/pythonic/operator_/getitem.hpp +++ b/pythran/pythonic/operator_/getitem.hpp @@ -14,7 +14,7 @@ namespace operator_ { return std::forward(a)[std::forward(b)]; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/iadd.hpp b/pythran/pythonic/operator_/iadd.hpp index 6e77849ebd..564fd9b450 100644 --- a/pythran/pythonic/operator_/iadd.hpp +++ b/pythran/pythonic/operator_/iadd.hpp @@ -9,9 +9,9 @@ #include "pythonic/operator_/icommon.hpp" +#include "pythonic/types/dict.hpp" #include "pythonic/types/list.hpp" #include "pythonic/types/set.hpp" -#include "pythonic/types/dict.hpp" PYTHONIC_NS_BEGIN @@ -35,7 +35,7 @@ namespace operator_ { return b; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/icommon.hpp b/pythran/pythonic/operator_/icommon.hpp index d7b4140fa3..bff2016246 100644 --- a/pythran/pythonic/operator_/icommon.hpp +++ b/pythran/pythonic/operator_/icommon.hpp @@ -21,8 +21,9 @@ namespace operator_ { template - auto OPERATOR_NAME(bool, A &&a, B &&b, ...) - -> decltype(std::forward(a) OPERATOR_SYMBOL std::forward(b)) + auto OPERATOR_NAME(bool, A &&a, B &&b, + ...) -> decltype(std::forward(a) + OPERATOR_SYMBOL std::forward(b)) { return std::forward(a) OPERATOR_SYMBOL std::forward(b); } @@ -32,7 +33,7 @@ namespace operator_ { return std::forward(a) OPERATOR_ISYMBOL std::forward(b); } -} +} // namespace operator_ PYTHONIC_NS_END #undef OPERATOR_NAME #undef OPERATOR_SYMBOL diff --git a/pythran/pythonic/operator_/iconcat.hpp b/pythran/pythonic/operator_/iconcat.hpp index ea80f1ee60..adad2d0900 100644 --- a/pythran/pythonic/operator_/iconcat.hpp +++ b/pythran/pythonic/operator_/iconcat.hpp @@ -3,10 +3,10 @@ #include "pythonic/include/operator_/iconcat.hpp" -#include "pythonic/utils/functor.hpp" +#include "pythonic/types/dict.hpp" #include "pythonic/types/list.hpp" #include "pythonic/types/set.hpp" -#include "pythonic/types/dict.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -35,7 +35,7 @@ namespace operator_ { return b; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/ifloordiv.hpp b/pythran/pythonic/operator_/ifloordiv.hpp index d10087483e..caea2ca547 100644 --- a/pythran/pythonic/operator_/ifloordiv.hpp +++ b/pythran/pythonic/operator_/ifloordiv.hpp @@ -23,7 +23,7 @@ namespace operator_ { return (a - mod(a, b)) / b; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/imax.hpp b/pythran/pythonic/operator_/imax.hpp index 63d6f0b53d..4412792872 100644 --- a/pythran/pythonic/operator_/imax.hpp +++ b/pythran/pythonic/operator_/imax.hpp @@ -3,31 +3,33 @@ #include "pythonic/include/operator_/imax.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/maximum.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN namespace operator_ { template - auto imax(A &&a, B &&b) -> typename std::enable_if< - std::is_const::value || !std::is_assignable::value, - decltype(numpy::functor::maximum{}(std::forward(a), - std::forward(b)))>::type + auto imax(A &&a, B &&b) -> + typename std::enable_if< + std::is_const::value || !std::is_assignable::value, + decltype(numpy::functor::maximum{}(std::forward(a), + std::forward(b)))>::type { return numpy::functor::maximum{}(std::forward(a), std::forward(b)); } template - auto imax(A &&a, B &&b) -> typename std::enable_if< - !std::is_const::value && std::is_assignable::value, - decltype(a = numpy::functor::maximum{}(std::forward(a), - std::forward(b)))>::type + auto imax(A &&a, B &&b) -> + typename std::enable_if< + !std::is_const::value && std::is_assignable::value, + decltype(a = numpy::functor::maximum{}(std::forward(a), + std::forward(b)))>::type { return a = numpy::functor::maximum{}(a, std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/imin.hpp b/pythran/pythonic/operator_/imin.hpp index 8405872a69..e1f32ea152 100644 --- a/pythran/pythonic/operator_/imin.hpp +++ b/pythran/pythonic/operator_/imin.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/imin.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/minimum.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -12,23 +12,25 @@ namespace operator_ { template - auto imin(A &&a, B &&b) -> typename std::enable_if< - std::is_const::value || !std::is_assignable::value, - decltype(numpy::functor::minimum{}(std::forward(a), - std::forward(b)))>::type + auto imin(A &&a, B &&b) -> + typename std::enable_if< + std::is_const::value || !std::is_assignable::value, + decltype(numpy::functor::minimum{}(std::forward(a), + std::forward(b)))>::type { return numpy::functor::minimum{}(std::forward(a), std::forward(b)); } template - auto imin(A &&a, B &&b) -> typename std::enable_if< - !std::is_const::value && std::is_assignable::value, - decltype(a = numpy::functor::minimum{}(std::forward(a), - std::forward(b)))>::type + auto imin(A &&a, B &&b) -> + typename std::enable_if< + !std::is_const::value && std::is_assignable::value, + decltype(a = numpy::functor::minimum{}(std::forward(a), + std::forward(b)))>::type { return a = numpy::functor::minimum{}(a, std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/imod.hpp b/pythran/pythonic/operator_/imod.hpp index 60378e768e..6825f2ddbe 100644 --- a/pythran/pythonic/operator_/imod.hpp +++ b/pythran/pythonic/operator_/imod.hpp @@ -20,7 +20,7 @@ namespace operator_ { return a %= std::forward(b); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/indexOf.hpp b/pythran/pythonic/operator_/indexOf.hpp index d007553e12..28def8bff8 100644 --- a/pythran/pythonic/operator_/indexOf.hpp +++ b/pythran/pythonic/operator_/indexOf.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/indexOf.hpp" -#include "pythonic/builtins/str.hpp" #include "pythonic/builtins/ValueError.hpp" +#include "pythonic/builtins/str.hpp" #include "pythonic/utils/functor.hpp" #include @@ -23,7 +23,7 @@ namespace operator_ " is not in this sequence"); return where - a.begin(); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/invert.hpp b/pythran/pythonic/operator_/invert.hpp index 6985d3e36c..def3cff64c 100644 --- a/pythran/pythonic/operator_/invert.hpp +++ b/pythran/pythonic/operator_/invert.hpp @@ -15,7 +15,7 @@ namespace operator_ { return ~std::forward(a); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/ipow.hpp b/pythran/pythonic/operator_/ipow.hpp index 0a69cf7b9e..708985ef59 100644 --- a/pythran/pythonic/operator_/ipow.hpp +++ b/pythran/pythonic/operator_/ipow.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/ipow.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/builtins/pow.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -21,7 +21,7 @@ namespace operator_ { return a = builtins::pow(a, std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/is_.hpp b/pythran/pythonic/operator_/is_.hpp index f15fd01be0..b9eff92b60 100644 --- a/pythran/pythonic/operator_/is_.hpp +++ b/pythran/pythonic/operator_/is_.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/is_.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/builtins/id.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace operator_ { return builtins::id(std::forward(a)) == builtins::id(std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/is_not.hpp b/pythran/pythonic/operator_/is_not.hpp index a2fbb1a98d..63c4c9839d 100644 --- a/pythran/pythonic/operator_/is_not.hpp +++ b/pythran/pythonic/operator_/is_not.hpp @@ -16,7 +16,7 @@ namespace operator_ { return builtins::id(std::forward(a)) != builtins::id(std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/itruediv.hpp b/pythran/pythonic/operator_/itruediv.hpp index a52ac09edd..ad6feb5b9c 100644 --- a/pythran/pythonic/operator_/itruediv.hpp +++ b/pythran/pythonic/operator_/itruediv.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/itruediv.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/operator_/truediv.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,20 +16,22 @@ namespace operator_ return truediv(a, std::forward(b)); } template - auto itruediv(A &a, B &&b) -> typename std::enable_if< - std::is_same(b)))>::value, - A &>::type + auto itruediv(A &a, B &&b) -> + typename std::enable_if< + std::is_same(b)))>::value, + A &>::type { return a = truediv(a, std::forward(b)); } template - auto itruediv(A &a, B &&b) -> typename std::enable_if< - !std::is_same(b)))>::value, - decltype(truediv(a, std::forward(b)))>::type + auto itruediv(A &a, B &&b) -> + typename std::enable_if< + !std::is_same(b)))>::value, + decltype(truediv(a, std::forward(b)))>::type { return truediv(a, std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/lshift.hpp b/pythran/pythonic/operator_/lshift.hpp index 995340125d..a758fc9afd 100644 --- a/pythran/pythonic/operator_/lshift.hpp +++ b/pythran/pythonic/operator_/lshift.hpp @@ -12,8 +12,8 @@ namespace operator_ { template - auto lshift(A &&a, B &&b) - -> decltype(std::forward(a) << std::forward(b)) + auto lshift(A &&a, B &&b) -> decltype(std::forward(a) + << std::forward(b)) { return std::forward(a) << std::forward(b); } diff --git a/pythran/pythonic/operator_/matmul.hpp b/pythran/pythonic/operator_/matmul.hpp index 3a0ed65f72..49bbbea3ba 100644 --- a/pythran/pythonic/operator_/matmul.hpp +++ b/pythran/pythonic/operator_/matmul.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/matmul.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/numpy/dot.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace operator_ { return numpy::functor::dot{}(std::forward(a), std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/mod.hpp b/pythran/pythonic/operator_/mod.hpp index 7cc333ce3a..60f0047e8d 100644 --- a/pythran/pythonic/operator_/mod.hpp +++ b/pythran/pythonic/operator_/mod.hpp @@ -11,10 +11,11 @@ namespace operator_ { template - auto mod(A &&a, B &&b) -> typename std::enable_if< - std::is_fundamental::type>::value && - std::is_fundamental::type>::value, - decltype(std::forward(a) % std::forward(b))>::type + auto mod(A &&a, B &&b) -> + typename std::enable_if< + std::is_fundamental::type>::value && + std::is_fundamental::type>::value, + decltype(std::forward(a) % std::forward(b))>::type { auto t = std::forward(a) % b; return t < 0 ? (t + b) : t; @@ -41,7 +42,7 @@ namespace operator_ { return std::forward(a) % std::forward(b); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/neg.hpp b/pythran/pythonic/operator_/neg.hpp index e20b49a2cd..326460282b 100644 --- a/pythran/pythonic/operator_/neg.hpp +++ b/pythran/pythonic/operator_/neg.hpp @@ -15,7 +15,7 @@ namespace operator_ { return -std::forward(a); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/not_.hpp b/pythran/pythonic/operator_/not_.hpp index dca674fbec..76602f2c5e 100644 --- a/pythran/pythonic/operator_/not_.hpp +++ b/pythran/pythonic/operator_/not_.hpp @@ -19,7 +19,7 @@ namespace operator_ { return !a.real() && !a.imag(); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/or_.hpp b/pythran/pythonic/operator_/or_.hpp index 7a7a0f453d..69092b4c5b 100644 --- a/pythran/pythonic/operator_/or_.hpp +++ b/pythran/pythonic/operator_/or_.hpp @@ -18,7 +18,7 @@ namespace operator_ } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL(or_, |, true) -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/pos.hpp b/pythran/pythonic/operator_/pos.hpp index fa72eb61d7..239294a142 100644 --- a/pythran/pythonic/operator_/pos.hpp +++ b/pythran/pythonic/operator_/pos.hpp @@ -15,7 +15,7 @@ namespace operator_ { return a; } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/pow.hpp b/pythran/pythonic/operator_/pow.hpp index fb18687f08..7f801d6e17 100644 --- a/pythran/pythonic/operator_/pow.hpp +++ b/pythran/pythonic/operator_/pow.hpp @@ -1,7 +1,7 @@ #ifndef PYTHONIC_OPERATOR_POW_HPP #define PYTHONIC_OPERATOR_POW_HPP -#include "pythonic/include/operator_/pow.hpp" #include "pythonic/builtins/pow.hpp" +#include "pythonic/include/operator_/pow.hpp" #endif diff --git a/pythran/pythonic/operator_/rshift.hpp b/pythran/pythonic/operator_/rshift.hpp index ee335f9c9a..b656ae28af 100644 --- a/pythran/pythonic/operator_/rshift.hpp +++ b/pythran/pythonic/operator_/rshift.hpp @@ -11,14 +11,14 @@ PYTHONIC_NS_BEGIN namespace operator_ { template - auto rshift(A &&a, B &&b) - -> decltype(std::forward(a) >> std::forward(b)) + auto rshift(A &&a, + B &&b) -> decltype(std::forward(a) >> std::forward(b)) { return std::forward(a) >> std::forward(b); } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL(rshift, >>, true) -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/sub.hpp b/pythran/pythonic/operator_/sub.hpp index cb07f36a41..a91e394200 100644 --- a/pythran/pythonic/operator_/sub.hpp +++ b/pythran/pythonic/operator_/sub.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/operator_/sub.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/operator_/overloads.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -18,9 +18,10 @@ namespace operator_ } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL( - sub, -, (((b < 0) ? (a <= std::numeric_limits::max() + b) - : (std::numeric_limits::min() + b <= a)))) -} + sub, -, + (((b < 0) ? (a <= std::numeric_limits::max() + b) + : (std::numeric_limits::min() + b <= a)))) +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/truediv.hpp b/pythran/pythonic/operator_/truediv.hpp index e9e5c144fe..285da27489 100644 --- a/pythran/pythonic/operator_/truediv.hpp +++ b/pythran/pythonic/operator_/truediv.hpp @@ -10,12 +10,12 @@ PYTHONIC_NS_BEGIN namespace operator_ { template - auto truediv(A &&a, B &&b) - -> decltype(std::forward(a) / (double)std::forward(b)) + auto truediv(A &&a, B &&b) -> decltype(std::forward(a) / + (double)std::forward(b)) { return std::forward(a) / ((double)std::forward(b)); } -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/operator_/xor_.hpp b/pythran/pythonic/operator_/xor_.hpp index d37bb64e32..a25137ad5b 100644 --- a/pythran/pythonic/operator_/xor_.hpp +++ b/pythran/pythonic/operator_/xor_.hpp @@ -17,7 +17,7 @@ namespace operator_ } DEFINE_ALL_OPERATOR_OVERLOADS_IMPL(xor_, ^, true) -} +} // namespace operator_ PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/random/shuffle.hpp b/pythran/pythonic/random/shuffle.hpp index 19b74344fd..43f0366a79 100644 --- a/pythran/pythonic/random/shuffle.hpp +++ b/pythran/pythonic/random/shuffle.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/random/shuffle.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/builtins/None.hpp" #include "pythonic/random/random.hpp" +#include "pythonic/utils/functor.hpp" #include @@ -47,7 +47,7 @@ namespace random function randf; }; - } + } // namespace details template types::none_type shuffle(T &seq, function &&randf) @@ -56,7 +56,7 @@ namespace random details::URG(std::forward(randf))); return builtins::None; } -} +} // namespace random PYTHONIC_NS_END diff --git a/pythran/pythonic/scipy/special/binom.hpp b/pythran/pythonic/scipy/special/binom.hpp index 47204a7399..e9182c797a 100644 --- a/pythran/pythonic/scipy/special/binom.hpp +++ b/pythran/pythonic/scipy/special/binom.hpp @@ -28,13 +28,13 @@ namespace scipy return boost::math::binomial_coefficient( n, k, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME binom #define NUMPY_NARY_FUNC_SYM details::binom #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/chbevl.hpp b/pythran/pythonic/scipy/special/chbevl.hpp index 2e3b5b68f9..6d1c06a412 100644 --- a/pythran/pythonic/scipy/special/chbevl.hpp +++ b/pythran/pythonic/scipy/special/chbevl.hpp @@ -14,7 +14,7 @@ namespace scipy namespace special { template - double chbevl(double x, const double(&array)[N]) + double chbevl(double x, const double (&array)[N]) { const double *p = &array[0]; double b0 = *p++; @@ -32,7 +32,7 @@ namespace scipy } } // namespace special -} +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/gamma.hpp b/pythran/pythonic/scipy/special/gamma.hpp index 2ee3b2b96d..2353157b96 100644 --- a/pythran/pythonic/scipy/special/gamma.hpp +++ b/pythran/pythonic/scipy/special/gamma.hpp @@ -17,8 +17,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME gamma #define NUMPY_NARY_FUNC_SYM xsimd::tgamma #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/gammaincinv.hpp b/pythran/pythonic/scipy/special/gammaincinv.hpp index 63eb790b05..f972ed8d9b 100644 --- a/pythran/pythonic/scipy/special/gammaincinv.hpp +++ b/pythran/pythonic/scipy/special/gammaincinv.hpp @@ -23,15 +23,15 @@ namespace scipy { using namespace boost::math::policies; return boost::math::gamma_p_inv(a, p, - make_policy(promote_double())); + make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME gammaincinv #define NUMPY_NARY_FUNC_SYM details::gammaincinv #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/gammaln.hpp b/pythran/pythonic/scipy/special/gammaln.hpp index 82ad0f6553..5dc55a84c7 100644 --- a/pythran/pythonic/scipy/special/gammaln.hpp +++ b/pythran/pythonic/scipy/special/gammaln.hpp @@ -17,8 +17,8 @@ namespace scipy #define NUMPY_NARY_FUNC_NAME gammaln #define NUMPY_NARY_FUNC_SYM xsimd::lgamma #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/hankel1.hpp b/pythran/pythonic/scipy/special/hankel1.hpp index 0f20cd37b7..1fa9a83ad2 100644 --- a/pythran/pythonic/scipy/special/hankel1.hpp +++ b/pythran/pythonic/scipy/special/hankel1.hpp @@ -24,13 +24,13 @@ namespace scipy { return boost::math::cyl_hankel_1(x, y); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME hankel1 #define NUMPY_NARY_FUNC_SYM details::hankel1 #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/hankel2.hpp b/pythran/pythonic/scipy/special/hankel2.hpp index ddce9a019d..518c3d8968 100644 --- a/pythran/pythonic/scipy/special/hankel2.hpp +++ b/pythran/pythonic/scipy/special/hankel2.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/scipy/special/hankel2.hpp" -#include "pythonic/types/ndarray.hpp" #include "pythonic/types/complex.hpp" +#include "pythonic/types/ndarray.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/numpy_traits.hpp" @@ -24,13 +24,13 @@ namespace scipy { return boost::math::cyl_hankel_2(x, y); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME hankel2 #define NUMPY_NARY_FUNC_SYM details::hankel2 #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/i0.hpp b/pythran/pythonic/scipy/special/i0.hpp index e32de34b68..7a365e60a8 100644 --- a/pythran/pythonic/scipy/special/i0.hpp +++ b/pythran/pythonic/scipy/special/i0.hpp @@ -31,13 +31,13 @@ namespace scipy return (exp(x) * chbevl(32.0 / x - 2.0, B) / sqrt(x)); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME i0 #define NUMPY_NARY_FUNC_SYM details::i0 #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/i0e.hpp b/pythran/pythonic/scipy/special/i0e.hpp index f1ee8428f2..702f5d974e 100644 --- a/pythran/pythonic/scipy/special/i0e.hpp +++ b/pythran/pythonic/scipy/special/i0e.hpp @@ -30,13 +30,13 @@ namespace scipy return (chbevl(32.0 / x - 2.0, B) / sqrt(x)); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME i0e #define NUMPY_NARY_FUNC_SYM details::i0e #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/iv.hpp b/pythran/pythonic/scipy/special/iv.hpp index 06a9283609..658a3f3010 100644 --- a/pythran/pythonic/scipy/special/iv.hpp +++ b/pythran/pythonic/scipy/special/iv.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_i(x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME iv #define NUMPY_NARY_FUNC_SYM details::iv #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/ivp.hpp b/pythran/pythonic/scipy/special/ivp.hpp index 3834f54355..db689f1500 100644 --- a/pythran/pythonic/scipy/special/ivp.hpp +++ b/pythran/pythonic/scipy/special/ivp.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_i_prime( x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ivp #define NUMPY_NARY_FUNC_SYM details::ivp #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/jv.hpp b/pythran/pythonic/scipy/special/jv.hpp index 944228be94..8485907ac9 100644 --- a/pythran/pythonic/scipy/special/jv.hpp +++ b/pythran/pythonic/scipy/special/jv.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_j(x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME jv #define NUMPY_NARY_FUNC_SYM details::jv #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/jvp.hpp b/pythran/pythonic/scipy/special/jvp.hpp index 99ad7974c1..c9a674c2a7 100644 --- a/pythran/pythonic/scipy/special/jvp.hpp +++ b/pythran/pythonic/scipy/special/jvp.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_j_prime( x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME jvp #define NUMPY_NARY_FUNC_SYM details::jvp #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/kv.hpp b/pythran/pythonic/scipy/special/kv.hpp index 151acd0bb5..406bb1a96d 100644 --- a/pythran/pythonic/scipy/special/kv.hpp +++ b/pythran/pythonic/scipy/special/kv.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_k(x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME kv #define NUMPY_NARY_FUNC_SYM details::kv #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/kvp.hpp b/pythran/pythonic/scipy/special/kvp.hpp index dcfc6d3791..3f916ef362 100644 --- a/pythran/pythonic/scipy/special/kvp.hpp +++ b/pythran/pythonic/scipy/special/kvp.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_bessel_k_prime( x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME kvp #define NUMPY_NARY_FUNC_SYM details::kvp #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/ndtr.hpp b/pythran/pythonic/scipy/special/ndtr.hpp index 4245fbf4e7..1316b49eda 100644 --- a/pythran/pythonic/scipy/special/ndtr.hpp +++ b/pythran/pythonic/scipy/special/ndtr.hpp @@ -25,13 +25,13 @@ namespace scipy boost::math::normal dist(0.0, 1.0); return cdf(dist, x); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ndtr #define NUMPY_NARY_FUNC_SYM details::ndtr #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/ndtri.hpp b/pythran/pythonic/scipy/special/ndtri.hpp index f19df22856..bde9632328 100644 --- a/pythran/pythonic/scipy/special/ndtri.hpp +++ b/pythran/pythonic/scipy/special/ndtri.hpp @@ -25,13 +25,13 @@ namespace scipy boost::math::normal dist(0.0, 1.0); return quantile(dist, x); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME ndtri #define NUMPY_NARY_FUNC_SYM details::ndtri #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/spherical_jn.hpp b/pythran/pythonic/scipy/special/spherical_jn.hpp index 643847c53a..da92301c2c 100644 --- a/pythran/pythonic/scipy/special/spherical_jn.hpp +++ b/pythran/pythonic/scipy/special/spherical_jn.hpp @@ -33,13 +33,13 @@ namespace scipy make_policy(promote_double())); } } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME spherical_jn #define NUMPY_NARY_FUNC_SYM details::spherical_jn #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/spherical_yn.hpp b/pythran/pythonic/scipy/special/spherical_yn.hpp index cde3816dff..952587984a 100644 --- a/pythran/pythonic/scipy/special/spherical_yn.hpp +++ b/pythran/pythonic/scipy/special/spherical_yn.hpp @@ -33,13 +33,13 @@ namespace scipy make_policy(promote_double())); } } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME spherical_yn #define NUMPY_NARY_FUNC_SYM details::spherical_yn #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/yv.hpp b/pythran/pythonic/scipy/special/yv.hpp index 7367ea69ef..42462a1edb 100644 --- a/pythran/pythonic/scipy/special/yv.hpp +++ b/pythran/pythonic/scipy/special/yv.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_neumann(x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME yv #define NUMPY_NARY_FUNC_SYM details::yv #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/scipy/special/yvp.hpp b/pythran/pythonic/scipy/special/yvp.hpp index f08bf1fd95..b8cb59ab67 100644 --- a/pythran/pythonic/scipy/special/yvp.hpp +++ b/pythran/pythonic/scipy/special/yvp.hpp @@ -25,13 +25,13 @@ namespace scipy return boost::math::cyl_neumann_prime( x, y, make_policy(promote_double())); } - } + } // namespace details #define NUMPY_NARY_FUNC_NAME yvp #define NUMPY_NARY_FUNC_SYM details::yvp #include "pythonic/types/numpy_nary_expr.hpp" - } -} + } // namespace special +} // namespace scipy PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/string/find.hpp b/pythran/pythonic/string/find.hpp index da093eed90..a787184055 100644 --- a/pythran/pythonic/string/find.hpp +++ b/pythran/pythonic/string/find.hpp @@ -3,8 +3,8 @@ #include "pythonic/include/string/find.hpp" -#include "pythonic/utils/functor.hpp" #include "pythonic/types/str.hpp" +#include "pythonic/utils/functor.hpp" PYTHONIC_NS_BEGIN @@ -16,7 +16,7 @@ namespace string { return s.find(std::forward(val)); } -} +} // namespace string PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/time/sleep.hpp b/pythran/pythonic/time/sleep.hpp index 7da71a0292..605bc8b634 100644 --- a/pythran/pythonic/time/sleep.hpp +++ b/pythran/pythonic/time/sleep.hpp @@ -1,12 +1,12 @@ #ifndef PYTHONIC_TIME_SLEEP_HPP #define PYTHONIC_TIME_SLEEP_HPP +#include "pythonic/builtins/None.hpp" #include "pythonic/include/time/sleep.hpp" #include "pythonic/utils/functor.hpp" -#include "pythonic/builtins/None.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace time std::this_thread::sleep_for(std::chrono::duration(value)); return builtins::None; } -} +} // namespace time PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/time/time.hpp b/pythran/pythonic/time/time.hpp index 44ed54c76e..3dac449d7d 100644 --- a/pythran/pythonic/time/time.hpp +++ b/pythran/pythonic/time/time.hpp @@ -16,10 +16,11 @@ namespace time std::chrono::time_point tp = std::chrono::steady_clock::now(); return std::chrono::duration_cast( - tp.time_since_epoch()).count() / + tp.time_since_epoch()) + .count() / 1000.; } -} +} // namespace time PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/types/bool.hpp b/pythran/pythonic/types/bool.hpp index 21456be410..35ac01d37d 100644 --- a/pythran/pythonic/types/bool.hpp +++ b/pythran/pythonic/types/bool.hpp @@ -18,13 +18,17 @@ inline PyObject *to_python::convert(bool b) inline bool from_python::is_convertible(PyObject *obj) { - return obj == Py_True || obj == Py_False || PyObject_TypeCheck(obj, &PyBoolArrType_Type); + return obj == Py_True || obj == Py_False || + PyObject_TypeCheck(obj, &PyBoolArrType_Type); } inline bool from_python::convert(PyObject *obj) { - if(obj == Py_True) return true; - else if(obj == Py_False) return false; - else return PyInt_AsLong(obj); + if (obj == Py_True) + return true; + else if (obj == Py_False) + return false; + else + return PyInt_AsLong(obj); } PYTHONIC_NS_END diff --git a/pythran/pythonic/types/cfun.hpp b/pythran/pythonic/types/cfun.hpp index f5b355a258..058f7080ed 100644 --- a/pythran/pythonic/types/cfun.hpp +++ b/pythran/pythonic/types/cfun.hpp @@ -8,8 +8,7 @@ PYTHONIC_NS_BEGIN namespace types { template - cfun::cfun(ReturnType (*fun)(ArgsType...)) - : ptr(fun) + cfun::cfun(ReturnType (*fun)(ArgsType...)) : ptr(fun) { } @@ -18,7 +17,7 @@ namespace types { return (*ptr)(args...); } -} +} // namespace types PYTHONIC_NS_END #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/types/dynamic_tuple.hpp b/pythran/pythonic/types/dynamic_tuple.hpp index e20f08c03f..9e516b43f0 100644 --- a/pythran/pythonic/types/dynamic_tuple.hpp +++ b/pythran/pythonic/types/dynamic_tuple.hpp @@ -4,12 +4,12 @@ #include "pythonic/include/types/dynamic_tuple.hpp" #include "pythonic/types/assignable.hpp" -#include "pythonic/types/traits.hpp" #include "pythonic/types/nditerator.hpp" +#include "pythonic/types/traits.hpp" #include "pythonic/utils/int_.hpp" +#include "pythonic/utils/nested_container.hpp" #include "pythonic/utils/seq.hpp" #include "pythonic/utils/shared_ref.hpp" -#include "pythonic/utils/nested_container.hpp" #include #include @@ -86,22 +86,22 @@ namespace types } template - dynamic_tuple dynamic_tuple:: - operator+(dynamic_tuple const &other) const + dynamic_tuple + dynamic_tuple::operator+(dynamic_tuple const &other) const { dynamic_tuple result(begin(), end()); result.data->resize(size() + other.size()); std::copy(other.begin(), other.end(), result.data->begin() + size()); return result; } -} +} // namespace types PYTHONIC_NS_END namespace std { template - size_t hash>:: - operator()(pythonic::types::dynamic_tuple const &l) const + size_t hash>::operator()( + pythonic::types::dynamic_tuple const &l) const { std::hash hasher; size_t seed = 0x9e3779b9; @@ -109,12 +109,12 @@ namespace std seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); return seed; } -} +} // namespace std #ifdef ENABLE_PYTHON_MODULE -#include "pythonic/include/utils/seq.hpp" #include "pythonic/include/utils/fwd.hpp" +#include "pythonic/include/utils/seq.hpp" #include "pythonic/python/core.hpp" PYTHONIC_NS_BEGIN diff --git a/pythran/pythonic/types/file.hpp b/pythran/pythonic/types/file.hpp index 04c72d4603..25da9b28bf 100644 --- a/pythran/pythonic/types/file.hpp +++ b/pythran/pythonic/types/file.hpp @@ -266,7 +266,7 @@ namespace types inline file_iterator::file_iterator() : f(nullptr), set(false), curr(), - position(std::numeric_limits::max()){}; + position(std::numeric_limits::max()) {}; inline bool file_iterator::operator==(file_iterator const &f2) const { diff --git a/pythran/pythonic/types/finfo.hpp b/pythran/pythonic/types/finfo.hpp index e3c3d7d278..348d3299be 100644 --- a/pythran/pythonic/types/finfo.hpp +++ b/pythran/pythonic/types/finfo.hpp @@ -22,7 +22,7 @@ namespace types { return std::numeric_limits::epsilon(); } -} +} // namespace types PYTHONIC_NS_END /* pythran attribute system { */ @@ -30,12 +30,12 @@ PYTHONIC_NS_BEGIN namespace builtins { template - auto getattr(types::attr::EPS, pythonic::types::finfo const &f) - -> decltype(f.eps()) + auto getattr(types::attr::EPS, + pythonic::types::finfo const &f) -> decltype(f.eps()) { return f.eps(); } -} +} // namespace builtins PYTHONIC_NS_END /* } */ #endif diff --git a/pythran/pythonic/types/generator.hpp b/pythran/pythonic/types/generator.hpp index 19f8efb53e..4a3ef67e74 100644 --- a/pythran/pythonic/types/generator.hpp +++ b/pythran/pythonic/types/generator.hpp @@ -11,8 +11,7 @@ PYTHONIC_NS_BEGIN namespace types { template - generator_iterator::generator_iterator() - : the_generator() + generator_iterator::generator_iterator() : the_generator() { the_generator.__generator_state = -1; } // this represents the end @@ -41,8 +40,8 @@ namespace types } template - bool generator_iterator:: - operator!=(generator_iterator const &other) const + bool + generator_iterator::operator!=(generator_iterator const &other) const { assert(other.the_generator.__generator_state == -1 || the_generator.__generator_state == -1); @@ -51,8 +50,8 @@ namespace types } template - bool generator_iterator:: - operator==(generator_iterator const &other) const + bool + generator_iterator::operator==(generator_iterator const &other) const { assert(other.the_generator.__generator_state == -1 || the_generator.__generator_state == -1); @@ -61,15 +60,15 @@ namespace types } template - bool generator_iterator:: - operator<(generator_iterator const &other) const + bool + generator_iterator::operator<(generator_iterator const &other) const { assert(other.the_generator.__generator_state == -1 || the_generator.__generator_state == -1); return the_generator.__generator_state != other.the_generator.__generator_state; } -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/types/ndarray.hpp b/pythran/pythonic/types/ndarray.hpp index 191933ccd6..d3fecbed70 100644 --- a/pythran/pythonic/types/ndarray.hpp +++ b/pythran/pythonic/types/ndarray.hpp @@ -73,10 +73,10 @@ PYTHONIC_NS_BEGIN namespace types { template - array::value> + array_tuple::value> make_strides(pS const &shape, utils::index_sequence) { - array::value> out; + array_tuple::value> out; out[std::tuple_size::value - 1] = 1; (void)std::initializer_list{ (out[std::tuple_size::value - Is - 2] = @@ -86,7 +86,7 @@ namespace types } template - array::value> make_strides(pS const &shape) + array_tuple::value> make_strides(pS const &shape) { return make_strides( shape, utils::make_index_sequence::value - 1>()); @@ -226,24 +226,24 @@ namespace types } template - typename type_helper>>::iterator - type_helper>>::make_iterator( - ndarray> &n, long i) + typename type_helper>>::iterator + type_helper>>::make_iterator( + ndarray> &n, long i) { return n.buffer + i; } template - typename type_helper>>::const_iterator - type_helper>>::make_iterator( - ndarray> const &n, long i) + typename type_helper>>::const_iterator + type_helper>>::make_iterator( + ndarray> const &n, long i) { return n.buffer + i; } template template - T *type_helper>>::initialize_from_iterable( + T *type_helper>>::initialize_from_iterable( S &shape, T *from, Iter &&iter) { sutils::assign(std::get::value - 1>(shape), iter.size()); @@ -251,41 +251,41 @@ namespace types } template - typename type_helper>>::type - type_helper>>::get(ndarray> &&self, - long i) + typename type_helper>>::type + type_helper>>::get( + ndarray> &&self, long i) { return self.buffer[i]; } template - typename type_helper> const &>::iterator - type_helper> const &>::make_iterator( - ndarray> &n, long i) + typename type_helper> const &>::iterator + type_helper> const &>::make_iterator( + ndarray> &n, long i) { return n.buffer + i; } template - typename type_helper> const &>::const_iterator - make_iterator(ndarray> const &n, long i) + typename type_helper> const &>::const_iterator + make_iterator(ndarray> const &n, long i) { return n.buffer + i; } template template - T *type_helper> const &>::initialize_from_iterable( - S &shape, T *from, Iter &&iter) + T *type_helper> const &>:: + initialize_from_iterable(S &shape, T *from, Iter &&iter) { sutils::assign(std::get::value - 1>(shape), iter.size()); return std::copy(iter.begin(), iter.end(), from); } template - typename type_helper> const &>::type & - type_helper> const &>::get( - ndarray> const &self, long i) + typename type_helper> const &>::type & + type_helper> const &>::get( + ndarray> const &self, long i) { return self.buffer[i]; } @@ -303,7 +303,7 @@ namespace types template template long noffset::operator()(S const &strides, - array const &indices) const + array_tuple const &indices) const { auto index = patch_index( indices[M - L], @@ -315,7 +315,8 @@ namespace types template template - long noffset::operator()(S const &strides, array const &indices, + long noffset::operator()(S const &strides, + array_tuple const &indices, pS const &shape) const { auto index = patch_index( @@ -332,7 +333,7 @@ namespace types template <> template long noffset<1>::operator()(S const &strides, - array const &indices) const + array_tuple const &indices) const { auto index = patch_index( indices[M - 1], @@ -342,7 +343,8 @@ namespace types template <> template - long noffset<1>::operator()(S const &strides, array const &indices, + long noffset<1>::operator()(S const &strides, + array_tuple const &indices, pS const &shape) const { auto index = patch_index( @@ -603,7 +605,7 @@ namespace types template template typename std::enable_if::value, T &>::type - ndarray::fast(array const &indices) + ndarray::fast(array_tuple const &indices) { assert(inbound_indices(indices)); return *(buffer + noffset::value>{}(*this, indices)); @@ -612,7 +614,7 @@ namespace types template template typename std::enable_if::value, T>::type - ndarray::fast(array const &indices) const + ndarray::fast(array_tuple const &indices) const { assert(inbound_indices(indices)); return *(buffer + noffset::value>{}(*this, indices)); @@ -620,7 +622,7 @@ namespace types template template - auto ndarray::fast(array const &indices) const & -> + auto ndarray::fast(array_tuple const &indices) const & -> typename std::enable_if::value, decltype(nget().fast(*this, indices))>::type @@ -630,7 +632,7 @@ namespace types template template - auto ndarray::fast(array const &indices) && -> + auto ndarray::fast(array_tuple const &indices) && -> typename std::enable_if::value, decltype(nget().fast(std::move(*this), indices))>::type @@ -641,7 +643,7 @@ namespace types template template typename std::enable_if::value, T const &>::type - ndarray::operator[](array const &indices) const + ndarray::operator[](array_tuple const &indices) const { return *(buffer + noffset::value>{}(*this, indices, _shape)); @@ -650,7 +652,7 @@ namespace types template template typename std::enable_if::value, T &>::type - ndarray::operator[](array const &indices) + ndarray::operator[](array_tuple const &indices) { return *(buffer + noffset::value>{}(*this, indices, _shape)); @@ -658,7 +660,7 @@ namespace types template template - auto ndarray::operator[](array const &indices) const & -> + auto ndarray::operator[](array_tuple const &indices) const & -> typename std::enable_if::value, decltype(nget()(*this, indices))>::type { @@ -667,7 +669,7 @@ namespace types template template - auto ndarray::operator[](array const &indices) && -> + auto ndarray::operator[](array_tuple const &indices) && -> typename std::enable_if::value, decltype(nget()(std::move(*this), indices))>::type @@ -755,7 +757,7 @@ namespace types template auto ndarray::operator()(S0 const &s0, S const &...s) && -> decltype(extended_slice::value>{}( - std::move(*this), s0, s...)) + std::move(*this), s0, s...)) { return extended_slice::value>{}(std::move(*this), s0, s...); @@ -844,9 +846,9 @@ namespace types template template - auto - ndarray::operator[](std::tuple const &indices) const - -> typename std::enable_if< + auto ndarray::operator[]( + std::tuple const &indices) const -> + typename std::enable_if< is_numexpr_arg::value, decltype(this->_fwdindex( indices, utils::make_index_sequence<2 + sizeof...(Tys)>()))>::type @@ -1068,10 +1070,11 @@ namespace std { template - auto get(E &&a) -> typename std::enable_if< - pythonic::types::is_array::type>::type>::value, - decltype(std::forward(a)[I])>::type + auto get(E &&a) -> + typename std::enable_if< + pythonic::types::is_array::type>::type>::value, + decltype(std::forward(a)[I])>::type { return std::forward(a)[I]; } @@ -1095,9 +1098,8 @@ namespace builtins } template - auto - _build_gexpr<1>::operator()(E const &a, S const &...slices) - -> decltype(E(a)(slices...)) + auto _build_gexpr<1>::operator()(E const &a, S const &...slices) + -> decltype(E(a)(slices...)) { return E(a)(slices...); } @@ -1112,7 +1114,7 @@ namespace builtins auto _make_real(E const &a, utils::int_<1>) -> decltype(_build_gexpr{}( types::ndarray::type, - types::array>{}, + types::array_tuple>{}, types::slice())) { using stype = typename types::is_complex::type; @@ -1122,7 +1124,7 @@ namespace builtins auto translated_mem = reinterpret_cast> const &>( a.mem); - types::ndarray> translated{ + types::ndarray> translated{ translated_mem, new_shape}; return _build_gexpr{}( translated, types::slice{0, std::get(new_shape), 2}); @@ -1144,19 +1146,22 @@ namespace builtins template auto _make_real(types::numpy_iexpr const &a, utils::int_<1>) -> decltype(_build_gexpr::value>{}( - std::declval::dtype>::type, - types::array::value + 1>>>(), + std::declval::dtype>::type, + types::array_tuple::value + 1>>>(), long(), types::slice())) { constexpr size_t value = types::numpy_iexpr::value; - using stype = typename types::is_complex::dtype>::type; + using stype = typename types::is_complex< + typename types::numpy_iexpr::dtype>::type; auto new_shape = sutils::getshape(a.arg); std::get(new_shape) *= 2; // this is tricky and dangerous! auto translated_mem = reinterpret_cast> const &>( a.arg.mem); - types::ndarray> translated{ + types::ndarray> translated{ translated_mem, new_shape}; long offset = (a.buffer - a.arg.buffer) / a.arg.template strides<0>(); return _build_gexpr{}( @@ -1188,19 +1193,22 @@ namespace builtins template auto _make_imag(types::numpy_iexpr const &a, utils::int_<1>) -> decltype(_build_gexpr::value>{}( - std::declval::dtype>::type, - types::array::value + 1>>>(), + std::declval::dtype>::type, + types::array_tuple::value + 1>>>(), long(), types::slice())) { constexpr size_t value = types::numpy_iexpr::value; - using stype = typename types::is_complex::dtype>::type; + using stype = typename types::is_complex< + typename types::numpy_iexpr::dtype>::type; auto new_shape = sutils::getshape(a.arg); std::get::value>(new_shape) *= 2; // this is tricky and dangerous! auto translated_mem = reinterpret_cast> const &>( a.arg.mem); - types::ndarray> translated{ + types::ndarray> translated{ translated_mem, new_shape}; long offset = (a.buffer - a.arg.buffer) / a.arg.template strides<0>(); return _build_gexpr{}( @@ -1211,7 +1219,7 @@ namespace builtins auto _make_imag(E const &a, utils::int_<1>) -> decltype(_build_gexpr{}( types::ndarray::type, - types::array>{}, + types::array_tuple>{}, types::slice())) { using stype = typename types::is_complex::type; @@ -1221,7 +1229,7 @@ namespace builtins auto translated_mem = reinterpret_cast> const &>( a.mem); - types::ndarray> translated{ + types::ndarray> translated{ translated_mem, new_shape}; return _build_gexpr{}( translated, types::slice{1, std::get(new_shape), 2}); @@ -1229,7 +1237,7 @@ namespace builtins } // namespace details template - types::array getattr(types::attr::SHAPE, E const &a) + types::array_tuple getattr(types::attr::SHAPE, E const &a) { return sutils::getshape(a); } @@ -1247,9 +1255,9 @@ namespace builtins } template - types::array getattr(types::attr::STRIDES, E const &a) + types::array_tuple getattr(types::attr::STRIDES, E const &a) { - types::array strides; + types::array_tuple strides; strides[E::value - 1] = sizeof(typename E::dtype); auto shape = sutils::getshape(a); std::transform(strides.rbegin(), strides.rend() - 1, shape.rbegin(), @@ -1303,8 +1311,9 @@ namespace builtins typename types::numpy_iexpr::dtype>::value>{})) { return details::_make_real( - e, utils::int_::dtype>::value>{}); + e, + utils::int_< + types::is_complex::dtype>::value>{}); } template @@ -1554,7 +1563,7 @@ namespace impl template bool check_shape(T const *dims, utils::index_sequence) { - types::array dims_match = { + types::array_tuple dims_match = { (is_integral_constant::type>::value ? (dims[Is] == std::conditional< diff --git a/pythran/pythonic/types/nditerator.hpp b/pythran/pythonic/types/nditerator.hpp index e809776c0e..2cb2b90479 100644 --- a/pythran/pythonic/types/nditerator.hpp +++ b/pythran/pythonic/types/nditerator.hpp @@ -13,8 +13,7 @@ namespace types /* Iterator over whatever provides a fast(long) method to access its element */ template - nditerator::nditerator(E &data, long index) - : data(data), index(index) + nditerator::nditerator(E &data, long index) : data(data), index(index) { } @@ -190,8 +189,8 @@ namespace types } template - const_nditerator &const_nditerator:: - operator=(const_nditerator const &other) + const_nditerator & + const_nditerator::operator=(const_nditerator const &other) { index = other.index; return *this; @@ -245,36 +244,36 @@ namespace types } template - long const_simd_nditerator:: - operator-(const_simd_nditerator const &other) const + long const_simd_nditerator::operator-( + const_simd_nditerator const &other) const { return (data - other.data) / vector_size; } template - bool const_simd_nditerator:: - operator!=(const_simd_nditerator const &other) const + bool const_simd_nditerator::operator!=( + const_simd_nditerator const &other) const { return data != other.data; } template - bool const_simd_nditerator:: - operator==(const_simd_nditerator const &other) const + bool const_simd_nditerator::operator==( + const_simd_nditerator const &other) const { return data == other.data; } template - bool const_simd_nditerator:: - operator<(const_simd_nditerator const &other) const + bool const_simd_nditerator::operator<( + const_simd_nditerator const &other) const { return data < other.data; } template - const_simd_nditerator &const_simd_nditerator:: - operator=(const_simd_nditerator const &other) + const_simd_nditerator & + const_simd_nditerator::operator=(const_simd_nditerator const &other) { data = other.data; return *this; @@ -305,12 +304,12 @@ namespace types } template - typename T::dtype const *make_const_nditerator:: - operator()(T const &self, long i) const + typename T::dtype const * + make_const_nditerator::operator()(T const &self, long i) const { return self.buffer + i; } -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/types/numpy_broadcast.hpp b/pythran/pythonic/types/numpy_broadcast.hpp index 31b1cd8be0..6f63445a09 100644 --- a/pythran/pythonic/types/numpy_broadcast.hpp +++ b/pythran/pythonic/types/numpy_broadcast.hpp @@ -97,7 +97,7 @@ namespace types template template typename broadcast::dtype - broadcast::operator[](array) const + broadcast::operator[](array_tuple) const { return _base._value; } diff --git a/pythran/pythonic/types/numpy_expr.hpp b/pythran/pythonic/types/numpy_expr.hpp index 9f139ffe08..20331cd9a9 100644 --- a/pythran/pythonic/types/numpy_expr.hpp +++ b/pythran/pythonic/types/numpy_expr.hpp @@ -205,17 +205,17 @@ namespace types template auto numpy_expr::map_fast(Indices... indices) const -> decltype(this->_map_fast( - array{{indices...}}, + array_tuple{{indices...}}, utils::make_index_sequence{})) { static_assert(sizeof...(Indices) == sizeof...(Args), "compatible call"); - return _map_fast(array{{indices...}}, + return _map_fast(array_tuple{{indices...}}, utils::make_index_sequence{}); } template - auto numpy_expr::operator[](long i) const - -> decltype(this->fast(i)) + auto + numpy_expr::operator[](long i) const -> decltype(this->fast(i)) { if (i < 0) i += size(); @@ -367,7 +367,7 @@ namespace types if (sutils::any_of(*this, [](long n) { return n != 1; })) throw ValueError("The truth value of an array with more than one element " "is ambiguous. Use a.any() or a.all()"); - array first = {0}; + array_tuple first = {0}; return operator[](first); } diff --git a/pythran/pythonic/types/numpy_gexpr.hpp b/pythran/pythonic/types/numpy_gexpr.hpp index 88afc93f7f..451eed0b15 100644 --- a/pythran/pythonic/types/numpy_gexpr.hpp +++ b/pythran/pythonic/types/numpy_gexpr.hpp @@ -727,8 +727,8 @@ namespace types #endif template - auto numpy_gexpr::operator[](long i) const - -> decltype(this->fast(i)) + auto + numpy_gexpr::operator[](long i) const -> decltype(this->fast(i)) { if (i < 0) i += std::get<0>(_shape); @@ -762,7 +762,7 @@ namespace types template template - auto numpy_gexpr::fast(array const &indices) + auto numpy_gexpr::fast(array_tuple const &indices) const & -> decltype(nget().fast(*this, indices)) { return nget().fast(*this, indices); @@ -770,7 +770,7 @@ namespace types template template - auto numpy_gexpr::fast(array const &indices) + auto numpy_gexpr::fast(array_tuple const &indices) && -> decltype(nget().fast(std::move(*this), indices)) { return nget().fast(std::move(*this), indices); @@ -778,7 +778,7 @@ namespace types template template - auto numpy_gexpr::operator[](array const &indices) + auto numpy_gexpr::operator[](array_tuple const &indices) const & -> decltype(nget()(*this, indices)) { return nget()(*this, indices); @@ -786,7 +786,7 @@ namespace types template template - auto numpy_gexpr::operator[](array const &indices) + auto numpy_gexpr::operator[](array_tuple const &indices) && -> decltype(nget()(std::move(*this), indices)) { return nget()(std::move(*this), indices); diff --git a/pythran/pythonic/types/numpy_iexpr.hpp b/pythran/pythonic/types/numpy_iexpr.hpp index 7489974e8d..d4faef6489 100644 --- a/pythran/pythonic/types/numpy_iexpr.hpp +++ b/pythran/pythonic/types/numpy_iexpr.hpp @@ -283,7 +283,7 @@ namespace types template typename numpy_iexpr::dtype const & - numpy_iexpr::fast(array const &indices) const + numpy_iexpr::fast(array_tuple const &indices) const { return buffer[compute_fast_offset( indices[value - 1], arg.template shape(), indices, arg, @@ -292,7 +292,7 @@ namespace types template typename numpy_iexpr::dtype & - numpy_iexpr::fast(array const &indices) + numpy_iexpr::fast(array_tuple const &indices) { return const_cast( const_cast(*this).fast(indices)); @@ -413,7 +413,7 @@ namespace types template typename numpy_iexpr::dtype const & - numpy_iexpr::operator[](array const &indices) const + numpy_iexpr::operator[](array_tuple const &indices) const { return buffer[compute_offset(indices[value - 1] < 0 ? indices[value - 1] + @@ -425,7 +425,7 @@ namespace types template typename numpy_iexpr::dtype & - numpy_iexpr::operator[](array const &indices) + numpy_iexpr::operator[](array_tuple const &indices) { return const_cast(const_cast(*this)[indices]); } diff --git a/pythran/pythonic/types/numpy_nary_expr.hpp b/pythran/pythonic/types/numpy_nary_expr.hpp index 6a8724b35f..66644875fc 100644 --- a/pythran/pythonic/types/numpy_nary_expr.hpp +++ b/pythran/pythonic/types/numpy_nary_expr.hpp @@ -18,10 +18,11 @@ namespace functor { template - auto NUMPY_NARY_FUNC_NAME:: - operator()(T &&... args) const -> typename std::enable_if< - !types::valid_numexpr_parameters::type...>::value, - decltype(NUMPY_NARY_FUNC_SYM(std::forward(args)...))>::type + auto NUMPY_NARY_FUNC_NAME::operator()(T &&...args) const -> + typename std::enable_if< + !types::valid_numexpr_parameters< + typename std::decay::type...>::value, + decltype(NUMPY_NARY_FUNC_SYM(std::forward(args)...))>::type { return NUMPY_NARY_FUNC_SYM(std::forward(args)...); } @@ -32,12 +33,11 @@ namespace functor types::numpy_expr< NUMPY_NARY_FUNC_NAME, typename types::NUMPY_NARY_RESHAPE_MODE::type...>>::type - NUMPY_NARY_FUNC_NAME:: - operator()(E &&... args) const + NUMPY_NARY_FUNC_NAME::operator()(E &&...args) const { return {std::forward(args)...}; } -} +} // namespace functor #undef NUMPY_NARY_FUNC_NAME #undef NUMPY_NARY_FUNC_SYM diff --git a/pythran/pythonic/types/numpy_operators.hpp b/pythran/pythonic/types/numpy_operators.hpp index 2da2315945..836613246a 100644 --- a/pythran/pythonic/types/numpy_operators.hpp +++ b/pythran/pythonic/types/numpy_operators.hpp @@ -3,27 +3,27 @@ #include "pythonic/include/types/numpy_operators.hpp" -#include "pythonic/types/numpy_broadcast.hpp" +#include "pythonic/numpy/bitwise_not.hpp" +#include "pythonic/numpy/mod.hpp" #include "pythonic/operator_/add.hpp" #include "pythonic/operator_/and_.hpp" -#include "pythonic/operator_/or_.hpp" -#include "pythonic/operator_/xor_.hpp" #include "pythonic/operator_/div.hpp" #include "pythonic/operator_/eq.hpp" -#include "pythonic/operator_/gt.hpp" #include "pythonic/operator_/ge.hpp" +#include "pythonic/operator_/gt.hpp" +#include "pythonic/operator_/le.hpp" #include "pythonic/operator_/lshift.hpp" #include "pythonic/operator_/lt.hpp" -#include "pythonic/operator_/le.hpp" #include "pythonic/operator_/mul.hpp" +#include "pythonic/operator_/ne.hpp" #include "pythonic/operator_/neg.hpp" #include "pythonic/operator_/not_.hpp" -#include "pythonic/operator_/ne.hpp" +#include "pythonic/operator_/or_.hpp" #include "pythonic/operator_/pos.hpp" #include "pythonic/operator_/rshift.hpp" #include "pythonic/operator_/sub.hpp" -#include "pythonic/numpy/mod.hpp" -#include "pythonic/numpy/bitwise_not.hpp" +#include "pythonic/operator_/xor_.hpp" +#include "pythonic/types/numpy_broadcast.hpp" #include "pythonic/types/numpy_op_helper.hpp" PYTHONIC_NS_BEGIN @@ -109,7 +109,7 @@ namespace types #define NUMPY_BINARY_FUNC_NAME operator- #define NUMPY_BINARY_FUNC_SYM operator_::functor::sub #include "pythonic/types/numpy_binary_op.hpp" -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/types/numpy_texpr.hpp b/pythran/pythonic/types/numpy_texpr.hpp index 5de28bf7a5..47c47881b6 100644 --- a/pythran/pythonic/types/numpy_texpr.hpp +++ b/pythran/pythonic/types/numpy_texpr.hpp @@ -113,10 +113,11 @@ namespace types template template - auto numpy_texpr_2::operator[](S const &s0) const -> numpy_texpr< - decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, - pythonic::builtins::None), - (s0.step, s0)))> + auto numpy_texpr_2::operator[](S const &s0) const + -> numpy_texpr< + decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, + pythonic::builtins::None), + (s0.step, s0)))> { return {arg(fast_contiguous_slice(pythonic::builtins::None, pythonic::builtins::None), @@ -125,10 +126,11 @@ namespace types template template - auto - numpy_texpr_2::operator[](S const &s0) -> numpy_texprarg( - fast_contiguous_slice(pythonic::builtins::None, pythonic::builtins::None), - (s0.step, s0)))> + auto numpy_texpr_2::operator[](S const &s0) + -> numpy_texpr< + decltype(this->arg(fast_contiguous_slice(pythonic::builtins::None, + pythonic::builtins::None), + (s0.step, s0)))> { return {arg(fast_contiguous_slice(pythonic::builtins::None, pythonic::builtins::None), @@ -360,9 +362,9 @@ namespace types } template - numpy_texpr>>::numpy_texpr( - ndarray> const &arg) - : numpy_texpr_2>>{arg} + numpy_texpr>>::numpy_texpr( + ndarray> const &arg) + : numpy_texpr_2>>{arg} { } diff --git a/pythran/pythonic/types/numpy_vexpr.hpp b/pythran/pythonic/types/numpy_vexpr.hpp index 889420b93c..9bb66b6e17 100644 --- a/pythran/pythonic/types/numpy_vexpr.hpp +++ b/pythran/pythonic/types/numpy_vexpr.hpp @@ -61,9 +61,9 @@ namespace types template template auto numpy_vexpr::operator()(S const &...slices) const - -> decltype(ndarray>{*this}(slices...)) + -> decltype(ndarray>{*this}(slices...)) { - return ndarray>{*this}(slices...); + return ndarray>{*this}(slices...); } #ifdef USE_XSIMD template diff --git a/pythran/pythonic/types/pointer.hpp b/pythran/pythonic/types/pointer.hpp index 7cca903197..b55efcdf57 100644 --- a/pythran/pythonic/types/pointer.hpp +++ b/pythran/pythonic/types/pointer.hpp @@ -31,7 +31,7 @@ namespace types { return data[i]; } -} +} // namespace types PYTHONIC_NS_END namespace std @@ -56,7 +56,7 @@ namespace std { return t[I]; } -} +} // namespace std #ifdef ENABLE_PYTHON_MODULE diff --git a/pythran/pythonic/types/str.hpp b/pythran/pythonic/types/str.hpp index 1f7a9816a3..e5dbe6083b 100644 --- a/pythran/pythonic/types/str.hpp +++ b/pythran/pythonic/types/str.hpp @@ -689,8 +689,8 @@ namespace operator_ { template - auto mod(const char (&fmt)[N], Arg &&arg) - -> decltype(types::str(fmt) % std::forward(arg)) + auto mod(const char (&fmt)[N], + Arg &&arg) -> decltype(types::str(fmt) % std::forward(arg)) { return types::str(fmt) % std::forward(arg); } diff --git a/pythran/pythonic/types/tuple.hpp b/pythran/pythonic/types/tuple.hpp index 0316b52c87..a91670a2f1 100644 --- a/pythran/pythonic/types/tuple.hpp +++ b/pythran/pythonic/types/tuple.hpp @@ -403,25 +403,25 @@ namespace types } template - dynamic_tuple array_base_slicer::operator()(array const &b, + dynamic_tuple array_base_slicer::operator()(array_tuple const &b, slice const &s) { normalized_slice ns = s.normalize(b.size()); - array tmp; + array_tuple tmp; for (long j = 0; j < ns.size(); ++j) tmp[j] = b[ns.lower + j * ns.step]; return {&tmp[0], &tmp[ns.size()]}; } template - dynamic_tuple array_base_slicer::operator()(array const &b, + dynamic_tuple array_base_slicer::operator()(array_tuple const &b, cstride_slice const &s) { auto ns = s.normalize(b.size()); if (stride == 1) { return {&b[ns.lower], &b[ns.upper]}; } else { - array tmp; + array_tuple tmp; for (long j = 0; j < ns.size(); ++j) tmp[j] = b[ns.lower + j * ns.step]; return {&tmp[0], &tmp[ns.size()]}; @@ -429,7 +429,7 @@ namespace types } template - dynamic_tuple array_base_slicer::operator()(array const &b, + dynamic_tuple array_base_slicer::operator()(array_tuple const &b, fast_contiguous_slice const &s) { auto cns = s.normalize(b.size()); @@ -569,8 +569,8 @@ to_python>::convert(std::tuple const &t) template template -PyObject *to_python>::do_convert(types::array const &t, - utils::index_sequence) +PyObject *to_python>::do_convert( + types::array_tuple const &t, utils::index_sequence) { PyObject *out = PyTuple_New(N); (void)std::initializer_list{ @@ -590,7 +590,8 @@ PyObject *to_python>::do_convert( } template -PyObject *to_python>::convert(types::array const &t) +PyObject * +to_python>::convert(types::array_tuple const &t) { return do_convert(t, utils::make_index_sequence()); } @@ -644,7 +645,7 @@ std::tuple from_python>::convert(PyObject *obj) } template -bool from_python>:: +bool from_python>:: is_convertible(PyObject *obj) { @@ -659,13 +660,13 @@ bool from_python>:: template template -types::array from_python>::do_convert( +types::array_tuple from_python>::do_convert( PyObject *obj, typename utils::index_sequence) { return {::from_python(PyTuple_GET_ITEM(obj, S))...}; } template -types::array from_python>:: +types::array_tuple from_python>:: convert(PyObject *obj) { diff --git a/pythran/pythonic/types/variant_functor.hpp b/pythran/pythonic/types/variant_functor.hpp index b777fad2cc..75dfcd11f1 100644 --- a/pythran/pythonic/types/variant_functor.hpp +++ b/pythran/pythonic/types/variant_functor.hpp @@ -4,8 +4,8 @@ #include "pythonic/include/types/variant_functor.hpp" #include "pythonic/utils/meta.hpp" -#include #include +#include PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace types template variant_functor_impl::variant_functor_impl(char mem[], Type const &t) - : fun(new (mem) Type(t)) + : fun(new(mem) Type(t)) { } @@ -32,7 +32,7 @@ namespace types template variant_functor_impl::variant_functor_impl( char mem[], variant_functor_impl const &t) - : fun(t.fun ? new (mem) Type(*t.fun) : nullptr) + : fun(t.fun ? new(mem) Type(*t.fun) : nullptr) { } @@ -126,7 +126,7 @@ namespace types template template - auto variant_functor_impl::operator()(Args &&... args) + auto variant_functor_impl::operator()(Args &&...args) -> decltype(std::declval()(std::forward(args)...)) { assert(fun && "handler defined"); @@ -135,7 +135,7 @@ namespace types template template - auto variant_functor_impl::operator()(Args &&... args) const + auto variant_functor_impl::operator()(Args &&...args) const -> decltype(std::declval()(std::forward(args)...)) { assert(fun && "handler defined"); @@ -145,7 +145,7 @@ namespace types template template variant_functor_impl::variant_functor_impl( - char mem[], OtherTypes const &... t) + char mem[], OtherTypes const &...t) : head(mem, t...), tail(mem, t...) { } @@ -177,9 +177,11 @@ namespace types template template - auto variant_functor_impl::operator()(Args &&... args) -> - typename __combined()(std::forward(args)...)), - decltype(std::declval()(std::forward(args)...))...>::type + auto variant_functor_impl::operator()(Args &&...args) -> + typename __combined< + decltype(std::declval()(std::forward(args)...)), + decltype(std::declval()( + std::forward(args)...))...>::type { if (head.fun) return head(std::forward(args)...); @@ -189,17 +191,19 @@ namespace types template template - auto variant_functor_impl::operator()(Args &&... args) const - -> - typename __combined()(std::forward(args)...)), - decltype(std::declval()(std::forward(args)...))...>::type + auto + variant_functor_impl::operator()(Args &&...args) const -> + typename __combined< + decltype(std::declval()(std::forward(args)...)), + decltype(std::declval()( + std::forward(args)...))...>::type { if (head.fun) return head(std::forward(args)...); else return tail(std::forward(args)...); } - } + } // namespace details template variant_functor::variant_functor(variant_functor const &other) @@ -210,8 +214,8 @@ namespace types } template - variant_functor &variant_functor:: - operator=(variant_functor const &other) + variant_functor & + variant_functor::operator=(variant_functor const &other) { details::variant_functor_impl::assign(mem, other); return *this; @@ -219,8 +223,8 @@ namespace types template template - variant_functor &variant_functor:: - operator=(variant_functor const &other) + variant_functor &variant_functor::operator=( + variant_functor const &other) { details::variant_functor_impl::assign(mem, other); return *this; @@ -228,8 +232,8 @@ namespace types template template - variant_functor &variant_functor:: - operator=(OtherType const &other) + variant_functor & + variant_functor::operator=(OtherType const &other) { static_assert( utils::any_of::value...>::value, @@ -240,7 +244,7 @@ namespace types template template - variant_functor::variant_functor(OtherTypes const &... t) + variant_functor::variant_functor(OtherTypes const &...t) : details::variant_functor_impl(mem, t...) { } @@ -255,6 +259,6 @@ namespace types t)) { } -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/types/vectorizable_type.hpp b/pythran/pythonic/types/vectorizable_type.hpp index 81e0d90432..01f61e462c 100644 --- a/pythran/pythonic/types/vectorizable_type.hpp +++ b/pythran/pythonic/types/vectorizable_type.hpp @@ -4,16 +4,16 @@ #include "pythonic/include/types/vectorizable_type.hpp" #include "pythonic/include/numpy/bool_.hpp" -#include "pythonic/include/numpy/uint8.hpp" +#include "pythonic/include/numpy/float32.hpp" +#include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/numpy/int16.hpp" +#include "pythonic/include/numpy/int32.hpp" +#include "pythonic/include/numpy/int64.hpp" #include "pythonic/include/numpy/int8.hpp" #include "pythonic/include/numpy/uint16.hpp" -#include "pythonic/include/numpy/int16.hpp" #include "pythonic/include/numpy/uint32.hpp" -#include "pythonic/include/numpy/int32.hpp" #include "pythonic/include/numpy/uint64.hpp" -#include "pythonic/include/numpy/int64.hpp" -#include "pythonic/include/numpy/float32.hpp" -#include "pythonic/include/numpy/float64.hpp" +#include "pythonic/include/numpy/uint8.hpp" PYTHONIC_NS_BEGIN namespace operator_ @@ -22,8 +22,8 @@ namespace operator_ { struct mod; struct div; - } -} + } // namespace functor +} // namespace operator_ namespace builtins { @@ -33,8 +33,8 @@ namespace builtins { struct abssqr; } - } -} + } // namespace pythran +} // namespace builtins namespace numpy { @@ -69,8 +69,8 @@ namespace numpy struct spacing; struct true_divide; struct where; - } -} + } // namespace functor +} // namespace numpy namespace scipy { namespace special @@ -95,9 +95,9 @@ namespace scipy struct ndtri; struct spherical_jn; struct spherical_yn; - } - } -} + } // namespace functor + } // namespace special +} // namespace scipy namespace types { template @@ -185,7 +185,7 @@ namespace types // true; }; -} +} // namespace types PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/utils/allocate.hpp b/pythran/pythonic/utils/allocate.hpp index a09cda14e2..f9247a85f9 100644 --- a/pythran/pythonic/utils/allocate.hpp +++ b/pythran/pythonic/utils/allocate.hpp @@ -9,7 +9,7 @@ namespace utils #ifdef PYTHRAN_TRACE_ALLOCATION size_t pythran_allocation_site; #endif -} +} // namespace utils PYTHONIC_NS_END diff --git a/pythran/pythonic/utils/array_helper.hpp b/pythran/pythonic/utils/array_helper.hpp index fa8722533c..35d5352c9e 100644 --- a/pythran/pythonic/utils/array_helper.hpp +++ b/pythran/pythonic/utils/array_helper.hpp @@ -13,7 +13,7 @@ PYTHONIC_NS_BEGIN */ template template -auto nget::operator()(A &&self, types::array const &indices) +auto nget::operator()(A &&self, types::array_tuple const &indices) -> decltype(nget()(std::forward(self)[0], indices)) { return nget()(std::forward(self)[indices[M - L - 1]], indices); @@ -21,7 +21,7 @@ auto nget::operator()(A &&self, types::array const &indices) template template -auto nget::fast(A &&self, types::array const &indices) +auto nget::fast(A &&self, types::array_tuple const &indices) -> decltype(nget().fast(std::forward(self).fast(0), indices)) { return nget().fast(std::forward(self).fast(indices[M - L - 1]), @@ -29,14 +29,14 @@ auto nget::fast(A &&self, types::array const &indices) } template -auto nget<0>::operator()(A &&self, types::array const &indices) +auto nget<0>::operator()(A &&self, types::array_tuple const &indices) -> decltype(std::forward(self)[indices[M - 1]]) { return std::forward(self)[indices[M - 1]]; } template -auto nget<0>::fast(A &&self, types::array const &indices) +auto nget<0>::fast(A &&self, types::array_tuple const &indices) -> decltype(std::forward(self).fast(indices[M - 1])) { return std::forward(self).fast(indices[M - 1]); diff --git a/pythran/pythonic/utils/broadcast_copy.hpp b/pythran/pythonic/utils/broadcast_copy.hpp index d44ef84bd0..d892e4d580 100644 --- a/pythran/pythonic/utils/broadcast_copy.hpp +++ b/pythran/pythonic/utils/broadcast_copy.hpp @@ -252,7 +252,8 @@ namespace utils #ifdef USE_XSIMD constexpr bool vectorize = vector_form; #else - constexpr bool vectorize = false;; + constexpr bool vectorize = false; + ; #endif broadcast_copy_dispatcher{}(self, other); } @@ -264,11 +265,10 @@ namespace utils std::integral_constant, std::integral_constant) { - if(D==0) { + if (D == 0) { std::copy(other.data(), other.data() + other.flat_size(), self.data()); return self; - } - else { + } else { return broadcast_copy_helper( self, other, std::integral_constant(), std::integral_constant{}); @@ -285,11 +285,11 @@ namespace utils self, reshaped, std::true_type(), is_plain); } - template::value> + template ::value> struct is_flat { static const bool value = T::is_flat; }; - template + template struct is_flat { static const bool value = false; }; @@ -299,7 +299,9 @@ namespace utils { return broadcast_copy_helper( self, other, std::integral_constant= 0)>(), - std::integral_constant::type::is_flat && is_flat::type>::value>{}); + std::integral_constant < bool, + std::decay::type::is_flat + &&is_flat::type>::value > {}); } /* update diff --git a/pythran/pythonic/utils/fwd.hpp b/pythran/pythonic/utils/fwd.hpp index 66438d6561..f3c460d219 100644 --- a/pythran/pythonic/utils/fwd.hpp +++ b/pythran/pythonic/utils/fwd.hpp @@ -9,10 +9,10 @@ namespace utils { template - void fwd(Types const &... types) + void fwd(Types const &...types) { } -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/utils/iterator.hpp b/pythran/pythonic/utils/iterator.hpp index 5ab35a95ef..cda0e6b2e1 100644 --- a/pythran/pythonic/utils/iterator.hpp +++ b/pythran/pythonic/utils/iterator.hpp @@ -9,14 +9,12 @@ namespace utils { template - comparable_iterator::comparable_iterator() - : T() + comparable_iterator::comparable_iterator() : T() { } template - comparable_iterator::comparable_iterator(T const &t) - : T(t) + comparable_iterator::comparable_iterator(T const &t) : T(t) { } @@ -27,24 +25,22 @@ namespace utils } template - iterator_reminder::iterator_reminder(T const &v) - : values(v) + iterator_reminder::iterator_reminder(T const &v) : values(v) { } template - iterator_reminder::iterator_reminder(T const &v) - : values(v) + iterator_reminder::iterator_reminder(T const &v) : values(v) { } template iterator_reminder::iterator_reminder( - T const &v, Others const &... others) + T const &v, Others const &...others) : values(v, others...) { } -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/utils/nested_container.hpp b/pythran/pythonic/utils/nested_container.hpp index f11bc73b40..2996e4e2e1 100644 --- a/pythran/pythonic/utils/nested_container.hpp +++ b/pythran/pythonic/utils/nested_container.hpp @@ -3,9 +3,9 @@ #include "pythonic/include/utils/nested_container.hpp" -#include #include "pythonic/types/traits.hpp" #include "pythonic/utils/numpy_traits.hpp" +#include PYTHONIC_NS_BEGIN namespace utils @@ -16,10 +16,11 @@ namespace utils { auto n = t.size(); return n ? n * nested_container_size::value, bool, - typename Type::value_type>::type>::flat_size(*t.begin()) : 0; + // If we have a scalar or a complex, we want to stop + // recursion, and then dispatch to bool specialization + types::is_dtype::value, bool, + typename Type::value_type>::type>::flat_size(*t.begin()) + : 0; } /* Recursion stops on bool */ @@ -28,7 +29,7 @@ namespace utils { return 1; } -} +} // namespace utils PYTHONIC_NS_END #endif diff --git a/pythran/pythonic/utils/neutral.hpp b/pythran/pythonic/utils/neutral.hpp index 62b1d7d6d7..ab1f206107 100644 --- a/pythran/pythonic/utils/neutral.hpp +++ b/pythran/pythonic/utils/neutral.hpp @@ -4,10 +4,10 @@ #include "pythonic/include/utils/neutral.hpp" #include "pythonic/operator_/iadd.hpp" #include "pythonic/operator_/iand.hpp" -#include "pythonic/operator_/ior.hpp" -#include "pythonic/operator_/imul.hpp" #include "pythonic/operator_/imax.hpp" #include "pythonic/operator_/imin.hpp" +#include "pythonic/operator_/imul.hpp" +#include "pythonic/operator_/ior.hpp" #include "pythonic/operator_/ixor.hpp" #endif diff --git a/pythran/pythonic/utils/numpy_conversion.hpp b/pythran/pythonic/utils/numpy_conversion.hpp index 05382b7e74..82c1638b11 100644 --- a/pythran/pythonic/utils/numpy_conversion.hpp +++ b/pythran/pythonic/utils/numpy_conversion.hpp @@ -18,8 +18,8 @@ #else #define NUMPY_EXPR_TO_NDARRAY0_IMPL(fname) \ template \ - auto fname(E const &expr, Types &&...others) \ - ->typename std::enable_if< \ + auto fname(E const &expr, Types &&...others) -> \ + typename std::enable_if< \ !types::is_ndarray::value && types::is_numexpr_arg::value, \ decltype(fname( \ types::ndarray{expr}, \ diff --git a/pythran/pythonic/utils/pdqsort.hpp b/pythran/pythonic/utils/pdqsort.hpp index 384f5c6f1c..7fce8403d8 100644 --- a/pythran/pythonic/utils/pdqsort.hpp +++ b/pythran/pythonic/utils/pdqsort.hpp @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include #if __cplusplus >= 201103L #include @@ -641,7 +641,7 @@ namespace pdqsort_detail leftmost = false; } } -} +} // namespace pdqsort_detail template inline void pdqsort(Iter begin, Iter end, Compare comp) @@ -651,10 +651,11 @@ inline void pdqsort(Iter begin, Iter end, Compare comp) #if __cplusplus >= 201103L pdqsort_detail::pdqsort_loop< - Iter, Compare, pdqsort_detail::is_default_compare< - typename std::decay::type>::value && - std::is_arithmetic::value_type>::value>( + Iter, Compare, + pdqsort_detail::is_default_compare< + typename std::decay::type>::value && + std::is_arithmetic< + typename std::iterator_traits::value_type>::value>( begin, end, comp, pdqsort_detail::log2(end - begin)); #else pdqsort_detail::pdqsort_loop( diff --git a/pythran/pythonic/utils/reserve.hpp b/pythran/pythonic/utils/reserve.hpp index 564457467a..44bd765e1b 100644 --- a/pythran/pythonic/utils/reserve.hpp +++ b/pythran/pythonic/utils/reserve.hpp @@ -12,7 +12,7 @@ namespace utils void reserve(Container &, From &&) // do nothing unless specialized { } -} +} // namespace utils PYTHONIC_NS_END #endif