diff options
| author | robot-piglet <[email protected]> | 2024-11-22 12:00:16 +0300 | 
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-11-22 12:09:38 +0300 | 
| commit | 9478cfdab4217d3710b96329466825bf47111d7d (patch) | |
| tree | b4c844cd8a745ea05e60c9e9debb226b21ebf3ad /contrib/python/pythran | |
| parent | 6b6dd52cba2350a42670094a53b7df008f38577f (diff) | |
Intermediate changes
commit_hash:e8f03143f071def87f56790176fbdc918784ed35
Diffstat (limited to 'contrib/python/pythran')
1210 files changed, 8591 insertions, 4400 deletions
diff --git a/contrib/python/pythran/.dist-info/METADATA b/contrib/python/pythran/.dist-info/METADATA index 66c4bc97786..f68434e090c 100644 --- a/contrib/python/pythran/.dist-info/METADATA +++ b/contrib/python/pythran/.dist-info/METADATA @@ -1,6 +1,6 @@  Metadata-Version: 2.1  Name: pythran -Version: 0.16.1 +Version: 0.17.0  Summary: Ahead of Time compiler for numeric kernels  Author-email: Serge Guelton <[email protected]>  License: Copyright (c) 2012, HPC Project and Serge Guelton @@ -52,22 +52,24 @@ Requires-Python: >=3.7  Description-Content-Type: text/x-rst  License-File: LICENSE  License-File: AUTHORS -Requires-Dist: ply>=3.4 +Requires-Dist: ply >=3.4  Requires-Dist: setuptools -Requires-Dist: gast~=0.5.0 +Requires-Dist: gast ~=0.6.0  Requires-Dist: numpy -Requires-Dist: beniget~=0.4.0 +Requires-Dist: beniget ~=0.4.0  Provides-Extra: doc -Requires-Dist: numpy; extra == "doc" -Requires-Dist: nbsphinx; extra == "doc" -Requires-Dist: scipy; extra == "doc" -Requires-Dist: guzzle-sphinx-theme; extra == "doc" +Requires-Dist: numpy ; extra == 'doc' +Requires-Dist: nbsphinx ; extra == 'doc' +Requires-Dist: scipy ; extra == 'doc' +Requires-Dist: guzzle-sphinx-theme ; extra == 'doc'  Provides-Extra: test -Requires-Dist: ipython; extra == "test" -Requires-Dist: nbval; extra == "test" -Requires-Dist: cython; extra == "test" -Requires-Dist: wheel; extra == "test" -Requires-Dist: packaging; extra == "test" +Requires-Dist: ipython ; extra == 'test' +Requires-Dist: nbval ; extra == 'test' +Requires-Dist: cython ; extra == 'test' +Requires-Dist: wheel ; extra == 'test' +Requires-Dist: packaging ; extra == 'test' +Requires-Dist: ninja ; extra == 'test' +Requires-Dist: meson ; extra == 'test'  Pythran  ####### diff --git a/contrib/python/pythran/pythran/analyses/__init__.py b/contrib/python/pythran/pythran/analyses/__init__.py index 8560129b078..3c149f9b0bd 100644 --- a/contrib/python/pythran/pythran/analyses/__init__.py +++ b/contrib/python/pythran/pythran/analyses/__init__.py @@ -9,7 +9,7 @@ into  import analyses.Foo  """ -from .aliases import Aliases, StrictAliases +from .aliases import Aliases, StrictAliases, InterproceduralAliases  from .ancestors import Ancestors, AncestorsWithBody  from .argument_effects import ArgumentEffects  from .argument_read_once import ArgumentReadOnce diff --git a/contrib/python/pythran/pythran/analyses/aliases.py b/contrib/python/pythran/pythran/analyses/aliases.py index 1266b7cfd06..79f050e7111 100644 --- a/contrib/python/pythran/pythran/analyses/aliases.py +++ b/contrib/python/pythran/pythran/analyses/aliases.py @@ -544,6 +544,11 @@ class Aliases(ModuleAnalysis):      # aliasing created by statements +    def init_function_alias(self, node): +        "each argument is bound to a different identifier" +        self.aliases.update((arg.id, {arg}) +                            for arg in node.args.args) +      def visit_FunctionDef(self, node):          '''          Initialise aliasing default value before visiting. @@ -558,8 +563,7 @@ class Aliases(ModuleAnalysis):          self.aliases.update((k, {v})                              for k, v in self.global_declarations.items()) -        self.aliases.update((arg.id, {arg}) -                            for arg in node.args.args) +        self.init_function_alias(node)          self.generic_visit(node)          if Aliases.RetId in self.aliases: @@ -612,6 +616,27 @@ class Aliases(ModuleAnalysis):              node.return_alias = merge_return_aliases +    def visit_Assert(self, node): +        self.generic_visit(node) + +        if not isinstance(node.test, ast.Compare): +            return +        if len(node.test.ops) != 1: +            return +        op = node.test.ops[0] +        comparator = node.test.comparators[0] + +        if not isinstance(node.test.left, ast.Name): +            return +        if not isinstance(comparator, ast.Name): +            return + +        if isinstance(op, ast.IsNot): +            left_aliases = self.aliases[node.test.left.id] +            right_aliases = self.aliases[comparator.id] +            self.aliases[node.test.left.id] = self.aliases[node.test.left.id].difference(right_aliases) +            right_aliases.difference_update(left_aliases) +      def visit_Assign(self, node):          r'''          Assignment creates aliasing between lhs and rhs @@ -626,8 +651,9 @@ class Aliases(ModuleAnalysis):          Everyone points to the formal parameter 'a' \o/          '''          md.visit(self, node) -        value_aliases = self.visit(node.value) -        for t in node.targets: +        value_aliases = self.visit(node.value) if node.value else {} +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for t in targets:              if isinstance(t, ast.Name):                  self.aliases[t.id] = set(value_aliases) or {t}                  for alias in list(value_aliases): @@ -638,6 +664,8 @@ class Aliases(ModuleAnalysis):              else:                  self.visit(t) +    visit_AnnAssign = visit_Assign +      def visit_For(self, node):          '''          For loop creates aliasing between the target @@ -786,3 +814,14 @@ class StrictAliases(Aliases):      def get_unbound_value_set(self):          return set() + + +class InterproceduralAliases(Aliases): +    """ +    Gather aliases while assuming two different parameters can point to the same +    value +    """ + +    def init_function_alias(self, node): +        self.aliases.update((arg.id, set(node.args.args)) +                            for arg in node.args.args) diff --git a/contrib/python/pythran/pythran/analyses/argument_effects.py b/contrib/python/pythran/pythran/analyses/argument_effects.py index f89f4f68837..808b86349c5 100644 --- a/contrib/python/pythran/pythran/analyses/argument_effects.py +++ b/contrib/python/pythran/pythran/analyses/argument_effects.py @@ -135,13 +135,16 @@ class ArgumentEffects(ModuleAnalysis):          self.generic_visit(node)      def visit_Assign(self, node): -        for t in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for t in targets:              if isinstance(t, ast.Subscript):                  n = self.argument_index(t)                  if n >= 0:                      self.current_function.update_effects[n] = True          self.generic_visit(node) +    visit_AnnAssign = visit_Assign +      def visit_Call(self, node):          for i, arg in enumerate(node.args):              n = self.argument_index(arg) diff --git a/contrib/python/pythran/pythran/analyses/argument_read_once.py b/contrib/python/pythran/pythran/analyses/argument_read_once.py index a30fa5a0985..8210fc70d74 100644 --- a/contrib/python/pythran/pythran/analyses/argument_read_once.py +++ b/contrib/python/pythran/pythran/analyses/argument_read_once.py @@ -147,10 +147,13 @@ class ArgumentReadOnce(ModuleAnalysis):      def visit_Assign(self, node):          dep = self.generic_visit(node) -        local = [self.local_effect(t, 2) for t in node.targets +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        local = [self.local_effect(t, 2) for t in targets                   if isinstance(t, ast.Subscript)]          return lambda ctx: dep(ctx) + sum(l(ctx) for l in local) +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          dep = self.generic_visit(node)          local = self.local_effect(node.target, 2) diff --git a/contrib/python/pythran/pythran/analyses/cfg.py b/contrib/python/pythran/pythran/analyses/cfg.py index 7006b3eb2ef..b2e9de78f47 100644 --- a/contrib/python/pythran/pythran/analyses/cfg.py +++ b/contrib/python/pythran/pythran/analyses/cfg.py @@ -61,7 +61,7 @@ class CFG(FunctionAnalysis):          return (node,), ()      # All these nodes have the same behavior as pass -    visit_Assign = visit_AugAssign = visit_Import = visit_Pass +    visit_Assign = visit_AnnAssign = visit_AugAssign = visit_Import = visit_Pass      visit_Expr = visit_Print = visit_ImportFrom = visit_Pass      visit_Yield = visit_Delete = visit_Pass diff --git a/contrib/python/pythran/pythran/analyses/constant_expressions.py b/contrib/python/pythran/pythran/analyses/constant_expressions.py index ce90617a78b..7c6e3938f78 100644 --- a/contrib/python/pythran/pythran/analyses/constant_expressions.py +++ b/contrib/python/pythran/pythran/analyses/constant_expressions.py @@ -99,3 +99,9 @@ class ConstantExpressions(NodeAnalysis):      def visit_Index(self, node):          return self.visit(node.value) and self.add(node) + +    def visit_AnnAssign(self, node): +        self.visit(node.target) +        # skip annotation +        if node.value: +            self.visit(node.value) diff --git a/contrib/python/pythran/pythran/analyses/fixed_size_list.py b/contrib/python/pythran/pythran/analyses/fixed_size_list.py index 956473226dc..1d05d2dc421 100644 --- a/contrib/python/pythran/pythran/analyses/fixed_size_list.py +++ b/contrib/python/pythran/pythran/analyses/fixed_size_list.py @@ -57,10 +57,13 @@ class FixedSizeList(FunctionAnalysis):      def visit_Assign(self, node):          self.generic_visit(node) +        if not node.value: +            return          if not self.is_fixed_size_list_def(node.value):              return -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              def_ = self.def_use_chains.chains[target]              if any(not self.is_safe_use(u) for u in def_.users()):                  break @@ -72,6 +75,8 @@ class FixedSizeList(FunctionAnalysis):          else:              self.result.add(node.value) +    visit_AnnAssign = visit_Assign +      def visit_Call(self, node):          self.generic_visit(node)          for i, arg in enumerate(node.args): diff --git a/contrib/python/pythran/pythran/analyses/imported_ids.py b/contrib/python/pythran/pythran/analyses/imported_ids.py index 2abafcdef59..4df642bceed 100644 --- a/contrib/python/pythran/pythran/analyses/imported_ids.py +++ b/contrib/python/pythran/pythran/analyses/imported_ids.py @@ -50,10 +50,14 @@ class ImportedIds(NodeAnalysis):          # order matter as an assignation          # is evaluated before being assigned          md.visit(self, node) -        self.visit(node.value) -        for target in node.targets: +        if node.value: +            self.visit(node.value) +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              self.visit(target) +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          self.in_augassign = True          self.generic_visit(node) diff --git a/contrib/python/pythran/pythran/analyses/lazyness_analysis.py b/contrib/python/pythran/pythran/analyses/lazyness_analysis.py index 0efdaef374b..5589231080b 100644 --- a/contrib/python/pythran/pythran/analyses/lazyness_analysis.py +++ b/contrib/python/pythran/pythran/analyses/lazyness_analysis.py @@ -159,9 +159,13 @@ class LazynessAnalysis(FunctionAnalysis):      def visit_Assign(self, node):          md.visit(self, node) -        self.visit(node.value) -        ids = self.gather(Identifiers, node.value) -        for target in node.targets: +        if node.value: +            self.visit(node.value) +            ids = self.gather(Identifiers, node.value) +        else: +            ids = set() +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              if isinstance(target, ast.Name):                  self.assign_to(target, ids)                  if node.value not in self.pure_expressions: @@ -177,6 +181,8 @@ class LazynessAnalysis(FunctionAnalysis):              else:                  raise PythranSyntaxError("Assign to unknown node", node) +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          md.visit(self, node)          # augassigned variable can't be lazy diff --git a/contrib/python/pythran/pythran/analyses/literals.py b/contrib/python/pythran/pythran/analyses/literals.py index 47c71950ef2..929e8c4e6a7 100644 --- a/contrib/python/pythran/pythran/analyses/literals.py +++ b/contrib/python/pythran/pythran/analyses/literals.py @@ -20,6 +20,8 @@ class Literals(FunctionAnalysis):          # a constructor which may be costly and they can be updated using          # function call          if isinstance(node.value, (ast.Constant, ast.Lambda)): -            targets = [target for target in node.targets +            targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +            targets = [target for target in targets                         if isinstance(target, ast.Name)]              self.result.update(targets) +    visit_AnnAssign = visit_Assign diff --git a/contrib/python/pythran/pythran/analyses/locals_analysis.py b/contrib/python/pythran/pythran/analyses/locals_analysis.py index 91ebb56e7fd..0d76584521a 100644 --- a/contrib/python/pythran/pythran/analyses/locals_analysis.py +++ b/contrib/python/pythran/pythran/analyses/locals_analysis.py @@ -82,12 +82,18 @@ class Locals(ModuleAnalysis):          self.expr_parent = node          self.result[node] = self.locals.copy()          md.visit(self, node) -        self.visit(node.value) -        self.locals.update(t.id for t in node.targets +        if node.value: +            self.visit(node.value) +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        self.locals.update(t.id for t in targets                             if isinstance(t, ast.Name)) -        for target in node.targets: +        for target in targets:              self.visit(target) +    def visit_AnnAssign(self, node): +        self.visit_Assign(node) +        self.visit(node.annotation) +      def visit_For(self, node):          self.expr_parent = node          self.result[node] = self.locals.copy() diff --git a/contrib/python/pythran/pythran/analyses/range_values.py b/contrib/python/pythran/pythran/analyses/range_values.py index 2b9a8cf0017..bc11d37b47f 100644 --- a/contrib/python/pythran/pythran/analyses/range_values.py +++ b/contrib/python/pythran/pythran/analyses/range_values.py @@ -579,14 +579,19 @@ class RangeValuesSimple(RangeValuesBase):          >>> res['b']          Interval(low=2, high=2)          """ +        if not node.value: +            return          assigned_range = self.visit(node.value) -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              if isinstance(target, ast.Name):                  # Make sure all Interval doesn't alias for multiple variables.                  self.add(target.id, assigned_range)              else:                  self.visit(target) +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          """ Update range value for augassigned variables. diff --git a/contrib/python/pythran/pythran/backend.py b/contrib/python/pythran/pythran/backend.py index c5de8d6461a..cb0f77c1ccd 100644 --- a/contrib/python/pythran/pythran/backend.py +++ b/contrib/python/pythran/pythran/backend.py @@ -408,26 +408,29 @@ class CxxFunction(ast.NodeVisitor):          Finally, process OpenMP clause like #pragma omp atomic          """ +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,)          if not all(isinstance(n, (ast.Name, ast.Subscript)) -                   for n in node.targets): +                   for n in targets):              raise PythranSyntaxError(                  "Must assign to an identifier or a subscript",                  node) +        if not node.value: +            return self.visit_Pass(node)          value = self.visit(node.value) -        targets = [self.visit(t) for t in node.targets] -        alltargets = "= ".join(targets) -        islocal = (len(targets) == 1 and -                   isinstance(node.targets[0], ast.Name) and -                   node.targets[0].id in self.scope[node] and -                   node.targets[0].id not in self.openmp_deps) +        stargets = [self.visit(t) for t in targets] +        alltargets = "= ".join(stargets) +        islocal = (len(stargets) == 1 and +                   isinstance(targets[0], ast.Name) and +                   targets[0].id in self.scope[node] and +                   targets[0].id not in self.openmp_deps)          if islocal:              # remove this decls from local decls -            self.ldecls.difference_update(t.id for t in node.targets) +            self.ldecls.difference_update(t.id for t in targets)              # add a local declaration -            if self.types[node.targets[0]].iscombined(): -                alltargets = '{} {}'.format(self.typeof(node.targets[0]), +            if self.types[targets[0]].iscombined(): +                alltargets = '{} {}'.format(self.typeof(targets[0]),                                              alltargets) -            elif isinstance(self.types[node.targets[0]], +            elif isinstance(self.types[targets[0]],                              self.types.builder.Assignable):                  alltargets = '{} {}'.format(                      self.types.builder.AssignableNoEscape( @@ -435,7 +438,7 @@ class CxxFunction(ast.NodeVisitor):                              'decltype({})'.format(value))).sgenerate(),                      alltargets)              else: -                assert isinstance(self.types[node.targets[0]], +                assert isinstance(self.types[targets[0]],                                    self.types.builder.Lazy)                  alltargets = '{} {}'.format(                      self.types.builder.Lazy( @@ -445,6 +448,8 @@ class CxxFunction(ast.NodeVisitor):          stmt = Assign(alltargets, value)          return self.process_omp_attachements(node, stmt) +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          value = self.visit(node.value)          target = self.visit(node.target) @@ -907,7 +912,7 @@ class CxxFunction(ast.NodeVisitor):          body = self.visit(node.body)          orelse = self.visit(node.orelse)          return ( -            "(((bool){0}) " +            "(pythonic::builtins::functor::bool_{{}}({0}) "              "? typename __combined<decltype({1}), decltype({2})>::type({1}) "              ": typename __combined<decltype({1}), decltype({2})>::type({2}))"          ).format(test, body, orelse) @@ -1026,9 +1031,13 @@ class CxxFunction(ast.NodeVisitor):          else:              ret = repr(node.value) + TYPE_TO_SUFFIX.get(type(node.value), "")          if node in self.immediates: -            assert isinstance(node.value, int) -            return "std::integral_constant<%s, %s>{}" % ( -                PYTYPE_TO_CTYPE_TABLE[type(node.value)], str(node.value).lower()) +            if isinstance(node.value, int): +                return "std::integral_constant<%s, %s>{}" % ( +                    PYTYPE_TO_CTYPE_TABLE[type(node.value)], str(node.value).lower()) +            if isinstance(node.value, str): +                assert len(node.value) == 1 +                return "std::integral_constant<char, '%s'>{}" % node.value +            raise PythranSyntaxError("Unsupported immediate type", node)          return ret      def visit_Attribute(self, node): @@ -1321,12 +1330,17 @@ class CxxGenerator(CxxFunction):              ]).generate())      def visit_Assign(self, node): +        if not node.value: +            return self.visit_Pass(node)          value = self.visit(node.value) -        targets = [self.visit(t) for t in node.targets] +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        targets = [self.visit(t) for t in targets]          alltargets = "= ".join(targets)          stmt = Assign(alltargets, value)          return self.process_omp_attachements(node, stmt) +    visit_AnnAssign = visit_Assign +      def can_use_autofor(self, node):          """          TODO : Yield should block only if it is use in the for loop, not in the diff --git a/contrib/python/pythran/pythran/config.py b/contrib/python/pythran/pythran/config.py index c8d09640c7e..053c26d3d81 100644 --- a/contrib/python/pythran/pythran/config.py +++ b/contrib/python/pythran/pythran/config.py @@ -193,6 +193,11 @@ def make_extension(python, **extra):          "extra_objects": []      } +    # In case the extension doesn't include any optimization level, make sure we +    # have a decent default. Later options have prcedence so this is still +    # customizable by users. +    extension['extra_compile_args'].insert(0, "-O2") +      if python:          extension['define_macros'].append('ENABLE_PYTHON_MODULE')      extension['define_macros'].append( @@ -234,7 +239,7 @@ def make_extension(python, **extra):          extension['include_dirs'].append(numpy.get_include())      # blas dependency -    reserved_blas_entries = 'pythran-openblas', 'none' +    reserved_blas_entries = 'scipy-openblas', 'pythran-openblas', 'none'      user_blas = cfg.get('compiler', 'blas')      if user_blas == 'pythran-openblas':          try: @@ -250,24 +255,28 @@ def make_extension(python, **extra):                             "Please install it or change the compiler.blas "                             "setting. Defaulting to 'none'")              user_blas = 'none' +    elif user_blas == 'scipy-openblas': +        try: +            import scipy_openblas64 as openblas +            # required to cope with atlas missing extern "C" +            extension['define_macros'].append('PYTHRAN_BLAS_SCIPY_OPENBLAS') +            extension['include_dirs'].append(openblas.get_include_dir()) +            extension['library_dirs'].append(openblas.get_lib_dir()) +            extension['libraries'].append(openblas.get_library()) +            extension['extra_link_args'].append("-Wl,-rpath=" + openblas.get_lib_dir()) +        except ImportError: +            logger.warning("Failed to find 'scipy-openblas64' package. " +                           "Please install it or change the compiler.blas " +                           "setting. Defaulting to 'none'") +            user_blas = 'none' +      if user_blas == 'none':          extension['define_macros'].append('PYTHRAN_BLAS_NONE')      if user_blas not in reserved_blas_entries: -        try: -            import numpy.distutils.system_info as numpy_sys -             # Numpy can pollute stdout with checks -            with silent(): -                numpy_blas = numpy_sys.get_info(user_blas) -                extension['libraries'].extend(numpy_blas.get('libraries', [])) -                extension['library_dirs'].extend( -                    numpy_blas.get('library_dirs', [])) -        # `numpy.distutils` not present for Python >= 3.12 -        except ImportError: -            blas = numpy.show_config('dicts')["Build Dependencies"]["blas"] -            libblas = {'openblas64': 'openblas'}.get(blas['name'], blas['name']) -            extension["libraries"].append(libblas) +        extension["libraries"].append(user_blas) +        extension['define_macros'].append('PYTHRAN_BLAS_{}'.format(user_blas.upper()))      # final macro normalization @@ -327,6 +336,10 @@ def run():      parser.add_argument('--no-python', action='store_true',                          help='do not include Python-related flags') +    parser.add_argument('-V', '--version', +                        action='version', +                        version=pythran.version.__version__) +      parser.add_argument('--verbose', '-v', action='count', default=0,                          help=(                              'verbose mode: [-v] prints warnings if pythranrc ' @@ -382,20 +395,22 @@ def run():      if args.libs or args.verbose >= 2:          ldflags = [] -        ldflags.extend((compiler_obj.library_dir_option(include)) +        ldflags.extend(('-L' + compiler_obj.library_dir_option(include))                         for include in extension['library_dirs'])          ldflags.extend((compiler_obj.library_option(include))                         for include in extension['libraries'])          if args.python: -            libpl = distutils.sysconfig.get_config_var('LIBPL') -            if libpl: -                ldflags.append(libpl)              libs = distutils.sysconfig.get_config_var('LIBS')              if libs:                  ldflags.extend(shsplit(libs)) -            ldflags.append(compiler_obj.library_option('python') -                           + distutils.sysconfig.get_config_var('VERSION')) +            libdir = distutils.sysconfig.get_config_var('LIBDIR') +            pylib = distutils.sysconfig.get_config_var('LDLIBRARY') +            if libdir and pylib: +                ldflags.append(os.path.join(libdir, pylib)) +            else: +                ldflags.append(compiler_obj.library_option('python') +                               + distutils.sysconfig.get_config_var('VERSION'))          logger.info('LDFLAGS = '.rjust(10) + ' '.join(ldflags))          if args.libs: diff --git a/contrib/python/pythran/pythran/graph.py b/contrib/python/pythran/pythran/graph.py index 83626eb8ba4..7a29337e27a 100644 --- a/contrib/python/pythran/pythran/graph.py +++ b/contrib/python/pythran/pythran/graph.py @@ -63,71 +63,3 @@ def has_path(graph, src, dest):              return True          worklist.extend(graph.successors(current))      return False - -# Copied verbatim from NetworkX 2.6.1 -# -# NetworkX is distributed with the 3-clause BSD license. -# -# :: -# -#   Copyright (C) 2004-2021, NetworkX Developers -#   Aric Hagberg <[email protected]> -#   Dan Schult <[email protected]> -#   Pieter Swart <[email protected]> -#   All rights reserved. -# -#   Redistribution and use in source and binary forms, with or without -#   modification, are permitted provided that the following conditions are -#   met: -# -#     * Redistributions of source code must retain the above copyright -#       notice, this list of conditions and the following disclaimer. -# -#     * Redistributions in binary form must reproduce the above -#       copyright notice, this list of conditions and the following -#       disclaimer in the documentation and/or other materials provided -#       with the distribution. -# -#     * Neither the name of the NetworkX Developers nor the names of its -#       contributors may be used to endorse or promote products derived -#       from this software without specific prior written permission. -# -#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -def _all_simple_paths_graph(G, source, targets, cutoff): -    visited = dict.fromkeys([source]) -    stack = [iter(G[source])] -    while stack: -        children = stack[-1] -        child = next(children, None) -        if child is None: -            stack.pop() -            visited.popitem() -        elif len(visited) < cutoff: -            if child in visited: -                continue -            if child in targets: -                yield list(visited) + [child] -            visited[child] = None -            if targets - set(visited.keys()):  # expand stack until find all targets -                stack.append(iter(G[child])) -            else: -                visited.popitem()  # maybe other ways to child -        else:  # len(visited) == cutoff: -            for target in (targets & (set(children) | {child})) - set(visited.keys()): -                yield list(visited) + [target] -            stack.pop() -            visited.popitem() - -def all_simple_paths(graph, src, target): -    return _all_simple_paths_graph(graph, src, {target},  len(graph) - 1) diff --git a/contrib/python/pythran/pythran/interval.py b/contrib/python/pythran/pythran/interval.py index 4e5dff8fd9f..b8ef42e694f 100644 --- a/contrib/python/pythran/pythran/interval.py +++ b/contrib/python/pythran/pythran/interval.py @@ -196,13 +196,15 @@ class Interval(object):          >>> Interval(1, 5) ** Interval(-5, -4)          Interval(low=1.0, high=1.0)          >>> Interval(-1, 5) ** Interval(-5, 3) -        Interval(low=-1.0, high=125.0) +        Interval(low=-1.0, high=125)          >>> Interval(1, 5) ** Interval(3, 8) -        Interval(low=1.0, high=390625.0) +        Interval(low=1, high=390625)          """          res = [v1 ** v2 for v1, v2 in                 itertools.product(range1.bounds(), range2.bounds())] -        return Interval(numpy.ceil(min(res)), numpy.floor(max(res))) +        minres, maxres = min(res), max(res) +        return Interval(type(minres)(numpy.ceil(minres)), +                        type(maxres)(numpy.floor(maxres)))      def __lshift__(range1, range2):          """ diff --git a/contrib/python/pythran/pythran/optimizations/__init__.py b/contrib/python/pythran/pythran/optimizations/__init__.py index 899e6ce876d..c42c1e08ddc 100644 --- a/contrib/python/pythran/pythran/optimizations/__init__.py +++ b/contrib/python/pythran/pythran/optimizations/__init__.py @@ -13,6 +13,7 @@ import optimisations.xxxxx  from .constant_folding import ConstantFolding, PartialConstantFolding  from .copyto import CopyTo  from .dead_code_elimination import DeadCodeElimination +from .fast_gexpr import FastGExpr  from .forward_substitution import ForwardSubstitution, PreInliningForwardSubstitution  from .iter_transformation import IterTransformation  from .comprehension_patterns import ComprehensionPatterns diff --git a/contrib/python/pythran/pythran/optimizations/constant_folding.py b/contrib/python/pythran/pythran/optimizations/constant_folding.py index 726a217fe95..5bf1f3e0233 100644 --- a/contrib/python/pythran/pythran/optimizations/constant_folding.py +++ b/contrib/python/pythran/pythran/optimizations/constant_folding.py @@ -93,8 +93,11 @@ class ConstEval(ast.NodeVisitor):              self.locals.pop(node.id)      def visit_Assign(self, node): +        if not node.value: +            return          value = self.visit(node.value) -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              if isinstance(target, ast.Name):                  self.locals[target.id] = value              elif isinstance(target, ast.Subscript): @@ -102,6 +105,8 @@ class ConstEval(ast.NodeVisitor):              else:                  raise NotImplementedError("assign") +    visit_AnnAssign = visit_Assign +      def visit_AugAssign(self, node):          value = self.visit(node.value)          ty = type(node.op) diff --git a/contrib/python/pythran/pythran/optimizations/copyto.py b/contrib/python/pythran/pythran/optimizations/copyto.py index 33aa79fcc5e..e95d7194ec1 100644 --- a/contrib/python/pythran/pythran/optimizations/copyto.py +++ b/contrib/python/pythran/pythran/optimizations/copyto.py @@ -68,9 +68,12 @@ class CopyTo(Transformation):          return node      def visit_Assign(self, node): -        if len(node.targets) != 1: +        if not node.value:              return node -        target, = node.targets +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        if len(targets) != 1: +            return node +        target, = targets          if not self.is_fully_sliced(target):              return node          if self.is_fully_sliced(node.value): @@ -87,5 +90,6 @@ class CopyTo(Transformation):                      [target.value, value],                      [])                  ) +    visit_AnnAssign = visit_Assign diff --git a/contrib/python/pythran/pythran/optimizations/dead_code_elimination.py b/contrib/python/pythran/pythran/optimizations/dead_code_elimination.py index c4077380de4..fd1a6b91dc3 100644 --- a/contrib/python/pythran/pythran/optimizations/dead_code_elimination.py +++ b/contrib/python/pythran/pythran/optimizations/dead_code_elimination.py @@ -91,15 +91,26 @@ class DeadCodeElimination(Transformation):                     if self.used_target(target)]          if len(targets) == len(node.targets):              return node -        node.targets = targets          self.update = True          if targets: +            node.targets = targets              return node          if node.value in self.pure_expressions:              return ast.Pass()          else:              return ast.Expr(value=node.value) +    def visit_AnnAssign(self, node): +        if not node.value: +            return node +        if self.used_target(node.target): +            return node +        self.update = True +        if node.value in self.pure_expressions: +            return ast.Pass() +        else: +            return ast.Expr(value=node.value) +      def visit_Expr(self, node):          if (node.value in self.pure_expressions and                  not isinstance(node.value, ast.Yield)): diff --git a/contrib/python/pythran/pythran/optimizations/fast_gexpr.py b/contrib/python/pythran/pythran/optimizations/fast_gexpr.py new file mode 100644 index 00000000000..8fe23b33d08 --- /dev/null +++ b/contrib/python/pythran/pythran/optimizations/fast_gexpr.py @@ -0,0 +1,73 @@ +""" Optimize a[...] = b[...] + c when we have no conflicting aliasing """ + +from pythran.analyses import InterproceduralAliases +from pythran.passmanager import Transformation + +import gast as ast + + +class FastGExpr(Transformation): + +    def __init__(self): +        self.update = False +        super(FastGExpr, self).__init__(InterproceduralAliases) + +    def as_gexpr(self, node): +        if not isinstance(node, ast.Subscript): +            return None +        if not isinstance(node.slice, ast.Slice): +            if not isinstance(node.slice, ast.Tuple): +                return None +            if not any(isinstance(elt, ast.Slice) for elt in node.slice.elts): +                return None + +        if not isinstance(node.value, ast.Name): +            return None + +        return node.value, node.slice + +    def may_alias(self, gexpr, value): +        if isinstance(value, ast.Constant): +            return False +        if isinstance(value, (ast.List, ast.Tuple)): +            return any(self.may_alias(gexpr, elt) for elt in value.elts) +        if isinstance(value, ast.UnaryOp): +            return self.may_alias(gexpr, value.operand) +        if isinstance(value, ast.BinOp): +            return any(self.may_alias(gexpr, elt) for elt in (value.left, +                                                              value.right)) +        if isinstance(value, ast.Subscript): +            if not isinstance(value.value, ast.Name): +                return True +            return not self.interprocedural_aliases[gexpr[0]].isdisjoint(self.interprocedural_aliases[value.value]) + +        return True + + +    def visit_Assign(self, node): +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        if len(targets) > 1: +            return node + +        if not node.value: +            return node + +        target, = targets +        value = node.value +        gexpr = self.as_gexpr(target) +        if not gexpr: +            return node + +        if self.may_alias(gexpr, value): +            return node + +        self.update = True + +        func = ast.Attribute( +            value=ast.Attribute(value=ast.Name('builtins', ast.Load(), +                                               None, None), +                                attr="pythran", ctx=ast.Load()), +            attr="restrict_assign", ctx=ast.Load()) +        return ast.Expr(ast.Call(func, args=[target, value], keywords=[])) +    visit_AnnAssign = visit_Assign + diff --git a/contrib/python/pythran/pythran/optimizations/forward_substitution.py b/contrib/python/pythran/pythran/optimizations/forward_substitution.py index e1e325877d2..4d34f8c05e5 100644 --- a/contrib/python/pythran/pythran/optimizations/forward_substitution.py +++ b/contrib/python/pythran/pythran/optimizations/forward_substitution.py @@ -35,6 +35,15 @@ class Remover(ast.NodeTransformer):                  return ast.Pass()          return node +    def visit_AnnAssign(self, node): +        if node in self.nodes: +            to_prune = self.nodes[node] +            if node.target in to_prune: +                return ast.Pass() +            else: +                return node +        return node +  class ForwardSubstitution(Transformation): @@ -135,22 +144,31 @@ class ForwardSubstitution(Transformation):                      return value              elif len(parent.targets) == 1:                  ids = self.gather(Identifiers, value) -                node_stmt = next(reversed([s for s in self.ancestors[node] -                                 if isinstance(s, ast.stmt)])) -                all_paths = graph.all_simple_paths(self.cfg, parent, node_stmt) -                for path in all_paths: -                    for stmt in path[1:-1]: +                node_stmt = next(s for s in self.ancestors[node][::-1] +                                 if isinstance(s, ast.stmt)) +                # Check if there is a path from `parent' to `node_stmt' that +                # modifies any of the identifier from `value'. If so, cancel the +                # forward substitution. +                worklist = [node_stmt] +                visited = {parent} +                while worklist: +                    workitem = worklist.pop() +                    if workitem in visited: +                        continue +                    visited.add(workitem) +                    for pred in self.cfg.predecessors(workitem): +                        if not graph.has_path(self.cfg, parent, pred): +                            continue +                          assigned_ids = {n.id -                                        for n in self.gather(IsAssigned, stmt)} +                                        for n in self.gather(IsAssigned, +                                                             pred)}                          if not ids.isdisjoint(assigned_ids): -                            break -                    else: -                        continue -                    break -                else: -                    self.update = True -                    self.to_remove[parent].append(dnode) -                    return value +                            return node  # cancel +                        worklist.append(pred) +                self.update = True +                self.to_remove[parent].append(dnode) +                return value          return node diff --git a/contrib/python/pythran/pythran/optimizations/inlining.py b/contrib/python/pythran/pythran/optimizations/inlining.py index 70ea9c9fffb..dac8dc6b2f4 100644 --- a/contrib/python/pythran/pythran/optimizations/inlining.py +++ b/contrib/python/pythran/pythran/optimizations/inlining.py @@ -50,6 +50,7 @@ __pythran_inlinefooa0)) * (__pythran_inlinefoob1 + \      visit_Return = visit_Stmt      visit_Assign = visit_Stmt +    visit_AnnAssign = visit_Stmt      visit_AugAssign = visit_Stmt      visit_Print = visit_Stmt      visit_For = visit_Stmt diff --git a/contrib/python/pythran/pythran/optimizations/list_to_tuple.py b/contrib/python/pythran/pythran/optimizations/list_to_tuple.py index f820aa73e77..87261ab7330 100644 --- a/contrib/python/pythran/pythran/optimizations/list_to_tuple.py +++ b/contrib/python/pythran/pythran/optimizations/list_to_tuple.py @@ -102,6 +102,8 @@ class ListToTuple(Transformation):          node.value = self.convert(node.value)          return node +    visit_AnnAssign = visit_Assign +      def convert(self, node):          self.update = True diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/append.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/append.hpp new file mode 100644 index 00000000000..f558245002a --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/append.hpp @@ -0,0 +1,22 @@ +#ifndef PYTHONIC_DISPATCH_APPEND_HPP +#define PYTHONIC_DISPATCH_APPEND_HPP + +#include "pythonic/include/__dispatch__/append.hpp" + +#include "pythonic/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type append(Any &&any, Arg &&arg) +  { +    std::forward<Any>(any).push_back(std::forward<Arg>(arg)); +    return {}; +  } +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/conjugate.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/conjugate.hpp index 0a21614138c..90bb8be1768 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/conjugate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/__dispatch__/copy.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/copy.hpp index 70e59d1f383..8eb42561faf 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/copy.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/copy.hpp @@ -14,7 +14,7 @@ namespace __dispatch__    {      return any.copy();    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/count.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/count.hpp index 5d350f6106e..cc566bea029 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/count.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/count.hpp @@ -11,12 +11,12 @@ namespace __dispatch__  {    template <class Any, class Value> -  auto count(Any &&any, Value &&value) -      -> decltype(any.count(std::forward<Value>(value))) +  auto count(Any &&any, +             Value &&value) -> decltype(any.count(std::forward<Value>(value)))    {      return any.count(std::forward<Value>(value));    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/extend.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/extend.hpp new file mode 100644 index 00000000000..634ffb6d060 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/extend.hpp @@ -0,0 +1,22 @@ +#ifndef PYTHONIC_DISPATCH_EXTEND_HPP +#define PYTHONIC_DISPATCH_EXTEND_HPP + +#include "pythonic/include/__dispatch__/extend.hpp" + +#include "pythonic/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type extend(Any &&any, Arg &&arg) +  { +    std::forward<Any>(any) += std::forward<Arg>(arg); +    return {}; +  } +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/insert.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/insert.hpp new file mode 100644 index 00000000000..5b90502f472 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/insert.hpp @@ -0,0 +1,26 @@ +#ifndef PYTHONIC_DISPATCH_INSERT_HPP +#define PYTHONIC_DISPATCH_INSERT_HPP + +#include "pythonic/include/__dispatch__/insert.hpp" + +#include "pythonic/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type insert(Any &&any, long index, Arg &&arg) +  { +    index = index % (1 + any.size()); // +1 because we want to be able to insert +                                      // at the end of any +    if (index < 0) +      index += any.size(); +    any.insert(index, std::forward<Arg>(arg)); +    return builtins::None; +  } +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/pop.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/pop.hpp index 72c4aa474f2..262c82d240c 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/pop.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/pop.hpp @@ -10,12 +10,12 @@ PYTHONIC_NS_BEGIN  namespace __dispatch__  {    template <class Any, class... Arg0> -  auto pop(Any &&any, Arg0 &&... arg0) -      -> decltype(any.pop(std::forward<Arg0>(arg0)...)) +  auto pop(Any &&any, +           Arg0 &&...arg0) -> decltype(any.pop(std::forward<Arg0>(arg0)...))    {      return any.pop(std::forward<Arg0>(arg0)...);    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/remove.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/remove.hpp index 60493e30384..114b02f3821 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/remove.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/remove.hpp @@ -14,7 +14,7 @@ namespace __dispatch__    {      return any.remove(arg0);    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/reverse.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/reverse.hpp new file mode 100644 index 00000000000..055d33fb684 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/reverse.hpp @@ -0,0 +1,24 @@ +#ifndef PYTHONIC_DISPATCH_REVERSE_HPP +#define PYTHONIC_DISPATCH_REVERSE_HPP + +#include "pythonic/include/__dispatch__/reverse.hpp" + +#include "pythonic/utils/functor.hpp" + +#include <algorithm> + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any> +  types::none_type reverse(Any &&any) +  { +    std::reverse(any.begin(), any.end()); +    return {}; +  } +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/sort.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/sort.hpp index a49b8f8955a..3bdc0cdccb4 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/sort.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/sort.hpp @@ -12,14 +12,14 @@ namespace __dispatch__  {    template <class T, class... Args> -  auto sort(types::list<T> &l, Args &&... args) +  auto sort(types::list<T> &l, Args &&...args)        -> decltype(pythonic::builtins::list::sort(l,                                                   std::forward<Args>(args)...))    {      return pythonic::builtins::list::sort(l, std::forward<Args>(args)...);    }    template <class T, class... Args> -  auto sort(types::list<T> &&l, Args &&... args) +  auto sort(types::list<T> &&l, Args &&...args)        -> decltype(pythonic::builtins::list::sort(std::move(l),                                                   std::forward<Args>(args)...))    { @@ -27,12 +27,12 @@ namespace __dispatch__                                            std::forward<Args>(args)...);    }    template <class Any, class... Args> -  types::none_type sort(Any &&any, Args &&... args) +  types::none_type sort(Any &&any, Args &&...args)    {      return pythonic::numpy::ndarray::sort(std::forward<Any>(any),                                            std::forward<Args>(args)...);    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/tolist.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/tolist.hpp new file mode 100644 index 00000000000..a39c4394a9a --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/tolist.hpp @@ -0,0 +1,8 @@ +#ifndef PYTHONIC_DISPATCH_TOLIST_HPP +#define PYTHONIC_DISPATCH_TOLIST_HPP + +#include "pythonic/include/__dispatch__/tolist.hpp" +#include "pythonic/numpy/ndarray/tolist.hpp" +#include "pythonic/types/array.hpp" + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/__dispatch__/update.hpp b/contrib/python/pythran/pythran/pythonic/__dispatch__/update.hpp index faae8c9a274..12f1acfbfe0 100644 --- a/contrib/python/pythran/pythran/pythonic/__dispatch__/update.hpp +++ b/contrib/python/pythran/pythran/pythonic/__dispatch__/update.hpp @@ -11,12 +11,12 @@ namespace __dispatch__  {    template <class Any, class... Arg0> -  auto update(Any &&any, Arg0 &&... arg0) +  auto update(Any &&any, Arg0 &&...arg0)        -> decltype(any.update(std::forward<Arg0>(arg0)...))    {      return any.update(std::forward<Arg0>(arg0)...);    } -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array.hpp b/contrib/python/pythran/pythran/pythonic/array/array.hpp new file mode 100644 index 00000000000..6edf437706f --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array.hpp @@ -0,0 +1,34 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_HPP +#define PYTHONIC_ARRAY_ARRAY_HPP + +#include "pythonic/include/array/array.hpp" + +#include "pythonic/types/array.hpp" +#include "pythonic/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ +  namespace details +  { + +    template <char c> +    types::array<typename details::typecodes<c>::type> +    array(std::integral_constant<char, c>) +    { +      return {0}; +    } + +    template <char c, class E> +    types::array<typename details::typecodes<c>::type> +    array(std::integral_constant<char, c>, E &&elts) +    { +      return {std::forward<E>(elts)}; +    } +  } // namespace details + +} // namespace array +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/buffer_info.hpp b/contrib/python/pythran/pythran/pythonic/array/array/buffer_info.hpp new file mode 100644 index 00000000000..3413e05442f --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/buffer_info.hpp @@ -0,0 +1,25 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_BUFFER_INFO_HPP +#define PYTHONIC_ARRAY_ARRAY_BUFFER_INFO_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    std::tuple<long, long> buffer_info(types::array<T> const &seq) +    { +      return std::make_tuple(seq.id(), seq.size()); +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/byteswap.hpp b/contrib/python/pythran/pythran/pythonic/array/array/byteswap.hpp new file mode 100644 index 00000000000..be93143b6fe --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/byteswap.hpp @@ -0,0 +1,46 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_BYTESWAP_HPP +#define PYTHONIC_ARRAY_ARRAY_BYTESWAP_HPP + +#include "pythonic/include/array/array/byteswap.hpp" +#include "pythonic/utils/functor.hpp" + +#include <byteswap.h> + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { +    inline void byteswap(char *buffer, size_t n, std::integral_constant<unsigned, 2>) +    { +      auto *ibuffer = reinterpret_cast<uint16_t *>(buffer); +      for (size_t i = 0; i < n; i++) +        ibuffer[i] = bswap_16(ibuffer[i]); +    } +    inline void byteswap(char *buffer, size_t n, std::integral_constant<unsigned, 4>) +    { +      auto *ibuffer = reinterpret_cast<uint32_t *>(buffer); +      for (size_t i = 0; i < n; i++) +        ibuffer[i] = bswap_32(ibuffer[i]); +    } +    inline void byteswap(char *buffer, size_t n, std::integral_constant<unsigned, 8>) +    { +      auto *ibuffer = reinterpret_cast<uint64_t *>(buffer); +      for (size_t i = 0; i < n; i++) +        ibuffer[i] = bswap_64(ibuffer[i]); +    } + +    template <class T> +    types::none_type byteswap(types::array<T> &seq) +    { +      byteswap(reinterpret_cast<char *>(seq.data()), seq.size(), +               std::integral_constant<unsigned, sizeof(T)>{}); +      return {}; +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/count.hpp b/contrib/python/pythran/pythran/pythonic/array/array/count.hpp new file mode 100644 index 00000000000..a787213385b --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/count.hpp @@ -0,0 +1,24 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_COUNT_HPP +#define PYTHONIC_ARRAY_ARRAY_COUNT_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    long count(types::array<T> const &seq) +    { +      return std::count(seq.begin(), seq.end()); +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/extend.hpp b/contrib/python/pythran/pythran/pythonic/array/array/extend.hpp new file mode 100644 index 00000000000..b27f79bbaa7 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/extend.hpp @@ -0,0 +1,25 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_EXTEND_HPP +#define PYTHONIC_ARRAY_ARRAY_EXTEND_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T, class S> +    types::none_type extend(types::array<T> &a, S &&elts) +    { +      seq += std::forward<S>(elts); +      return {}; +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/frombytes.hpp b/contrib/python/pythran/pythran/pythonic/array/array/frombytes.hpp new file mode 100644 index 00000000000..a42701531bf --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/frombytes.hpp @@ -0,0 +1,28 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_FROMBYTES_HPP +#define PYTHONIC_ARRAY_ARRAY_FROMBYTES_HPP + +#include "pythonic/include/utils/functor.hpp" +#include "pythonic/types/array.hpp" +#include "pythonic/types/str.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    types::none_type frombytes(types::array<T> &seq, types::str const &s) +    { +      long size = seq.size(); +      seq.resize(size + s.size() / sizeof(T)); +      memcpy(seq.data() + size, s.c_str(), s.size()); +      return {}; +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/fromfile.hpp b/contrib/python/pythran/pythran/pythonic/array/array/fromfile.hpp new file mode 100644 index 00000000000..1c4151d9a7d --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/fromfile.hpp @@ -0,0 +1,27 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_FROMFILE_HPP +#define PYTHONIC_ARRAY_ARRAY_FROMFILE_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    types::none_type fromfile(types::array<T> &seq, types::file &f, long n) +    { +      long p = seq.size(); +      seq.resize(p + n); +      f.read_as(n, seq.data() + p); +      return {}; +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/array/fromlist.hpp b/contrib/python/pythran/pythran/pythonic/array/array/fromlist.hpp new file mode 100644 index 00000000000..9a4e8ca9f7b --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/array/fromlist.hpp @@ -0,0 +1,25 @@ +#ifndef PYTHONIC_ARRAY_ARRAY_FROMLIST_HPP +#define PYTHONIC_ARRAY_ARRAY_FROMLIST_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T, class E> +    types::none_type fromlist(types::array<T> &seq, E &&elts) +    { +      seq += std::forward<E>(elts); +      return {}; +    } + +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/array/typecodes.hpp b/contrib/python/pythran/pythran/pythonic/array/typecodes.hpp new file mode 100644 index 00000000000..287bf464bfb --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/array/typecodes.hpp @@ -0,0 +1,6 @@ +#ifndef PYTHONIC_ARRAY_TYPECODES_HPP +#define PYTHONIC_ARRAY_TYPECODES_HPP + +#include "pythonic/include/array/typecodes.hpp" + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/bisect/bisect.hpp b/contrib/python/pythran/pythran/pythonic/bisect/bisect.hpp index 3efc50b943c..84258fbe367 100644 --- a/contrib/python/pythran/pythran/pythonic/bisect/bisect.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/bisect/bisect_left.hpp b/contrib/python/pythran/pythran/pythonic/bisect/bisect_left.hpp index 964c1126639..00e7cf4ea45 100644 --- a/contrib/python/pythran/pythran/pythonic/bisect/bisect_left.hpp +++ b/contrib/python/pythran/pythran/pythonic/bisect/bisect_left.hpp @@ -24,7 +24,7 @@ namespace bisect      return bisect(x, a, lo, hi,                    std::lower_bound<typename X::const_iterator, A>);    } -} +} // namespace bisect  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/bisect/bisect_right.hpp b/contrib/python/pythran/pythran/pythonic/bisect/bisect_right.hpp index f82893d2fef..ac71177bd31 100644 --- a/contrib/python/pythran/pythran/pythonic/bisect/bisect_right.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/all.hpp b/contrib/python/pythran/pythran/pythonic/builtins/all.hpp index 6fb8383595d..a77851e0dad 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/all.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/any.hpp b/contrib/python/pythran/pythran/pythonic/builtins/any.hpp index d74e5c2ae2a..2246fcf22c3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/any.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/any.hpp @@ -18,7 +18,7 @@ namespace builtins          return true;      return false;    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/bin.hpp b/contrib/python/pythran/pythran/pythonic/builtins/bin.hpp index f102c797003..f53fbc46192 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/bin.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/bin.hpp @@ -58,7 +58,7 @@ namespace builtins        return res;      }    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/bool_.hpp b/contrib/python/pythran/pythran/pythonic/builtins/bool_.hpp index 843b273cd62..c50889b659d 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/bool_.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/bool_.hpp @@ -26,7 +26,7 @@ namespace builtins      }      template <class T, size_t N> -    bool bool_::operator()(types::array<T, N> const &val) const +    bool bool_::operator()(types::array_tuple<T, N> const &val) const      {        return N;      } diff --git a/contrib/python/pythran/pythran/pythonic/builtins/chr.hpp b/contrib/python/pythran/pythran/pythonic/builtins/chr.hpp index 3984cb549ae..0f216d2b94b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/chr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict.hpp index f6dc3080852..6b54af33289 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/dict.hpp @@ -28,9 +28,10 @@ namespace builtins      }      template <class Iterable> -    auto dict(Iterable &&iterable) -> types::dict< -        typename std::decay<decltype(std::get<0>(*iterable.begin()))>::type, -        typename std::decay<decltype(std::get<1>(*iterable.begin()))>::type> +    auto dict(Iterable &&iterable) +        -> types::dict< +            typename std::decay<decltype(std::get<0>(*iterable.begin()))>::type, +            typename std::decay<decltype(std::get<1>(*iterable.begin()))>::type>      {        types::dict<            typename std::decay<decltype(std::get<0>(*iterable.begin()))>::type, diff --git a/contrib/python/pythran/pythran/pythonic/builtins/dict/clear.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/clear.hpp index 7efdba91358..cd59ba33119 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/clear.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/copy.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/copy.hpp index 06fcbb767d9..3cd0d80061f 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/copy.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/fromkeys.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/fromkeys.hpp index 2fb83b6e8e6..3cfbcfb9ce9 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/fromkeys.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/dict/fromkeys.hpp @@ -21,14 +21,14 @@ namespace builtins      fromkeys(Iterable &&iter, V const &v)      {        types::dict<typename std::remove_reference<Iterable>::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/contrib/python/pythran/pythran/pythonic/builtins/dict/get.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/get.hpp index bcb0f587a0b..f88f6f31cc3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/get.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/items.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/items.hpp index 5bbd6ced2f9..dc0a5537a75 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/items.hpp +++ b/contrib/python/pythran/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 <tuple> @@ -22,8 +22,8 @@ namespace builtins      {        return std::forward<D>(d).items();      } -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/dict/keys.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/keys.hpp index d4dfa271d79..2f7563373f4 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/keys.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/dict/keys.hpp @@ -23,8 +23,8 @@ namespace builtins      {        return std::forward<D>(d).keys();      } -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/dict/pop.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/pop.hpp index a22e470576e..7e47d6bbaeb 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/pop.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/popitem.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/popitem.hpp index e0369befcaa..4c3dd6e2903 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/popitem.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/dict/popitem.hpp @@ -21,8 +21,8 @@ namespace builtins      {        return std::forward<D>(d).popitem();      } -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/dict/setdefault.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/setdefault.hpp index 3f1079897aa..1fd1dbeb981 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/setdefault.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/update.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/update.hpp index ffda356efd2..21d27c4e4f5 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/dict/values.hpp b/contrib/python/pythran/pythran/pythonic/builtins/dict/values.hpp index 69fd137d3d6..cff17f8e212 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/dict/values.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/dict/values.hpp @@ -19,8 +19,8 @@ namespace builtins      {        return std::forward<D>(d).values();      } -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/divmod.hpp b/contrib/python/pythran/pythran/pythonic/builtins/divmod.hpp index 8227d53915b..5f2a22fd1ac 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/divmod.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/enumerate.hpp b/contrib/python/pythran/pythran/pythonic/builtins/enumerate.hpp index 06ed8918459..faab84a4558 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/enumerate.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/enumerate.hpp @@ -29,8 +29,8 @@ namespace builtins      }      template <class Iterator> -    enumerate_iterator<Iterator> &enumerate_iterator<Iterator>:: -    operator+=(long n) +    enumerate_iterator<Iterator> & +    enumerate_iterator<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 <class Iterator> -    bool enumerate_iterator<Iterator>:: -    operator!=(enumerate_iterator<Iterator> const &other) const +    bool enumerate_iterator<Iterator>::operator!=( +        enumerate_iterator<Iterator> const &other) const      {        return !(*this == other);      }      template <class Iterator> -    bool enumerate_iterator<Iterator>:: -    operator<(enumerate_iterator const &other) const +    bool enumerate_iterator<Iterator>::operator<( +        enumerate_iterator const &other) const      {        return iter < other.iter;      }      template <class Iterator> -    bool enumerate_iterator<Iterator>:: -    operator==(enumerate_iterator<Iterator> const &other) const +    bool enumerate_iterator<Iterator>::operator==( +        enumerate_iterator<Iterator> const &other) const      {        return iter == other.iter;      }      template <class Iterator> -    long enumerate_iterator<Iterator>:: -    operator-(enumerate_iterator<Iterator> const &other) const +    long enumerate_iterator<Iterator>::operator-( +        enumerate_iterator<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<Iterable>(seq), first};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/file.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file.hpp index fef17cbc151..c79388552e1 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/fileno.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/fileno.hpp index b167d3ade20..83c7f4305b6 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/fileno.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/isatty.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/isatty.hpp index b8e0216003e..e9245ffab8e 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/isatty.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/next.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/next.hpp index f1ae5fbafe5..e41223e31cd 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/next.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/readlines.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/readlines.hpp index 5bea169b08a..fa31688715d 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/readlines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/tell.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/tell.hpp index dc5fbabe218..6e645839b8f 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/tell.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/file/writelines.hpp b/contrib/python/pythran/pythran/pythonic/builtins/file/writelines.hpp index 6859de2d44e..bc6ffb20658 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/file/writelines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/float_/is_integer.hpp b/contrib/python/pythran/pythran/pythonic/builtins/float_/is_integer.hpp index 5ffccf83838..491acf02cf5 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/float_/is_integer.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/hex.hpp b/contrib/python/pythran/pythran/pythonic/builtins/hex.hpp index 3ab0221f0bd..ccdbc090634 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/hex.hpp +++ b/contrib/python/pythran/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 <sstream> @@ -20,7 +20,7 @@ namespace builtins      oss << "0x" << std::hex << v;      return oss.str();    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/in.hpp b/contrib/python/pythran/pythran/pythonic/builtins/in.hpp index 69623a8dd0b..a4f57ee1fa2 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/in.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/in.hpp @@ -30,7 +30,7 @@ namespace details    {      return t.contains(v);    } -} +} // namespace details  template <class T, class V>  bool in(T &&t, V const &v) diff --git a/contrib/python/pythran/pythran/pythonic/builtins/iter.hpp b/contrib/python/pythran/pythran/pythonic/builtins/iter.hpp index dc54d242a56..b2c155c136a 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/iter.hpp +++ b/contrib/python/pythran/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 <class T> -    iter<T>::iter(T data) -        : iterator(data.begin()), _end(data.end()), data(data) +    iter<T>::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>(t)};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/len.hpp b/contrib/python/pythran/pythran/pythonic/builtins/len.hpp index 703db0dd988..2c4e4f44498 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/len.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/len.hpp @@ -6,8 +6,8 @@  #include "pythonic/types/traits.hpp"  #include "pythonic/utils/functor.hpp" -#include <tuple>  #include <iterator> +#include <tuple>  PYTHONIC_NS_BEGIN @@ -24,6 +24,6 @@ namespace builtins    {      return t.size();    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/list.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list.hpp index 9c793954b34..95d065d6f9a 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/append.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/append.hpp index a9d89b544fe..804fc11f931 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/append.hpp +++ b/contrib/python/pythran/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<F>(value));        return builtins::None;      } -  } -} +  } // namespace list +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/list/count.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/count.hpp index e43223ea9dd..d986a9fbdc0 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/count.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/extend.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/extend.hpp index 273f4cf80a0..e1321d79ff7 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/extend.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/insert.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/insert.hpp index 123a0178848..452336831d3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/insert.hpp +++ b/contrib/python/pythran/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<F>(value));        return builtins::None;      } -  } -} +  } // namespace list +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/list/pop.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/pop.hpp index 37cd6fecb99..efbf13994e5 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/pop.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/remove.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/remove.hpp index 1d655470655..b7202068bc9 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/remove.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/reverse.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/reverse.hpp index 2948d3f24b2..a292d22a965 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/reverse.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/list/sort.hpp b/contrib/python/pythran/pythran/pythonic/builtins/list/sort.hpp index 365de6505d9..913b87d4f9f 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/list/sort.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/map.hpp b/contrib/python/pythran/pythran/pythonic/builtins/map.hpp index fde24f3d3af..ac6eb0354a1 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/map.hpp +++ b/contrib/python/pythran/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 <iterator> @@ -44,8 +44,8 @@ namespace builtins      template <typename Operator, typename... Iters>      template <size_t... I>      typename map_res<Operator, Iters...>::type -        map_iterator<Operator, Iters...>::get_value(utils::index_sequence<I...>, -                                                    std::false_type) const +    map_iterator<Operator, Iters...>::get_value(utils::index_sequence<I...>, +                                                std::false_type) const      {        return _op(*std::get<I>(it)...);      } @@ -53,16 +53,15 @@ namespace builtins      template <typename Operator, typename... Iters>      template <size_t... I>      typename map_res<Operator, Iters...>::type -        map_iterator<Operator, Iters...>::get_value(utils::index_sequence<I...>, -                                                    std::true_type) const +    map_iterator<Operator, Iters...>::get_value(utils::index_sequence<I...>, +                                                std::true_type) const      {        return types::make_tuple(*std::get<I>(it)...);      }      template <typename Operator, typename... Iters>      typename map_res<Operator, Iters...>::type -        map_iterator<Operator, Iters...>:: -        operator*() const +    map_iterator<Operator, Iters...>::operator*() const      {        return get_value(utils::make_index_sequence<sizeof...(Iters)>{},                         std::is_same<Operator, types::none_type>()); @@ -76,8 +75,8 @@ namespace builtins      }      template <typename Operator, typename... Iters> -    map_iterator<Operator, Iters...> &map_iterator<Operator, Iters...>:: -    operator++() +    map_iterator<Operator, Iters...> & +    map_iterator<Operator, Iters...>::operator++()      {        next(utils::make_index_sequence<sizeof...(Iters)>{});        return *this; @@ -98,16 +97,16 @@ namespace builtins      }      template <typename Operator, typename... Iters> -    map_iterator<Operator, Iters...> &map_iterator<Operator, Iters...>:: -    operator+=(long i) +    map_iterator<Operator, Iters...> & +    map_iterator<Operator, Iters...>::operator+=(long i)      { -      advance(i, utils::int_<sizeof...(Iters)-1>()); +      advance(i, utils::int_<sizeof...(Iters) - 1>());        return *this;      }      template <typename Operator, typename... Iters> -    map_iterator<Operator, Iters...> map_iterator<Operator, Iters...>:: -    operator+(long i) const +    map_iterator<Operator, Iters...> +    map_iterator<Operator, Iters...>::operator+(long i) const      {        map_iterator<Operator, Iters...> other(*this);        other += i; @@ -131,22 +130,22 @@ namespace builtins      }      template <typename Operator, typename... Iters> -    bool map_iterator<Operator, Iters...>:: -    operator==(map_iterator<Operator, Iters...> const &other) const +    bool map_iterator<Operator, Iters...>::operator==( +        map_iterator<Operator, Iters...> const &other) const      { -      return equal(other, utils::int_<sizeof...(Iters)-1>()); +      return equal(other, utils::int_<sizeof...(Iters) - 1>());      }      template <typename Operator, typename... Iters> -    bool map_iterator<Operator, Iters...>:: -    operator!=(map_iterator<Operator, Iters...> const &other) const +    bool map_iterator<Operator, Iters...>::operator!=( +        map_iterator<Operator, Iters...> const &other) const      {        return !(*this == other);      }      template <typename Operator, typename... Iters> -    bool map_iterator<Operator, Iters...>:: -    operator<(map_iterator<Operator, Iters...> const &other) const +    bool map_iterator<Operator, Iters...>::operator<( +        map_iterator<Operator, Iters...> const &other) const      {        return !(*this == other);      } @@ -168,15 +167,15 @@ namespace builtins      }      template <typename Operator, typename... Iters> -    long map_iterator<Operator, Iters...>:: -    operator-(map_iterator<Operator, Iters...> const &other) const +    long map_iterator<Operator, Iters...>::operator-( +        map_iterator<Operator, Iters...> const &other) const      { -      return min_len(other, utils::int_<sizeof...(Iters)-1>()); +      return min_len(other, utils::int_<sizeof...(Iters) - 1>());      }      template <typename Operator, typename... Iters>      template <class... Types> -    map<Operator, Iters...>::map(Operator const &_op, Types &&... _iters) +    map<Operator, Iters...>::map(Operator const &_op, Types &&..._iters)          : utils::iterator_reminder<true, Iters...>(                std::forward<Types>(_iters)...),            map_iterator<Operator, Iters...>( @@ -206,18 +205,19 @@ namespace builtins      {        return end_iter;      } -  } +  } // namespace details    template <typename Operator, typename... Iter> -  auto map(Operator &&_op, Iter &&... iters) -> details::map< -      typename std::remove_cv< -          typename std::remove_reference<Operator>::type>::type, -      typename types::iterator<typename std::remove_cv< -          typename std::remove_reference<Iter>::type>::type>::type...> +  auto map(Operator &&_op, Iter &&...iters) +      -> details::map< +          typename std::remove_cv< +              typename std::remove_reference<Operator>::type>::type, +          typename types::iterator<typename std::remove_cv< +              typename std::remove_reference<Iter>::type>::type>::type...>    {      return {std::forward<Operator>(_op), std::forward<Iter>(iters)...};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/max.hpp b/contrib/python/pythran/pythran/pythonic/builtins/max.hpp index 48514877f56..aeb9eb79701 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/max.hpp +++ b/contrib/python/pythran/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 <class... Types> -  auto max(Types &&... values) +  auto max(Types &&...values)        -> decltype(details::minmax(operator_::functor::lt{},                                    std::forward<Types>(values)...))    {      return details::minmax(operator_::functor::lt{},                             std::forward<Types>(values)...);    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/min.hpp b/contrib/python/pythran/pythran/pythonic/builtins/min.hpp index 1b413764899..915a711ce81 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/min.hpp +++ b/contrib/python/pythran/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 <class... Types> -  auto min(Types &&... values) +  auto min(Types &&...values)        -> decltype(details::minmax(operator_::functor::gt{},                                    std::forward<Types>(values)...))    {      return details::minmax(operator_::functor::gt{},                             std::forward<Types>(values)...);    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/minmax.hpp b/contrib/python/pythran/pythran/pythonic/builtins/minmax.hpp index d580b697158..f74a25cdeb4 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/minmax.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/minmax.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/builtins/minmax.hpp" -#include <utility>  #include <algorithm> +#include <utility>  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 <class Op, class T0, class T1, class... Types>      typename std::enable_if<!std::is_same<T1, types::kwonly>::value,                              typename __combined<T0, T1, Types...>::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<T0, T1, Types...>::type;        std::initializer_list<value_type> values = { @@ -42,8 +42,8 @@ namespace builtins            static_cast<value_type>(ts)...};        return minmax(op, values);      } -  } -} +  } // namespace details +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/next.hpp b/contrib/python/pythran/pythran/pythonic/builtins/next.hpp index afecc8b2d53..e9ef292321d 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/next.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/next.hpp @@ -23,7 +23,7 @@ namespace builtins      } else        throw types::StopIteration();    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/oct.hpp b/contrib/python/pythran/pythran/pythonic/builtins/oct.hpp index ec4e483429f..9150c790633 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/oct.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/open.hpp b/contrib/python/pythran/pythran/pythonic/builtins/open.hpp index 6128c3a36cc..adbeaa1b457 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/open.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/open.hpp @@ -16,7 +16,7 @@ namespace builtins    {      return {filename, strmode};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/ord.hpp b/contrib/python/pythran/pythran/pythonic/builtins/ord.hpp index 07a362bf3ce..07f941c7f33 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/ord.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp index 5086bd6d105..cb0715c02d0 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfBreak.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfCont.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfCont.hpp index 12b144b7c07..eb53537bd5c 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfCont.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp index d7bb508b993..713e9d99a93 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfNoReturn.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp index b0dd350d0b9..4a2a194bf17 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/StaticIfReturn.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/abssqr.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/abssqr.hpp index f400910c4ee..90375172fb3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/abssqr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/and_.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/and_.hpp index 90375ad4e29..193c2d2a62b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/and_.hpp +++ b/contrib/python/pythran/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<T0, T1>)val0;      } -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/pythran/is_none.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/is_none.hpp index 084170ff626..83a42d9c24b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/is_none.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/len_set.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/len_set.hpp index 6b24e17e507..03b9f8fbd8b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/len_set.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/pythran/len_set.hpp @@ -19,10 +19,11 @@ namespace builtins      long len_set(Iterable const &s)      {        return std::set<typename std::iterator_traits< -          typename Iterable::iterator>::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/contrib/python/pythran/pythran/pythonic/builtins/pythran/make_shape.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/make_shape.hpp index 13db44f1385..d3cdd871e84 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/make_shape.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/pythran/or_.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/or_.hpp index 08cbeda5463..8fc97fa5a95 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/or_.hpp +++ b/contrib/python/pythran/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<T0, T1>)std::forward<T1>(v1)();      } -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/pythran/restrict_assign.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/restrict_assign.hpp new file mode 100644 index 00000000000..f3f3cb07687 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/builtins/pythran/restrict_assign.hpp @@ -0,0 +1,6 @@ +#ifndef PYTHONIC_BUILTIN_RESTRICT_ASSIGN_HPP +#define PYTHONIC_BUILTIN_RESTRICT_ASSIGN_HPP + +#include "pythonic/include/builtins/pythran/restrict_assign.hpp" + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_if.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_if.hpp index cd7e395b843..8e6c975cae8 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_if.hpp +++ b/contrib/python/pythran/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 <class T, class F0, class F1> -    auto static_if(T const &cond, F0 f0, F1 f1) -        -> decltype(details::static_if<T>{cond}(f0, f1)) +    auto static_if(T const &cond, F0 f0, +                   F1 f1) -> decltype(details::static_if<T>{cond}(f0, f1))      {        return details::static_if<T>{cond}(f0, f1);      } -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_list.hpp b/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_list.hpp index ee84ae35fcc..adf15e86359 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/pythran/static_list.hpp +++ b/contrib/python/pythran/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 <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> const &other) +    types::static_list<T, N> static_list(types::array_tuple<T, N> const &other)      {        return other.template to_array<types::list_version>();      }      template <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> &other) +    types::static_list<T, N> static_list(types::array_tuple<T, N> &other)      {        return other.template to_array<types::list_version>();      }      template <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> &&other) +    types::static_list<T, N> static_list(types::array_tuple<T, N> &&other)      {        return other.template to_array<types::list_version>();      } @@ -35,8 +35,8 @@ namespace builtins      {        return pythonic::builtins::functor::list{}(std::forward<T>(other));      } -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/reduce.hpp b/contrib/python/pythran/pythran/pythonic/builtins/reduce.hpp index e2fb2569a99..068dc42fbc3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/reduce.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/reduce.hpp @@ -40,7 +40,7 @@ namespace builtins          s.begin(), s.end(),          static_cast<reduce_helper_t<Iterable, Operator, T>>(init), op);    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/reversed.hpp b/contrib/python/pythran/pythran/pythonic/builtins/reversed.hpp index 954dd8bb814..f765c3ac395 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/reversed.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/reversed.hpp @@ -18,8 +18,7 @@ namespace builtins      }      template <class Iterable> -    reversed<Iterable>::reversed(Iterable const &iterable) -        : iterable(iterable) +    reversed<Iterable>::reversed(Iterable const &iterable) : iterable(iterable)      {      } @@ -47,14 +46,14 @@ namespace builtins      {        return iterable.rend();      } -  } +  } // namespace details    template <class Iterable>    details::reversed<Iterable> reversed(Iterable const &iterable)    {      return {iterable};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/round.hpp b/contrib/python/pythran/pythran/pythonic/builtins/round.hpp index f9618f77aff..4089ca084e4 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/round.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/round.hpp @@ -25,7 +25,7 @@ namespace builtins    {      return std::lround(v);    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/set.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set.hpp index 337f4592e3f..736c732aba5 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/add.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/add.hpp index 329536687c3..6ea8f0d73f1 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/add.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/clear.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/clear.hpp index d855c9c8445..cb7020ac63b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/clear.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/copy.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/copy.hpp index dc309baaa77..7996dc54409 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/copy.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/difference_update.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/difference_update.hpp index 29d18000821..9de4f8a14d6 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/difference_update.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/set/difference_update.hpp @@ -16,7 +16,7 @@ namespace builtins      template <typename T, typename... Types>      types::none_type difference_update(types::set<T> &set, -                                       Types const &... others) +                                       Types const &...others)      {        set.difference_update(others...);        return {}; @@ -24,7 +24,7 @@ namespace builtins      template <typename T, typename... Types>      types::none_type difference_update(types::set<T> &&set, -                                       Types const &... others) +                                       Types const &...others)      {        // nothing to be done as we work on rvalue        return {}; @@ -32,12 +32,12 @@ namespace builtins      template <typename... Types>      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/contrib/python/pythran/pythran/pythonic/builtins/set/discard.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/discard.hpp index 8219da30af6..82210c22f66 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/discard.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/intersection.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/intersection.hpp index 7477fdf0b52..09417a47fb1 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/intersection.hpp +++ b/contrib/python/pythran/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 T, typename... Types>      typename __combined<types::set<T>, Types...>::type -    intersection(types::set<T> const &set, Types const &... others) +    intersection(types::set<T> const &set, Types const &...others)      {        return set.intersection(others...);      } @@ -29,11 +29,11 @@ namespace builtins       */      template <typename... Types>      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/contrib/python/pythran/pythran/pythonic/builtins/set/intersection_update.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/intersection_update.hpp index 5bf8b65a814..847a4d4dd6c 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/intersection_update.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/set/intersection_update.hpp @@ -16,7 +16,7 @@ namespace builtins      template <typename T, typename... Types>      types::none_type intersection_update(types::set<T> &set, -                                         Types const &... others) +                                         Types const &...others)      {        set.intersection_update(others...);        return {}; @@ -24,7 +24,7 @@ namespace builtins      template <typename T, typename... Types>      types::none_type intersection_update(types::set<T> &&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 <typename... Types>      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/contrib/python/pythran/pythran/pythonic/builtins/set/isdisjoint.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/isdisjoint.hpp index 2f5c08794e1..7613c53d7a9 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/isdisjoint.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/issubset.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/issubset.hpp index b74680f9187..0222faf7450 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/issubset.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/issuperset.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/issuperset.hpp index 10da3c1ad3c..7f3d7597985 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/issuperset.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/remove.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/remove.hpp index 1035406a697..0cbc67d76e4 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/remove.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference.hpp index b8fd2451936..14dd6fbbdf8 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference_update.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference_update.hpp index fcbac1a4290..e9aa1675ceb 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/symmetric_difference_update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/set/update.hpp b/contrib/python/pythran/pythran/pythonic/builtins/set/update.hpp index 673a6e192b1..e2965e07b7d 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/set/update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/sorted.hpp b/contrib/python/pythran/pythran/pythonic/builtins/sorted.hpp index 8e247435a0e..c8e9e2efda2 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/sorted.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str.hpp index d77176f03bf..ce0cf778ac7 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/__mod__.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/__mod__.hpp index 812f1abf23a..2ea185e1f37 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/__mod__.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/str/__mod__.hpp @@ -29,7 +29,7 @@ namespace builtins          fmt(f % std::get<std::tuple_size<Tuple>::value - I>(a), a,              utils::int_<I - 1>());        } -    } +    } // namespace details      template <class T>      types::str __mod__(types::str const &s, T const &arg) @@ -46,13 +46,14 @@ namespace builtins        return fmter.str();      }      template <size_t N, class T> -    types::str __mod__(types::str const &s, types::array<T, N> const &args) +    types::str __mod__(types::str const &s, +                       types::array_tuple<T, N> const &args)      {        boost::format fmter(s.chars());        details::fmt(fmter, args, utils::int_<N>());        return fmter.str();      } -  } -} +  } // namespace str +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/str/capitalize.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/capitalize.hpp index 5102d46dbc0..743bbe8c2f4 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/capitalize.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/count.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/count.hpp index 2a9f6b5ec38..b7c6bbdc769 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/count.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/endswith.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/endswith.hpp index b8df066ce69..70fa51f46a0 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/endswith.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/isalpha.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/isalpha.hpp index e7d9beaa704..4fa77567ba2 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/isalpha.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/isdigit.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/isdigit.hpp index 58da6227c4d..43ffe5d5a7b 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/isdigit.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/join.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/join.hpp index af966c789b0..38cf6fd963a 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/join.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/lower.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/lower.hpp index 6d2bcd6cb9c..417d01df6b3 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/lower.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/lstrip.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/lstrip.hpp index d3a031bfede..1b4a37310d6 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/lstrip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/rstrip.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/rstrip.hpp index a1536478bd1..2dadb99bc53 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/rstrip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/startswith.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/startswith.hpp index 1d297f4c87e..226388ca5f7 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/startswith.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/strip.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/strip.hpp index c580a63a8a3..e1cab71ee96 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/strip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/str/upper.hpp b/contrib/python/pythran/pythran/pythonic/builtins/str/upper.hpp index 1f8d38a8840..d90d583ec25 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/str/upper.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/sum.hpp b/contrib/python/pythran/pythran/pythonic/builtins/sum.hpp index 5c35f1c4a66..f583b1ae394 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/sum.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -25,25 +25,26 @@ namespace builtins      }      template <class Tuple> -    auto tuple_sum<Tuple, 0>::operator()(Tuple const &t) -        -> decltype(std::get<0>(t)) +    auto +    tuple_sum<Tuple, 0>::operator()(Tuple const &t) -> decltype(std::get<0>(t))      {        return std::get<0>(t);      } -  } +  } // namespace details    template <class Iterable, class T> -  auto sum(Iterable s, T start) -> decltype(std::accumulate( -      s.begin(), s.end(), -      static_cast<typename assignable<decltype(start + *s.begin())>::type>( -          start))) +  auto sum(Iterable s, T start) +      -> decltype(std::accumulate( +          s.begin(), s.end(), +          static_cast<typename assignable<decltype(start + *s.begin())>::type>( +              start)))    {      return std::accumulate(          s.begin(), s.end(),          static_cast<typename assignable<decltype(start + *s.begin())>::type>(              start));    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/tuple.hpp b/contrib/python/pythran/pythran/pythonic/builtins/tuple.hpp index 4692a1108d4..7abe56ad8f1 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/tuple.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/tuple.hpp @@ -38,7 +38,7 @@ namespace builtins    typename std::enable_if<        types::len_of<typename std::remove_cv<typename std::remove_reference<            StaticIterable>::type>::type>::value >= 0, -      types::array< +      types::array_tuple<            typename std::iterator_traits<                typename std::remove_cv<typename std::remove_reference<                    StaticIterable>::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<typename std::remove_reference<                  StaticIterable>::type>::type::iterator>::value_type, -        types::len_of<typename std::remove_cv<typename std::remove_reference< -            StaticIterable>::type>::type>::value> res; +        types::len_of<typename std::remove_cv< +            typename std::remove_reference<StaticIterable>::type>::type>::value> +        res;      std::copy(i.begin(), i.end(), res.begin());      return res;    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/type.hpp b/contrib/python/pythran/pythran/pythonic/builtins/type.hpp index 55b530a80b2..401c566845e 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/type.hpp +++ b/contrib/python/pythran/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 <class T, size_t N> -  struct type_functor<types::array<T, N>> { +  struct type_functor<types::array_tuple<T, N>> {      using type = functor::tuple;    };    template <class T, class pS> @@ -142,7 +142,7 @@ namespace builtins    {      return {};    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/builtins/xrange.hpp b/contrib/python/pythran/pythran/pythonic/builtins/xrange.hpp index 2436fa470c0..696ac32089f 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/xrange.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/builtins/zip.hpp b/contrib/python/pythran/pythran/pythonic/builtins/zip.hpp index 84f7bf8e558..3fb8c045218 100644 --- a/contrib/python/pythran/pythran/pythonic/builtins/zip.hpp +++ b/contrib/python/pythran/pythran/pythonic/builtins/zip.hpp @@ -12,12 +12,12 @@ namespace builtins  {    template <typename... Iter> -  auto zip(Iter &&... iters) -      -> decltype(map(builtins::None, std::forward<Iter>(iters)...)) +  auto zip(Iter &&...iters) -> decltype(map(builtins::None, +                                            std::forward<Iter>(iters)...))    {      return map(builtins::None, std::forward<Iter>(iters)...);    } -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/cmath/acos.hpp b/contrib/python/pythran/pythran/pythonic/cmath/acos.hpp index d35580c144e..b3cb0051428 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/acos.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/acosh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/acosh.hpp index 09193d0d3a2..67b00ee66c8 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/acosh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/asin.hpp b/contrib/python/pythran/pythran/pythonic/cmath/asin.hpp index a18a35b291f..6c55305660e 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/asin.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/asinh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/asinh.hpp index d460ba71faf..7c6949eab71 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/asinh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/atan.hpp b/contrib/python/pythran/pythran/pythonic/cmath/atan.hpp index ecc5020e8db..28d30766eb8 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/atan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/atanh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/atanh.hpp index 997c74310f2..098827ce24d 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/atanh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/cos.hpp b/contrib/python/pythran/pythran/pythonic/cmath/cos.hpp index fe4965949fb..1d73a31ea9b 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/cos.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -23,7 +23,7 @@ namespace cmath    {      return std::cos(v);    } -} +} // namespace cmath  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/cmath/cosh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/cosh.hpp index 671143a91bd..f466f94c429 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/cosh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/exp.hpp b/contrib/python/pythran/pythran/pythonic/cmath/exp.hpp index aa06a419b31..8202b2e1116 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/exp.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/isinf.hpp b/contrib/python/pythran/pythran/pythonic/cmath/isinf.hpp index c2f012b8e31..98303da9712 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/isinf.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/isnan.hpp b/contrib/python/pythran/pythran/pythonic/cmath/isnan.hpp index 969dc7461ae..96b68e65ce9 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/isnan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/log.hpp b/contrib/python/pythran/pythran/pythonic/cmath/log.hpp index 8c8fe36930b..b885a430232 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/log.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -17,7 +17,7 @@ namespace cmath    {      return log(x) / log(base);    } -} +} // namespace cmath  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/cmath/log10.hpp b/contrib/python/pythran/pythran/pythonic/cmath/log10.hpp index 86c3c793916..55eda96e702 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/log10.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/sin.hpp b/contrib/python/pythran/pythran/pythonic/cmath/sin.hpp index 5dcec69e746..1f57e20720e 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/sin.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/sinh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/sinh.hpp index 891d543f066..e1a28836cca 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/sinh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/sqrt.hpp b/contrib/python/pythran/pythran/pythonic/cmath/sqrt.hpp index f84a6293ed3..8b5582fdcd6 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/sqrt.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/tan.hpp b/contrib/python/pythran/pythran/pythonic/cmath/tan.hpp index 23052a4a6e0..537042c4d99 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/tan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/cmath/tanh.hpp b/contrib/python/pythran/pythran/pythonic/cmath/tanh.hpp index b81d76e718a..07483841565 100644 --- a/contrib/python/pythran/pythran/pythonic/cmath/tanh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/core.hpp b/contrib/python/pythran/pythran/pythonic/core.hpp index feb77722fb0..844d944cb53 100644 --- a/contrib/python/pythran/pythran/pythonic/core.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/functools/partial.hpp b/contrib/python/pythran/pythran/pythonic/functools/partial.hpp index d6ab8bdabe2..e2a2df85e75 100644 --- a/contrib/python/pythran/pythran/pythonic/functools/partial.hpp +++ b/contrib/python/pythran/pythran/pythonic/functools/partial.hpp @@ -17,37 +17,37 @@ namespace functools    {      template <typename... ClosureTypes> -    task<ClosureTypes...>::task() -        : closure() +    task<ClosureTypes...>::task() : closure()      {      }      template <typename... ClosureTypes> -    task<ClosureTypes...>::task(ClosureTypes const &... types) +    task<ClosureTypes...>::task(ClosureTypes const &...types)          : closure(types...)      {      }      template <typename... ClosureTypes>      template <typename... Types> -    auto task<ClosureTypes...>::operator()(Types &&... types) const -> decltype( -        this->call(utils::make_index_sequence<sizeof...(ClosureTypes)-1>(), -                   std::forward<Types>(types)...)) +    auto task<ClosureTypes...>::operator()(Types &&...types) const +        -> decltype(this->call( +            utils::make_index_sequence<sizeof...(ClosureTypes) - 1>(), +            std::forward<Types>(types)...))      { -      return call(utils::make_index_sequence<sizeof...(ClosureTypes)-1>(), +      return call(utils::make_index_sequence<sizeof...(ClosureTypes) - 1>(),                    std::forward<Types>(types)...);      } -  } +  } // namespace details    template <typename... Types>    // remove references as closure capture the env by copy    details::task<typename std::remove_cv<        typename std::remove_reference<Types>::type>::type...> -  partial(Types &&... types) +  partial(Types &&...types)    {      return {std::forward<Types>(types)...};    } -} +} // namespace functools  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/functools/reduce.hpp b/contrib/python/pythran/pythran/pythonic/functools/reduce.hpp index 3d0cdff245a..452b85599cd 100644 --- a/contrib/python/pythran/pythran/pythonic/functools/reduce.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/append.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/append.hpp new file mode 100644 index 00000000000..3a87a320c58 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/append.hpp @@ -0,0 +1,18 @@ +#ifndef PYTHONIC_INCLUDE_DISPATCH_APPEND_HPP +#define PYTHONIC_INCLUDE_DISPATCH_APPEND_HPP + +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type append(Any &&any, Arg &&arg0); + +  DEFINE_FUNCTOR(pythonic::__dispatch__, append); +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/clear.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/clear.hpp index ae78da378ba..e3a912e2f7e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/clear.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/conjugate.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/conjugate.hpp index 869cb55762e..0a5b94b561d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/conjugate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/copy.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/copy.hpp index 04819e9477a..265301da68e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/copy.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/count.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/count.hpp index 0fe42b94e7b..8dcc6fcca1a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/count.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/count.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace __dispatch__  {    template <class Any, class Value> -  auto count(Any &&any, Value &&value) -      -> decltype(any.count(std::forward<Value>(value))); +  auto count(Any &&any, +             Value &&value) -> decltype(any.count(std::forward<Value>(value)));    DEFINE_FUNCTOR(pythonic::__dispatch__, count); -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/extend.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/extend.hpp new file mode 100644 index 00000000000..760cebed1ae --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/extend.hpp @@ -0,0 +1,18 @@ +#ifndef PYTHONIC_INCLUDE_DISPATCH_EXTEND_HPP +#define PYTHONIC_INCLUDE_DISPATCH_EXTEND_HPP + +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type extend(Any &&any, Arg &&arg0); + +  DEFINE_FUNCTOR(pythonic::__dispatch__, extend); +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/index.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/index.hpp index c658f749418..0532e6cbce3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/index.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/insert.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/insert.hpp new file mode 100644 index 00000000000..c486b3ce663 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/insert.hpp @@ -0,0 +1,18 @@ +#ifndef PYTHONIC_INCLUDE_DISPATCH_INSERT_HPP +#define PYTHONIC_INCLUDE_DISPATCH_INSERT_HPP + +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any, class Arg> +  types::none_type insert(Any &&any, long index, Arg &&arg0); + +  DEFINE_FUNCTOR(pythonic::__dispatch__, insert); +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/pop.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/pop.hpp index 8a44bfe1a57..ac37c2e6533 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/pop.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/pop.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace __dispatch__  {    template <class Any, class... Arg0> -  auto pop(Any &&any, Arg0 &&... arg0) -      -> decltype(any.pop(std::forward<Arg0>(arg0)...)); +  auto pop(Any &&any, +           Arg0 &&...arg0) -> decltype(any.pop(std::forward<Arg0>(arg0)...));    DEFINE_FUNCTOR(pythonic::__dispatch__, pop); -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/remove.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/remove.hpp index 4b78c24603e..7e9c34fe4d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/remove.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/reverse.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/reverse.hpp new file mode 100644 index 00000000000..0734d21312a --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/reverse.hpp @@ -0,0 +1,18 @@ +#ifndef PYTHONIC_INCLUDE_DISPATCH_REVERSE_HPP +#define PYTHONIC_INCLUDE_DISPATCH_REVERSE_HPP + +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ + +  template <class Any> +  types::none_type reverse(Any &&any); + +  DEFINE_FUNCTOR(pythonic::__dispatch__, reverse); +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/sort.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/sort.hpp index e2dc8fe4c0c..d57b8c2f38b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/sort.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/sort.hpp @@ -10,18 +10,18 @@ namespace __dispatch__  {    template <class T, class... Args> -  auto sort(types::list<T> &l, Args &&... args) +  auto sort(types::list<T> &l, Args &&...args)        -> decltype(pythonic::builtins::list::sort(l,                                                   std::forward<Args>(args)...));    template <class T, class... Args> -  auto sort(types::list<T> &&l, Args &&... args) +  auto sort(types::list<T> &&l, Args &&...args)        -> decltype(pythonic::builtins::list::sort(std::move(l),                                                   std::forward<Args>(args)...));    template <class Any, class... Args> -  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/contrib/python/pythran/pythran/pythonic/include/__dispatch__/tolist.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/tolist.hpp new file mode 100644 index 00000000000..199ee3fc9b4 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/tolist.hpp @@ -0,0 +1,53 @@ +#ifndef PYTHONIC_INCLUDE_DISPATCH_TOLIST_HPP +#define PYTHONIC_INCLUDE_DISPATCH_TOLIST_HPP + +#include "pythonic/include/numpy/ndarray/tolist.hpp" +#include "pythonic/include/types/array.hpp" + +PYTHONIC_NS_BEGIN + +namespace __dispatch__ +{ +  template <class Any> +  auto tolist(Any &&any) -> decltype(numpy::ndarray::tolist(any)) +  { +    return numpy::ndarray::tolist(any); +  } + +  template <class T, class S> +  types::list< +      typename std::conditional<std::is_integral<T>::value, long, double>::type> +  tolist(types::sliced_array<T, S> &&a) +  { +    return {a.begin(), a.end()}; +  } + +  template <class T, class S> +  types::list< +      typename std::conditional<std::is_integral<T>::value, long, double>::type> +  tolist(types::sliced_array<T, S> const &a) +  { +    return {a.begin(), a.end()}; +  } + +  template <class T> +  types::list< +      typename std::conditional<std::is_integral<T>::value, long, double>::type> +  tolist(types::array<T> &&a) +  { +    return {a.begin(), a.end()}; +  } + +  template <class T> +  types::list< +      typename std::conditional<std::is_integral<T>::value, long, double>::type> +  tolist(types::array<T> const &a) +  { +    return {a.begin(), a.end()}; +  } + +  DEFINE_FUNCTOR(pythonic::__dispatch__, tolist); +} // namespace __dispatch__ +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/update.hpp b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/update.hpp index e7ed9dd06bf..258c9f6b86b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/__dispatch__/update.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/__dispatch__/update.hpp @@ -9,11 +9,11 @@ namespace __dispatch__  {    template <class Any, class... Arg0> -  auto update(Any &&any, Arg0 &&... arg0) +  auto update(Any &&any, Arg0 &&...arg0)        -> decltype(any.update(std::forward<Arg0>(arg0)...));    DEFINE_FUNCTOR(pythonic::__dispatch__, update); -} +} // namespace __dispatch__  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array.hpp new file mode 100644 index 00000000000..1c076e11dd7 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array.hpp @@ -0,0 +1,81 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ +  namespace details +  { +    template <char c> +    struct typecodes; +    template <> +    struct typecodes<'b'> { +      using type = signed char; +    }; +    template <> +    struct typecodes<'B'> { +      using type = unsigned char; +    }; +    template <> +    struct typecodes<'u'> { +      using type = wchar_t; +    }; +    template <> +    struct typecodes<'h'> { +      using type = signed short; +    }; +    template <> +    struct typecodes<'H'> { +      using type = unsigned short; +    }; +    template <> +    struct typecodes<'i'> { +      using type = signed int; +    }; +    template <> +    struct typecodes<'I'> { +      using type = unsigned int; +    }; +    template <> +    struct typecodes<'l'> { +      using type = signed long; +    }; +    template <> +    struct typecodes<'L'> { +      using type = unsigned long; +    }; +    template <> +    struct typecodes<'q'> { +      using type = signed long long; +    }; +    template <> +    struct typecodes<'Q'> { +      using type = unsigned long long; +    }; +    template <> +    struct typecodes<'f'> { +      using type = float; +    }; +    template <> +    struct typecodes<'d'> { +      using type = double; +    }; + +    template <char c> +    types::array<typename details::typecodes<c>::type> +        array(std::integral_constant<char, c>); + +    template <char c, class E> +    types::array<typename details::typecodes<c>::type> +    array(std::integral_constant<char, c>, E &&elts); +  } // namespace details + +  DEFINE_FUNCTOR(pythonic::array::details, array); +} // namespace array +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/buffer_info.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/buffer_info.hpp new file mode 100644 index 00000000000..954978d3c98 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/buffer_info.hpp @@ -0,0 +1,23 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_BUFFER_INFO_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_BUFFER_INFO_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    std::tuple<long, long> buffer_info(types::array<T> const &seq); + +    DEFINE_FUNCTOR(pythonic::array::array, buffer_info); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/byteswap.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/byteswap.hpp new file mode 100644 index 00000000000..e3bcdaecf70 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/byteswap.hpp @@ -0,0 +1,28 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_BYTESWAP_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_BYTESWAP_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    types::none_type byteswap(types::array<T> &seq); + +    template <class T> +    types::none_type byteswap(types::array<T> &&seq) +    { +      return {}; +    } + +    DEFINE_FUNCTOR(pythonic::array::array, byteswap); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/count.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/count.hpp new file mode 100644 index 00000000000..80ff7dc0d06 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/count.hpp @@ -0,0 +1,22 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_COUNT_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_COUNT_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    long count(types::array<T> const &seq); + +    DEFINE_FUNCTOR(pythonic::array::array, count); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/extend.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/extend.hpp new file mode 100644 index 00000000000..004a4de8287 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/extend.hpp @@ -0,0 +1,22 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_EXTEND_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_EXTEND_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T, class S> +    types::none_type extend(types::array<T> &a, S &&elts); + +    DEFINE_FUNCTOR(pythonic::array::array, extend); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/frombytes.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/frombytes.hpp new file mode 100644 index 00000000000..22f2724dfb6 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/frombytes.hpp @@ -0,0 +1,23 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMBYTES_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMBYTES_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/types/str.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    types::none_type frombytes(types::array<T> &seq, types::str const &); + +    DEFINE_FUNCTOR(pythonic::array::array, frombytes); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/fromfile.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/fromfile.hpp new file mode 100644 index 00000000000..2dee79fd50b --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/fromfile.hpp @@ -0,0 +1,41 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMFILE_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMFILE_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/types/file.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T> +    types::none_type fromfile(types::array<T> &seq, types::file &f, long n); + +    template <class T> +    types::none_type fromfile(types::array<T> &seq, types::file &&f, long n) +    { +      return fromfile(seq, f, n); +    } + +    template <class T> +    types::none_type fromfile(types::array<T> &&seq, types::file &&f, long n) +    { +      return fromfile(seq, f, n); +    } + +    template <class T> +    types::none_type fromfile(types::array<T> &&seq, types::file &f, long n) +    { +      return fromfile(seq, f, n); +    } + +    DEFINE_FUNCTOR(pythonic::array::array, fromfile); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/array/fromlist.hpp b/contrib/python/pythran/pythran/pythonic/include/array/array/fromlist.hpp new file mode 100644 index 00000000000..e164bc722b7 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/array/fromlist.hpp @@ -0,0 +1,27 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMLIST_HPP +#define PYTHONIC_INCLUDE_ARRAY_ARRAY_FROMLIST_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/include/utils/functor.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ + +  namespace array +  { + +    template <class T, class E> +    types::none_type fromlist(types::array<T> &seq, E &&elts); +    template <class T, class E> +    types::none_type fromlist(types::array<T> &&seq, E &&elts) +    { +      return fromlist(seq, elts); +    } + +    DEFINE_FUNCTOR(pythonic::array::array, fromlist); +  } // namespace array +} // namespace array +PYTHONIC_NS_END +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/array/typecodes.hpp b/contrib/python/pythran/pythran/pythonic/include/array/typecodes.hpp new file mode 100644 index 00000000000..791f037b524 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/array/typecodes.hpp @@ -0,0 +1,14 @@ +#ifndef PYTHONIC_INCLUDE_ARRAY_TYPECODES_HPP +#define PYTHONIC_INCLUDE_ARRAY_TYPECODES_HPP + +#include "pythonic/types/str.hpp" + +PYTHONIC_NS_BEGIN + +namespace array +{ +  static types::str const typecodes("bBuhHiIlLqQfd"); +} +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/bisect/bisect.hpp b/contrib/python/pythran/pythran/pythonic/include/bisect/bisect.hpp index 8eb3e9fda50..3d54ae8a094 100644 --- a/contrib/python/pythran/pythran/pythonic/include/bisect/bisect.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/bisect/bisect.hpp @@ -27,7 +27,7 @@ namespace bisect                    std::upper_bound<typename X::const_iterator, A>);    DEFINE_FUNCTOR(pythonic::bisect, bisect); -} +} // namespace bisect  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_left.hpp b/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_left.hpp index 0953aa3e4b6..589eb2e43ac 100644 --- a/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_left.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_right.hpp b/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_right.hpp index c4d0d479e4a..a29a0130c36 100644 --- a/contrib/python/pythran/pythran/pythonic/include/bisect/bisect_right.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/abs.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/abs.hpp index ca927fb6226..cec382b7130 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/abs.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/all.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/all.hpp index e3b619e3af8..4d9c6085e81 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/all.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/any.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/any.hpp index 86b3d845cd8..5bb310e634c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/any.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/bin.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/bin.hpp index 7365388c787..f507ec4b55d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/bin.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/bool_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/bool_.hpp index f48b174f597..f0fdd1b52e5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/bool_.hpp +++ b/contrib/python/pythran/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<Ts...> const &val) const;        template <class T, size_t N> -      bool operator()(types::array<T, N> const &val) const; +      bool operator()(types::array_tuple<T, N> 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/contrib/python/pythran/pythran/pythonic/include/builtins/chr.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/chr.hpp index 6e30ee95908..0c3819bc008 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/chr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/complex.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/complex.hpp index 7057bd3791f..1ad6bc6dfee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/complex.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/complex/conjugate.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/complex/conjugate.hpp index dcb8d5ac329..0c2b4607793 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/complex/conjugate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict.hpp index f84a9798a1b..f4fdb169832 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/dict.hpp @@ -20,13 +20,15 @@ namespace builtins      types::dict<K, V> dict(types::dict<K, V> const &);      template <class Iterable> -    auto dict(Iterable &&iterable) -> types::dict< -        typename std::decay<decltype(std::get<0>(*iterable.begin()))>::type, -        typename std::decay<decltype(std::get<1>(*iterable.begin()))>::type>; -  } +    auto dict(Iterable &&iterable) +        -> types::dict< +            typename std::decay<decltype(std::get<0>(*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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/clear.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/clear.hpp index d90a2f3cf22..c51f03ef477 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/clear.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/copy.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/copy.hpp index e0a92e31bb2..33213a8226b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/copy.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/fromkeys.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/fromkeys.hpp index 0bcf1ff1e86..d06ff6ee574 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/fromkeys.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/get.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/get.hpp index 01edc4b6a58..be4e976f4af 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/get.hpp +++ b/contrib/python/pythran/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<T, J>::type get(::dict_container<T>, I, J);      DEFINE_FUNCTOR(pythonic::builtins::dict, get); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/items.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/items.hpp index 21e47d0e6ee..13d34bc997a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/items.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/items.hpp @@ -19,8 +19,8 @@ namespace builtins      auto items(D &&d) -> decltype(std::forward<D>(d).items());      DEFINE_FUNCTOR(pythonic::builtins::dict, items); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/keys.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/keys.hpp index f0dbba54520..5f0a78dfb83 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/keys.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/keys.hpp @@ -17,8 +17,8 @@ namespace builtins      auto keys(D &&d) -> decltype(std::forward<D>(d).keys());      DEFINE_FUNCTOR(pythonic::builtins::dict, keys); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/pop.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/pop.hpp index 7d0562c7899..06ae4499ce1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/pop.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/popitem.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/popitem.hpp index 5f12f97b596..16d7c1136ae 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/popitem.hpp +++ b/contrib/python/pythran/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 <tuple> @@ -18,8 +18,8 @@ namespace builtins      auto popitem(D &&d) -> decltype(std::forward<D>(d).popitem());      DEFINE_FUNCTOR(pythonic::builtins::dict, popitem); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/setdefault.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/setdefault.hpp index e14b8221c08..cd7a58b679c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/setdefault.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/setdefault.hpp @@ -25,8 +25,8 @@ namespace builtins      types::none<V> setdefault(types::dict<K, V> &&d, W const &k);      DEFINE_FUNCTOR(pythonic::builtins::dict, setdefault); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/update.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/update.hpp index 8d6990a90f7..6e95782e334 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/dict/values.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/values.hpp index 26030f7f09b..d47d0aa1444 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/dict/values.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/dict/values.hpp @@ -16,8 +16,8 @@ namespace builtins      auto values(D &&d) -> decltype(std::forward<D>(d).values());      DEFINE_FUNCTOR(pythonic::builtins::dict, values); -  } -} +  } // namespace dict +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/divmod.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/divmod.hpp index c6933382676..2dc79538c7a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/divmod.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file.hpp index ac84be64d4f..fbe7b70e4b1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/close.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/close.hpp index 106b3d0baae..e4fbf8f509f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/close.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/fileno.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/fileno.hpp index db8c9c055e6..9323f7b699d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/fileno.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/flush.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/flush.hpp index e0d2b3a2403..e193d9f8b6e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/flush.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/isatty.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/isatty.hpp index 87bfb137597..55bdc933352 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/isatty.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/next.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/next.hpp index 1378f872d7f..9d51b4ba7e3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/next.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/read.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/read.hpp index aeaa1f3ab2a..8ac0b63dbc0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/read.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/readline.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/readline.hpp index 31abcc98fef..00810611b13 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/readline.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/readlines.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/readlines.hpp index 32dea082d94..a5f77ee32ec 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/readlines.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/file/readlines.hpp @@ -20,7 +20,7 @@ namespace builtins      types::list<types::str> readlines(F &&f, long sizehint);      DEFINE_FUNCTOR(pythonic::builtins::file, readlines); -  } -} +  } // namespace file +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/file/seek.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/seek.hpp index 40f4202a5cc..93cd83c78b2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/seek.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/tell.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/tell.hpp index a9f623d3dcd..12bbab67831 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/tell.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/truncate.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/truncate.hpp index 72782386998..45146410c65 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/truncate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/write.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/write.hpp index 66f09cc73e4..66fe5ee813f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/write.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/file/writelines.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/file/writelines.hpp index f98dfc14825..966173a973a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/file/writelines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/float_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/float_.hpp index b9d05a6701c..15ca376ccf2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/float_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/float_/is_integer.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/float_/is_integer.hpp index cfc14f7e8c0..ae979b9d16d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/float_/is_integer.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/hex.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/hex.hpp index 5d5acb13fc8..a078ffc3940 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/hex.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/id.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/id.hpp index 40378062eaa..257f36c5bcb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/id.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/int_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/int_.hpp index e7a0d941505..dcee7b16489 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/int_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/isinstance.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/isinstance.hpp index 8a25f0f33cc..806cd0ee29f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/isinstance.hpp +++ b/contrib/python/pythran/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<str, char const *> {      using type = true_type;    }; -} +} // namespace types  namespace builtins  { @@ -41,14 +41,14 @@ namespace builtins      template <class Obj, class... Clss>      struct isinstance<Obj, std::tuple<Clss...>> {        using type = typename std::conditional< -          utils::any_of< -              std::is_same<typename types::isinstance< -                               Obj, typename std::decay<decltype( -                                        std::declval<Clss>()())>::type>::type, -                           types::true_type>::value...>::value, +          utils::any_of<std::is_same< +              typename types::isinstance< +                  Obj, typename std::decay< +                           decltype(std::declval<Clss>()())>::type>::type, +              types::true_type>::value...>::value,            types::true_type, types::false_type>::type;      }; -  } +  } // namespace details    template <class Obj, class Cls>    typename details::isinstance<Obj, Cls>::type isinstance(Obj, Cls) @@ -57,7 +57,7 @@ namespace builtins    }    DEFINE_FUNCTOR(pythonic::builtins, isinstance); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/iter.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/iter.hpp index 1e3dc07c495..7c252347b7a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/iter.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/iter.hpp @@ -23,7 +23,7 @@ namespace builtins        iterator const &begin() const;        iterator const &end() const;      }; -  } +  } // namespace details    template <class T>    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/contrib/python/pythran/pythran/pythonic/include/builtins/len.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/len.hpp index e0fcf0aade8..d884ee5c382 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/len.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/len.hpp @@ -4,8 +4,8 @@  #include "pythonic/include/utils/functor.hpp"  #include "pythonic/include/utils/yield.hpp" -#include <tuple>  #include <iterator> +#include <tuple>  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/contrib/python/pythran/pythran/pythonic/include/builtins/list.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list.hpp index c587b413c59..aba29bc9c1f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/list.hpp @@ -23,10 +23,10 @@ namespace builtins          typename std::remove_reference<Iterable>::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/contrib/python/pythran/pythran/pythonic/include/builtins/list/append.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/append.hpp index 507606d4c3b..d07b99cef15 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/append.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/list/count.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/count.hpp index b8e3707b906..85e4ef16989 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/count.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/list/extend.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/extend.hpp index 8c071ca1aee..bac4c967049 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/extend.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/list/insert.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/insert.hpp index 58bfb6a686c..5b762f4eca9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/insert.hpp +++ b/contrib/python/pythran/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<T> &seq, long n, F &&value);      DEFINE_FUNCTOR(pythonic::builtins::list, insert); -  } -} +  } // namespace list +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/list/pop.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/pop.hpp index 9ac28a6d27a..633e0f00e82 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/pop.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/list/remove.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/remove.hpp index 8fd44c85b35..da4307b42c9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/remove.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/list/reverse.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/reverse.hpp index edc2c523706..f5fe0227c12 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/reverse.hpp +++ b/contrib/python/pythran/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<T> &seq);      DEFINE_FUNCTOR(pythonic::builtins::list, reverse); -  } -} +  } // namespace list +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/list/sort.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/list/sort.hpp index 4f92e8f0334..1db0c70bbe4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/list/sort.hpp +++ b/contrib/python/pythran/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<T> &seq, K key);      DEFINE_FUNCTOR(pythonic::builtins::list, sort); -  } -} +  } // namespace list +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/map.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/map.hpp index 5e0912eb599..788106712cf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/map.hpp +++ b/contrib/python/pythran/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 <utility> @@ -21,15 +21,15 @@ namespace builtins      template <class Operator, class... Iters>      struct map_res { -      using type = decltype( -          std::declval<Operator>()(std::declval<typename std::iterator_traits< +      using type = decltype(std::declval<Operator>()( +          std::declval<typename std::iterator_traits<                typename Iters::iterator>::value_type>()...));      };      template <class... Iters>      struct map_res<types::none_type, Iters...> { -      using type = -          decltype(types::make_tuple(std::declval<typename std::iterator_traits< +      using type = decltype(types::make_tuple( +          std::declval<typename std::iterator_traits<                typename Iters::iterator>::value_type>()...));      }; @@ -98,23 +98,24 @@ namespace builtins        map() = default;        // Use an extra template to enable forwarding        template <class... Types> -      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 <typename Operator, typename... Iter> -  auto map(Operator &&_op, Iter &&... iters) -> details::map< -      typename std::remove_cv< -          typename std::remove_reference<Operator>::type>::type, -      typename types::iterator<typename std::remove_cv< -          typename std::remove_reference<Iter>::type>::type>::type...>; +  auto map(Operator &&_op, Iter &&...iters) +      -> details::map< +          typename std::remove_cv< +              typename std::remove_reference<Operator>::type>::type, +          typename types::iterator<typename std::remove_cv< +              typename std::remove_reference<Iter>::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/contrib/python/pythran/pythran/pythonic/include/builtins/max.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/max.hpp index 6f69e58b22b..6ece9c33542 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/max.hpp +++ b/contrib/python/pythran/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 <class... Types> -  auto max(Types &&... values) +  auto max(Types &&...values)        -> decltype(details::minmax(operator_::functor::lt{},                                    std::forward<Types>(values)...));    DEFINE_FUNCTOR(pythonic::builtins, max); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/min.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/min.hpp index 9b2a6608c7e..4aabbaed453 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/min.hpp +++ b/contrib/python/pythran/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 <class... Types> -  auto min(Types &&... values) +  auto min(Types &&...values)        -> decltype(details::minmax(operator_::functor::gt{},                                    std::forward<Types>(values)...));    DEFINE_FUNCTOR(pythonic::builtins, min); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/minmax.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/minmax.hpp index 8163964c183..68f894dc0fc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/minmax.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/minmax.hpp @@ -1,8 +1,8 @@  #ifndef PYTHONIC_INCLUDE_BUILTIN_MINMAX_HPP  #define PYTHONIC_INCLUDE_BUILTIN_MINMAX_HPP -#include <utility>  #include "pythonic/include/builtins/pythran/kwonly.hpp" +#include <utility>  PYTHONIC_NS_BEGIN @@ -21,8 +21,8 @@ namespace builtins      typename std::enable_if<!std::is_same<T1, types::kwonly>::value,                              typename __combined<T0, T1, Types...>::type>::type      minmax(Op const &, T0 const &, T1 const &, Types const &...); -  } -} +  } // namespace details +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/next.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/next.hpp index abea2e5ee39..f89e332cc1a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/next.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/oct.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/oct.hpp index af52c36a3e2..1b1a219b7d4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/oct.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/open.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/open.hpp index 126985be040..e68d4feaa2a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/open.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/ord.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/ord.hpp index d9658b94ae3..32356b07d60 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/ord.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/pow.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pow.hpp index 7b07574dcb8..c31526d7eb0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pow.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/pow.hpp @@ -16,11 +16,11 @@ namespace builtins    long pow(long, std::integral_constant<long, N>);    template <class... Types> -  auto pow(Types &&... args) +  auto pow(Types &&...args)        -> decltype(numpy::functor::power{}(std::forward<Types>(args)...));    DEFINE_FUNCTOR(pythonic::builtins, pow); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/print.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/print.hpp index 9e6599ffb90..fa7b86ce2d0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/print.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/print.hpp @@ -1,8 +1,8 @@  #ifndef PYTHONIC_INCLUDE_BUILTIN_PRINT_HPP  #define PYTHONIC_INCLUDE_BUILTIN_PRINT_HPP -#include <ostream>  #include "pythonic/include/utils/functor.hpp" +#include <ostream>  PYTHONIC_NS_BEGIN @@ -12,14 +12,14 @@ namespace builtins    void print_nonl();    template <typename T, typename... Types> -  void print_nonl(T const &value, Types const &... values); +  void print_nonl(T const &value, Types const &...values);    void print();    template <typename T, typename... Types> -  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/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp index b631bfff7a8..6c590b067d9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfBreak.hpp +++ b/contrib/python/pythran/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<T> StaticIfBreak(T const &arg);      DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfBreak); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp index 4fc6f53af79..918b9cedbe7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfCont.hpp +++ b/contrib/python/pythran/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<T> StaticIfCont(T const &arg);      DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfCont); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp index 4f795c261bf..b19474f63d2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfNoReturn.hpp +++ b/contrib/python/pythran/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<T> StaticIfNoReturn(T const &arg);      DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfNoReturn); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp index 766e5dc5ab5..72f7b898fdc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/StaticIfReturn.hpp +++ b/contrib/python/pythran/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<T> StaticIfReturn(T const &arg);      DEFINE_FUNCTOR(pythonic::builtins::pythran, StaticIfReturn); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/abssqr.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/abssqr.hpp index 5f62296b096..2f7284fd19d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/abssqr.hpp +++ b/contrib/python/pythran/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 <class T>        T abssqr(std::complex<T> 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/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/and_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/and_.hpp index d6b15e95bd6..2ef5198b39c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/and_.hpp +++ b/contrib/python/pythran/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<T0, T1> and_(T0 &&, T1 &&);      DEFINE_FUNCTOR(pythonic::builtins::pythran, and_); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/len_set.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/len_set.hpp index 474f991b17b..146e9f8b5e6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/len_set.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/make_shape.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/make_shape.hpp index 9f97d723ebf..fbe1ad1a31f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/make_shape.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/make_shape.hpp @@ -11,8 +11,8 @@ namespace builtins      pythonic::types::pshape<Args...> make_shape(Args... args);      DEFINE_FUNCTOR(pythonic::builtins::pythran, make_shape); -  } // pythran -} // builtins +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/or_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/or_.hpp index e84af2fe82d..1622c50b540 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/or_.hpp +++ b/contrib/python/pythran/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<T0, T1> or_(T0 &&, T1 &&);      DEFINE_FUNCTOR(pythonic::builtins::pythran, or_); -  } -} +  } // namespace pythran +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/restrict_assign.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/restrict_assign.hpp new file mode 100644 index 00000000000..7332335e160 --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/restrict_assign.hpp @@ -0,0 +1,29 @@ +#ifndef PYTHONIC_INCLUDE_BUILTIN_RESTRICT_ASSIGN_HPP +#define PYTHONIC_INCLUDE_BUILTIN_RESTRICT_ASSIGN_HPP + +#include "pythonic/include/types/numpy_gexpr.hpp" + +PYTHONIC_NS_BEGIN + +namespace builtins +{ +  namespace pythran +  { +    template <class Arg, class... S, class E> +    void restrict_assign(types::numpy_gexpr<Arg, S...> &&target, E &&value) +    { +      std::move(target)._copy_restrict(std::forward<E>(value)); +    } + +    template <class T, class E> +    void restrict_assign(T &&target, E &&value) +    { +      target = std::forward<E>(value); +    } + +    DEFINE_FUNCTOR(pythonic::builtins::pythran, restrict_assign); +  } // namespace pythran +} // namespace builtins +PYTHONIC_NS_END + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_if.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_if.hpp index a678609de5d..bafed1af01a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_if.hpp +++ b/contrib/python/pythran/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 <class... Args> -          auto operator()(Args &&... args) const -> typename __combined< -              decltype(f0(std::forward<Args>(args)...)), -              decltype(f1(std::forward<Args>(args)...))>::type +          auto operator()(Args &&...args) const -> +              typename __combined< +                  decltype(f0(std::forward<Args>(args)...)), +                  decltype(f1(std::forward<Args>(args)...))>::type            {              if (state_)                return f0(std::forward<Args>(args)...); @@ -71,10 +72,10 @@ namespace builtins            return {state_, f0, f1};          }        }; -    } +    } // namespace details      template <class T, class F0, class F1> -    auto static_if(T const &cond, F0 f0, F1 f1) -        -> decltype(details::static_if<T>{cond}(f0, f1)); +    auto static_if(T const &cond, F0 f0, +                   F1 f1) -> decltype(details::static_if<T>{cond}(f0, f1));      template <class F0, class F1>      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/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_list.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_list.hpp index 3d6ba21c710..cc3067bc0ea 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_list.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/pythran/static_list.hpp @@ -17,15 +17,15 @@ namespace builtins        return {};      }      template <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> const &other); +    types::static_list<T, N> static_list(types::array_tuple<T, N> const &other);      template <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> &other); +    types::static_list<T, N> static_list(types::array_tuple<T, N> &other);      template <class T, size_t N> -    types::static_list<T, N> static_list(types::array<T, N> &&other); +    types::static_list<T, N> static_list(types::array_tuple<T, N> &&other);      template <class T> -    auto static_list(T &&other) -> decltype( -        pythonic::builtins::functor::list{}(std::forward<T>(other))); +    auto static_list(T &&other) -> decltype(pythonic::builtins::functor::list{}( +                                    std::forward<T>(other)));      template <class T0, class... Tys>      types::static_list<typename __combined<T0, Tys...>::type, diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/range.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/range.hpp index d88756401ba..7c40b6dcd6e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/range.hpp +++ b/contrib/python/pythran/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<I, pythonic::builtins::range> {      typedef long type;    }; -} +} // namespace std  /* type inference stuff  {*/  #include "pythonic/include/types/combined.hpp" diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/reduce.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/reduce.hpp index 2084ccbf3ad..75791102f44 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/reduce.hpp +++ b/contrib/python/pythran/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<long, 1> + static_list<long, 1> -  // returns array<long, 2> +  // returns array_tuple<long, 2>    // and this widens to list    template <class Iterable, class Operator, class T>    using reduce_helper_t = typename __combined< @@ -36,7 +36,7 @@ namespace builtins            static_cast<reduce_helper_t<Iterable, Operator, T>>(init), op));    DEFINE_FUNCTOR(pythonic::builtins, reduce); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/reversed.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/reversed.hpp index ead92971547..805009da183 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/reversed.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/reversed.hpp @@ -26,13 +26,13 @@ namespace builtins        const_iterator begin() const;        const_iterator end() const;      }; -  } +  } // namespace details    template <class Iterable>    details::reversed<Iterable> reversed(Iterable const &iterable);    DEFINE_FUNCTOR(pythonic::builtins, reversed); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/round.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/round.hpp index 49563a81db4..0e456394811 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/round.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set.hpp index d5cf0c3dd36..6bff4e9b7a1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/set.hpp @@ -17,9 +17,9 @@ namespace builtins      inline types::set<typename std::iterator_traits<          typename std::remove_reference<Iterable>::type::iterator>::value_type>      set(Iterable &&t); -  } +  } // namespace anonymous    DEFINE_FUNCTOR(pythonic::builtins::anonymous, set); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/set/add.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/add.hpp index 18794b4ba4a..c9e9f2fd865 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/add.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/clear.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/clear.hpp index 4ccfbe12bdd..1011bd0973f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/clear.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/copy.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/copy.hpp index f6628cd93f5..b83eb45376d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/copy.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference.hpp index e246a88eb3a..bdc34bc830a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference.hpp @@ -13,14 +13,14 @@ namespace builtins    {      template <typename T, typename... Types> -    types::set<T> difference(types::set<T> const &set, Types const &... others); +    types::set<T> difference(types::set<T> const &set, Types const &...others);      template <typename T, typename... Types> -    types::set<T> difference(types::set<T> &&set, Types const &... others); +    types::set<T> difference(types::set<T> &&set, Types const &...others);      template <typename... Types>      types::empty_set difference(types::empty_set const &set, -                                Types const &... others); +                                Types const &...others);      template <typename T>      types::set<T> difference(types::set<T> 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/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference_update.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference_update.hpp index 7057bb5cf58..7514ad93b06 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/difference_update.hpp +++ b/contrib/python/pythran/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 <typename T, typename... Types>      types::none_type difference_update(types::set<T> &set, -                                       Types const &... others); +                                       Types const &...others);      template <typename T, typename... Types>      types::none_type difference_update(types::set<T> &&set, -                                       Types const &... others); +                                       Types const &...others);      template <typename... Types>      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/contrib/python/pythran/pythran/pythonic/include/builtins/set/discard.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/discard.hpp index 1e79a834507..11820088e09 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/discard.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection.hpp index eb4e34d1722..3a33b6bca59 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection.hpp @@ -14,7 +14,7 @@ namespace builtins      template <typename T, typename... Types>      typename __combined<types::set<T>, Types...>::type -    intersection(types::set<T> const &set, Types const &... others); +    intersection(types::set<T> 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 <typename... Types>      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/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection_update.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection_update.hpp index e7d4583cf42..a9fd1bdfc5c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/intersection_update.hpp +++ b/contrib/python/pythran/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 <typename T, typename... Types>      types::none_type intersection_update(types::set<T> &set, -                                         Types const &... others); +                                         Types const &...others);      template <typename T, typename... Types>      types::none_type intersection_update(types::set<T> &&set, -                                         Types const &... others); +                                         Types const &...others);      template <typename... Types>      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/contrib/python/pythran/pythran/pythonic/include/builtins/set/isdisjoint.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/isdisjoint.hpp index 0edf1bd0017..d2a0d41ece1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/isdisjoint.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/issubset.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/issubset.hpp index 8748d64acde..fb3026ee7e1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/issubset.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/issuperset.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/issuperset.hpp index 3b32830f28e..f9f886070c2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/issuperset.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/remove.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/remove.hpp index cd1edc50e7a..98211154405 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/remove.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference.hpp index 916449ae261..a58e3635ccc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp index 094bc118435..71b68679fa9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/symmetric_difference_update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/set/union_.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/union_.hpp index 92f0741359c..2e561dd825b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/union_.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/set/union_.hpp @@ -14,11 +14,11 @@ namespace builtins      template <typename T, typename... Types>      typename __combined<types::set<T>, Types...>::type -    union_(types::set<T> const &set, Types const &... others); +    union_(types::set<T> const &set, Types const &...others);      template <typename... Types>      typename __combined<types::empty_set, Types...>::type -    union_(types::empty_set const &init, Types const &... others); +    union_(types::empty_set const &init, Types const &...others);      template <typename T>      types::set<T> union_(types::set<T> 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/contrib/python/pythran/pythran/pythonic/include/builtins/set/update.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/set/update.hpp index 99163e3ecbb..ec57cdc1529 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/set/update.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/sorted.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/sorted.hpp index be2859f02f2..61553dbdde5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/sorted.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str.hpp index ccaa8846de7..4adf0379b6b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/__mod__.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/__mod__.hpp index e598da55b52..5a687fd6f72 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/__mod__.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/str/__mod__.hpp @@ -16,10 +16,11 @@ namespace builtins      template <class... Ts>      types::str __mod__(types::str const &, std::tuple<Ts...> const &args);      template <size_t N, class T> -    types::str __mod__(types::str const &, types::array<T, N> const &args); +    types::str __mod__(types::str const &, +                       types::array_tuple<T, N> const &args);      DEFINE_FUNCTOR(pythonic::builtins::str, __mod__); -  } -} +  } // namespace str +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/str/capitalize.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/capitalize.hpp index fdf49293134..9fd4ccc1d83 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/capitalize.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/count.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/count.hpp index 35c0a6ae884..f6f8244b9a9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/count.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/endswith.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/endswith.hpp index 78f94b170c5..4772df1d17f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/endswith.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/find.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/find.hpp index b9852d98cb8..f7563e670b2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/find.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/isalpha.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/isalpha.hpp index 463f4f25a2f..dec802e5a20 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/isalpha.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/isdigit.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/isdigit.hpp index 5771c7da4c3..d58089f96f0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/isdigit.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/join.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/join.hpp index aa566d1e4d4..cac5684f615 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/join.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/lower.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/lower.hpp index b204a5c25ba..2ba4cf0d37c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/lower.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/lstrip.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/lstrip.hpp index 23c75f03716..565590aa531 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/lstrip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/replace.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/replace.hpp index 2493f641457..353d73cff84 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/replace.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/str/replace.hpp @@ -17,7 +17,7 @@ namespace builtins                         long count = std::numeric_limits<long>::max());      DEFINE_FUNCTOR(pythonic::builtins::str, replace); -  } -} +  } // namespace str +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/str/rstrip.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/rstrip.hpp index db2d6a27173..d3beb61e5b9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/rstrip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/split.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/split.hpp index a2d19f60f0e..43304c4b3e6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/split.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/startswith.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/startswith.hpp index e1931d2e78a..41fe3878271 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/startswith.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/strip.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/strip.hpp index ec045f11181..1a5cfce67b6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/strip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/str/upper.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/str/upper.hpp index 6c1b0279f1e..19b150ad1ef 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/str/upper.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/sum.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/sum.hpp index d33137066a7..dd5adfce71a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/sum.hpp +++ b/contrib/python/pythran/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 <numeric> @@ -17,21 +17,22 @@ namespace builtins    {      template <class Tuple, size_t N>      struct tuple_sum { -      auto operator()(Tuple const &t) -          -> decltype(std::get<N>(t) + tuple_sum<Tuple, N - 1>()(t)); +      auto operator()(Tuple const &t) -> decltype(std::get<N>(t) + +                                                  tuple_sum<Tuple, N - 1>()(t));      };      template <class Tuple>      struct tuple_sum<Tuple, 0> {        auto operator()(Tuple const &t) -> decltype(std::get<0>(t));      }; -  } +  } // namespace details    template <class Iterable, class T> -  auto sum(Iterable s, T start) -> decltype(std::accumulate( -      s.begin(), s.end(), -      static_cast<typename assignable<decltype(start + *s.begin())>::type>( -          start))); +  auto sum(Iterable s, T start) +      -> decltype(std::accumulate( +          s.begin(), s.end(), +          static_cast<typename assignable<decltype(start + *s.begin())>::type>( +              start)));    template <class Iterable>    auto sum(Iterable s) -> decltype(sum(s, 0L)) @@ -40,10 +41,11 @@ namespace builtins    }    template <class... Types> -  auto sum(std::tuple<Types...> const &t) -> decltype( -      details::tuple_sum<std::tuple<Types...>, sizeof...(Types)-1>()(t)) +  auto sum(std::tuple<Types...> const &t) +      -> decltype(details::tuple_sum<std::tuple<Types...>, +                                     sizeof...(Types) - 1>()(t))    { -    return details::tuple_sum<std::tuple<Types...>, sizeof...(Types)-1>()(t); +    return details::tuple_sum<std::tuple<Types...>, sizeof...(Types) - 1>()(t);    }    template <class T, size_t N, class V> @@ -53,7 +55,7 @@ namespace builtins    }    DEFINE_FUNCTOR(pythonic::builtins, sum); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/tuple.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/tuple.hpp index 59e3db27931..1dcdcfa40df 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/tuple.hpp +++ b/contrib/python/pythran/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<typename std::remove_cv<typename std::remove_reference<            StaticIterable>::type>::type>::value >= 0, -      types::array< +      types::array_tuple<            typename std::iterator_traits<                typename std::remove_cv<typename std::remove_reference<                    StaticIterable>::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/contrib/python/pythran/pythran/pythonic/include/builtins/type.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/type.hpp index d115066a797..bd50e722b84 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/type.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/type.hpp @@ -11,7 +11,7 @@ namespace builtins    template <class T>    typename type_functor<T>::type type(T const &t);    DEFINE_FUNCTOR(pythonic::builtins, type); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/builtins/xrange.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/xrange.hpp index 340eeabd141..9b2d17d0d46 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/xrange.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/builtins/zip.hpp b/contrib/python/pythran/pythran/pythonic/include/builtins/zip.hpp index d37be63b66f..731f91eecdd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/builtins/zip.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/builtins/zip.hpp @@ -10,11 +10,11 @@ namespace builtins  {    template <typename... Iter> -  auto zip(Iter &&... iters) -      -> decltype(map(builtins::None, std::forward<Iter>(iters)...)); +  auto zip(Iter &&...iters) -> decltype(map(builtins::None, +                                            std::forward<Iter>(iters)...));    DEFINE_FUNCTOR(pythonic::builtins, zip); -} +} // namespace builtins  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/acos.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/acos.hpp index 71ac51e739f..92d24f89d50 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/acos.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/acosh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/acosh.hpp index 46d979f9166..11402111049 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/acosh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/asin.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/asin.hpp index f5e8fb2e1dd..f40ef734774 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/asin.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/asinh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/asinh.hpp index ba7fa7ee2e5..904e57f04b0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/asinh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/atan.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/atan.hpp index 9cef6406d77..47b979517c1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/atan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/atanh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/atanh.hpp index ede7ff35f9a..9ebc8069387 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/atanh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/cos.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/cos.hpp index f5071fc02be..40a35bc7f35 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/cos.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -16,7 +16,7 @@ namespace cmath    std::complex<T> cos(T const &v);    DEFINE_FUNCTOR(pythonic::cmath, cos); -} +} // namespace cmath  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/cosh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/cosh.hpp index 905b213209c..ffcc2e95747 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/cosh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/e.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/e.hpp index d128c68dbea..fbf9acd5c1e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/e.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/exp.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/exp.hpp index 8c5b3ba1f1d..a970e3b148f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/exp.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/isinf.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/isinf.hpp index 1b1a0e13dea..24acc80756a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/isinf.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/isnan.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/isnan.hpp index be7cc9ad842..f52136c3e4f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/isnan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/log.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/log.hpp index dd59e40200f..618aeae30eb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/log.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -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/contrib/python/pythran/pythran/pythonic/include/cmath/log10.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/log10.hpp index 85851944a52..6c2f62768b0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/log10.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/pi.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/pi.hpp index 6ddfe9f8d1f..5672ddb31dc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/pi.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/sin.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/sin.hpp index 699b9268c6e..12b68901059 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/sin.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/sinh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/sinh.hpp index 42a64fba04f..3a773bc54da 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/sinh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/sqrt.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/sqrt.hpp index 4a78f2d1d85..1a7c0e1fd2a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/sqrt.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/tan.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/tan.hpp index 605d6a56725..26336f5f20a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/tan.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/cmath/tanh.hpp b/contrib/python/pythran/pythran/pythonic/include/cmath/tanh.hpp index 8a628bd5cc4..ded400fd570 100644 --- a/contrib/python/pythran/pythran/pythonic/include/cmath/tanh.hpp +++ b/contrib/python/pythran/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 <cmath> diff --git a/contrib/python/pythran/pythran/pythonic/include/functools/partial.hpp b/contrib/python/pythran/pythran/pythonic/include/functools/partial.hpp index ab6698502da..9fdf30ee90b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/functools/partial.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/functools/partial.hpp @@ -4,8 +4,8 @@  #include "pythonic/include/utils/functor.hpp"  #include "pythonic/include/utils/seq.hpp" -#include <utility>  #include <tuple> +#include <utility>  PYTHONIC_NS_BEGIN @@ -33,10 +33,10 @@ namespace functools        task();        task(task const &) = default; -      task(ClosureTypes const &... types); +      task(ClosureTypes const &...types);        template <std::size_t... S, typename... Types> -      auto call(utils::index_sequence<S...>, Types &&... types) const +      auto call(utils::index_sequence<S...>, Types &&...types) const            -> decltype(std::get<0>(closure)(std::get<S + 1>(closure)...,                                             std::forward<Types>(types)...))        { @@ -45,20 +45,21 @@ namespace functools        }        template <typename... Types> -      auto operator()(Types &&... types) const -> decltype( -          this->call(utils::make_index_sequence<sizeof...(ClosureTypes)-1>(), -                     std::forward<Types>(types)...)); +      auto operator()(Types &&...types) const +          -> decltype(this->call( +              utils::make_index_sequence<sizeof...(ClosureTypes) - 1>(), +              std::forward<Types>(types)...));      }; -  } +  } // namespace details    template <typename... Types>    // remove references as closure capture the env by copy    details::task<typename std::remove_cv<        typename std::remove_reference<Types>::type>::type...> -  partial(Types &&... types); +  partial(Types &&...types);    DEFINE_FUNCTOR(pythonic::functools, partial); -} +} // namespace functools  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/functools/reduce.hpp b/contrib/python/pythran/pythran/pythonic/include/functools/reduce.hpp index 02bb5bac486..c237c65c667 100644 --- a/contrib/python/pythran/pythran/pythonic/include/functools/reduce.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp index ae538dda8bf..cfb4b1ede8f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/close.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp index 3798ee16d1a..4a05685c052 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/fileno.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp index 48b802af02d..7b06ae234c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/flush.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp index f489ce43561..d5843b66e5b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/isatty.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp index 6b81cfbd988..aa1bcaea8d7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/next.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp index 8a168d3276f..5065064eed9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/read.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp index 8a81030be1a..b2ee4f9478f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readline.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp index d4df432dfa6..74b88c44f9f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/readlines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp index 0bd1b54c7a6..b2b576bc363 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/seek.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp index 09deee54ae8..c9d4c50b4a8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/tell.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp index 9dd855b7458..20ff10f4ee0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/truncate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp index 90813ffebc4..7546220544c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/write.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp b/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp index ff55e19760e..a77af96683f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/io/_io/TextIOWrapper/writelines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/itertools/common.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/common.hpp index 41295a771dd..ea5452d6e9b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/common.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/itertools/common.hpp @@ -8,7 +8,7 @@ namespace itertools    struct npos {    }; -} +} // namespace itertools  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/itertools/count.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/count.hpp index 16956112d8b..06e93d9658a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/count.hpp +++ b/contrib/python/pythran/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 <iterator> @@ -38,7 +38,7 @@ namespace itertools        iterator const &begin() const;        iterator end() const;      }; -  } +  } // namespace details    template <typename T0, typename T1 = T0>    details::count<typename __combined<T0, T1>::type> count(T0 start, @@ -47,7 +47,7 @@ namespace itertools    details::count<long> count();    DEFINE_FUNCTOR(pythonic::itertools, count); -} +} // namespace itertools  PYTHONIC_NS_END  /* type inference stuff  {*/ diff --git a/contrib/python/pythran/pythran/pythonic/include/itertools/islice.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/islice.hpp index 69c0afdad9f..b6545a0a02b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/islice.hpp +++ b/contrib/python/pythran/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 <iterator>  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/contrib/python/pythran/pythran/pythonic/include/itertools/permutations.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/permutations.hpp index 5aff43d0411..7b0630622ca 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/permutations.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/itertools/permutations.hpp @@ -88,7 +88,7 @@ namespace itertools    permutations(T0 iter);    template <typename T0, long N0> -  _permutations<T0, types::array<typename T0::value_type, (size_t)N0>> +  _permutations<T0, types::array_tuple<typename T0::value_type, (size_t)N0>>    permutations(T0 iter, std::integral_constant<long, N0>);    DEFINE_FUNCTOR(pythonic::itertools, permutations); diff --git a/contrib/python/pythran/pythran/pythonic/include/itertools/product.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/product.hpp index 7ca6f0c6a99..070726c630d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/product.hpp +++ b/contrib/python/pythran/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 <iterator>  #include <type_traits> @@ -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 <typename... Iter>    details::product<typename std::remove_cv<        typename std::remove_reference<Iter>::type>::type...> -  product(Iter &&... iters); +  product(Iter &&...iters);    DEFINE_FUNCTOR(pythonic::itertools, product); -} +} // namespace itertools  PYTHONIC_NS_END  /* type inference stuff  {*/ diff --git a/contrib/python/pythran/pythran/pythonic/include/itertools/repeat.hpp b/contrib/python/pythran/pythran/pythonic/include/itertools/repeat.hpp index c827e8d5e38..477a789af5b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/itertools/repeat.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/itertools/repeat.hpp @@ -43,7 +43,7 @@ namespace itertools    _repeat<T, true> repeat(T iter);    DEFINE_FUNCTOR(pythonic::itertools, repeat); -} +} // namespace itertools  PYTHONIC_NS_END  /* type inference stuff  {*/ diff --git a/contrib/python/pythran/pythran/pythonic/include/math/ceil.hpp b/contrib/python/pythran/pythran/pythonic/include/math/ceil.hpp index 2b496014623..e46b2c0e509 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/ceil.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/degrees.hpp b/contrib/python/pythran/pythran/pythonic/include/math/degrees.hpp index 724ffd310e2..7473031e9da 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/degrees.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/factorial.hpp b/contrib/python/pythran/pythran/pythonic/include/math/factorial.hpp index cbfc0612821..a0284876ee5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/factorial.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/floor.hpp b/contrib/python/pythran/pythran/pythonic/include/math/floor.hpp index 8e2b82dd29b..f5d66ac20d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/floor.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/frexp.hpp b/contrib/python/pythran/pythran/pythonic/include/math/frexp.hpp index 56d6a80427d..bc91d276878 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/frexp.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -12,7 +12,7 @@ namespace math  {    std::tuple<double, long> frexp(double x);    DEFINE_FUNCTOR(pythonic::math, frexp); -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/math/gamma.hpp b/contrib/python/pythran/pythran/pythonic/include/math/gamma.hpp index 19e7d1eb8c7..fc37585ee62 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/gamma.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/isinf.hpp b/contrib/python/pythran/pythran/pythonic/include/math/isinf.hpp index 6c5f8b0d9e2..5884b60d98b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/isinf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/log.hpp b/contrib/python/pythran/pythran/pythonic/include/math/log.hpp index 0d4090d3c9f..ab2056264cb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/log.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/modf.hpp b/contrib/python/pythran/pythran/pythonic/include/math/modf.hpp index a3ccd0e8c67..566766971d1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/modf.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -12,7 +12,7 @@ namespace math  {    std::tuple<double, double> modf(double x);    DEFINE_FUNCTOR(pythonic::math, modf); -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/math/pi.hpp b/contrib/python/pythran/pythran/pythonic/include/math/pi.hpp index c7cc32985fd..065b4098127 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/pi.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/math/radians.hpp b/contrib/python/pythran/pythran/pythonic/include/math/radians.hpp index 1262a000f67..1ed2583a9ba 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/radians.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/math/radians.hpp @@ -11,7 +11,7 @@ namespace math    template <class T>    double radians(T x);    DEFINE_FUNCTOR(pythonic::math, radians); -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/math/trunc.hpp b/contrib/python/pythran/pythran/pythonic/include/math/trunc.hpp index bdb454b109b..b9b6713c5db 100644 --- a/contrib/python/pythran/pythran/pythonic/include/math/trunc.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/abs.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/abs.hpp index 1e6c928967e..8459a6790f9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/abs.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/absolute.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/absolute.hpp index 1b421ac57ab..b5dae6727a9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/absolute.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/add.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/add.hpp index fbae482f7ad..3e4be00470a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/add.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/alen.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/alen.hpp index 6deccde09a5..b072d9a6efb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/alen.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/all.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/all.hpp index 77cc158b55e..cfe8caf1bed 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/all.hpp +++ b/contrib/python/pythran/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 <class E>    typename std::enable_if<        E::value != 1, -      types::ndarray<typename E::dtype, types::array<long, E::value - 1>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value - 1>>>::type    all(E const &array, long axis);    DEFINE_FUNCTOR(pythonic::numpy, all); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/allclose.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/allclose.hpp index 07b26d49410..c2a373d459e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/allclose.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/alltrue.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/alltrue.hpp index da988f7a42e..e73ff3660ab 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/alltrue.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/alltrue.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class... Types> -  auto alltrue(Types &&... types) -      -> decltype(all(std::forward<Types>(types)...)); +  auto +  alltrue(Types &&...types) -> decltype(all(std::forward<Types>(types)...));    DEFINE_FUNCTOR(pythonic::numpy, alltrue); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/angle.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/angle.hpp index 991ed7e3bf7..619e2ac6a65 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/angle.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_deg.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_deg.hpp index 210bc94cec8..ebef8869ce6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_deg.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_rad.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_rad.hpp index 5f5d7def3bb..a0d032753a2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/angle_in_rad.hpp +++ b/contrib/python/pythran/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 <class T> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/any.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/any.hpp index 2add8b04052..044005a66a9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/any.hpp +++ b/contrib/python/pythran/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 <class E>    typename std::enable_if<        E::value != 1, -      types::ndarray<typename E::dtype, types::array<long, E::value - 1>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value - 1>>>::type    any(E const &array, long axis);    DEFINE_FUNCTOR(pythonic::numpy, any); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/append.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/append.hpp index 935ef25176a..c78901598c4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/append.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/arange.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arange.hpp index 0b6cb1bcb32..7148c517313 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arange.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/arange.hpp @@ -148,9 +148,11 @@ namespace numpy        }        template <class... S> -      auto operator()(S const &...s) const -> typename std::enable_if< -          (sizeof...(S) > 1), -          decltype(std::declval<types::ndarray<dtype, shape_t>>()(s...))>::type +      auto operator()(S const &...s) const -> +          typename std::enable_if< +              (sizeof...(S) > 1), +              decltype(std::declval<types::ndarray<dtype, shape_t>>()( +                  s...))>::type        {          return types::ndarray<dtype, shape_t>{              types::numpy_expr<pythonic::operator_::functor::pos, arange_index>{ diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/arccos.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arccos.hpp index 9c6745408af..3921c461585 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arccos.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arccosh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arccosh.hpp index 8d1e7695aef..1a77b725f35 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arccosh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arcsin.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arcsin.hpp index 849bead8022..0a221c7ab30 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arcsin.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arcsinh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arcsinh.hpp index 94922c939c9..efaafe1ee9f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arcsinh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arctan.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arctan.hpp index fb44c56b94d..1f12102aed3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arctan.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arctan2.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arctan2.hpp index fb6ba8fbb39..fc32506c7a4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arctan2.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/arctanh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/arctanh.hpp index ebf4a20807f..9dc63e94aef 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/arctanh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/argmax.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/argmax.hpp index 1bc9c5522c7..bc8de17e626 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/argmax.hpp +++ b/contrib/python/pythran/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 <class E> -  types::ndarray<long, types::array<long, E::value - 1>> argmax(E const &expr, -                                                                long axis); +  types::ndarray<long, types::array_tuple<long, E::value - 1>> +  argmax(E const &expr, long axis);    DEFINE_FUNCTOR(pythonic::numpy, argmax); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/argmin.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/argmin.hpp index 429a168fd39..126ac3bb8c0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/argmin.hpp +++ b/contrib/python/pythran/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 <class E> -  types::ndarray<long, types::array<long, E::value - 1>> argmin(E const &expr, -                                                                long axis); +  types::ndarray<long, types::array_tuple<long, E::value - 1>> +  argmin(E const &expr, long axis);    DEFINE_FUNCTOR(pythonic::numpy, argmin); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/argsort.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/argsort.hpp index d7c3a189ebc..6926de372e5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/argsort.hpp +++ b/contrib/python/pythran/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 <class E> -  types::ndarray<long, types::array<long, 1>> argsort(E const &expr, -                                                      types::none_type, -                                                      types::none_type={}); +  types::ndarray<long, types::array_tuple<long, 1>> +  argsort(E const &expr, types::none_type, types::none_type = {});    template <class T, class pS>    types::ndarray<long, pS> argsort(types::ndarray<T, pS> const &a, -                                   long axis = -1,  types::none_type kind={}); +                                   long axis = -1, types::none_type kind = {});    template <class T, class pS> -  types::ndarray<long, pS> argsort(types::ndarray<T, pS> const &a, -                                   long axis,  types::str const& kind); +  types::ndarray<long, pS> argsort(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/argwhere.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/argwhere.hpp index c69144a76f9..90107d2f584 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/argwhere.hpp +++ b/contrib/python/pythran/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 <class E> -  typename types::ndarray<long, types::array<long, 2>> argwhere(E const &expr); +  typename types::ndarray<long, types::array_tuple<long, 2>> +  argwhere(E const &expr);    DEFINE_FUNCTOR(pythonic::numpy, argwhere); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/around.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/around.hpp index d79a3deff9c..4e9ae04c522 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/around.hpp +++ b/contrib/python/pythran/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 <class E> -  auto around(E &&a, long decimals) -> typename std::enable_if< -      !std::is_integral< -          typename types::dtype_of<typename std::decay<E>::type>::type>::value, -      decltype(functor::rint{}(functor::multiply{}( -                   std::forward<E>(a), +  auto around(E &&a, long decimals) -> +      typename std::enable_if< +          !std::is_integral<typename types::dtype_of< +              typename std::decay<E>::type>::type>::value, +          decltype(functor::rint{}(functor::multiply{}( +                       std::forward<E>(a), +                       std::declval<typename types::dtype_of< +                           typename std::decay<E>::type>::type>())) /                     std::declval<typename types::dtype_of< -                       typename std::decay<E>::type>::type>())) / -               std::declval<typename types::dtype_of< -                   typename std::decay<E>::type>::type>())>::type; +                       typename std::decay<E>::type>::type>())>::type;    // the integer version is only relevant when decimals < 0    template <class E> -  auto around(E &&a, long decimals) -> typename std::enable_if< -      std::is_integral< -          typename types::dtype_of<typename std::decay<E>::type>::type>::value, -      decltype(numpy::functor::floor_divide{}( -                   functor::float64{}(std::forward<E>(a)), +  auto around(E &&a, long decimals) -> +      typename std::enable_if< +          std::is_integral<typename types::dtype_of< +              typename std::decay<E>::type>::type>::value, +          decltype(numpy::functor::floor_divide{}( +                       functor::float64{}(std::forward<E>(a)), +                       std::declval<typename types::dtype_of< +                           typename std::decay<E>::type>::type>()) *                     std::declval<typename types::dtype_of< -                       typename std::decay<E>::type>::type>()) * -               std::declval<typename types::dtype_of< -                   typename std::decay<E>::type>::type>())>::type; +                       typename std::decay<E>::type>::type>())>::type;    DEFINE_FUNCTOR(pythonic::numpy, around); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/array.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/array.hpp index 694d7a53b1c..fbc6081c7d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/array.hpp +++ b/contrib/python/pythran/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<typename std::decay<T>::type>::value,        types::ndarray<typename dtype::type, -                     types::array<long, std::decay<T>::type::value>>>::type -  array(T &&iterable, dtype d = dtype()); +                     types::array_tuple<long, std::decay<T>::type::value>>>:: +      type +      array(T &&iterable, dtype d = dtype());    template <class T,              class dtype = types::dtype_t<typename std::decay<T>::type::dtype>>    typename std::enable_if<        !types::has_size<typename std::decay<T>::type>::value &&            !types::is_dtype<typename std::decay<T>::type>::value,        types::ndarray<typename dtype::type, -                     types::array<long, std::decay<T>::type::value>>>::type -  array(T &&iterable, dtype d = dtype()); +                     types::array_tuple<long, std::decay<T>::type::value>>>:: +      type +      array(T &&iterable, dtype d = dtype());    template <class T, class dtype = types::dtype_t<typename types::dtype_of<                           typename std::decay<T>::type>::type>> @@ -52,7 +54,7 @@ namespace numpy    array(types::array_base<T, N, V> &&, dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, array); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/array2string.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/array2string.hpp index 29d2b4960b2..c689c72321e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/array2string.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/array_equal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/array_equal.hpp index 617598aef7b..218238fa23c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/array_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/array_equiv.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/array_equiv.hpp index 1ea7c520282..d79c84c6a56 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/array_equiv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/asarray.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/asarray.hpp index 58fde934b97..40377c3ea2f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/asarray.hpp +++ b/contrib/python/pythran/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 <class E, class dtype>    struct _asarray {      template <class... Types> -    auto operator()(Types &&... args) +    auto operator()(Types &&...args)          -> decltype(array(std::forward<Types>(args)...));    }; @@ -23,9 +23,10 @@ namespace numpy    };    template <class E> -  auto asarray(E &&e, types::none_type d = types::none_type()) -> decltype( -      _asarray<typename std::decay<E>::type, -               typename types::dtype_of<typename std::decay<E>::type>::type>{}( +  auto asarray(E &&e, types::none_type d = types::none_type()) +      -> decltype(_asarray<typename std::decay<E>::type, +                           typename types::dtype_of< +                               typename std::decay<E>::type>::type>{}(            std::forward<E>(e)));    template <class E, class dtype> @@ -34,7 +35,7 @@ namespace numpy                             typename dtype::type>{}(std::forward<E>(e), d));    DEFINE_FUNCTOR(pythonic::numpy, asarray); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/asarray_chkfinite.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/asarray_chkfinite.hpp index f028e6419ff..4320bfd34d4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/asarray_chkfinite.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/asfarray.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/asfarray.hpp index 1c306df3a9a..114543d279b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/asfarray.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/asfarray.hpp @@ -9,10 +9,10 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E, class dtype = functor::float64> -  auto asfarray(E &&e, dtype d = dtype()) -      -> decltype(asarray(std::forward<E>(e), d)); +  auto asfarray(E &&e, +                dtype d = dtype()) -> decltype(asarray(std::forward<E>(e), d));    DEFINE_FUNCTOR(pythonic::numpy, asfarray); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/asscalar.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/asscalar.hpp index b35c22cafed..ef2c5f6cba2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/asscalar.hpp +++ b/contrib/python/pythran/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<typename E::dtype> asscalar(E const &expr);    DEFINE_FUNCTOR(pythonic::numpy, asscalar); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_1d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_1d.hpp index ed73f588f55..f6a43e51281 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_1d.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_2d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_2d.hpp index 4e22a00ce22..b882ae747a0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_2d.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_2d.hpp @@ -15,23 +15,25 @@ namespace numpy    atleast_2d(T t);    template <class T> -          auto atleast_2d(T const &t) -> -          typename std::enable_if < (!types::is_dtype<T>::value) && -      T::value<2, types::ndarray< -                      typename T::dtype, -                      types::pshape<std::integral_constant<long, 1>, -                                    typename std::tuple_element< -                                        0, typename T::shape_t>::type>>>::type; +  auto atleast_2d(T const &t) -> +      typename std::enable_if < (!types::is_dtype<T>::value) && +          T::value<2, +                   types::ndarray< +                       typename T::dtype, +                       types::pshape<std::integral_constant<long, 1>, +                                     typename std::tuple_element< +                                         0, typename T::shape_t>::type>>>::type;    template <class T> -  auto atleast_2d(T &&t) -> typename std::enable_if< -      (!types::is_dtype<typename std::remove_cv< -          typename std::remove_reference<T>::type>::type>::value) && -          std::decay<T>::type::value >= 2, -      decltype(std::forward<T>(t))>::type; +  auto atleast_2d(T &&t) -> +      typename std::enable_if< +          (!types::is_dtype<typename std::remove_cv< +               typename std::remove_reference<T>::type>::type>::value) && +              std::decay<T>::type::value >= 2, +          decltype(std::forward<T>(t))>::type;    DEFINE_FUNCTOR(pythonic::numpy, atleast_2d); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_3d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_3d.hpp index b5755733d12..b7720c10228 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_3d.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/atleast_3d.hpp @@ -15,23 +15,25 @@ namespace numpy                                        std::integral_constant<long, 1>>>>::type    atleast_3d(T t);    template <class T> -  auto atleast_3d(T const &t) -> typename std::enable_if< -      (!types::is_dtype<T>::value) && (T::value == 1), -      types::ndarray<typename T::dtype, -                     types::pshape<std::integral_constant<long, 1>, -                                   typename std::tuple_element< -                                       0, typename T::shape_t>::type, -                                   std::integral_constant<long, 1>>>>::type; +  auto atleast_3d(T const &t) -> +      typename std::enable_if< +          (!types::is_dtype<T>::value) && (T::value == 1), +          types::ndarray<typename T::dtype, +                         types::pshape<std::integral_constant<long, 1>, +                                       typename std::tuple_element< +                                           0, typename T::shape_t>::type, +                                       std::integral_constant<long, 1>>>>::type;    template <class T> -  auto atleast_3d(T const &t) -> typename std::enable_if< -      (!types::is_dtype<T>::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<long, 1>>>>::type; +  auto atleast_3d(T const &t) -> +      typename std::enable_if< +          (!types::is_dtype<T>::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<long, 1>>>>::type;    template <class T>    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/contrib/python/pythran/pythran/pythonic/include/numpy/average.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/average.hpp index fd932195206..c5ae85b5342 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/average.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/average.hpp @@ -17,10 +17,10 @@ namespace numpy    template <class E, class W>    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/contrib/python/pythran/pythran/pythonic/include/numpy/base_repr.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/base_repr.hpp index f102143ef1f..83adcc5267f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/base_repr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/binary_repr.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/binary_repr.hpp index f6bb382f7dd..0891a908281 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/binary_repr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/bincount.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bincount.hpp index 24022fd35c7..087b41f5503 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bincount.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_and.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_and.hpp index f4389ca83a2..34881a76df8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_and.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_not.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_not.hpp index 3673eebe9a7..b455b623f56 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_not.hpp +++ b/contrib/python/pythran/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<A const &>()) 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/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_or.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_or.hpp index be50b626d87..fd9e76c5535 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_or.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_xor.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_xor.hpp index 9324d6d5427..26fca6f8ede 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bitwise_xor.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/bool_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/bool_.hpp index 546aa96fa45..224aa4313bc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/bool_.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/broadcast_to.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/broadcast_to.hpp index 122c43c6ab0..cc3f14b825c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/broadcast_to.hpp +++ b/contrib/python/pythran/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<typename types::dtype_of<E>::type>{}));    DEFINE_FUNCTOR(pythonic::numpy, broadcast_to); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/byte.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/byte.hpp index 79f388e5aad..c7478f393f7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/byte.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/cbrt.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cbrt.hpp index b78a05ee1af..01e4fa0d95d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cbrt.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/ceil.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ceil.hpp index fa8575c6997..4230af7081d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ceil.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/clip.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/clip.hpp index 610b2146734..3d5e11ab6e3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/clip.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/clip.hpp @@ -26,7 +26,7 @@ namespace numpy      template <class T, class Mi>      typename __combined<T, Mi>::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/contrib/python/pythran/pythran/pythonic/include/numpy/complex.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/complex.hpp index 5d14999e4dd..a44cacddef7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/complex.hpp +++ b/contrib/python/pythran/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<double>;  #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/complex128.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/complex128.hpp index 04c240b9b5f..cc7a4730131 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/complex128.hpp +++ b/contrib/python/pythran/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<double> complex128();      template <class V>      std::complex<double> 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<double>;  #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/complex256.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/complex256.hpp index d92e057a2f1..caed53d6376 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/complex256.hpp +++ b/contrib/python/pythran/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<long double> complex256();      template <class V>      std::complex<long double> 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<long double>;  #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/complex64.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/complex64.hpp index 623a84e288f..f09026f40d7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/complex64.hpp +++ b/contrib/python/pythran/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<float> complex64(V v);      template <class T>      std::complex<float> complex64(std::complex<T> 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<float>;  #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/concatenate.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/concatenate.hpp index 8ce663f0bf2..a5033900ecf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/concatenate.hpp +++ b/contrib/python/pythran/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 <class E, size_t M, class V> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    concatenate(types::array_base<E, M, V> const &args, long axis = 0);    template <class... Types>    auto concatenate(std::tuple<Types...> const &args, long axis = 0)        -> types::ndarray<            typename __combined<typename std::decay<Types>::type::dtype...>::type, -          types::array< +          types::array_tuple<                long, std::tuple_element<0, std::tuple<Types...>>::type::value>>;    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    concatenate(types::list<E> const &args, long axis = 0);    DEFINE_FUNCTOR(pythonic::numpy, concatenate); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/conj.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/conj.hpp index c4ecc6a883d..79954543b6e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/conj.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/conjugate.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/conjugate.hpp index 686cd1fd27a..442d2ccb08d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/conjugate.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/convolve.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/convolve.hpp index b87fa07d51d..dd63f4ec2d9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/convolve.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/copy.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/copy.hpp index 891b562bd2c..952f0407354 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/copy.hpp +++ b/contrib/python/pythran/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 <class E>    typename std::enable_if<        !types::is_array<E>::value && !types::is_dtype<E>::value, -      types::ndarray<typename E::dtype, types::array<long, E::value>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value>>>::type    copy(E const &v);    // scalar / complex case @@ -37,7 +38,7 @@ namespace numpy    copy(types::numpy_texpr<types::ndarray<T, pS>> const &a);    DEFINE_FUNCTOR(pythonic::numpy, copy); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/copysign.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/copysign.hpp index bafe162931c..33dcbbfa801 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/copysign.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/copyto.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/copyto.hpp index 2fefe9470c1..07854fec2e5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/copyto.hpp +++ b/contrib/python/pythran/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<T, pS> &&out, E const &expr);    template <class T, class pS, class E> -  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &out, E const &expr); +  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &out, +                          E const &expr);    template <class T, class pS, class E> -  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &&out, E const &expr); +  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &&out, +                          E const &expr);    // pythran extensions    template <class E, class F> -  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/contrib/python/pythran/pythran/pythonic/include/numpy/correlate.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/correlate.hpp index 8a33eec0ade..6e6216b78a4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/correlate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/cos.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cos.hpp index aae84e4d5c5..c19969a39e7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cos.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/cosh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cosh.hpp index d028a6a12a3..9b369f625ff 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cosh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/count_nonzero.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/count_nonzero.hpp index 748511e8080..3a140881bf2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/count_nonzero.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/cross.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cross.hpp index 3f12a70544e..139d0874a65 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cross.hpp +++ b/contrib/python/pythran/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 <class E, class F>    types::ndarray<        typename __combined<typename E::dtype, typename F::dtype>::type, -      types::array<long, E::value>> +      types::array_tuple<long, E::value>>    cross(E const &e, F const &f);    DEFINE_FUNCTOR(pythonic::numpy, cross); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp index d804c6d958f..c6184dc998a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ctypeslib/as_array.hpp @@ -17,8 +17,8 @@ namespace numpy      template <class T>      types::ndarray<T, types::pshape<long>> as_array(types::pointer<T>, long);      DEFINE_FUNCTOR(pythonic::numpy::ctypeslib, as_array); -  } -} +  } // namespace ctypeslib +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/cumprod.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cumprod.hpp index a3bbd2cf98d..b2e3b583547 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cumprod.hpp +++ b/contrib/python/pythran/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 <class E, class... Opts> -  auto cumprod(E &&e, Opts &&... opts) +  auto cumprod(E &&e, Opts &&...opts)        -> decltype(partial_sum<operator_::functor::imul>(            std::forward<E>(e), std::forward<Opts>(opts)...));    NUMPY_EXPR_TO_NDARRAY0_DECL(cumprod);    DEFINE_FUNCTOR(pythonic::numpy, cumprod); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/cumsum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/cumsum.hpp index 8f16278a4a0..cd37a1e657b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/cumsum.hpp +++ b/contrib/python/pythran/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 <class E, class... Opts> -  auto cumsum(E &&e, Opts &&... opts) +  auto cumsum(E &&e, Opts &&...opts)        -> decltype(partial_sum<operator_::functor::add>(            std::forward<E>(e), std::forward<Opts>(opts)...));    DEFINE_FUNCTOR(pythonic::numpy, cumsum); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/deg2rad.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/deg2rad.hpp index b104663b38f..cf040a3c539 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/deg2rad.hpp +++ b/contrib/python/pythran/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 <class T> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/degrees.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/degrees.hpp index 2e2edb275fe..f74dcd8c95e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/degrees.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/delete_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/delete_.hpp index ebdbd409df4..d8cc67c48d8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/delete_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/diag.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/diag.hpp index 3f4e20f836d..c0813ccc99c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/diag.hpp +++ b/contrib/python/pythran/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 <class T, class pS>    typename std::enable_if<std::tuple_size<pS>::value == 1, -                          types::ndarray<T, types::array<long, 2>>>::type +                          types::ndarray<T, types::array_tuple<long, 2>>>::type    diag(types::ndarray<T, pS> const &a, long k = 0);    template <class T> -  auto diag(types::list<T> const &a, long k = 0) -      -> decltype(diag(asarray(a), k)); +  auto diag(types::list<T> 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/contrib/python/pythran/pythran/pythonic/include/numpy/diff.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/diff.hpp index 2498aa53198..9b610f3a86b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/diff.hpp +++ b/contrib/python/pythran/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 <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    diff(E const &expr, long n = 1, long axis = -1);    DEFINE_FUNCTOR(pythonic::numpy, diff); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/digitize.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/digitize.hpp index 08ff40a6dd1..ebf182a5a80 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/digitize.hpp +++ b/contrib/python/pythran/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<long, types::pshape<long>> digitize(E const &expr, F const &b);    DEFINE_FUNCTOR(pythonic::numpy, digitize); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/divide.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/divide.hpp index 4b296246f57..b25972fcb8f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/dot.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/dot.hpp index a8dc8089a82..1d7b2a2576a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/dot.hpp +++ b/contrib/python/pythran/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" @@ -28,13 +28,19 @@ struct is_strided {  template <class E>  struct is_blas_array { -  // FIXME: also support gexpr with stride?    static constexpr bool value =        pythonic::types::is_array<E>::value && -      is_blas_type<pythonic::types::dtype_of<E>>::value && +      is_blas_type<typename pythonic::types::dtype_of<E>::type>::value &&        !is_strided<E>::value;  }; +template <class E> +struct is_blas_expr { +  static constexpr bool value = +      pythonic::types::is_array<E>::value && +      is_blas_type<typename pythonic::types::dtype_of<E>::type>::value; +}; +  PYTHONIC_NS_BEGIN  namespace numpy @@ -50,7 +56,7 @@ namespace numpy    typename std::enable_if<        types::is_numexpr_arg<E>::value && types::is_numexpr_arg<F>::value &&            E::value == 1 && F::value == 1 && -          (!is_blas_array<E>::value || !is_blas_array<F>::value || +          (!is_blas_expr<E>::value || !is_blas_expr<F>::value ||             !std::is_same<typename E::dtype, typename F::dtype>::value),        typename __combined<typename E::dtype, typename F::dtype>::type>::type    dot(E const &e, F const &f); @@ -91,6 +97,46 @@ namespace numpy        std::complex<double>>::type    dot(E const &e, F const &f); +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, float>::value && +          std::is_same<typename F::dtype, float>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      float>::type +  dot(E const &e, F const &f); + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, double>::value && +          std::is_same<typename F::dtype, double>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      double>::type +  dot(E const &e, F const &f); + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, std::complex<float>>::value && +          std::is_same<typename F::dtype, std::complex<float>>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      std::complex<float>>::type +  dot(E const &e, F const &f); + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, std::complex<double>>::value && +          std::is_same<typename F::dtype, std::complex<double>>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      std::complex<double>>::type +  dot(E const &e, F const &f); +    /// Matrix / Vector multiplication    // We transpose the matrix to reflect our C order @@ -136,8 +182,7 @@ namespace numpy            is_blas_type<typename E::dtype>::value &&            is_blas_type<typename F::dtype>::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<typename E::dtype, typename F::dtype>::type,            types::pshape<long>>>::type @@ -154,8 +199,7 @@ namespace numpy            is_blas_type<typename E::dtype>::value &&            is_blas_type<typename F::dtype>::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<typename E::dtype, typename F::dtype>::type,            types::pshape<long>>>::type @@ -195,7 +239,7 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::ndarray<E, pS0> const &a, types::ndarray<E, pS1> const &b);    template <class E, class pS0, class pS1, class pS2> @@ -211,21 +255,21 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::numpy_texpr<types::ndarray<E, pS0>> const &a,        types::ndarray<E, pS1> const &b);    template <class E, class pS0, class pS1>    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::ndarray<E, pS0> const &a,        types::numpy_texpr<types::ndarray<E, pS1>> const &b);    template <class E, class pS0, class pS1>    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::numpy_texpr<types::ndarray<E, pS0>> const &a,        types::numpy_texpr<types::ndarray<E, pS1>> const &b); @@ -240,11 +284,10 @@ namespace numpy            is_blas_type<typename E::dtype>::value &&            is_blas_type<typename F::dtype>::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<typename E::dtype, typename F::dtype>::type, -          types::array<long, 2>>>::type +          types::array_tuple<long, 2>>>::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 +299,7 @@ namespace numpy            E::value == 2 && F::value == 2, // And it is matrix / matrix        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, 2>>>::type +          types::array_tuple<long, 2>>>::type    dot(E const &e, F const &f);    // N x M where N >= 3 and M == 1 @@ -265,7 +308,7 @@ namespace numpy        (E::value >= 3 && F::value == 1),        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, E::value - 1>>>::type +          types::array_tuple<long, E::value - 1>>>::type    dot(E const &e, F const &f);    // N x M where N >= 3 and M >= 2 @@ -274,11 +317,11 @@ namespace numpy        (E::value >= 3 && F::value >= 2),        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, E::value - 1>>>::type +          types::array_tuple<long, E::value - 1>>>::type    dot(E const &e, F const &f);    DEFINE_FUNCTOR(pythonic::numpy, dot); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/double_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/double_.hpp index 3fd626d6e86..4a1ddca092c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/double_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/dtype/type.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/dtype/type.hpp index 004d17dee5f..20afbad814a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/dtype/type.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/dtype/type.hpp @@ -10,8 +10,8 @@ namespace numpy      template <class T, class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/ediff1d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ediff1d.hpp index 07c653f58bd..7431b333839 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ediff1d.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ediff1d.hpp @@ -14,7 +14,7 @@ namespace numpy    auto ediff1d(types::list<E> const &expr) -> decltype(ediff1d(asarray(expr)));    DEFINE_FUNCTOR(pythonic::numpy, ediff1d); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/empty.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/empty.hpp index 38546b20601..77047e4c998 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/empty.hpp +++ b/contrib/python/pythran/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 <class dtype = functor::float64> -  typename dtype::type -  empty(types::pshape<> const &shape, dtype d = dtype()); +  typename dtype::type empty(types::pshape<> const &shape, dtype d = dtype());    template <class pS, class dtype = functor::float64>    types::ndarray<typename dtype::type, sutils::shape_t<pS>> @@ -27,7 +26,7 @@ namespace numpy    empty(std::integral_constant<long, N>, dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, empty); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/empty_like.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/empty_like.hpp index 42d82b80da0..28baea1b086 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/empty_like.hpp +++ b/contrib/python/pythran/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<typename E::dtype>()));    DEFINE_FUNCTOR(pythonic::numpy, empty_like) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/equal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/equal.hpp index 8057acad764..99066bc844b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/exp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/exp.hpp index 215a81e018d..ff78511a8b5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/exp.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/expand_dims.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/expand_dims.hpp index c549b6cfe0d..7ab322f6de6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/expand_dims.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/expand_dims.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <typename T> -  types::ndarray<typename T::dtype, types::array<long, T::value + 1>> +  types::ndarray<typename T::dtype, types::array_tuple<long, T::value + 1>>    expand_dims(T const &input, int axis);    DEFINE_FUNCTOR(pythonic::numpy, expand_dims); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/expm1.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/expm1.hpp index c755bc6460b..a4bddf64ee8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/expm1.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/eye.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/eye.hpp index 54da451b1b1..62033463c1c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/eye.hpp +++ b/contrib/python/pythran/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 <class dtype = functor::float64> -  types::ndarray<typename dtype::type, types::array<long, 2>> +  types::ndarray<typename dtype::type, types::array_tuple<long, 2>>    eye(long N, long M, long k = 0, dtype d = dtype());    template <class dtype = functor::float64> -  types::ndarray<typename dtype::type, types::array<long, 2>> +  types::ndarray<typename dtype::type, types::array_tuple<long, 2>>    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/contrib/python/pythran/pythran/pythonic/include/numpy/fabs.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fabs.hpp index 64d6b4c49b2..e43839bc5cc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fabs.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/c2c.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/c2c.hpp index 50efdbe4a59..9ea27559aee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/c2c.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<std::complex<T>, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      c2c(types::ndarray<std::complex<T>, 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fft.hpp index faa4b0488ab..512ac55d8e7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fft.hpp +++ b/contrib/python/pythran/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 <class T, class pS, class N = types::none_type, class Norm = types::none_type> +    template <class T, class pS, class N = types::none_type, +              class Norm = types::none_type>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &a, N const & n = {}, long axis = -1, +        types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> const &a, N const &n = {}, long axis = -1,          Norm const &norm = {}); -    template <class T, class pS, class N = types::none_type, class Norm = types::none_type> +    template <class T, class pS, class N = types::none_type, +              class Norm = types::none_type>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &a, N const & n = {}, long axis = -1, +                   types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> const &a, N const &n = {}, long axis = -1,          Norm const &norm = {}); -    template <class T, class pS, class N = types::none_type, class Norm = types::none_type> +    template <class T, class pS, class N = types::none_type, +              class Norm = types::none_type>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &a, N const & n = {}, long axis = -1, +                   types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fftn.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fftn.hpp index c4c3561caff..8f7d78b17bc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fftn.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/fftn.hpp @@ -15,7 +15,7 @@ namespace numpy                class Norm = types::none_type>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> 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<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> 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<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> 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<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> 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<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> 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<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> const &s,           Axes const &axes = {}, Norm const &norm = {}); diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/hfft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/hfft.hpp index 38b06fd511f..6337bd991f5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/hfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &a, long n = -1,           long axis = -1, types::str const &norm = {});      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &a, types::none_type n,           long axis, types::str const &norm);      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, 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<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {}); @@ -59,7 +59,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm); @@ -68,7 +68,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm); @@ -77,14 +77,14 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ifft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ifft.hpp index 24f6bfa88cd..cb15442fd77 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ifft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {});      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm);      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, types::none_type n, long axis = -1,           types::none_type norm = types::none_type{});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, types::none_type n, long axis = -1,           types::none_type norm = types::none_type{});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ihfft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ihfft.hpp index 6512191907f..e1e2af123da 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/ihfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,            types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,            types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, long n, long axis,            types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, types::none_type n, long axis = -1,            types::none_type norm = types::none_type{});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,            types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,            types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &a, long n, long axis,            types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/irfft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/irfft.hpp index 2ec0ac26b3b..b10c977bdee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/irfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &a, long n = -1,            long axis = -1, types::str const &norm = {});      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &a, types::none_type n,            long axis, types::str const &norm);      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &a, long n, long axis,            types::none_type norm);      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, 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<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,            types::str const &norm = {}); @@ -59,7 +59,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,            types::str const &norm); @@ -68,7 +68,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &a, long n, long axis,            types::none_type norm); @@ -77,14 +77,14 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fft/rfft.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fft/rfft.hpp index 2125ab17644..e8b410ff425 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fft/rfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, types::none_type n, long axis = -1,           types::none_type norm = types::none_type{});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, long n = -1, long axis = -1,           types::str const &norm = {});      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, types::none_type n, long axis,           types::str const &norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &a, long n, long axis,           types::none_type norm);      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/fill_diagonal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fill_diagonal.hpp index 94617bd027f..ef8a05cf98b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fill_diagonal.hpp +++ b/contrib/python/pythran/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<E>::type::dtype);    DEFINE_FUNCTOR(pythonic::numpy, fill_diagonal) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/finfo.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/finfo.hpp index 9bde7525406..93122dc2260 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/finfo.hpp +++ b/contrib/python/pythran/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<typename dtype::type> finfo(dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, finfo) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/fix.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fix.hpp index 2708930d6c8..e4a85a5049a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fix.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/fix.hpp @@ -1,18 +1,29 @@  #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  namespace numpy  { +  namespace wrapper +  { +    template <class E> +    E fix(E const &e) +    { +      if (std::is_integral<E>::value) +        return e; +      else +        return std::trunc(e); +    } +  } // namespace wrapper  #define NUMPY_NARY_FUNC_NAME fix -#define NUMPY_NARY_FUNC_SYM std::trunc +#define NUMPY_NARY_FUNC_SYM wrapper::fix  #include "pythonic/include/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/flatnonzero.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/flatnonzero.hpp index a592be1df38..9b48111f261 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/flatnonzero.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/flatnonzero.hpp @@ -11,7 +11,7 @@ namespace numpy    types::ndarray<long, types::pshape<long>> flatnonzero(E const &expr);    DEFINE_FUNCTOR(pythonic::numpy, flatnonzero); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/flip.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/flip.hpp index cc22afce5af..ab2705cf0d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/flip.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/flip.hpp @@ -12,8 +12,8 @@ namespace numpy    namespace details    {      template <class E, class S, size_t... I> -    auto flip(E const &expr, S const &slices, utils::index_sequence<I...>) -        -> decltype(expr(slices[I]...)); +    auto flip(E const &expr, S const &slices, +              utils::index_sequence<I...>) -> decltype(expr(slices[I]...));    }    template <class E> @@ -22,7 +22,7 @@ namespace numpy                                  utils::make_index_sequence<E::value>{}));    DEFINE_FUNCTOR(pythonic::numpy, flip); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/fliplr.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fliplr.hpp index c2738a93e88..605d2677ac0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fliplr.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/fliplr.hpp @@ -9,9 +9,10 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E> -  auto fliplr(E &&expr) -> decltype(std::forward<E>(expr)( -      types::cstride_slice<1>{builtins::None, builtins::None}, -      types::slice{builtins::None, builtins::None, -1})); +  auto +  fliplr(E &&expr) -> decltype(std::forward<E>(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/contrib/python/pythran/pythran/pythonic/include/numpy/flipud.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/flipud.hpp index e02b76b4346..a4b5f241a6a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/flipud.hpp +++ b/contrib/python/pythran/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 <class E> -  auto flipud(E &&expr) -> decltype( -      std::forward<E>(expr)[types::slice{builtins::None, builtins::None, -1}]); +  auto +  flipud(E &&expr) -> decltype(std::forward<E>( +                       expr)[types::slice{builtins::None, builtins::None, -1}]);    DEFINE_FUNCTOR(pythonic::numpy, flipud); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/float128.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/float128.hpp index d1638ca45fc..a0051f56bc4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/float128.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/float32.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/float32.hpp index efb10431bca..a88b5b3d883 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/float32.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/float64.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/float64.hpp index 8b5a7b5ebc7..0494e3303e3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/float64.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/float_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/float_.hpp index ed470a24c37..b4e25d97ad5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/float_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/floor.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/floor.hpp index 8e3bec5dbe6..ba8cc1eadd4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/floor.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/floor_divide.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/floor_divide.hpp index 8a9df6d4d41..85de7c53122 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/floor_divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fmod.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fmod.hpp index a7b3732c2fa..e3d17ff2283 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fmod.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/frexp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/frexp.hpp index 6a894806026..e9a2b202afc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/frexp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fromfile.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fromfile.hpp index 62498964bdb..4352d16ba43 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fromfile.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fromfunction.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fromfunction.hpp index c4068d8a7fb..ade065d1469 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fromfunction.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fromiter.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fromiter.hpp index 3c6009a2db4..077c4de534c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fromiter.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/fromstring.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/fromstring.hpp index 38aeab73f38..545a053b170 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/fromstring.hpp +++ b/contrib/python/pythran/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 <limits>  #include <sstream> @@ -20,7 +20,7 @@ namespace numpy               types::str const &sep = {});    DEFINE_FUNCTOR(pythonic::numpy, fromstring); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/full.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/full.hpp index 18deb0cb575..4c945f6dfb0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/full.hpp +++ b/contrib/python/pythran/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<long, N>, F fill_value, types::none_type _ = {});    DEFINE_FUNCTOR(pythonic::numpy, full); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/full_like.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/full_like.hpp index 0c57174ed2f..61cac42cf13 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/full_like.hpp +++ b/contrib/python/pythran/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<typename E::dtype>()));    DEFINE_FUNCTOR(pythonic::numpy, full_like) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/greater.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/greater.hpp index e04f675ddac..fca6d154795 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/greater.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/greater_equal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/greater_equal.hpp index 7ab0b317457..a0082017742 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/greater_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/heaviside.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/heaviside.hpp index 1b7594b7f64..b1f749515f3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/heaviside.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/hstack.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/hstack.hpp index 05ea492a4a1..13caae7529b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/hstack.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/hstack.hpp @@ -13,7 +13,7 @@ namespace numpy        -> decltype(concatenate(std::forward<ArraySequence>(seq), 1));    DEFINE_FUNCTOR(pythonic::numpy, hstack); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/hypot.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/hypot.hpp index 1f98eb076fd..e318465c205 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/hypot.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/identity.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/identity.hpp index c506c11569d..fb12e68022a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/identity.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/imag.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/imag.hpp index 93c772a1edc..086b3b6f802 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/imag.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/indices.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/indices.hpp index 4fd613a66db..544d96760ee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/indices.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/insert.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/insert.hpp index af748c18d47..5b8b94363fa 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/insert.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/int16.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/int16.hpp index b4c5361e3f5..fa3e9f34bb0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/int16.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/int32.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/int32.hpp index 6e41d388f3f..5bc35e04d6d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/int32.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/int64.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/int64.hpp index 7a68ef324b4..5e0bca6ed55 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/int64.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/int8.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/int8.hpp index 9e8c5b643e9..9021c0972ad 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/int8.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/int_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/int_.hpp index 57df3fe4b9c..efc448dc794 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/int_.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/intc.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/intc.hpp index 0293dc392b6..a340dee7e69 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/intc.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/intersect1d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/intersect1d.hpp index 9888a45a489..e07cb2c91bd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/intersect1d.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/intp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/intp.hpp index d5ccb27c5a2..bfaf84eb9dc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/intp.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/invert.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/invert.hpp index eb1c8bc3fe1..82ccfea6d3d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/invert.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/isclose.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isclose.hpp index 1cdcc438a57..922f1c64591 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isclose.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/iscomplex.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/iscomplex.hpp index f9fa2ca249f..c64d8170dc9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/iscomplex.hpp +++ b/contrib/python/pythran/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 <class I>      constexpr typename std::enable_if<!types::is_complex<I>::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/contrib/python/pythran/pythran/pythonic/include/numpy/isfinite.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isfinite.hpp index e0f5e87f70a..52c4467f8db 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isfinite.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/isinf.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isinf.hpp index 138f6a5cf24..6d23fa0b41b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isinf.hpp +++ b/contrib/python/pythran/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 <class T>      bool isinf(std::complex<T> 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/contrib/python/pythran/pythran/pythonic/include/numpy/isnan.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isnan.hpp index 4648d1b01f1..d471777df7d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isnan.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/isnan.hpp @@ -14,19 +14,21 @@ namespace numpy      template <class T>      bool isnan(std::complex<T> const &v);      template <class T> -    auto isnan(T const &v) -> typename std::enable_if< -        std::is_floating_point<typename std::decay<T>::type>::value, -        bool>::type; +    auto isnan(T const &v) -> +        typename std::enable_if< +            std::is_floating_point<typename std::decay<T>::type>::value, +            bool>::type;      template <class T> -    auto isnan(T const &v) -> typename std::enable_if< -        !std::is_floating_point<typename std::decay<T>::type>::value, -        bool>::type; -  } +    auto isnan(T const &v) -> +        typename std::enable_if< +            !std::is_floating_point<typename std::decay<T>::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/contrib/python/pythran/pythran/pythonic/include/numpy/isneginf.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isneginf.hpp index 6e0dc821a0b..8a21a2d4e5e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isneginf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/isposinf.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isposinf.hpp index a6ee98e41cf..d7167946bfb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isposinf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/isreal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isreal.hpp index f00ee32af2c..a43a129b4c2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isreal.hpp +++ b/contrib/python/pythran/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 <class I>      typename std::enable_if<!types::is_complex<I>::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/contrib/python/pythran/pythran/pythonic/include/numpy/isrealobj.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isrealobj.hpp index 2f131e7b8a1..0d9abf0f520 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isrealobj.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/isscalar.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/isscalar.hpp index a863c041dad..e63e134022d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/isscalar.hpp +++ b/contrib/python/pythran/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 <type_traits> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/issctype.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/issctype.hpp index bf552fb55ca..e38e2647534 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/issctype.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ldexp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ldexp.hpp index 7d46b5aff38..e7af0bc2c57 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ldexp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/left_shift.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/left_shift.hpp index 7a4cd6decc6..9071066ddaf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/left_shift.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/less.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/less.hpp index d7980a67ded..096be659d23 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/less.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/less_equal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/less_equal.hpp index 77f792b4c71..135782bf157 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/less_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/lexsort.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/lexsort.hpp index 5a6478d8f8e..5f5ef6db251 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/lexsort.hpp +++ b/contrib/python/pythran/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<long, types::pshape<long>> lexsort(pS const &keys);    DEFINE_FUNCTOR(pythonic::numpy, lexsort) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/matrix_power.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/matrix_power.hpp index 4e00e257363..adb1af5d9c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/matrix_power.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/matrix_power.hpp @@ -9,12 +9,12 @@ namespace numpy    namespace linalg    {      template <class E> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/norm.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/norm.hpp index 8918ba5de62..42ab8dcaa01 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/linalg/norm.hpp +++ b/contrib/python/pythran/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 <class Array>      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>(array))))); @@ -28,9 +28,9 @@ namespace numpy      template <class Array>      using norm_t = typename std::conditional<          std::decay<Array>::type::value == 1, norm_dtype_t<Array>, -        types::ndarray< -            norm_dtype_t<Array>, -            types::array<long, std::decay<Array>::type::value - 1>>>::type; +        types::ndarray<norm_dtype_t<Array>, +                       types::array_tuple<long, std::decay<Array>::type::value - +                                                    1>>>::type;      template <class Array>      norm_t<Array> norm(Array &&array, double ord, types::none_type axis = {}); @@ -42,13 +42,15 @@ namespace numpy      norm_t<Array> norm(Array &&array, double ord, long axis);      template <class Array> -    norm_t<Array> norm(Array &&array, double ord, types::array<long, 1> axis); +    norm_t<Array> norm(Array &&array, double ord, +                       types::array_tuple<long, 1> axis);      template <class Array> -    norm_t<Array> norm(Array &&array, double ord, types::array<long, 2> axis); +    norm_t<Array> norm(Array &&array, double ord, +                       types::array_tuple<long, 2> axis);      DEFINE_FUNCTOR(pythonic::numpy::linalg, norm); -  } -} +  } // namespace linalg +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/linspace.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/linspace.hpp index 090649d85a7..71d009c457d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/linspace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/log.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/log.hpp index f9ef70567d6..07562a4e147 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/log.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/log10.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/log10.hpp index 53edf98c8e0..c5b3f5eb72c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/log10.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/log1p.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/log1p.hpp index d294932cba9..e27c46df161 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/log1p.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/log2.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/log2.hpp index b30b3c7ad4e..a0997833728 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/log2.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp.hpp index 9403527921d..333d5f45a64 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp2.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp2.hpp index b3dbcacd79a..9fafebe1c72 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logaddexp2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/logical_and.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logical_and.hpp index bad0cefd0a4..d509f71f6e3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logical_and.hpp +++ b/contrib/python/pythran/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 <class T0, class T1> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/logical_not.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logical_not.hpp index 3307bb858b1..3d83196980e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logical_not.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/logical_or.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logical_or.hpp index 5a91098fe95..f274b853395 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logical_or.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/logical_xor.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logical_xor.hpp index f7ad2abf81f..1075eaef8b4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logical_xor.hpp +++ b/contrib/python/pythran/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 <class T0, class T1> -    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 <class T0, class T1>      bool logical_xor(std::complex<T0> const &t0, std::complex<T1> 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/contrib/python/pythran/pythran/pythonic/include/numpy/logspace.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/logspace.hpp index cc7b5c5963a..478e497a92d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/logspace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/longlong.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/longlong.hpp index cde5bf455f3..393a0658f56 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/longlong.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/max.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/max.hpp index c1c212c59a2..3120f92c94a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/max.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/max.hpp @@ -10,11 +10,11 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class... Args> -  auto max(Args &&... args) -> decltype( -      reduce<operator_::functor::imax>(std::forward<Args>(args)...)); +  auto max(Args &&...args) -> decltype(reduce<operator_::functor::imax>( +                               std::forward<Args>(args)...));    DEFINE_FUNCTOR(pythonic::numpy, max); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/maximum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/maximum.hpp index e8dfc8545f8..d13fcd5d6c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/maximum.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/mean.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/mean.hpp index 9028bc0e731..0aa0e9a5b9e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/mean.hpp +++ b/contrib/python/pythran/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 <class dtype>      using dtype_or_double = typename dtype_or_double_helper<dtype>::type; -  } +  } // namespace details    template <class E, class dtype = types::none_type>    auto mean(E const &expr, types::none_type axis = {}, dtype d = {}, @@ -43,8 +43,8 @@ namespace numpy    template <class E, class dtype = types::none_type>    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 <class E, class dtype>    types::ndarray<details::dtype_or_double<dtype>, @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/median.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/median.hpp index 7abd73ec04c..af1f229a871 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/median.hpp +++ b/contrib/python/pythran/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 <algorithm>  PYTHONIC_NS_BEGIN @@ -17,8 +17,9 @@ namespace numpy    template <class T, class pS>    typename std::enable_if<        std::tuple_size<pS>::value != 1, -      types::ndarray<decltype(std::declval<T>() + 1.), -                     types::array<long, std::tuple_size<pS>::value - 1>>>::type +      types::ndarray< +          decltype(std::declval<T>() + 1.), +          types::array_tuple<long, std::tuple_size<pS>::value - 1>>>::type    median(types::ndarray<T, pS> const &arr, long axis);    template <class T, class pS> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/min.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/min.hpp index db6734550ae..4e5137d9f19 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/min.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/min.hpp @@ -11,11 +11,11 @@ namespace numpy  {    template <class... Args> -  auto min(Args &&... args) -> decltype( -      reduce<operator_::functor::imin>(std::forward<Args>(args)...)); +  auto min(Args &&...args) -> decltype(reduce<operator_::functor::imin>( +                               std::forward<Args>(args)...));    DEFINE_FUNCTOR(pythonic::numpy, min); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/minimum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/minimum.hpp index 9611f20a5a3..ba6e58a5b91 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/minimum.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/mod.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/mod.hpp index 247c3dcec51..72f1587c572 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/mod.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/multiply.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/multiply.hpp index dd0803a20e9..7234ace92bd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/multiply.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nan_to_num.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nan_to_num.hpp index fd14db8bd23..3ee762ced09 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nan_to_num.hpp +++ b/contrib/python/pythran/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 <limits> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmax.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmax.hpp index 8815b77847d..8611ee187c2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmax.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmin.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmin.hpp index dba681ce9b4..d1ff19d6292 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nanargmin.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nanmax.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nanmax.hpp index 542f6b03282..f3259f8ff21 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nanmax.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nanmin.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nanmin.hpp index 82853a94b84..ae970b35637 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nanmin.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nansum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nansum.hpp index b47f54fa9cc..d3d0ff7b96d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nansum.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray.hpp index 655f0b1f13e..293b0467a24 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray.hpp +++ b/contrib/python/pythran/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<long, N>, dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, ndarray); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/astype.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/astype.hpp index 2cdde10c734..22fc0e4fce0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/astype.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/astype.hpp @@ -14,8 +14,8 @@ namespace numpy      auto astype(E &&e, dtype d) -> decltype(asarray(std::forward<E>(e), d));      DEFINE_FUNCTOR(pythonic::numpy::ndarray, astype); -  } -} +  } // namespace ndarray +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/fill.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/fill.hpp index 5f23d7ea047..3a760ac1160 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/fill.hpp +++ b/contrib/python/pythran/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<T, pS> &e, F f);      DEFINE_FUNCTOR(pythonic::numpy::ndarray, fill); -  } -} +  } // namespace ndarray +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/flatten.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/flatten.hpp index c2007186895..ab81081b71d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/flatten.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/item.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/item.hpp index aed8c4928db..2391263fb60 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/item.hpp +++ b/contrib/python/pythran/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<T, pS> const &expr, long i);      template <class E, size_t N> -    auto item(E &&expr, types::array<long, N> const &i) -> decltype(expr[i]); +    auto item(E &&expr, +              types::array_tuple<long, N> const &i) -> decltype(expr[i]);      // only for compatibility purpose, very bad impl      template <class E>      typename std::decay<E>::type::dtype item(E &&expr, long i);      DEFINE_FUNCTOR(pythonic::numpy::ndarray, item); -  } -} +  } // namespace ndarray +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/reshape.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/reshape.hpp index b1f8359ffc7..db3aad1d217 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/reshape.hpp +++ b/contrib/python/pythran/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 <class T, class pS, class S0, class S1, class... S>      auto reshape(types::ndarray<T, pS> const &expr, S0 i0, S1 i1, -                 S const &... indices) +                 S const &...indices)          -> decltype(reshape(expr,                              types::pshape<S0, S1, S...>{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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/sort.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/sort.hpp index a7ada510a2b..191fe06375b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/sort.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tofile.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tofile.hpp index 8e379c504ea..e0a38b7afd5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tofile.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tolist.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tolist.hpp index 05b82e79193..e45630bb2e0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tolist.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tostring.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tostring.hpp index 302b74012be..8e126ef1cc4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndarray/tostring.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndenumerate.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndenumerate.hpp index 74fb322f5bb..18d78f2ef5f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndenumerate.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ndenumerate.hpp @@ -11,7 +11,7 @@ namespace numpy    struct ndenumerate_iterator        : std::iterator<              std::random_access_iterator_tag, -            std::tuple<types::array<long, E::value>, typename E::dtype>> { +            std::tuple<types::array_tuple<long, E::value>, 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<types::array<long, E::value>, typename E::dtype> +    std::tuple<types::array_tuple<long, E::value>, 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/contrib/python/pythran/pythran/pythonic/include/numpy/ndim.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndim.hpp index 18aaf4cf176..163e7470bb2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndim.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ndindex.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ndindex.hpp index ccc4dab5cf6..387665cdbf9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ndindex.hpp +++ b/contrib/python/pythran/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 <numeric> @@ -13,15 +13,15 @@ namespace numpy    template <size_t N>    struct ndindex_iterator        : std::iterator< -            std::random_access_iterator_tag, types::array<long, N>, ptrdiff_t, -            types::array<long, N> *, -            types::array<long, -                         N> /* reference_type, but no reference is possible*/> { +            std::random_access_iterator_tag, types::array_tuple<long, N>, +            ptrdiff_t, types::array_tuple<long, N> *, +            types::array_tuple< +                long, N> /* reference_type, but no reference is possible*/> {      long index; -    types::array<long, N> shape; +    types::array_tuple<long, N> shape;      ndindex_iterator(); -    ndindex_iterator(types::array<long, N> const &shape, long first); -    types::array<long, N> operator*() const; +    ndindex_iterator(types::array_tuple<long, N> const &shape, long first); +    types::array_tuple<long, N> operator*() const;      ndindex_iterator &operator++();      ndindex_iterator &operator+=(long n);      bool operator!=(ndindex_iterator const &other) const; @@ -32,11 +32,11 @@ namespace numpy    template <size_t N>    struct _ndindex : ndindex_iterator<N> {      using iterator = ndindex_iterator<N>; -    types::array<long, N> shape; +    types::array_tuple<long, N> shape;      iterator end_iter;      _ndindex(); -    _ndindex(types::array<long, N> const &shape); +    _ndindex(types::array_tuple<long, N> const &shape);      iterator &begin();      iterator const &begin() const;      iterator end() const; @@ -46,13 +46,13 @@ namespace numpy    _ndindex<sizeof...(Types)> ndindex(Types... args);    template <size_t N> -  _ndindex<N> ndindex(types::array<long, N> const &args); +  _ndindex<N> ndindex(types::array_tuple<long, N> const &args);    template <class... Tys>    _ndindex<sizeof...(Tys)> ndindex(types::pshape<Tys...> const &args);    DEFINE_FUNCTOR(pythonic::numpy, ndindex); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/negative.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/negative.hpp index 26e1f9809ac..8b659ac2356 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/negative.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nextafter.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nextafter.hpp index 4ecf25f5a5d..451c85fb1eb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nextafter.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/nonzero.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/nonzero.hpp index 15751d10298..add55d20ea8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/nonzero.hpp +++ b/contrib/python/pythran/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 <class E>    auto nonzero(E const &expr) -      -> types::array<types::ndarray<long, types::array<long, 1>>, E::value>; +      -> types::array_tuple<types::ndarray<long, types::array_tuple<long, 1>>, +                            E::value>;    DEFINE_FUNCTOR(pythonic::numpy, nonzero) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/not_equal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/not_equal.hpp index 8c7fc9a007e..5cc374625d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/not_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ones.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ones.hpp index a4e6f69fa8e..8ce8d3f505a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ones.hpp +++ b/contrib/python/pythran/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 <class dtype = functor::float64> -  typename dtype::type -  ones(std::tuple<> const &shape, dtype d = dtype()); +  typename dtype::type ones(std::tuple<> const &shape, dtype d = dtype());    template <class pS, class dtype = functor::float64>    types::ndarray<typename dtype::type, sutils::shape_t<pS>> @@ -28,7 +27,7 @@ namespace numpy    ones(std::integral_constant<long, N>, dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, ones); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ones_like.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ones_like.hpp index 7212aeeeaa7..784b017d7e3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ones_like.hpp +++ b/contrib/python/pythran/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<typename E::dtype>()));    DEFINE_FUNCTOR(pythonic::numpy, ones_like) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/outer.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/outer.hpp index bd25e14b1ad..c125edba2e6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/outer.hpp +++ b/contrib/python/pythran/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<T0, pS0> const &a, types::ndarray<T1, pS1> const &b);    template <class T0, class pS0, class E1> -  auto outer(types::ndarray<T0, pS0> const &a, E1 const &b) -      -> decltype(outer(a, asarray(b))); +  auto outer(types::ndarray<T0, pS0> const &a, +             E1 const &b) -> decltype(outer(a, asarray(b)));    template <class E0, class T1, class pS1>    auto outer(E0 const &a, types::ndarray<T1, pS1> const &b)        -> decltype(outer(asarray(a), b));    template <class E0, class E1> -  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/contrib/python/pythran/pythran/pythonic/include/numpy/partial_sum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/partial_sum.hpp index 50267ce09d9..968ae7ee2c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/partial_sum.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/partial_sum.hpp @@ -24,15 +24,16 @@ namespace numpy    template <class Op, class E, class dtype = result_dtype<Op, E>>    using partial_sum_type = -      types::ndarray<typename dtype::type, types::array<long, E::value>>; +      types::ndarray<typename dtype::type, types::array_tuple<long, E::value>>;    template <class Op, class E, class dtype = result_dtype<Op, E>>    using partial_sum_type2 = -      types::ndarray<typename dtype::type, types::array<long, E::value - 1>>; +      types::ndarray<typename dtype::type, +                     types::array_tuple<long, E::value - 1>>;    template <class Op, class E, class dtype = result_dtype<Op, E>>    typename std::enable_if<E::value != 1, partial_sum_type<Op, E, dtype>>::type    partial_sum(E const &expr, long axis, dtype d = dtype()); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/place.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/place.hpp index c957d4b5b91..86e0094b91c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/place.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/power.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/power.hpp index d1e439f9621..18998d031c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/power.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/prod.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/prod.hpp index 3a65ecd5d52..459108a512d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/prod.hpp +++ b/contrib/python/pythran/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 <class... Args> -  auto prod(Args &&... args) -> decltype( -      reduce<operator_::functor::imul>(std::forward<Args>(args)...)); +  auto prod(Args &&...args) -> decltype(reduce<operator_::functor::imul>( +                                std::forward<Args>(args)...));    DEFINE_FUNCTOR(pythonic::numpy, prod); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ptp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ptp.hpp index 31b6d3b3278..6ee15eaaabd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ptp.hpp +++ b/contrib/python/pythran/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 <class E> -  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 <class E>    auto ptp(E const &expr) -> decltype(max(expr) - min(expr));    DEFINE_FUNCTOR(pythonic::numpy, ptp); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/put.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/put.hpp index 23f97766ca5..fad2c56efe2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/put.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/putmask.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/putmask.hpp index e66beae154e..c10c896432d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/putmask.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/rad2deg.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/rad2deg.hpp index 3a8b06880c0..f737f3c6126 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/rad2deg.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/radians.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/radians.hpp index 7cb7630d41a..a3c9252e86b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/radians.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/binomial.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/binomial.hpp index fde9a6d5c38..af628750a77 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/binomial.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/binomial.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<long, pS> binomial(double n, double p, pS const &shape);      auto binomial(double n, double p, long size) -        -> decltype(binomial(n, p, types::array<long, 1>{{size}})); +        -> decltype(binomial(n, p, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/bytes.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/bytes.hpp index 5c2122f3054..a33b1c9313d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/bytes.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/chisquare.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/chisquare.hpp index 7b23a280052..a59171d57db 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/chisquare.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/chisquare.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> chisquare(double df, pS const &shape);      auto chisquare(double df, long size) -        -> decltype(chisquare(df, types::array<long, 1>{{size}})); +        -> decltype(chisquare(df, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/choice.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/choice.hpp index f105eef0228..38234fdbe39 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/choice.hpp +++ b/contrib/python/pythran/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 <class T> -    auto choice(long max, T &&size) -        -> decltype(randint(0, max, std::forward<T>(size))); +    auto choice(long max, +                T &&size) -> decltype(randint(0, max, std::forward<T>(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/contrib/python/pythran/pythran/pythonic/include/numpy/random/dirichlet.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/dirichlet.hpp index a4de3ff1629..59f8d71c954 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/dirichlet.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/dirichlet.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> dirichlet(double alpha, pS const &shape);      auto dirichlet(double alpha, long size) -        -> decltype(dirichlet(alpha, types::array<long, 1>{{size}})); +        -> decltype(dirichlet(alpha, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/exponential.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/exponential.hpp index 14b8bd7a5ed..136efcfabc3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/exponential.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/exponential.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> exponential(double scale, pS const &shape);      auto exponential(double scale, long size) -        -> decltype(exponential(scale, types::array<long, 1>{{size}})); +        -> decltype(exponential(scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/f.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/f.hpp index fca6ba2a063..32e9ae53994 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/f.hpp +++ b/contrib/python/pythran/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 <class pS>      types::ndarray<double, pS> f(double dfnum, double dfden, pS const &shape); -    auto f(double dfnum, double dfden, long size) -        -> decltype(f(dfnum, dfden, types::array<long, 1>{{size}})); +    auto f(double dfnum, double dfden, +           long size) -> decltype(f(dfnum, dfden, +                                    types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/gamma.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/gamma.hpp index a14ad16e767..336e10eb729 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/gamma.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(gamma(shape, scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/generator.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/generator.hpp index 2c9d7b5b024..f1d07281057 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/generator.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/geometric.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/geometric.hpp index a3ab8f83f1b..a41b673a1cb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/geometric.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/geometric.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> geometric(double p, pS const &shape);      auto geometric(double p, long size) -        -> decltype(geometric(p, types::array<long, 1>{{size}})); +        -> decltype(geometric(p, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/gumbel.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/gumbel.hpp index 2f2633aa01c..0dd5481d500 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/gumbel.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(gumbel(loc, scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/laplace.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/laplace.hpp index 7e017ab3404..f0a5fab81a8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/laplace.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(laplace(loc, scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/logistic.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/logistic.hpp index c4266581bad..938ce930ca3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/logistic.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(logistic(loc, scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/lognormal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/lognormal.hpp index a1658a0885e..5c1ee965f9c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/lognormal.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(lognormal(mean, sigma, +                              types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/logseries.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/logseries.hpp index 70e013ea7b0..460902ffc97 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/logseries.hpp +++ b/contrib/python/pythran/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<double, pS> logseries(double loc, pS const &shape);      auto logseries(double loc, long size) -        -> decltype(logseries(loc, types::array<long, 1>{{size}})); +        -> decltype(logseries(loc, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/negative_binomial.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/negative_binomial.hpp index 2ee2f5b4e95..1b70ef5082b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/negative_binomial.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(negative_binomial(n, p, +                                      types::array_tuple<long, 1>{{size}}));      long negative_binomial(long n, double p, types::none_type size = {}); diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/random/normal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/normal.hpp index 0fa8994800a..bc69b5ff004 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/normal.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(normal(loc, scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/pareto.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/pareto.hpp index 0cc17e1dd74..a98eb234815 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/pareto.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/pareto.hpp @@ -16,13 +16,13 @@ namespace numpy      types::ndarray<double, pS> pareto(double a, pS const &shape);      auto pareto(double a, long size) -        -> decltype(pareto(a, types::array<long, 1>{{size}})); +        -> decltype(pareto(a, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/poisson.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/poisson.hpp index 5c55ce22c24..e9491470df3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/poisson.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/poisson.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> poisson(double lam, pS const &shape);      auto poisson(double lam, long size) -        -> decltype(poisson(lam, types::array<long, 1>{{size}})); +        -> decltype(poisson(lam, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/power.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/power.hpp index 3f9fc63ffca..f10fdc7553a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/power.hpp +++ b/contrib/python/pythran/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 <math.h>  PYTHONIC_NS_BEGIN @@ -15,13 +15,13 @@ namespace numpy      template <class pS>      types::ndarray<double, pS> power(double a, pS const &shape);      auto power(double a, long size) -        -> decltype(power(a, types::array<long, 1>{{size}})); +        -> decltype(power(a, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/rand.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/rand.hpp index 54f14c8ae67..5e10ebecc51 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/rand.hpp +++ b/contrib/python/pythran/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 <class... T> -    types::ndarray<double, types::array<long, sizeof...(T)>> rand(T... shape); +    types::ndarray<double, types::array_tuple<long, sizeof...(T)>> +    rand(T... shape);      double rand();      DEFINE_FUNCTOR(pythonic::numpy::random, rand); -  } -} +  } // namespace random +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/random/randint.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/randint.hpp index 58117b85a5b..bcc8ebbdeb2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/randint.hpp +++ b/contrib/python/pythran/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 <class pS> -    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<long, 1>{{size}})); +        -> decltype(randint(min, max, types::array_tuple<long, 1>{{size}}));      DEFINE_FUNCTOR(pythonic::numpy::random, randint); -  } -} +  } // namespace random +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/random/randn.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/randn.hpp index f33fce310b3..1a9cdd1c649 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/randn.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/randn.hpp @@ -11,13 +11,14 @@ namespace numpy    namespace random    {      template <class... T> -    types::ndarray<double, types::array<long, sizeof...(T)>> randn(T... shape); +    types::ndarray<double, types::array_tuple<long, sizeof...(T)>> +    randn(T... shape);      double randn();      DEFINE_FUNCTOR(pythonic::numpy::random, randn); -  } -} +  } // namespace random +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/random/random.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/random.hpp index faaaceaa1f9..084c57b6843 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/random.hpp +++ b/contrib/python/pythran/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 <class pS>      types::ndarray<double, pS> random(pS const &shape); -    auto random(long size) -> decltype(random(types::array<long, 1>{{size}})); +    auto +    random(long size) -> decltype(random(types::array_tuple<long, 1>{{size}}));      template <long N>      auto random(std::integral_constant<long, N>) -        -> decltype(random(types::array<std::integral_constant<long, N>, 1>{})) +        -> decltype(random( +            types::array_tuple<std::integral_constant<long, N>, 1>{}))      { -      return random(types::array<std::integral_constant<long, N>, 1>{}); +      return random(types::array_tuple<std::integral_constant<long, N>, 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/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_integers.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_integers.hpp index a731edab409..26f2f38d667 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_integers.hpp +++ b/contrib/python/pythran/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 <utility> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_sample.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_sample.hpp index bb17bed478c..582ac1e8ee9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/random_sample.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/ranf.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/ranf.hpp index 82c1db1f2f6..b49b82467c8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/ranf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/rayleigh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/rayleigh.hpp index 6f3eb1f3b9f..b638a296dc3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/rayleigh.hpp +++ b/contrib/python/pythran/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 <math.h>  PYTHONIC_NS_BEGIN @@ -16,13 +16,13 @@ namespace numpy      types::ndarray<double, pS> rayleigh(double scale, pS const &array_shape);      auto rayleigh(double scale, long size) -        -> decltype(rayleigh(scale, types::array<long, 1>{{size}})); +        -> decltype(rayleigh(scale, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/sample.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/sample.hpp index 4ac5a4f2b34..908d1bab0b4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/sample.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/seed.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/seed.hpp index 358462fbc91..343ba16e323 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/seed.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/shuffle.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/shuffle.hpp index 4245f55c220..4922a90c12f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/shuffle.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_exponential.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_exponential.hpp index 4ae39edc88d..8e6e7517d55 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_exponential.hpp +++ b/contrib/python/pythran/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<double, pS> standard_exponential(pS const &shape);      auto standard_exponential(long size) -        -> decltype(standard_exponential(types::array<long, 1>{{size}})); +        -> decltype(standard_exponential(types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_gamma.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_gamma.hpp index 8ca27a14557..055c257a84f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_gamma.hpp +++ b/contrib/python/pythran/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<double, pS> standard_gamma(double s, pS const &shape);      auto standard_gamma(double s, long size) -        -> decltype(standard_gamma(s, types::array<long, 1>{{size}})); +        -> decltype(standard_gamma(s, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_normal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_normal.hpp index 3dd2be0475c..f2f7c00b66c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/standard_normal.hpp +++ b/contrib/python/pythran/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<double, pS> standard_normal(pS const &shape);      auto standard_normal(long size) -        -> decltype(standard_normal(types::array<long, 1>{{size}})); +        -> decltype(standard_normal(types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/random/uniform.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/uniform.hpp index fee7eb84daa..da81018b81d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/uniform.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})); +        -> decltype(uniform(low, high, types::array_tuple<long, 1>{{size}}));      double uniform(double low = 0.0, double high = 1.0,                     types::none_type size = {}); diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/random/weibull.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/random/weibull.hpp index b4411da214d..2f96e7d0b9e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/random/weibull.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/random/weibull.hpp @@ -15,13 +15,13 @@ namespace numpy      types::ndarray<double, pS> weibull(double a, pS const &shape);      auto weibull(double a, long size) -        -> decltype(weibull(a, types::array<long, 1>{{size}})); +        -> decltype(weibull(a, types::array_tuple<long, 1>{{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/contrib/python/pythran/pythran/pythonic/include/numpy/ravel.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ravel.hpp index 797b00edb29..9fd9e8e51ef 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ravel.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/real.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/real.hpp index ef6fedb391e..900733f5f8c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/real.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/reciprocal.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/reciprocal.hpp index de6e15078d5..06d54a00c3d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/reciprocal.hpp +++ b/contrib/python/pythran/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<T>(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/contrib/python/pythran/pythran/pythonic/include/numpy/reduce.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/reduce.hpp index 36ce15dca26..6923590ca56 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/reduce.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -13,8 +13,8 @@ namespace operator_    {      struct imax;      struct imin; -  } -} +  } // namespace functor +} // namespace operator_  namespace numpy  { @@ -43,7 +43,7 @@ namespace numpy      template <class Op, class E, class T = types::none_type>      using reduce_result_type =          typename reduce_result_type_helper<Op, E, T>::type; -  } +  } // namespace    template <class Op, class E>    typename std::enable_if< @@ -79,7 +79,7 @@ namespace numpy    {      template <class E, class Op, class dtype = types::none_type>      using reduced_type = types::ndarray<reduce_result_type<Op, E, dtype>, -                                        types::array<long, E::value - 1>>; +                                        types::array_tuple<long, E::value - 1>>;    }    template <class Op, class E, class dtype = types::none_type> @@ -98,7 +98,7 @@ namespace numpy    template <class Op, class E, class Out>    typename std::enable_if<E::value != 1, reduced_type<E, Op>>::type    reduce(E const &array, long axis, types::none_type dtype, Out &&out); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/remainder.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/remainder.hpp index e2d310d8637..691687ff80b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/remainder.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -15,17 +15,17 @@ namespace numpy    namespace wrapper    {      template <class T0, class T1> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/repeat.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/repeat.hpp index e5a37d1ea5b..39dba3a7c0c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/repeat.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    repeat(types::ndarray<T, pS> const &expr, long repeats, long axis);    template <class T, class pS> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/resize.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/resize.hpp index 4ea024f99b6..3028f7cbf85 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/resize.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/right_shift.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/right_shift.hpp index e6f93acc2fa..ec440429cdc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/right_shift.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/rint.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/rint.hpp index 49f8694ed55..1b5e78d86eb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/rint.hpp +++ b/contrib/python/pythran/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 <class T>      std::complex<T> rint(std::complex<T> 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/contrib/python/pythran/pythran/pythonic/include/numpy/roll.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/roll.hpp index 1df6f3181df..cf8e122e52f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/roll.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/roll.hpp @@ -18,8 +18,8 @@ namespace numpy    template <class T, class pS, size_t N>    types::ndarray<T, pS> roll(types::ndarray<T, pS> const &expr, -                             types::array<long, N> shift, -                             types::array<long, N> axis); +                             types::array_tuple<long, N> shift, +                             types::array_tuple<long, N> axis);    NUMPY_EXPR_TO_NDARRAY0_DECL(roll);    DEFINE_FUNCTOR(pythonic::numpy, roll); diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/rollaxis.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/rollaxis.hpp index b26633f387e..15f1325ebf1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/rollaxis.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    rollaxis(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/rot90.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/rot90.hpp index 1faa224a5d3..6b3a5cba5ad 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/rot90.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    rot90(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/include/numpy/searchsorted.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/searchsorted.hpp index af23a56ef9c..378b30d021d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/searchsorted.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -21,11 +21,11 @@ namespace numpy    template <class E, class T>    typename std::enable_if<        types::is_numexpr_arg<E>::value, -      types::ndarray<long, types::array<long, E::value>>>::type +      types::ndarray<long, types::array_tuple<long, E::value>>>::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/contrib/python/pythran/pythran/pythonic/include/numpy/select.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/select.hpp index 106bf0ad7b2..c8040d7a3a7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/select.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/select.hpp @@ -10,14 +10,15 @@ namespace numpy  {    template <class C, class L> -  types::ndarray<typename L::dtype, types::array<long, L::value - 1>> +  types::ndarray<typename L::dtype, types::array_tuple<long, L::value - 1>>    select(C const &condlist, L const &choicelist,           typename L::dtype _default = 0);    template <class T, class TpS, class U, class UpS>    typename std::enable_if<        std::tuple_size<TpS>::value == std::tuple_size<UpS>::value, -      types::ndarray<T, types::array<long, std::tuple_size<TpS>::value>>>::type +      types::ndarray< +          T, types::array_tuple<long, std::tuple_size<TpS>::value>>>::type    select(types::list<types::ndarray<U, UpS>> const &condlist,           types::list<types::ndarray<T, TpS>> 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/contrib/python/pythran/pythran/pythonic/include/numpy/setdiff1d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/setdiff1d.hpp index 84b3fad818b..2389da8478f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/setdiff1d.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/shape.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/shape.hpp index ebb09f40f7a..a39ac8591c1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/shape.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/short_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/short_.hpp index 74e74436843..df740d99f85 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/short_.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/sin.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sin.hpp index acb1ee91f35..d0b89b8defb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sin.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/sinh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sinh.hpp index b834cdc97d5..d70bdf0ac55 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sinh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/sort.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sort.hpp index 95231004e5f..97c40568135 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sort.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/sort.hpp @@ -3,28 +3,28 @@  #include <algorithm> -#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 <class E> -  types::ndarray<typename E::dtype, types::array<long, 1>> +  types::ndarray<typename E::dtype, types::array_tuple<long, 1>>    sort(E const &expr, types::none_type);    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    sort(E const &expr, long axis = -1);    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    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/contrib/python/pythran/pythran/pythonic/include/numpy/sort_complex.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sort_complex.hpp index d0cb3c7d04b..746a9eacc9c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sort_complex.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/spacing.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/spacing.hpp index 3f7fe91e55b..c099acd80ed 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/spacing.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/split.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/split.hpp index b6d7ccee27f..dfc51673471 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/split.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/split.hpp @@ -8,22 +8,24 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class T, class pS> -  types::list<types::ndarray<T, types::array<long, std::tuple_size<pS>::value>>> +  types::list< +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>>    split(types::ndarray<T, pS> const &a, long nb_split);    template <class T, class pS, class I>    typename std::enable_if<        types::is_iterable<I>::value,        types::list<types::ndarray< -          T, types::array<long, std::tuple_size<pS>::value>>>>::type +          T, types::array_tuple<long, std::tuple_size<pS>::value>>>>::type    split(types::ndarray<T, pS> const &a, I const &split_mask);    template <class E, class I> -  types::list<types::ndarray<typename E::dtype, types::array<long, E::value>>> +  types::list< +      types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>>    split(E const &a, I const &);    DEFINE_FUNCTOR(pythonic::numpy, split); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/sqrt.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sqrt.hpp index 4a2aae60fe3..6f58776bf12 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sqrt.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/square.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/square.hpp index ab5fe9b1c8a..5f93d421df4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/square.hpp +++ b/contrib/python/pythran/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 <complex> @@ -19,7 +19,7 @@ namespace numpy    namespace wrapper    {      template <class T> -    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/contrib/python/pythran/pythran/pythonic/include/numpy/stack.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/stack.hpp index 070efe7cce5..94cbfcc5dd7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/stack.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/stack.hpp @@ -9,7 +9,7 @@ namespace numpy  {    template <class ArraySequence>    types::ndarray<typename ArraySequence::value_type::dtype, -                 types::array<long, ArraySequence::value_type::value + 1>> +                 types::array_tuple<long, ArraySequence::value_type::value + 1>>    stack(ArraySequence const &args, long axis = 0);    namespace details @@ -20,12 +20,13 @@ namespace numpy    }    template <class... Tys> -  types::ndarray<typename details::stack_helper_t<Tys...>::dtype, -                 types::array<long, details::stack_helper_t<Tys...>::value + 1>> +  types::ndarray< +      typename details::stack_helper_t<Tys...>::dtype, +      types::array_tuple<long, details::stack_helper_t<Tys...>::value + 1>>    stack(std::tuple<Tys...> const &args, long axis = 0);    DEFINE_FUNCTOR(pythonic::numpy, stack); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/std_.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/std_.hpp index 101e533bdcf..0e403bf214c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/std_.hpp +++ b/contrib/python/pythran/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 <class... Args> -  auto std_(Args &&... args) +  auto std_(Args &&...args)        -> decltype(functor::sqrt{}(var(std::forward<Args>(args)...)));    DEFINE_FUNCTOR(pythonic::numpy, std_); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/subtract.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/subtract.hpp index 99e6184aa32..45cfeb15275 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/subtract.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/sum.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/sum.hpp index 6ca19b4768e..835603298c7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/sum.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/sum.hpp @@ -11,14 +11,14 @@ namespace numpy  {    template <class... Args> -  auto sum(Args &&... args) +  auto sum(Args &&...args)        -> decltype(reduce<operator_::functor::iadd>(std::forward<Args>(args)...))    {      return reduce<operator_::functor::iadd>(std::forward<Args>(args)...);    }    DEFINE_FUNCTOR(pythonic::numpy, sum); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/swapaxes.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/swapaxes.hpp index f0dfd4d437b..13552f2cd3e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/swapaxes.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/swapaxes.hpp @@ -8,12 +8,14 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class T> -  auto swapaxes(T &&a, int axis1, int axis2) -> decltype(functor::transpose{}( -      std::forward<T>(a), -      std::declval<types::array<long, std::decay<T>::type::value>>())); +  auto swapaxes(T &&a, int axis1, int axis2) +      -> decltype(functor::transpose{}( +          std::forward<T>(a), +          std::declval< +              types::array_tuple<long, std::decay<T>::type::value>>()));    DEFINE_FUNCTOR(pythonic::numpy, swapaxes); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/take.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/take.hpp index cd2f7e764fe..47c311c86df 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/take.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/take.hpp @@ -10,7 +10,7 @@ namespace numpy        -> decltype(std::forward<T>(expr)[std::forward<F>(indices)]);    DEFINE_FUNCTOR(pythonic::numpy, take); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/tan.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/tan.hpp index 91d322d8a2d..142bba6bbe6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/tan.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/tanh.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/tanh.hpp index 18f38f2d244..edbdb7891aa 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/tanh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/tile.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/tile.hpp index 011f00892d1..6c844eeceee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/tile.hpp +++ b/contrib/python/pythran/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 <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    tile(E const &expr, long reps);    template <class E, size_t N> -  types::ndarray<typename E::dtype, types::array<long, N>> -  tile(E const &expr, types::array<long, N> const &reps); +  types::ndarray<typename E::dtype, types::array_tuple<long, N>> +  tile(E const &expr, types::array_tuple<long, N> const &reps);    DEFINE_FUNCTOR(pythonic::numpy, tile); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/trace.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/trace.hpp index fbd3282c903..a9ae44b1dcf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/trace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/transpose.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/transpose.hpp index 5a9aa973ea0..0eb9ade8b3e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/transpose.hpp +++ b/contrib/python/pythran/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 <class T, class pS>    typename std::enable_if<        (std::tuple_size<pS>::value > 2), -      types::ndarray<T, types::array<long, std::tuple_size<pS>::value>>>::type -  transpose(types::ndarray<T, pS> const &a); +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>>:: +      type +      transpose(types::ndarray<T, pS> const &a);    template <class T, class pS, size_t M> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> -  transpose(types::ndarray<T, pS> const &a, types::array<long, M> const &t); +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>> +  transpose(types::ndarray<T, pS> const &a, +            types::array_tuple<long, M> const &t);    template <class T, class pS, class... Args> -  types::ndarray<T, types::array<long, 1 + sizeof...(Args)>> -  transpose(types::ndarray<T, pS> const &a, long index, Args const &... indices) +  types::ndarray<T, types::array_tuple<long, 1 + sizeof...(Args)>> +  transpose(types::ndarray<T, pS> const &a, long index, Args const &...indices)    { -    return transpose( -        a, types::array<long, 1 + sizeof...(Args)>{{index, (long)indices...}}); +    return transpose(a, types::array_tuple<long, 1 + sizeof...(Args)>{ +                            {index, (long)indices...}});    }    template <class T> @@ -79,17 +81,18 @@ namespace numpy    };    template <class E> -  auto transpose(E const &expr) -> typename std::enable_if< -      (E::value > 2), -      decltype(transpose(types::ndarray<typename E::dtype, typename E::shape_t>{ -          expr}))>::type +  auto transpose(E const &expr) -> +      typename std::enable_if< +          (E::value > 2), +          decltype(transpose(types::ndarray<typename E::dtype, +                                            typename E::shape_t>{expr}))>::type    {      return transpose(          types::ndarray<typename E::dtype, typename E::shape_t>{expr});    }    DEFINE_FUNCTOR(pythonic::numpy, transpose); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/tri.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/tri.hpp index bcdd251019e..06b1e194bef 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/tri.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/tril.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/tril.hpp index a7a6df584d6..242674d9c03 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/tril.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/triu.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/triu.hpp index a30e68e1273..bccfc5af50f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/triu.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/true_divide.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/true_divide.hpp index dc7b68a2526..0f6d9e41527 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/true_divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/trunc.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/trunc.hpp index a5ec9f94295..8a01b4204fe 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/trunc.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/include/numpy/ubyte.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ubyte.hpp index 51327e593b5..e95fd990dea 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ubyte.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_accumulate.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_accumulate.hpp index ffbfa83fb51..be76448d59e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_accumulate.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_accumulate.hpp @@ -21,6 +21,6 @@ namespace numpy          -> decltype(partial_sum<numpy::functor::UFUNC_NAME>(std::forward<T>(a),                                                              axis, d));      DEFINE_FUNCTOR(pythonic::numpy::UFUNC_NAME, accumulate); -  } -} +  } // namespace UFUNC_NAME +} // namespace numpy  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_reduce.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_reduce.hpp index f7d6c7caf04..8f8b19f5999 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_reduce.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/ufunc_reduce.hpp @@ -27,16 +27,17 @@ namespace numpy            std::forward<Arg>(arg), 0L);      }      template <class... Args> -    auto reduce(Args &&... args) -> typename std::enable_if< -        sizeof...(Args) != 1, -        decltype(numpy::reduce<operator_::functor::UFUNC_INAME>( -            std::forward<Args>(args)...))>::type +    auto reduce(Args &&...args) -> +        typename std::enable_if< +            sizeof...(Args) != 1, +            decltype(numpy::reduce<operator_::functor::UFUNC_INAME>( +                std::forward<Args>(args)...))>::type      {        return numpy::reduce<operator_::functor::UFUNC_INAME>(            std::forward<Args>(args)...);      }      DEFINE_FUNCTOR(pythonic::numpy::UFUNC_NAME, reduce); -  } -} +  } // namespace UFUNC_NAME +} // namespace numpy  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/uint.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uint.hpp index ec4773dae2c..dd6242f7759 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uint.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uint16.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uint16.hpp index 05eea7869fc..0d1f6c33533 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uint16.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uint32.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uint32.hpp index 2c81cac7699..0d0bfcb17b4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uint32.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uint64.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uint64.hpp index caefe91ef45..85264f209c8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uint64.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uint8.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uint8.hpp index c268272cc1b..8eef53ba882 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uint8.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uintc.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uintc.hpp index 027326c312e..dc9a6e25c77 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uintc.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/uintp.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/uintp.hpp index f8184e349a0..10b035e7c5f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/uintp.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/ulonglong.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ulonglong.hpp index 8811bd2cc90..b78622d9563 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ulonglong.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/union1d.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/union1d.hpp index 5b578c3d9b8..241fd221ecc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/union1d.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/unique.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/unique.hpp index b4d8b0cc2fa..e353f4de2a8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/unique.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/unravel_index.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/unravel_index.hpp index 9f585f10e12..fcab8025b35 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/unravel_index.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/unravel_index.hpp @@ -9,12 +9,13 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E, class S> -  typename std::enable_if<std::is_scalar<E>::value, -                          types::array<long, std::tuple_size<S>::value>>::type +  typename std::enable_if< +      std::is_scalar<E>::value, +      types::array_tuple<long, std::tuple_size<S>::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/contrib/python/pythran/pythran/pythonic/include/numpy/unwrap.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/unwrap.hpp index 1615cf59f9a..e0928a5001f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/unwrap.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/ushort.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/ushort.hpp index 11d29800173..de2018e7957 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/ushort.hpp +++ b/contrib/python/pythran/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 <class V>      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/contrib/python/pythran/pythran/pythonic/include/numpy/var.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/var.hpp index 104a4f64015..f6a74f69b1c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/var.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -22,8 +22,8 @@ namespace numpy    template <class E>    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<E>(std::real(mean(expr)))); +           types::none_type out = builtins::None, +           long ddof = 0) -> decltype(var_type<E>(std::real(mean(expr))));    template <class E>    auto var(E const &expr, long axis, types::none_type dtype = builtins::None, @@ -31,7 +31,7 @@ namespace numpy        typename assignable<decltype(var_type<E>() * mean(expr, axis))>::type;    DEFINE_FUNCTOR(pythonic::numpy, var); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/vdot.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/vdot.hpp index 67f9ffdad93..db4cdcd64d7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/vdot.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/numpy/vstack.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/vstack.hpp index 38afc536988..9742af5e880 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/vstack.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/numpy/vstack.hpp @@ -25,13 +25,14 @@ namespace numpy    //    // the enable if is there to match this behavior    template <class ArraySequence> -  auto vstack(ArraySequence &&seq) -> typename std::enable_if< -      (impl::vstack_helper<ArraySequence>::value == 1), -      decltype(std::declval<impl::vstack_helper<ArraySequence>>().reshape( -          std::declval<types::array<long, 2>>()))>::type; +  auto vstack(ArraySequence &&seq) -> +      typename std::enable_if< +          (impl::vstack_helper<ArraySequence>::value == 1), +          decltype(std::declval<impl::vstack_helper<ArraySequence>>().reshape( +              std::declval<types::array_tuple<long, 2>>()))>::type;    DEFINE_FUNCTOR(pythonic::numpy, vstack); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/where.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/where.hpp index b75fa19621e..559c9aca5be 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/where.hpp +++ b/contrib/python/pythran/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 <class E>                                                           \ -  auto operator()(E && expr)->decltype(nonzero{}(std::forward<E>(expr)))       \ +  auto operator()(E &&expr)->decltype(nonzero{}(std::forward<E>(expr)))        \    {                                                                            \      return nonzero{}(std::forward<E>(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/contrib/python/pythran/pythran/pythonic/include/numpy/zeros.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/zeros.hpp index d525edaff69..d716de5d1bf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/zeros.hpp +++ b/contrib/python/pythran/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 <class dtype = functor::float64> -  typename dtype::type -  zeros(std::tuple<> const &shape, dtype d = dtype()); +  typename dtype::type zeros(std::tuple<> const &shape, dtype d = dtype());    template <class pS, class dtype = functor::float64>    types::ndarray<typename dtype::type, sutils::shape_t<pS>> @@ -27,7 +26,7 @@ namespace numpy    zeros(std::integral_constant<long, N>, dtype d = dtype());    DEFINE_FUNCTOR(pythonic::numpy, zeros); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/numpy/zeros_like.hpp b/contrib/python/pythran/pythran/pythonic/include/numpy/zeros_like.hpp index 80e063feef8..c593ddbad11 100644 --- a/contrib/python/pythran/pythran/pythonic/include/numpy/zeros_like.hpp +++ b/contrib/python/pythran/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<typename E::dtype>()));    DEFINE_FUNCTOR(pythonic::numpy, zeros_like) -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/omp/get_num_threads.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/get_num_threads.hpp index 48262f66296..d537b642eb4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/get_num_threads.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/omp/get_thread_num.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/get_thread_num.hpp index 36829d9b259..3a1eb8c6f4d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/get_thread_num.hpp +++ b/contrib/python/pythran/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 <omp.h>  #include "pythonic/include/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/include/omp/get_wtick.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/get_wtick.hpp index 5deab26d53b..f237f8ab3e4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/get_wtick.hpp +++ b/contrib/python/pythran/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 <omp.h>  #include "pythonic/include/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/include/omp/get_wtime.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/get_wtime.hpp index 68760a6cb0f..5d89da8b891 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/get_wtime.hpp +++ b/contrib/python/pythran/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 <omp.h>  #include "pythonic/include/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/include/omp/in_parallel.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/in_parallel.hpp index 0fc99b376b5..d7496c5455e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/in_parallel.hpp +++ b/contrib/python/pythran/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 <omp.h>  #include "pythonic/include/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/include/omp/set_nested.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/set_nested.hpp index 2760fe13fc1..a5aff3cc536 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/set_nested.hpp +++ b/contrib/python/pythran/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 <omp.h>  #include "pythonic/include/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/include/omp/set_num_threads.hpp b/contrib/python/pythran/pythran/pythonic/include/omp/set_num_threads.hpp index e31ac8ae962..619fefee97b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/omp/set_num_threads.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/__abs__.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/__abs__.hpp index add04278d88..7e9b4652fdb 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/__abs__.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/__add__.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/__add__.hpp index 1814c94b2d3..11e1f97ca69 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/__add__.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/__truediv__.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/__truediv__.hpp index fdf8d716bf6..5a884adfa0c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/__truediv__.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/abs.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/abs.hpp index 92eda417cd8..e04370d51d3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/abs.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/add.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/add.hpp index 4da63a2df98..a3f424457d6 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/add.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/and_.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/and_.hpp index 1c90e412084..430dc280f19 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/and_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/concat.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/concat.hpp index b4e5979e698..beba5e98f77 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/concat.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/concat.hpp @@ -9,11 +9,11 @@ namespace operator_  {    template <class A, class B> -  auto concat(A &&a, B &&b) -      -> decltype(std::forward<A>(a) + std::forward<B>(b)); +  auto concat(A &&a, +              B &&b) -> decltype(std::forward<A>(a) + std::forward<B>(b));    DEFINE_FUNCTOR(pythonic::operator_, concat); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/contains.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/contains.hpp index cb2b7307d74..ce741d860ed 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/contains.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto contains(A &&a, B &&b) -      -> decltype(in(std::forward<A>(a), std::forward<B>(b))); +  auto contains(A &&a, +                B &&b) -> decltype(in(std::forward<A>(a), std::forward<B>(b)));    DEFINE_FUNCTOR(pythonic::operator_, contains); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/countOf.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/countOf.hpp index bb941666fed..6e463a5668c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/countOf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/delitem.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/delitem.hpp index 56ff597978f..9371fae95e0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/delitem.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/div.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/div.hpp index 3ac0faccb56..3d8d44f6a4b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/div.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/eq.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/eq.hpp index eb9db18ed48..15ecae9c50f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/eq.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/floordiv.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/floordiv.hpp index 4f53b9fc26c..6da873f404c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/floordiv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/ge.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/ge.hpp index 7b4e07ee643..eb68863292f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/ge.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/getitem.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/getitem.hpp index 380007aa3af..78697dec48b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/getitem.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/getitem.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace operator_  {    template <class A, class B> -  auto getitem(A &&a, B &&b) -      -> decltype(std::forward<A>(a)[std::forward<B>(b)]); +  auto getitem(A &&a, +               B &&b) -> decltype(std::forward<A>(a)[std::forward<B>(b)]);    DEFINE_FUNCTOR(pythonic::operator_, getitem); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/gt.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/gt.hpp index 805cd62134d..371d247e163 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/gt.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/iadd.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/iadd.hpp index 83eaaf3371d..e8844df8f30 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/iadd.hpp +++ b/contrib/python/pythran/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 <class A>    auto iadd(types::empty_set, types::set<A> const &b) -> decltype(b); -} +} // namespace operator_  PYTHONIC_NS_END  #define OPERATOR_NAME iadd  #define OPERATOR_SYMBOL + diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/icommon.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/icommon.hpp index 23814a8c102..2d5c6a17452 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/icommon.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/icommon.hpp @@ -22,23 +22,25 @@ namespace operator_  {    template <class A, class B> -  auto OPERATOR_NAME(bool, A &&a, B &&b, ...) -      -> decltype(std::forward<A>(a) OPERATOR_SYMBOL std::forward<B>(b)); +  auto OPERATOR_NAME(bool, A &&a, B &&b, +                     ...) -> decltype(std::forward<A>(a) +                                          OPERATOR_SYMBOL std::forward<B>(b));    template <class A, class B>    auto OPERATOR_NAME(bool, A &&a, B &&b, std::nullptr_t)        -> decltype(std::forward<A>(a) OPERATOR_ISYMBOL std::forward<B>(b));    template <class A, class B> -  auto OPERATOR_NAME(A &&a, B &&b) -      -> decltype(OPERATOR_NAME(true, std::forward<A>(a), std::forward<B>(b), -                                nullptr)) +  auto OPERATOR_NAME(A &&a, +                     B &&b) -> decltype(OPERATOR_NAME(true, std::forward<A>(a), +                                                      std::forward<B>(b), +                                                      nullptr))    {      return OPERATOR_NAME(true, std::forward<A>(a), std::forward<B>(b), nullptr);    }    DEFINE_FUNCTOR(pythonic::operator_, OPERATOR_NAME); -} +} // namespace operator_  PYTHONIC_NS_END  #undef OPERATOR_NAME diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/iconcat.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/iconcat.hpp index 96266ca2639..3513f6c277d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/iconcat.hpp +++ b/contrib/python/pythran/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<A> b) -> decltype(b);    DEFINE_FUNCTOR(pythonic::operator_, iconcat); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/ifloordiv.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/ifloordiv.hpp index 721565a6478..fc18841ef1e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/ifloordiv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/imax.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/imax.hpp index a22a04954b4..c57935e245a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/imax.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto imax(A &&a, B &&b) -> typename std::enable_if< -      std::is_const<A>::value || !std::is_assignable<A, B>::value, -      decltype(numpy::functor::maximum{}(std::forward<A>(a), -                                         std::forward<B>(b)))>::type; +  auto imax(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_const<A>::value || !std::is_assignable<A, B>::value, +          decltype(numpy::functor::maximum{}(std::forward<A>(a), +                                             std::forward<B>(b)))>::type;    template <class A, class B> -  auto imax(A &&a, B &&b) -> typename std::enable_if< -      !std::is_const<A>::value && std::is_assignable<A, B>::value, -      decltype(a = numpy::functor::maximum{}(std::forward<A>(a), -                                             std::forward<B>(b)))>::type; +  auto imax(A &&a, B &&b) -> +      typename std::enable_if< +          !std::is_const<A>::value && std::is_assignable<A, B>::value, +          decltype(a = numpy::functor::maximum{}(std::forward<A>(a), +                                                 std::forward<B>(b)))>::type;    DEFINE_FUNCTOR(pythonic::operator_, imax); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/imin.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/imin.hpp index 0fea5836f6f..6036ff10dbd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/imin.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto imin(A &&a, B &&b) -> typename std::enable_if< -      std::is_const<A>::value || !std::is_assignable<A, B>::value, -      decltype(numpy::functor::minimum{}(std::forward<A>(a), -                                         std::forward<B>(b)))>::type; +  auto imin(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_const<A>::value || !std::is_assignable<A, B>::value, +          decltype(numpy::functor::minimum{}(std::forward<A>(a), +                                             std::forward<B>(b)))>::type;    template <class A, class B> -  auto imin(A &&a, B &&b) -> typename std::enable_if< -      !std::is_const<A>::value && std::is_assignable<A, B>::value, -      decltype(a = numpy::functor::minimum{}(std::forward<A>(a), -                                             std::forward<B>(b)))>::type; +  auto imin(A &&a, B &&b) -> +      typename std::enable_if< +          !std::is_const<A>::value && std::is_assignable<A, B>::value, +          decltype(a = numpy::functor::minimum{}(std::forward<A>(a), +                                                 std::forward<B>(b)))>::type;    DEFINE_FUNCTOR(pythonic::operator_, imin); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/imod.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/imod.hpp index 477d80afbb9..e7a828a8b38 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/imod.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/indexOf.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/indexOf.hpp index b66ff2b5bdc..8a2d306e667 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/indexOf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/inv.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/inv.hpp index 1f96938880e..03c033d0022 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/inv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/invert.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/invert.hpp index e647e6f5496..cdb0c2cb698 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/invert.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/invert.hpp @@ -12,7 +12,7 @@ namespace operator_    auto invert(A &&a) -> decltype(~std::forward<A>(a));    DEFINE_FUNCTOR(pythonic::operator_, invert); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/ipow.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/ipow.hpp index e6ab178fb33..baa721745a0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/ipow.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/is_.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/is_.hpp index 455ad489e1f..2426ff1db0d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/is_.hpp +++ b/contrib/python/pythran/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>(b)));    DEFINE_FUNCTOR(pythonic::operator_, is_); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/is_not.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/is_not.hpp index f1fe2132ace..46b51a1d830 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/is_not.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/is_not.hpp @@ -13,7 +13,7 @@ namespace operator_                                          builtins::id(std::forward<B>(b)));    DEFINE_FUNCTOR(pythonic::operator_, is_not); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/itemgetter.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/itemgetter.hpp index 4ae3b91fa29..7fd8943fcfa 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/itemgetter.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/itruediv.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/itruediv.hpp index c903aca21d5..75b058e449c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/itruediv.hpp +++ b/contrib/python/pythran/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>(b)));    template <class A, class B> -  auto itruediv(A &a, B &&b) -> typename std::enable_if< -      std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, -      A &>::type; +  auto itruediv(A &a, B &&b) -> +      typename std::enable_if< +          std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, +          A &>::type;    template <class A, class B> -  auto itruediv(A &a, B &&b) -> typename std::enable_if< -      !std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, -      decltype(truediv(a, std::forward<B>(b)))>::type; +  auto itruediv(A &a, B &&b) -> +      typename std::enable_if< +          !std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, +          decltype(truediv(a, std::forward<B>(b)))>::type;    DEFINE_FUNCTOR(pythonic::operator_, itruediv); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/le.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/le.hpp index 3ea728cb92c..f8456b32682 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/le.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/lshift.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/lshift.hpp index 33b8936ad68..0de91c72922 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/lshift.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto lshift(A &&a, B &&b) -      -> decltype(std::forward<A>(a) << std::forward<B>(b)); +  auto lshift(A &&a, B &&b) -> decltype(std::forward<A>(a) +                                        << std::forward<B>(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/contrib/python/pythran/pythran/pythonic/include/operator_/lt.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/lt.hpp index 791301650fa..b670073c9da 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/lt.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/matmul.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/matmul.hpp index 6800c341920..e0733b7d2bf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/matmul.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto matmul(A &&a, B &&b) -      -> decltype(numpy::functor::dot{}(std::forward<A>(a), -                                        std::forward<B>(b))); +  auto matmul(A &&a, +              B &&b) -> decltype(numpy::functor::dot{}(std::forward<A>(a), +                                                       std::forward<B>(b)));    DEFINE_FUNCTOR(pythonic::operator_, matmul); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/mod.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/mod.hpp index 3b18e51fe7e..3fecdec3d1f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/mod.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/mod.hpp @@ -9,10 +9,11 @@ namespace operator_  {    template <class A, class B> -  auto mod(A &&a, B &&b) -> typename std::enable_if< -      std::is_fundamental<typename std::decay<A>::type>::value && -          std::is_fundamental<typename std::decay<B>::type>::value, -      decltype(std::forward<A>(a) % std::forward<B>(b))>::type; +  auto mod(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_fundamental<typename std::decay<A>::type>::value && +              std::is_fundamental<typename std::decay<B>::type>::value, +          decltype(std::forward<A>(a) % std::forward<B>(b))>::type;    inline double mod(double a, long b); @@ -26,7 +27,7 @@ namespace operator_            decltype(std::forward<A>(a) % std::forward<B>(b))>::type;    DEFINE_FUNCTOR(pythonic::operator_, mod); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/mul.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/mul.hpp index 2fbcfeed1cf..e5f30d1e66f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/mul.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/ne.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/ne.hpp index 650db40338a..97b91722320 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/ne.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/neg.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/neg.hpp index 584e77d8d8f..0b30fbfef1f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/neg.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/neg.hpp @@ -12,7 +12,7 @@ namespace operator_    auto neg(A &&a) -> decltype(-std::forward<A>(a));    DEFINE_FUNCTOR(pythonic::operator_, neg); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/not_.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/not_.hpp index b756eba2e70..0c105ca2edf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/not_.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/not_.hpp @@ -14,7 +14,7 @@ namespace operator_    bool not_(std::complex<T> const &a);    DEFINE_FUNCTOR(pythonic::operator_, not_); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/or_.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/or_.hpp index 20aaddf55c5..75042642755 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/or_.hpp +++ b/contrib/python/pythran/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 <class A, class B>    auto or_(A &&a, B &&b) -> decltype(std::forward<A>(a) | std::forward<B>(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/contrib/python/pythran/pythran/pythonic/include/operator_/pos.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/pos.hpp index e3df7fb72b6..744b67fd37c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/pos.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/rshift.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/rshift.hpp index 0d662582b12..cc64a33a52b 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/rshift.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto rshift(A &&a, B &&b) -      -> decltype(std::forward<A>(a) >> std::forward<B>(b)); +  auto rshift(A &&a, +              B &&b) -> decltype(std::forward<A>(a) >> std::forward<B>(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/contrib/python/pythran/pythran/pythonic/include/operator_/sub.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/sub.hpp index a5c9e62767e..f0c8ac96f57 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/sub.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/truediv.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/truediv.hpp index b48350018e5..b6df765b478 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/truediv.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/operator_/truediv.hpp @@ -8,11 +8,11 @@ PYTHONIC_NS_BEGIN  namespace operator_  {    template <class A, class B> -  auto truediv(A &&a, B &&b) -      -> decltype(std::forward<A>(a) / (double)std::forward<B>(b)); +  auto truediv(A &&a, B &&b) -> decltype(std::forward<A>(a) / +                                         (double)std::forward<B>(b));    DEFINE_FUNCTOR(pythonic::operator_, truediv); -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/operator_/truth.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/truth.hpp index dd7dd80fff9..73a8473cd38 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/truth.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/operator_/xor_.hpp b/contrib/python/pythran/pythran/pythonic/include/operator_/xor_.hpp index aad75e98212..8ff75bacde9 100644 --- a/contrib/python/pythran/pythran/pythonic/include/operator_/xor_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/os/path/join.hpp b/contrib/python/pythran/pythran/pythonic/include/os/path/join.hpp index 74c68b58442..5c2300118f0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/os/path/join.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/os/path/join.hpp @@ -13,11 +13,11 @@ namespace os      T join(T &&head);      template <class T, class... Types> -    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/contrib/python/pythran/pythran/pythonic/include/random/choice.hpp b/contrib/python/pythran/pythran/pythonic/include/random/choice.hpp index 10c93749a50..a69fba90963 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/choice.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/expovariate.hpp b/contrib/python/pythran/pythran/pythonic/include/random/expovariate.hpp index 28dbb3d4999..1d7e1a66d50 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/expovariate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/gauss.hpp b/contrib/python/pythran/pythran/pythonic/include/random/gauss.hpp index 440a55fdb1e..d06ebd9eaf2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/gauss.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/randint.hpp b/contrib/python/pythran/pythran/pythonic/include/random/randint.hpp index a4dcfbbd2d8..0c74182242d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/randint.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/random.hpp b/contrib/python/pythran/pythran/pythonic/include/random/random.hpp index 84ed72880a7..d2dec8be45a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/random.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/randrange.hpp b/contrib/python/pythran/pythran/pythonic/include/random/randrange.hpp index 08b5899189f..84925cee4a4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/randrange.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -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/contrib/python/pythran/pythran/pythonic/include/random/sample.hpp b/contrib/python/pythran/pythran/pythonic/include/random/sample.hpp index 230e57b7d70..df2cfc2382d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/sample.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/seed.hpp b/contrib/python/pythran/pythran/pythonic/include/random/seed.hpp index cc41715f7ac..455eb49d5ad 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/seed.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/shuffle.hpp b/contrib/python/pythran/pythran/pythonic/include/random/shuffle.hpp index 797256d4bbf..d5db47aa42f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/shuffle.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/random/uniform.hpp b/contrib/python/pythran/pythran/pythonic/include/random/uniform.hpp index 2559716bc7b..f2bada04912 100644 --- a/contrib/python/pythran/pythran/pythonic/include/random/uniform.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/binom.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/binom.hpp index df2982d6051..8cf1773d401 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/binom.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/gamma.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/gamma.hpp index 1cf8ae271e3..65679241956 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/gamma.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaincinv.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaincinv.hpp index 89829312457..666ba823ba4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaincinv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaln.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaln.hpp index 7d96d3f9e9f..c1048dfbb16 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/gammaln.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel1.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel1.hpp index 70382e83447..e204d98563a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel1.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel2.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel2.hpp index b3b6f26cf9b..d6c126abd27 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/hankel2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0.hpp index a42dee09287..fd7d18d33a2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0.hpp @@ -61,13 +61,13 @@ namespace scipy        template <class T>        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/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0e.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0e.hpp index dbb47435efb..1ec5260c12f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/i0e.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/iv.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/iv.hpp index 0c4b0f846c6..1ef41ad3e44 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/iv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/ivp.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/ivp.hpp index f9f03e6de5c..53e96c2d84e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/ivp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/jv.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/jv.hpp index 97440d85ebf..d72502feec1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/jv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/jvp.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/jvp.hpp index 2eea0b4ebf8..aacbb968426 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/jvp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/kv.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/kv.hpp index b8b2bff86ce..7a4f0b3283e 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/kv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/kvp.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/kvp.hpp index 37271762926..a5bc58c9faa 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/kvp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtr.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtr.hpp index e0c3d4ca411..1f8a0b7e4c1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtri.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtri.hpp index 17e70609ec7..44915c74003 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/ndtri.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_jn.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_jn.hpp index eba7a55b080..8e2e8a14c76 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_jn.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_yn.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_yn.hpp index 211a8e1d2ce..6cb9d0fe285 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/spherical_yn.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/yv.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/yv.hpp index c8936a8e1e8..a4f40ebb6cd 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/yv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/scipy/special/yvp.hpp b/contrib/python/pythran/pythran/pythonic/include/scipy/special/yvp.hpp index 53aba998de7..b39ff9086ee 100644 --- a/contrib/python/pythran/pythran/pythonic/include/scipy/special/yvp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/string/find.hpp b/contrib/python/pythran/pythran/pythonic/include/string/find.hpp index 9e26442ff58..3486e832cf0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/string/find.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/time/sleep.hpp b/contrib/python/pythran/pythran/pythonic/include/time/sleep.hpp index 9634aa2979e..12056ff8d3d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/time/sleep.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/time/time.hpp b/contrib/python/pythran/pythran/pythonic/include/time/time.hpp index 6ee19ae75a8..d8481c09c15 100644 --- a/contrib/python/pythran/pythran/pythonic/include/time/time.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/array.hpp b/contrib/python/pythran/pythran/pythonic/include/types/array.hpp new file mode 100644 index 00000000000..d4e6c1e06ec --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/include/types/array.hpp @@ -0,0 +1,660 @@ +#ifndef PYTHONIC_INCLUDE_TYPES_ARRAY_HPP +#define PYTHONIC_INCLUDE_TYPES_ARRAY_HPP + +#include "pythonic/include/types/assignable.hpp" +#include "pythonic/include/types/empty_iterator.hpp" +#include "pythonic/include/types/list.hpp" +#include "pythonic/include/types/nditerator.hpp" +#include "pythonic/include/types/slice.hpp" +#include "pythonic/include/types/tuple.hpp" +#include "pythonic/include/types/vectorizable_type.hpp" +#include "pythonic/include/utils/allocate.hpp" +#include "pythonic/include/utils/int_.hpp" +#include "pythonic/include/utils/reserve.hpp" +#include "pythonic/include/utils/shared_ref.hpp" + +#include <algorithm> +#include <iterator> +#include <ostream> +#include <utility> +#include <vector> + +PYTHONIC_NS_BEGIN + +namespace types +{ +  template <class T> +  using container = std::vector<T, utils::allocator<T>>; + +  /* forward declaration */ +  template <class T> +  class array; +  template <class T, class S> +  class sliced_array; +  template <class T, class pS> +  struct ndarray; +  template <class... Tys> +  struct pshape; + +  template <class E> +  struct array_reference { +    typename E::data_type &data; +    array_reference(typename E::data_type &data) : data(data) +    { +    } +    array_reference &operator=(typename E::value_type value) +    { +      data = value; +      return *this; +    } +    array_reference &operator=(array_reference value) +    { +      data = value.data; +      return *this; +    } + +    operator typename E::value_type() const +    { +      return data; +    } + +    friend void swap(array_reference self, array_reference other) +    { +      std::swap(self.data, other.data); +    } +  }; + +  template <class E> +  struct array_iterator +      : std::iterator<std::random_access_iterator_tag, typename E::value_type> { +    E data; +    long index; +    array_iterator(E data, long index) : data(data), index(index) +    { +    } + +    array_reference<E> operator*() +    { +      return data.fast(index); +    } +    auto operator*() const -> decltype(data.fast(index)) +    { +      return data.fast(index); +    } +    array_iterator &operator++() +    { +      ++index; +      return *this; +    } +    array_iterator &operator--() +    { +      --index; +      return *this; +    } +    array_iterator &operator+=(long i) +    { +      index += i; +      return *this; +    } +    array_iterator &operator-=(long i) +    { +      index -= i; +      return *this; +    } +    array_iterator operator+(long i) const +    { +      array_iterator res(*this); +      res += i; +      return res; +    } +    array_iterator operator-(long i) const +    { +      array_iterator res(*this); +      res -= i; +      return res; +    } +    long operator-(array_iterator const &other) const +    { +      return index - other.index; +    } +    bool operator!=(array_iterator const &other) const +    { +      return index != other.index; +    } +    bool operator==(array_iterator const &other) const +    { +      return index == other.index; +    } +    bool operator<(array_iterator const &other) const +    { +      return index < other.index; +    } +    array_iterator &operator=(array_iterator const &other) +    { +      index = other.index; +      return *this; +    } +  }; + +  /* array view */ +  template <class T, class S = slice> +  class sliced_array +  { + +    // data holder +    typedef +        typename std::remove_cv<typename std::remove_reference<T>::type>::type +            _type; +    typedef container<_type> container_type; +    utils::shared_ref<container_type> _data; + +    template <class U> +    friend class array; + +    typename S::normalized_type slicing; + +  public: +    //  types +    typedef T data_type; +    typedef typename std::conditional<std::is_integral<T>::value, long, +                                      double>::type value_type; +    typedef array_reference<sliced_array> reference; +    typedef value_type const_reference; +    typedef array_iterator<sliced_array> iterator; +    typedef array_iterator<sliced_array> const_iterator; +    typedef typename container_type::size_type size_type; +    typedef typename container_type::difference_type difference_type; +    typedef typename container_type::allocator_type allocator_type; +    typedef typename container_type::pointer pointer; +    typedef typename container_type::const_pointer const_pointer; +    typedef std::reverse_iterator<iterator> reverse_iterator; +    typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + +    // minimal ndarray interface +    typedef data_type dtype; +    static const size_t value = 1; +    static const bool is_vectorizable = +        types::is_vectorizable_dtype<dtype>::value && +        !std::is_same<S, slice>::value; +    static const bool is_flat = std::is_same<slice, S>::value; +    static const bool is_strided = std::is_same<slice, S>::value; + +    using shape_t = types::array_tuple<long, value>; +    template <size_t I> +    auto shape() const -> decltype(details::extract_shape(*this, +                                                          utils::int_<I>{})) +    { +      return details::extract_shape(*this, utils::int_<I>{}); +    } + +    // constructor +    sliced_array(); +    sliced_array(sliced_array<T, S> const &s); +    sliced_array(array<T> const &other, S const &s); +    template <class Sn> +    sliced_array(utils::shared_ref<container_type> const &other, Sn const &s); + +    // assignment +    sliced_array &operator=(array<T> const &); +    sliced_array &operator=(sliced_array<T, S> const &); +    array<T> operator+(array<T> const &) const; +    template <size_t N, class V> +    array<T> operator+(array_base<T, N, V> const &) const; +    template <class Tp, class Sp> +    array<typename __combined<T, Tp>::type> +    operator+(sliced_array<Tp, Sp> const &) const; + +    // iterators +    iterator begin(); +    const_iterator begin() const; +    iterator end(); +    const_iterator end() const; +    reverse_iterator rbegin() +    { +      return {end()}; +    } +    const_reverse_iterator rbegin() const +    { +      return {end()}; +    } +    reverse_iterator rend() +    { +      return {begin()}; +    } +    const_reverse_iterator rend() const +    { +      return {begin()}; +    } + +    // size +    long size() const; +    explicit operator bool() const; + +    // accessors +    const_reference fast(long i) const; +    reference fast(long i); +    const_reference operator[](long i) const; +    reference operator[](long i); +    template <class Sp> +    typename std::enable_if< +        is_slice<Sp>::value, +        sliced_array<T, decltype(std::declval<S>() * std::declval<Sp>())>>::type +    operator[](Sp s) const; + +    template <class... Indices> +    dtype load(long index0, long index1, Indices... indices) const +    { +      return fast(index0).load(index1, indices...); +    } + +    dtype load(long index) const +    { +      return fast(index); +    } +    // comparison +    template <class K> +    bool operator==(array<K> const &other) const; + +#ifdef USE_XSIMD +    using simd_iterator = const_simd_nditerator<sliced_array>; +    using simd_iterator_nobroadcast = simd_iterator; +    template <class vectorizer> +    simd_iterator vbegin(vectorizer) const; +    template <class vectorizer> +    simd_iterator vend(vectorizer) const; +#endif + +    // other operations +    template <class V> +    bool contains(V const &v) const; +    intptr_t id() const; + +    intptr_t baseid() const +    { +      return reinterpret_cast<intptr_t>(&(*_data)); +    } + +    long count(T const &x) const; +    template <class Tp, class Sp> +    friend std::ostream &operator<<(std::ostream &os, +                                    sliced_array<Tp, Sp> const &v); +  }; + +  /* array */ +  template <class T> +  class array +  { + +    static const size_t DEFAULT_CAPACITY = 16; + +    // data holder +    typedef +        typename std::remove_cv<typename std::remove_reference<T>::type>::type +            _type; +    typedef container<_type> container_type; +    utils::shared_ref<container_type> _data; + +    template <class U, class S> +    friend class sliced_array; + +    template <class U> +    friend class array; + +  public: +    // types +    typedef T data_type; +    typedef typename std::conditional<std::is_integral<T>::value, long, +                                      double>::type value_type; +    typedef array_reference<array> reference; +    typedef value_type const_reference; +    typedef array_iterator<array> iterator; +    typedef array_iterator<array> const_iterator; +    typedef typename container_type::size_type size_type; +    typedef typename container_type::difference_type difference_type; +    typedef typename container_type::allocator_type allocator_type; +    typedef typename container_type::pointer pointer; +    typedef typename container_type::const_pointer const_pointer; +    typedef std::reverse_iterator<iterator> reverse_iterator; +    typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + +    // minimal ndarray interface +    typedef data_type dtype; +    static const size_t value = 1; +    static const bool is_vectorizable = types::is_vectorizable<dtype>::value; +    static const bool is_flat = true; +    static const bool is_strided = false; + +    // constructors +    array(); +    template <class InputIterator> +    array(InputIterator start, InputIterator stop); +    array(size_type sz); +    array(array &&other); +    array(array const &other); +    template <class Tp> +    array(list<Tp> const &other) : array(other.begin(), other.end()) +    { +    } +    template <class Tp, size_t N> +    array(static_list<Tp, N> const &other) : array(other.begin(), other.end()) +    { +    } +    template <class F> +    array(array<F> const &other); +    template <class Tp, class S> +    array(sliced_array<Tp, S> const &other); +    array<T> &operator=(array<T> &&other); +    template <class F> +    array<T> &operator=(array<F> const &other); +    array<T> &operator=(array<T> const &other); +    template <class Tp, size_t N, class V> +    array<T> &operator=(array_base<Tp, N, V> const &); +    template <class Tp, class S> +    array<T> &operator=(sliced_array<Tp, S> const &other); + +    template <class pS> +    array & +    operator=(ndarray<T, pshape<pS>> const &); // implemented in ndarray.hpp + +    template <class S> +    array<T> &operator+=(sliced_array<T, S> const &other); +    template <class S> +    array<T> operator+(sliced_array<T, S> const &other) const; +    template <size_t N, class V> +    array<T> operator+(array_base<T, N, V> const &other) const; + +    // io +    template <class S> +    friend std::ostream &operator<<(std::ostream &os, array<S> const &v); + +    // comparison +    template <class K> +    bool operator==(array<K> const &other) const; +    template <class K> +    bool operator!=(array<K> const &other) const; + +    // iterators +    iterator begin(); +    const_iterator begin() const; +    iterator end(); +    const_iterator end() const; +    reverse_iterator rbegin() +    { +      return {end()}; +    } +    const_reverse_iterator rbegin() const +    { +      return {end()}; +    } +    reverse_iterator rend() +    { +      return {begin()}; +    } +    const_reverse_iterator rend() const +    { +      return {begin()}; +    } + +    // comparison +    bool operator<(array<T> const &other) const; +    bool operator<=(array<T> const &other) const; +    bool operator>(array<T> const &other) const; +    bool operator>=(array<T> const &other) const; + +// element access +#ifdef USE_XSIMD +    using simd_iterator = const_simd_nditerator<array>; +    using simd_iterator_nobroadcast = simd_iterator; +    template <class vectorizer> +    simd_iterator vbegin(vectorizer) const; +    template <class vectorizer> +    simd_iterator vend(vectorizer) const; +#endif +    reference fast(long n); +    reference operator[](long n); + +    const_reference fast(long n) const; +    const_reference operator[](long n) const; + +    template <class Sp> +    typename std::enable_if<is_slice<Sp>::value, sliced_array<T, Sp>>::type +    operator[](Sp const &s) const; + +    template <class... Indices> +    dtype load(long index0, long index1, Indices... indices) const +    { +      return fast(index0).load(index1, indices...); +    } + +    dtype load(long index) const +    { +      return fast(index); +    } + +    dtype *data() +    { +      return _data->data(); +    } +    const dtype *data() const +    { +      return _data->data(); +    } + +    // modifiers +    template <class Tp> +    void push_back(Tp &&x); +    template <class Tp> +    void insert(long i, Tp &&x); + +    void reserve(size_t n); +    void resize(size_t n); +    void erase(size_t n); + +    T pop(long x = -1); +    void clear(); + +    // TODO: have to raise a valueError +    none_type remove(T const &x); + +    // Misc +    // TODO: have to raise a valueError +    long index(T const &x) const; + +    // array interface +    explicit operator bool() const; + +    template <class F> +    array<typename __combined<T, F>::type> operator+(array<F> const &s) const; + +    template <class F, class S> +    array<decltype(std::declval<T>() + +                   std::declval<typename sliced_array<F, S>::value_type>())> +    operator+(sliced_array<F, S> const &s) const; + +    array<T> operator*(long t) const; +    array<T> const &operator*=(long t); + +    template <class F> +    array<T> &operator+=(F const &s); + +    long size() const; +    template <class E> +    long _flat_size(E const &e, utils::int_<1>) const; +    template <class E, size_t L> +    long _flat_size(E const &e, utils::int_<L>) const; +    long flat_size() const; + +    template <class V> +    bool contains(V const &v) const; +    intptr_t id() const; + +    long count(T const &x) const; +    using shape_t = array_tuple<long, value>; +    template <size_t I> +    long shape() const +    { +      if (I == 0) +        return size(); +      else +        return details::extract_shape(*this, utils::int_<I>{}); +    } + +    template <class Tp, size_t N, class V> +    operator array_base<Tp, N, V>() const +    { +      assert(size() == N && "consistent size"); +      array_base<Tp, N, V> res; +      std::copy(begin(), end(), res.begin()); +      return res; +    } +  }; + +} // namespace types + +namespace utils +{ +  /** +   * Reserve enough space to save all values generated from f. +   * +   * We use a dummy arguments (p) to reserve only when f have a +   * const_iterator type. +   */ +  template <class T, class From> +  void reserve(types::array<T> &l, From const &f, +               typename From::const_iterator *p = nullptr); +} // namespace utils + +template <class T> +struct assignable<types::array<T>> { +  typedef types::array<typename assignable<T>::type> type; +}; + +template <class T, class S> +struct assignable<types::sliced_array<T, S>> { +  typedef types::array<typename assignable<T>::type> type; +}; + +template <class E> +struct assignable<types::array_reference<E>> { +  typedef typename E::value_type type; +}; + +PYTHONIC_NS_END + +/* overload std::get */ +namespace std +{ +  template <size_t I, class T> +  typename pythonic::types::array<T>::reference +  get(pythonic::types::array<T> &t); + +  template <size_t I, class T> +  typename pythonic::types::array<T>::const_reference +  get(pythonic::types::array<T> const &t); + +  template <size_t I, class T> +  typename pythonic::types::array<T>::value_type +  get(pythonic::types::array<T> &&t); + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::reference +  get(pythonic::types::sliced_array<T, S> &t); + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::const_reference +  get(pythonic::types::sliced_array<T, S> const &t); + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::value_type +  get(pythonic::types::sliced_array<T, S> &&t); + +  template <size_t I, class T> +  struct tuple_element<I, pythonic::types::array<T>> { +    typedef typename pythonic::types::array<T>::value_type type; +  }; +  template <size_t I, class T, class S> +  struct tuple_element<I, pythonic::types::sliced_array<T, S>> { +    typedef typename pythonic::types::sliced_array<T, S>::value_type type; +  }; +} // namespace std + +/* type inference stuff  {*/ +#include "pythonic/include/types/combined.hpp" + +template <class A, class B> +struct __combined<container<A>, pythonic::types::array<B>> { +  typedef pythonic::types::array<typename __combined<A, B>::type> type; +}; + +template <class A, class B> +struct __combined<pythonic::types::array<B>, container<A>> { +  typedef pythonic::types::array<typename __combined<A, B>::type> type; +}; + +template <class K, class V> +struct __combined<indexable<K>, pythonic::types::array<V>> { +  typedef pythonic::types::array<V> type; +}; + +template <class V, class K> +struct __combined<pythonic::types::array<V>, indexable<K>> { +  typedef pythonic::types::array<V> type; +}; + +template <class K, class V0, class V1> +struct __combined<indexable_container<K, V0>, pythonic::types::array<V1>> { +  typedef pythonic::types::array<typename __combined<V0, V1>::type> type; +}; + +template <class K, class V0, class V1> +struct __combined<pythonic::types::array<V1>, indexable_container<K, V0>> { +  typedef pythonic::types::array<typename __combined<V0, V1>::type> type; +}; + +template <class T0, class T1> +struct __combined<pythonic::types::array<T0>, pythonic::types::array<T1>> { +  typedef pythonic::types::array<typename __combined<T0, T1>::type> type; +}; + +template <class T0, class T1, class S> +struct __combined<pythonic::types::sliced_array<T1, S>, +                  pythonic::types::array<T0>> { +  typedef pythonic::types::array<typename __combined<T0, T1>::type> type; +}; +template <class T0, class T1, class S> +struct __combined<pythonic::types::array<T0>, +                  pythonic::types::sliced_array<T1, S>> { +  typedef pythonic::types::array<typename __combined<T0, T1>::type> type; +}; + +template <class T, size_t N, class V, class Tp> +struct __combined<pythonic::types::array_base<T, N, V>, +                  pythonic::types::array<Tp>> { +  typedef pythonic::types::array<typename __combined<T, Tp>::type> type; +}; +template <class T, size_t N, class V, class Tp> +struct __combined<pythonic::types::array<Tp>, +                  pythonic::types::array_base<T, N, V>> { +  typedef pythonic::types::array<typename __combined<T, Tp>::type> type; +}; + +/* } */ + +#ifdef ENABLE_PYTHON_MODULE + +PYTHONIC_NS_BEGIN + +template <typename T> +struct to_python<types::array<T>> { +  static PyObject *convert(types::array<T> const &v); +}; +template <typename T, typename S> +struct to_python<types::sliced_array<T, S>> { +  static PyObject *convert(types::sliced_array<T, S> const &v); +}; + +PYTHONIC_NS_END + +#endif + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/attr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/attr.hpp index 41d483d0cf5..6b73e924103 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/attr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/cfun.hpp b/contrib/python/pythran/pythran/pythonic/include/types/cfun.hpp index 2dc6d48ed41..6c88f2dd5ca 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/cfun.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/combined.hpp b/contrib/python/pythran/pythran/pythonic/include/types/combined.hpp index cc5e5973f7b..6f531e9fb98 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/combined.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/combined.hpp @@ -13,7 +13,7 @@ namespace types  PYTHONIC_NS_END  /* type inference stuff -*/ + */  template <class... Types>  struct __combined; @@ -33,12 +33,12 @@ struct __combined<T0, T1> {    // callable -> functor    template <class F0, class F1>    static pythonic::types::variant_functor<F0, F1> -  get(std::integral_constant<bool, true>); +      get(std::integral_constant<bool, true>);    // operator+ exists -> deduce type    template <class F0, class F1> -  static decltype(std::declval<F0>() + std::declval<F1>()) -  get(std::integral_constant<bool, false>); +  static decltype(std::declval<F0>() + +                  std::declval<F1>()) get(std::integral_constant<bool, false>);    // 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<T0, T1> {    using type = typename std::conditional<        std::is_same<T0, T1>::value, T0, -      decltype(get<T0, T1>(std::integral_constant< -          bool, pythonic::types::is_callable<T0>::value && -                    pythonic::types::is_callable<T1>::value>()))>::type; +      decltype(get<T0, T1>(std::integral_constant < bool, +                           pythonic::types::is_callable<T0>::value +                                   &&pythonic::types::is_callable<T1>::value > +                               ()))>::type;  };  template <class T0, class T1> diff --git a/contrib/python/pythran/pythran/pythonic/include/types/complex.hpp b/contrib/python/pythran/pythran/pythonic/include/types/complex.hpp index fbb4209c1a3..19ae86680ae 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/complex.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/complex.hpp @@ -4,14 +4,12 @@  #include <complex>  #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<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)  #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<std::complex<T>> {      size_t operator()(std::complex<T> const &x) const;    }; -} +} // namespace std  PYTHONIC_NS_BEGIN  namespace builtins @@ -99,7 +97,7 @@ namespace builtins                                       std::complex<double> const &self);    numpy::functor::complex256 getattr(types::attr::DTYPE,                                       std::complex<long double> const &self); -} +} // namespace builtins  PYTHONIC_NS_END  /* for type inference { */ @@ -127,19 +125,15 @@ struct __combined<std::complex<T0>, std::complex<T1>> {        ->std::complex<typename std::common_type<T, U>::type>                    \    {                                                                            \      using ctype = std::complex<typename std::common_type<T, U>::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/contrib/python/pythran/pythran/pythonic/include/types/dynamic_tuple.hpp b/contrib/python/pythran/pythran/pythonic/include/types/dynamic_tuple.hpp index 389edbfc1a7..0db63dcff6f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/dynamic_tuple.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/dynamic_tuple.hpp @@ -173,8 +173,8 @@ namespace types      using shape_t = typename shape_builder<dynamic_tuple, value>::type;      template <size_t I> -    auto shape() const -        -> decltype(details::extract_shape(*this, utils::int_<I>{})) +    auto shape() const -> decltype(details::extract_shape(*this, +                                                          utils::int_<I>{}))      {        return details::extract_shape(*this, utils::int_<I>{});      } diff --git a/contrib/python/pythran/pythran/pythonic/include/types/empty_iterator.hpp b/contrib/python/pythran/pythran/pythonic/include/types/empty_iterator.hpp index 2d58573af07..50ddda302a4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/empty_iterator.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/exceptions.hpp b/contrib/python/pythran/pythran/pythonic/include/types/exceptions.hpp index 33b5fac8872..3cdb832ece1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/exceptions.hpp +++ b/contrib/python/pythran/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 <stdexcept> @@ -18,7 +18,7 @@ namespace types    public:      BaseException(const BaseException &e) = default;      template <typename... Types> -    BaseException(Types const &... types); +    BaseException(Types const &...types);      virtual ~BaseException() noexcept = default;      dynamic_tuple<str> args;    }; @@ -31,8 +31,7 @@ namespace types      name() = default;                                                          \      name(const name &e) = default;                                             \      template <class... Types>                                                  \ -    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 <typename... Types>                                                 \ -  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/contrib/python/pythran/pythran/pythonic/include/types/file.hpp b/contrib/python/pythran/pythran/pythonic/include/types/file.hpp index 8781adb250a..7d192c9a9de 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/file.hpp +++ b/contrib/python/pythran/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 <fstream>  #include <iterator> @@ -92,6 +92,9 @@ namespace types      types::str read(long size = -1); +    template <class T> +    void read_as(long n, T *buffer); +      types::str readline(long size = std::numeric_limits<long>::max());      types::list<types::str> readlines(long sizehint = -1); @@ -107,7 +110,7 @@ namespace types      template <class T>      void writelines(T const &seq);    }; -} +} // namespace types  PYTHONIC_NS_END  /* pythran attribute system { */ @@ -123,7 +126,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/contrib/python/pythran/pythran/pythonic/include/types/finfo.hpp b/contrib/python/pythran/pythran/pythonic/include/types/finfo.hpp index f5af81c04b1..f15b2acc577 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/finfo.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/finfo.hpp @@ -18,7 +18,7 @@ namespace types    struct finfo<std::complex<T>> {      T eps() const;    }; -} +} // namespace types  PYTHONIC_NS_END  /* pythran attribute system { */ @@ -26,8 +26,8 @@ PYTHONIC_NS_BEGIN  namespace builtins  {    template <class T> -  auto getattr(types::attr::EPS, pythonic::types::finfo<T> const &f) -      -> decltype(f.eps()); +  auto getattr(types::attr::EPS, +               pythonic::types::finfo<T> const &f) -> decltype(f.eps());  }  PYTHONIC_NS_END  /* } */ diff --git a/contrib/python/pythran/pythran/pythonic/include/types/generator.hpp b/contrib/python/pythran/pythran/pythonic/include/types/generator.hpp index 587d71c6eb9..85998cccb52 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/generator.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/generator.hpp @@ -1,8 +1,8 @@  #ifndef PYTHONIC_INCLUDE_TYPES_GENERATOR_HPP  #define PYTHONIC_INCLUDE_TYPES_GENERATOR_HPP -#include <iterator>  #include <cstddef> +#include <iterator>  PYTHONIC_NS_BEGIN @@ -23,7 +23,7 @@ namespace types      bool operator==(generator_iterator<T> const &other) const;      bool operator<(generator_iterator<T> const &other) const;    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/immediate.hpp b/contrib/python/pythran/pythran/pythonic/include/types/immediate.hpp index 7e7bf3e075c..7b8de529d4c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/immediate.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/immediate.hpp @@ -26,7 +26,7 @@ namespace types    using true_immediate = immediate<bool, true>;    using false_immediate = immediate<bool, false>; -} +} // namespace types  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/types/int.hpp b/contrib/python/pythran/pythran/pythonic/include/types/int.hpp index ebd94eb8d19..40a53da2146 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/int.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/int.hpp @@ -12,7 +12,7 @@ namespace builtins    template <class T>    typename std::enable_if<std::is_integral<T>::value, T>::value    getattr(types::attr::IMAG, T self); -} +} // namespace builtins  PYTHONIC_NS_END  #ifdef ENABLE_PYTHON_MODULE diff --git a/contrib/python/pythran/pythran/pythonic/include/types/lazy.hpp b/contrib/python/pythran/pythran/pythonic/include/types/lazy.hpp index b5ea869df63..13680b0c1a2 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/lazy.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/lazy.hpp @@ -15,7 +15,7 @@ namespace types        std::is_same<lazy_res_t<T0>, lazy_res_t<T1>>::value, lazy_res_t<T0>,        typename __combined<lazy_res_decay_t<T0>,                            lazy_res_decay_t<T1>>::type>::type; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/list.hpp b/contrib/python/pythran/pythran/pythonic/include/types/list.hpp index 15a1db30866..be008c7bcca 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/list.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/list.hpp @@ -26,8 +26,6 @@ namespace types    template <class T>    using container = std::vector<T, utils::allocator<T>>; -  static const size_t DEFAULT_LIST_CAPACITY = 16; -    /* forward declaration */    struct empty_list;    template <class T> @@ -38,22 +36,6 @@ namespace types    struct ndarray;    template <class... Tys>    struct pshape; -  template <class T> -  struct is_list { -    static const bool value = false; -  }; -  template <class T> -  struct is_list<list<T>> { -    static const bool value = true; -  }; -  template <class T, class S> -  struct is_list<sliced_list<T, S>> { -    static const bool value = true; -  }; -  template <class T, size_t N> -  struct is_list<static_list<T, N>> { -    static const bool value = true; -  };    /* for type disambiguification */    struct single_value { @@ -104,10 +86,10 @@ namespace types      static const bool is_flat = std::is_same<slice, S>::value;      static const bool is_strided = std::is_same<slice, S>::value; -    using shape_t = types::array<long, value>; +    using shape_t = types::array_tuple<long, value>;      template <size_t I> -    auto shape() const -        -> decltype(details::extract_shape(*this, utils::int_<I>{})) +    auto shape() const -> decltype(details::extract_shape(*this, +                                                          utils::int_<I>{}))      {        return details::extract_shape(*this, utils::int_<I>{});      } @@ -193,6 +175,7 @@ namespace types    template <class T>    class list    { +    static constexpr size_t DEFAULT_CAPACITY = 16;      // data holder      typedef @@ -391,7 +374,7 @@ namespace types      intptr_t id() const;      long count(T const &x) const; -    using shape_t = array<long, value>; +    using shape_t = array_tuple<long, value>;      template <size_t I>      long shape() const      { @@ -439,7 +422,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<long, value>; +    using shape_t = types::array_tuple<long, value>;      typedef char value_type;      typedef empty_iterator iterator; diff --git a/contrib/python/pythran/pythran/pythonic/include/types/ndarray.hpp b/contrib/python/pythran/pythran/pythonic/include/types/ndarray.hpp index e28d665e1fd..49c82549874 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/ndarray.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/ndarray.hpp @@ -168,7 +168,7 @@ namespace types    };    template <class T, class pS> -  struct type_helper<ndarray<T, array<pS, 1>>> { +  struct type_helper<ndarray<T, array_tuple<pS, 1>>> {      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<T, array<pS, 1>> &n, long i); -    static const_iterator make_iterator(ndarray<T, array<pS, 1>> const &n, +    static iterator make_iterator(ndarray<T, array_tuple<pS, 1>> &n, long i); +    static const_iterator make_iterator(ndarray<T, array_tuple<pS, 1>> const &n,                                          long i);      template <class S, class Iter>      static T *initialize_from_iterable(S &shape, T *from, Iter &&iter); -    static type get(ndarray<T, array<pS, 1>> &&self, long i); +    static type get(ndarray<T, array_tuple<pS, 1>> &&self, long i);    };    template <class T, class pS> -  struct type_helper<ndarray<T, array<pS, 1>> const &> { +  struct type_helper<ndarray<T, array_tuple<pS, 1>> 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<T, array<pS, 1>> &n, long i); -    static const_iterator make_iterator(ndarray<T, array<pS, 1>> const &n, +    static iterator make_iterator(ndarray<T, array_tuple<pS, 1>> &n, long i); +    static const_iterator make_iterator(ndarray<T, array_tuple<pS, 1>> const &n,                                          long i);      template <class S, class Iter>      static T *initialize_from_iterable(S &shape, T *from, Iter &&iter); -    static type &get(ndarray<T, array<pS, 1>> const &self, long i); +    static type &get(ndarray<T, array_tuple<pS, 1>> 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<types::array<long, value - 1>, +    sutils::concat_t<types::array_tuple<long, value - 1>,                       pshape<std::integral_constant<long, 1>>>          _strides; // strides @@ -346,14 +346,14 @@ namespace types      {        static_assert(is_dtype<E>::value, "valid store");        *(buffer + noffset<std::tuple_size<pS>::value>{}( -                     *this, array<long, value>{{indices...}})) = +                     *this, array_tuple<long, value>{{indices...}})) =            static_cast<E>(elt);      }      template <class... Indices>      dtype load(Indices... indices) const      {        return *(buffer + noffset<std::tuple_size<pS>::value>{}( -                            *this, array<long, value>{{indices...}})); +                            *this, array_tuple<long, value>{{indices...}}));      }      template <class Op, class E, class... Indices> @@ -361,7 +361,7 @@ namespace types      {        static_assert(is_dtype<E>::value, "valid store");        Op{}(*(buffer + noffset<std::tuple_size<pS>::value>{}( -                          *this, array<long, value>{{indices...}})), +                          *this, array_tuple<long, value>{{indices...}})),             static_cast<E>(elt));      } @@ -382,19 +382,19 @@ namespace types      template <class Ty>      typename std::enable_if<std::is_integral<Ty>::value, T &>::type -    fast(array<Ty, value> const &indices); +    fast(array_tuple<Ty, value> const &indices);      template <class Ty>      typename std::enable_if<std::is_integral<Ty>::value, T>::type -    fast(array<Ty, value> const &indices) const; +    fast(array_tuple<Ty, value> const &indices) const;      template <class Ty, size_t M> -    auto fast(array<Ty, M> const &indices) const & -> +    auto fast(array_tuple<Ty, M> const &indices) const & ->          typename std::enable_if<std::is_integral<Ty>::value,                                  decltype(nget<M - 1>().fast(*this,                                                              indices))>::type;      template <class Ty, size_t M> -    auto fast(array<Ty, M> const &indices) && -> +    auto fast(array_tuple<Ty, M> const &indices) && ->          typename std::enable_if<std::is_integral<Ty>::value,                                  decltype(nget<M - 1>().fast(std::move(*this),                                                              indices))>::type; @@ -449,17 +449,20 @@ namespace types      }      template <class S0, class... S> -    auto operator()(S0 const &s0, S const &...s) const & -> decltype( -        extended_slice<count_new_axis<S0, S...>::value>{}((*this), s0, s...)); +    auto operator()(S0 const &s0, S const &...s) +        const & -> decltype(extended_slice<count_new_axis<S0, S...>::value>{}( +                    (*this), s0, s...));      template <class S0, class... S> -    auto operator()(S0 const &s0, S const &...s) & -> decltype( -        extended_slice<count_new_axis<S0, S...>::value>{}((*this), s0, s...)); +    auto operator()(S0 const &s0, S const &...s) +        & -> decltype(extended_slice<count_new_axis<S0, S...>::value>{}((*this), +                                                                        s0, +                                                                        s...));      template <class S0, class... S> -    auto operator()(S0 const &s0, S const &...s) && -> decltype( -        extended_slice<count_new_axis<S0, S...>::value>{}(std::move(*this), s0, -                                                          s...)); +    auto operator()(S0 const &s0, S const &...s) +        && -> decltype(extended_slice<count_new_axis<S0, S...>::value>{}( +               std::move(*this), s0, s...));      /* element filtering */      template <class F> // indexing through an array of boolean -- a mask @@ -528,19 +531,19 @@ namespace types      template <class Ty>      typename std::enable_if<std::is_integral<Ty>::value, T const &>::type -    operator[](array<Ty, value> const &indices) const; +    operator[](array_tuple<Ty, value> const &indices) const;      template <class Ty>      typename std::enable_if<std::is_integral<Ty>::value, T &>::type -    operator[](array<Ty, value> const &indices); +    operator[](array_tuple<Ty, value> const &indices);      template <class Ty, size_t M> -    auto operator[](array<Ty, M> const &indices) const & -> +    auto operator[](array_tuple<Ty, M> const &indices) const & ->          typename std::enable_if<std::is_integral<Ty>::value,                                  decltype(nget<M - 1>()(*this, indices))>::type;      template <class Ty, size_t M> -    auto operator[](array<Ty, M> const &indices) && -> +    auto operator[](array_tuple<Ty, M> const &indices) && ->          typename std::enable_if<std::is_integral<Ty>::value,                                  decltype(nget<M - 1>()(std::move(*this),                                                         indices))>::type; @@ -622,7 +625,7 @@ namespace types      template <class Ty, size_t M,                class _ = typename std::enable_if<!std::is_integral<Ty>::value,                                                  void>::type> -    auto operator[](array<Ty, M> const &indices) const +    auto operator[](array_tuple<Ty, M> const &indices) const          & -> decltype(this->_fwdindex(indices, utils::make_index_sequence<M>()))      {        return _fwdindex(indices, utils::make_index_sequence<M>()); @@ -664,12 +667,12 @@ namespace types      ndarray<T, qS> reshape(qS const &shape) &&;      template <class OT> -    ndarray<OT, types::array<long, value>> recast() +    ndarray<OT, types::array_tuple<long, value>> 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<raw_array<OT>>(); -      return ndarray<OT, types::array<long, value>>(new_mem, new_shape); +      return ndarray<OT, types::array_tuple<long, value>>(new_mem, new_shape);      }      explicit operator bool() const; @@ -715,10 +718,11 @@ namespace std  {    template <size_t I, class E> -  auto get(E &&a) -> typename std::enable_if< -      pythonic::types::is_array<typename std::remove_cv< -          typename std::remove_reference<E>::type>::type>::value, -      decltype(std::forward<E>(a)[I])>::type; +  auto get(E &&a) -> +      typename std::enable_if< +          pythonic::types::is_array<typename std::remove_cv< +              typename std::remove_reference<E>::type>::type>::value, +          decltype(std::forward<E>(a)[I])>::type;    template <size_t I, class T, class pS>    struct tuple_element<I, pythonic::types::ndarray<T, pS>> { @@ -748,7 +752,8 @@ namespace std    template <size_t I, class T, class F>    struct tuple_element<I, pythonic::types::numpy_vexpr<T, F>> { -    using type = decltype(std::declval<pythonic::types::numpy_vexpr<T, F>>()[0]); +    using type = +        decltype(std::declval<pythonic::types::numpy_vexpr<T, F>>()[0]);    };  } // namespace std @@ -825,8 +830,8 @@ namespace builtins      template <>      struct _build_gexpr<1> {        template <class E, class... S> -        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 <class E> @@ -836,7 +841,7 @@ namespace builtins      auto _make_real(E const &a, utils::int_<1>)          -> decltype(_build_gexpr<E::value>{}(              types::ndarray<typename types::is_complex<typename E::dtype>::type, -                           types::array<long, E::value>>{}, +                           types::array_tuple<long, E::value>>{},              types::slice()));      template <class T, class Ss, size_t... Is>      auto real_get(T &&expr, Ss const &indices, utils::index_sequence<Is...>) @@ -852,7 +857,7 @@ namespace builtins      auto _make_imag(E const &a, utils::int_<1>)          -> decltype(_build_gexpr<E::value>{}(              types::ndarray<typename types::is_complex<typename E::dtype>::type, -                           types::array<long, E::value>>{}, +                           types::array_tuple<long, E::value>>{},              types::slice()));      template <class T, class Ss, size_t... Is>      auto imag_get(T &&expr, Ss const &indices, utils::index_sequence<Is...>) @@ -863,7 +868,7 @@ namespace builtins    } // namespace details    template <class E> -  types::array<long, E::value> getattr(types::attr::SHAPE, E const &a); +  types::array_tuple<long, E::value> getattr(types::attr::SHAPE, E const &a);    inline types::pshape<> getattr(types::attr::SHAPE, ...)    { @@ -883,7 +888,7 @@ namespace builtins    }    template <class E> -  types::array<long, E::value> getattr(types::attr::STRIDES, E const &a); +  types::array_tuple<long, E::value> getattr(types::attr::STRIDES, E const &a);    inline std::tuple<> getattr(types::attr::STRIDES, ...)    { @@ -924,22 +929,24 @@ namespace builtins                   typename types::numpy_expr<Op, Args...>::dtype>::value>{}));    template <class E> -  auto getattr(types::attr::REAL, types::numpy_texpr<E> const &a) -> decltype( -      types::numpy_texpr<decltype(getattr(types::attr::REAL{}, a.arg))>{ +  auto getattr(types::attr::REAL, types::numpy_texpr<E> const &a) +      -> decltype(types::numpy_texpr<decltype(getattr(types::attr::REAL{}, +                                                      a.arg))>{            getattr(types::attr::REAL{}, a.arg)});    template <class E> -  auto getattr(types::attr::REAL, types::numpy_iexpr<E> const &a) -> decltype( -      types::numpy_iexpr<decltype(getattr(types::attr::REAL{}, a.arg))>{ +  auto getattr(types::attr::REAL, types::numpy_iexpr<E> const &a) +      -> decltype(types::numpy_iexpr<decltype(getattr(types::attr::REAL{}, +                                                      a.arg))>{            getattr(types::attr::REAL{}, a.arg)})    {      return {getattr(types::attr::REAL{}, a.arg)};    }    template <class T, class F> -  auto -  getattr(types::attr::REAL, types::numpy_vexpr<T, F> const &a) -> decltype( -      types::numpy_vexpr<decltype(getattr(types::attr::REAL{}, a.data_)), F>{ +  auto getattr(types::attr::REAL, types::numpy_vexpr<T, F> 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<Op, Args...>::dtype>::value>{}));    template <class E> -  auto getattr(types::attr::IMAG, types::numpy_texpr<E> const &a) -> decltype( -      types::numpy_texpr<decltype(getattr(types::attr::IMAG{}, a.arg))>{ +  auto getattr(types::attr::IMAG, types::numpy_texpr<E> const &a) +      -> decltype(types::numpy_texpr<decltype(getattr(types::attr::IMAG{}, +                                                      a.arg))>{            getattr(types::attr::IMAG{}, a.arg)});    template <class E> -  auto geatttr(types::attr::IMAG, types::numpy_iexpr<E> const &a) -> decltype( -      types::numpy_iexpr<decltype(getattr(types::attr::IMAG{}, a.arg))>{ +  auto geatttr(types::attr::IMAG, types::numpy_iexpr<E> const &a) +      -> decltype(types::numpy_iexpr<decltype(getattr(types::attr::IMAG{}, +                                                      a.arg))>{            getattr(types::attr::IMAG{}, a.arg)})    {      return {getattr(types::attr::IMAG{}, a.arg)};    }    template <class T, class F> -  auto -  getattr(types::attr::IMAG, types::numpy_vexpr<T, F> const &a) -> decltype( -      types::numpy_vexpr<decltype(getattr(types::attr::IMAG{}, a.data_)), F>{ +  auto getattr(types::attr::IMAG, types::numpy_vexpr<T, F> 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/contrib/python/pythran/pythran/pythonic/include/types/nditerator.hpp b/contrib/python/pythran/pythran/pythonic/include/types/nditerator.hpp index e74f19c2b5c..0d1f8281adf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/nditerator.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/nditerator.hpp @@ -48,8 +48,8 @@ namespace types    template <class E>    struct nditerator        : public std::iterator<std::random_access_iterator_tag, -                             typename std::remove_reference<decltype( -                                 std::declval<E &>().fast(0))>::type> { +                             typename std::remove_reference< +                                 decltype(std::declval<E &>().fast(0))>::type> {      E &data;      long index;      nditerator(E &data, long index); @@ -75,8 +75,8 @@ namespace types    template <class E>    struct const_nditerator        : public std::iterator<std::random_access_iterator_tag, -                             typename std::remove_reference<decltype( -                                 std::declval<E &>().fast(0))>::type> { +                             typename std::remove_reference< +                                 decltype(std::declval<E &>().fast(0))>::type> {      E const &data;      long index;      const_nditerator(E const &data, long index); @@ -153,8 +153,8 @@ namespace types    template <bool is_strided>    struct make_const_nditerator {      template <class T> -    auto operator()(T const &self, long i) -        -> decltype(const_nditerator<T>(self, i)) const; +    auto operator()(T const &self, +                    long i) -> decltype(const_nditerator<T>(self, i)) const;    };    template <> @@ -162,7 +162,7 @@ namespace types      template <class T>      typename T::dtype const *operator()(T const &self, long i) const;    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_broadcast.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_broadcast.hpp index 2340b10d160..f86dc628fe0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_broadcast.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_broadcast.hpp @@ -87,7 +87,7 @@ namespace types      using iterator = const_iterator;      T ref; -    using shape_t = types::array<long, value>; +    using shape_t = types::array_tuple<long, value>;      template <size_t I>      long shape() const @@ -259,8 +259,10 @@ namespace types    template <class T, class B>    struct broadcast_dtype {      using type = -        typename std::conditional<(std::is_integral<T>::value && std::is_integral<B>::value) -                                  ||(std::is_floating_point<T>::value && std::is_floating_point<B>::value), +        typename std::conditional<(std::is_integral<T>::value && +                                   std::is_integral<B>::value) || +                                      (std::is_floating_point<T>::value && +                                       std::is_floating_point<B>::value),                                    T, typename __combined<T, B>::type>::type;    };  #ifndef USE_XSIMD @@ -299,7 +301,7 @@ namespace types      dtype operator[](long) const;      template <size_t N> -    dtype operator[](array<long, N>) const; +    dtype operator[](array_tuple<long, N>) const;      template <class S>      typename std::enable_if<is_slice<S>::value, broadcast const &>::type diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_expr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_expr.hpp index c6ae90eb172..0d13801a6bf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_expr.hpp +++ b/contrib/python/pythran/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 <class Op, class Steps, class... Iters>    struct numpy_expr_iterator -      : std::iterator<std::random_access_iterator_tag, -                      typename std::remove_reference<decltype(std::declval< -                          Op>()(*std::declval<Iters>()...))>::type> { +      : std::iterator< +            std::random_access_iterator_tag, +            typename std::remove_reference<decltype(std::declval<Op>()( +                *std::declval<Iters>()...))>::type> {      Steps steps_;      std::tuple<Iters...> iters_; @@ -114,8 +115,8 @@ namespace types        return Dereferencer<Op>{}(iters_, s);      } -    auto operator*() const -> decltype( -        this->_dereference(utils::make_index_sequence<sizeof...(Iters)>{})) +    auto operator*() const -> decltype(this->_dereference( +                               utils::make_index_sequence<sizeof...(Iters)>{}))      {        return _dereference(utils::make_index_sequence<sizeof...(Iters)>{});      } @@ -141,9 +142,10 @@ namespace types      template <size_t... I>      void _incr(utils::index_sequence<I...>)      { -      (void)std::initializer_list<bool>{_incr_opt<I>(std::integral_constant< -          bool, std::is_same<long, typename std::tuple_element< -                                       I, Steps>::type>::value>{})...}; +      (void)std::initializer_list<bool>{_incr_opt<I>( +          std::integral_constant< +              bool, std::is_same<long, typename std::tuple_element< +                                           I, Steps>::type>::value>{})...};      }      numpy_expr_iterator &operator++()      { @@ -242,14 +244,15 @@ namespace types  #ifdef USE_XSIMD    template <class E, class Op, class Steps, class SIters, class... Iters>    struct numpy_expr_simd_iterator -      : std::iterator<std::random_access_iterator_tag, -                      typename std::remove_reference<decltype(std::declval< -                          Op>()(*std::declval<Iters>()...))>::type> { +      : std::iterator< +            std::random_access_iterator_tag, +            typename std::remove_reference<decltype(std::declval<Op>()( +                *std::declval<Iters>()...))>::type> {      Steps steps_;      std::tuple<Iters...> iters_;      SIters siters_; -    numpy_expr_simd_iterator(array<long, sizeof...(Iters)> steps, +    numpy_expr_simd_iterator(array_tuple<long, sizeof...(Iters)> steps,                               SIters const &siters, Iters... iters)          : steps_(steps), iters_(iters...), siters_(siters)      { @@ -275,8 +278,8 @@ namespace types                                           : (std::get<I>(siters_)))...);      } -    auto operator*() const -> decltype( -        this->_dereference(utils::make_index_sequence<sizeof...(Iters)>{})) +    auto operator*() const -> decltype(this->_dereference( +                               utils::make_index_sequence<sizeof...(Iters)>{}))      {        return _dereference(utils::make_index_sequence<sizeof...(Iters)>{});      } @@ -302,9 +305,10 @@ namespace types      template <size_t... I>      void _incr(utils::index_sequence<I...>)      { -      (void)std::initializer_list<bool>{_incr_opt<I>(std::integral_constant< -          bool, std::is_same<long, typename std::tuple_element< -                                       I, Steps>::type>::value>{})...}; +      (void)std::initializer_list<bool>{_incr_opt<I>( +          std::integral_constant< +              bool, std::is_same<long, typename std::tuple_element< +                                           I, Steps>::type>::value>{})...};      }      numpy_expr_simd_iterator &operator++()      { @@ -404,9 +408,10 @@ namespace types    template <class E, class Op, class... Iters>    struct numpy_expr_simd_iterator_nobroadcast -      : std::iterator<std::random_access_iterator_tag, -                      typename std::remove_reference<decltype(std::declval< -                          Op>()(*std::declval<Iters>()...))>::type> { +      : std::iterator< +            std::random_access_iterator_tag, +            typename std::remove_reference<decltype(std::declval<Op>()( +                *std::declval<Iters>()...))>::type> {      std::tuple<Iters...> iters_;      numpy_expr_simd_iterator_nobroadcast(Iters... iters) : iters_(iters...) @@ -433,8 +438,8 @@ namespace types        return Op{}((*std::get<I>(iters_))...);      } -    auto operator*() const -> decltype( -        this->_dereference(utils::make_index_sequence<sizeof...(Iters)>{})) +    auto operator*() const -> decltype(this->_dereference( +                               utils::make_index_sequence<sizeof...(Iters)>{}))      {        return _dereference(utils::make_index_sequence<sizeof...(Iters)>{});      } @@ -563,8 +568,9 @@ namespace types    template <class S, class Sp, class... Ss>    constexpr size_t count_none(size_t I)    { -    return I == 0 ? 0 : (std::is_same<S, none_type>::value + -                         count_none<Sp, Ss...>(I - 1)); +    return I == 0 ? 0 +                  : (std::is_same<S, none_type>::value + +                     count_none<Sp, Ss...>(I - 1));    }    template <class BT, class T> @@ -577,9 +583,9 @@ namespace types    }    template <size_t... J, class Arg, class Shp, class... S> -  auto make_subslice(utils::index_sequence<J...>, Arg const &arg, -                     Shp const &shp, std::tuple<S...> const &ss) -      -> decltype(arg(std::get<J>(ss)...)) +  auto +  make_subslice(utils::index_sequence<J...>, Arg const &arg, Shp const &shp, +                std::tuple<S...> const &ss) -> decltype(arg(std::get<J>(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<std::remove_reference<Args>::type::value...>::value; -    using value_type = decltype(Op()(std::declval< -        typename std::remove_reference<Args>::type::value_type>()...)); +    using value_type = decltype(Op()( +        std::declval< +            typename std::remove_reference<Args>::type::value_type>()...));      using dtype = decltype(Op()(          std::declval<typename std::remove_reference<Args>::type::dtype>()...)); @@ -639,13 +646,12 @@ namespace types  #ifdef CYTHON_ABI      template <class... Argp> -    numpy_expr(numpy_expr<Op, Argp...> const &other) -        : args(other.args) +    numpy_expr(numpy_expr<Op, Argp...> const &other) : args(other.args)      {      }  #endif -    numpy_expr(Args const &... args); +    numpy_expr(Args const &...args);      template <size_t... I>      const_iterator _begin(utils::index_sequence<I...>) const; @@ -694,7 +700,7 @@ namespace types      }      template <size_t... I> -    auto _map_fast(array<long, sizeof...(I)> const &indices, +    auto _map_fast(array_tuple<long, sizeof...(I)> const &indices,                     utils::index_sequence<I...>) const          -> decltype(Op()(std::get<I>(args).fast(std::get<I>(indices))...))      { @@ -702,14 +708,15 @@ namespace types      }      template <class... Indices> -    auto map_fast(Indices... indices) const -> decltype( -        this->_map_fast(array<long, sizeof...(Indices)>{{indices...}}, -                        utils::make_index_sequence<sizeof...(Args)>{})); +    auto map_fast(Indices... indices) const +        -> decltype(this->_map_fast( +            array_tuple<long, sizeof...(Indices)>{{indices...}}, +            utils::make_index_sequence<sizeof...(Args)>{}));    public:      template <size_t I>      auto shape() const -> decltype(details::init_shape_element<I>( -        args, valid_indices<value, std::tuple<Args...>>{})) +                           args, valid_indices<value, std::tuple<Args...>>{}))      {        return details::init_shape_element<I>(            args, valid_indices<value, std::tuple<Args...>>{}); @@ -733,8 +740,9 @@ namespace types              typename std::remove_reference<Args>::type::value_type>...>,          typename std::remove_reference<Args>::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 <size_t... I>      simd_iterator _vbegin(types::vectorize, utils::index_sequence<I...>) const;      simd_iterator vbegin(types::vectorize) const; @@ -754,9 +762,10 @@ namespace types  #endif      template <size_t... I, class... S> -    auto _get(utils::index_sequence<I...> is, S const &... s) const -> decltype( -        Op{}(make_subslice(utils::make_index_sequence<sizeof...(S)>{}, -                           std::get<I>(args), *this, std::make_tuple(s...))...)) +    auto _get(utils::index_sequence<I...> is, S const &...s) const +        -> decltype(Op{}( +            make_subslice(utils::make_index_sequence<sizeof...(S)>{}, +                          std::get<I>(args), *this, std::make_tuple(s...))...))      {        return Op{}(make_subslice(utils::make_index_sequence<sizeof...(S)>{},                                  std::get<I>(args), *this, @@ -764,7 +773,7 @@ namespace types      }      template <class... S> -    auto operator()(S const &... s) const +    auto operator()(S const &...s) const          -> decltype(this->_get(utils::make_index_sequence<sizeof...(Args)>{},                                 s...)); @@ -811,14 +820,13 @@ namespace types      }      template <class S>      auto operator[](S s) const -        -> decltype((*this) -                        ._index((s.lower, s), -                                utils::make_index_sequence<sizeof...(Args)>{})) +        -> decltype((*this)._index( +            (s.lower, s), utils::make_index_sequence<sizeof...(Args)>{}))      {        return _index(s, utils::make_index_sequence<sizeof...(Args)>{});      } -    dtype operator[](array<long, value> const &indices) const +    dtype operator[](array_tuple<long, value> const &indices) const      {        return _index(indices, utils::make_index_sequence<sizeof...(Args)>{});      } @@ -829,7 +837,7 @@ namespace types      long size() const;    }; -} +} // namespace types  template <class Op, class... Args>  struct assignable<types::numpy_expr<Op, Args...>> { @@ -882,8 +890,8 @@ struct __combined<pythonic::types::numpy_expr<Op, Args...>,                    pythonic::types::numpy_expr<Op2, Args2...>> {    using type = pythonic::types::ndarray<        typename pythonic::types::numpy_expr<Op, Args...>::dtype, -      pythonic::types::array<long, -                             pythonic::types::numpy_expr<Op, Args...>::value>>; +      pythonic::types::array_tuple< +          long, pythonic::types::numpy_expr<Op, Args...>::value>>;  };  template <class E, class Op, class... Args>  struct __combined<pythonic::types::numpy_iexpr<E>, @@ -907,8 +915,8 @@ struct __combined<pythonic::types::numpy_expr<Op, Args...>,                    pythonic::types::numpy_texpr<T>> {    using type = pythonic::types::ndarray<        typename pythonic::types::numpy_expr<Op, Args...>::dtype, -      pythonic::types::array<long, -                             pythonic::types::numpy_expr<Op, Args...>::value>>; +      pythonic::types::array_tuple< +          long, pythonic::types::numpy_expr<Op, Args...>::value>>;  };  template <class T, class Op, class... Args> @@ -916,8 +924,8 @@ struct __combined<pythonic::types::numpy_texpr<T>,                    pythonic::types::numpy_expr<Op, Args...>> {    using type = pythonic::types::ndarray<        typename pythonic::types::numpy_expr<Op, Args...>::dtype, -      pythonic::types::array<long, -                             pythonic::types::numpy_expr<Op, Args...>::value>>; +      pythonic::types::array_tuple< +          long, pythonic::types::numpy_expr<Op, Args...>::value>>;  };  /*}*/ diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_gexpr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_gexpr.hpp index cda948ff801..9057e4da1ff 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_gexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_gexpr.hpp @@ -150,12 +150,12 @@ namespace types      typename std::enable_if<          !is_slice<F>::value,          numpy_gexpr<ndarray<typename std::decay<E>::type::dtype, -                            array<long, std::decay<E>::type::value>>, +                            array_tuple<long, std::decay<E>::type::value>>,                      cstride_normalized_slice<1>, normalize_t<S>...>>::type      operator()(E &&expr, F const &s0, S const &...s)      {        return numpy_vexpr<ndarray<typename std::decay<E>::type::dtype, -                                 array<long, std::decay<E>::type::value>>, +                                 array_tuple<long, std::decay<E>::type::value>>,                           F>{std::forward<E>(expr), s0}(            fast_contiguous_slice(none_type{}, none_type{}), s...);      } @@ -234,9 +234,10 @@ namespace types      }      template <class T, class Ts> -    auto -    tuple_push_head(T const &val, Ts const &vals) -> decltype(tuple_push_head( -        val, vals, utils::make_index_sequence<std::tuple_size<Ts>::value>())) +    auto tuple_push_head(T const &val, Ts const &vals) +        -> decltype(tuple_push_head( +            val, vals, +            utils::make_index_sequence<std::tuple_size<Ts>::value>()))      {        return tuple_push_head(            val, vals, utils::make_index_sequence<std::tuple_size<Ts>::value>()); @@ -515,13 +516,13 @@ namespace types    };    template <class... Tys> -  struct gexpr_shape<pshape<Tys...>, array<long, 0>> { +  struct gexpr_shape<pshape<Tys...>, array_tuple<long, 0>> {      using type = pshape<Tys...>;    };    template <class... Tys, size_t N> -  struct gexpr_shape<pshape<Tys...>, array<long, N>> -      : gexpr_shape<pshape<Tys..., long>, array<long, N - 1>> { +  struct gexpr_shape<pshape<Tys...>, array_tuple<long, N>> +      : gexpr_shape<pshape<Tys..., long>, array_tuple<long, N - 1>> {    };    template <class... Tys, class... oTys, class... S, long stride> @@ -548,12 +549,12 @@ namespace types        : gexpr_shape<pshape<Tys..., long>, pshape<oTys...>, S...> {    };    template <class... Tys, size_t N, class... S> -  struct gexpr_shape<pshape<Tys...>, array<long, N>, long, S...> -      : gexpr_shape<pshape<Tys...>, array<long, N - 1>, S...> { +  struct gexpr_shape<pshape<Tys...>, array_tuple<long, N>, long, S...> +      : gexpr_shape<pshape<Tys...>, array_tuple<long, N - 1>, S...> {    };    template <class... Tys, size_t N, class cS, class... S> -  struct gexpr_shape<pshape<Tys...>, array<long, N>, cS, S...> -      : gexpr_shape<pshape<Tys..., long>, array<long, N - 1>, S...> { +  struct gexpr_shape<pshape<Tys...>, array_tuple<long, N>, cS, S...> +      : gexpr_shape<pshape<Tys..., long>, array_tuple<long, N - 1>, S...> {    };    template <class pS, class... S> @@ -640,13 +641,13 @@ namespace types      template <long stride>      static constexpr types::pshape<std::integral_constant<long, stride>>          last_stride(cstride_normalized_slice<stride>); -    static constexpr types::array<long, 1> last_stride(...); +    static constexpr types::array_tuple<long, 1> last_stride(...); -    sutils::concat_t<types::array<long, value - 1>, +    sutils::concat_t<types::array_tuple<long, value - 1>,                       typename std::conditional<                           sizeof...(S) == std::decay<Arg>::type::value,                           decltype(last_stride(std::declval<last_slice_t>())), -                         types::array<long, 1>>::type> +                         types::array_tuple<long, 1>>::type>          _strides; // strides      template <size_t I> @@ -743,6 +744,9 @@ namespace types      _copy(E const &expr);      template <class E> +    numpy_gexpr &_copy_restrict(E const &expr); + +    template <class E>      numpy_gexpr &operator=(E const &expr);      numpy_gexpr &operator=(numpy_gexpr const &expr); @@ -814,22 +818,23 @@ namespace types      void store(E elt, Indices... indices)      {        static_assert(is_dtype<E>::value, "valid store"); -      *(buffer + noffset<value>{}(*this, array<long, value>{{indices...}})) = +      *(buffer + +        noffset<value>{}(*this, array_tuple<long, value>{{indices...}})) =            static_cast<E>(elt);      }      template <class... Indices>      dtype load(Indices... indices) const      {        return *(buffer + -               noffset<value>{}(*this, array<long, value>{{indices...}})); +               noffset<value>{}(*this, array_tuple<long, value>{{indices...}}));      }      template <class Op, class E, class... Indices>      void update(E elt, Indices... indices) const      {        static_assert(is_dtype<E>::value, "valid store"); -      Op{}( -          *(buffer + noffset<value>{}(*this, array<long, value>{{indices...}})), -          static_cast<E>(elt)); +      Op{}(*(buffer + +             noffset<value>{}(*this, array_tuple<long, value>{{indices...}})), +           static_cast<E>(elt));      }  #ifdef USE_XSIMD @@ -845,24 +850,26 @@ namespace types      auto operator()(Sp const &...s) const -> decltype(make_gexpr(*this, s...));      template <class Sp> -    auto operator[](Sp const &s) const -> typename std::enable_if< -        is_slice<Sp>::value, decltype(make_gexpr(*this, (s.lower, s)))>::type; +    auto operator[](Sp const &s) const -> +        typename std::enable_if<is_slice<Sp>::value, +                                decltype(make_gexpr(*this, +                                                    (s.lower, s)))>::type;      template <size_t M> -    auto fast(array<long, M> const &indices) +    auto fast(array_tuple<long, M> const &indices)          const & -> decltype(nget<M - 1>().fast(*this, indices));      template <size_t M> -    auto fast(array<long, M> const &indices) && -> decltype(nget<M - 1>().fast( -        std::move(*this), indices)); +    auto fast(array_tuple<long, M> const &indices) +        && -> decltype(nget<M - 1>().fast(std::move(*this), indices));      template <size_t M> -    auto operator[](array<long, M> const &indices) +    auto operator[](array_tuple<long, M> const &indices)          const & -> decltype(nget<M - 1>()(*this, indices));      template <size_t M> -    auto operator[](array<long, M> const &indices) && -> decltype(nget<M - 1>()( -        std::move(*this), indices)); +    auto operator[](array_tuple<long, M> const &indices) +        && -> decltype(nget<M - 1>()(std::move(*this), indices));      template <class F> // indexing through an array of indices -- a view      typename std::enable_if<is_numexpr_arg<F>::value && @@ -927,9 +934,10 @@ namespace types      }      template <class Tp, size_t... Is> -    auto recast(utils::index_sequence<Is...>) -> decltype(make_gexpr( -        arg.template recast<Tp>(), -        recast_slice<sizeof(dtype), sizeof(Tp)>(std::get<Is>(slices))...)) +    auto recast(utils::index_sequence<Is...>) +        -> decltype(make_gexpr( +            arg.template recast<Tp>(), +            recast_slice<sizeof(dtype), sizeof(Tp)>(std::get<Is>(slices))...))      {        return make_gexpr(            arg.template recast<Tp>(), @@ -937,8 +945,8 @@ namespace types      }      template <class Tp> -    auto recast() -        -> decltype(recast<Tp>(utils::make_index_sequence<sizeof...(S)>())) +    auto +    recast() -> decltype(recast<Tp>(utils::make_index_sequence<sizeof...(S)>()))      {        return recast<Tp>(utils::make_index_sequence<sizeof...(S)>());      } @@ -988,8 +996,8 @@ struct __combined<pythonic::types::numpy_gexpr<Arg, S...>,    using type =        pythonic::types::ndarray <        typename __combined<typename t0::dtype, typename t1::dtype>::type, -        pythonic::types::array<long, -                               t0::value<t1::value ? t1::value : t0::value>>; +        pythonic::types::array_tuple< +            long, t0::value<t1::value ? t1::value : t0::value>>;  };  template <class Arg, class... S, class O> diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_iexpr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_iexpr.hpp index 18cd0242132..d0a65262313 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_iexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_iexpr.hpp @@ -14,9 +14,9 @@ namespace types    template <size_t L>    struct noffset {      template <class S, class Ty, size_t M> -    long operator()(S const &strides, array<Ty, M> const &indices) const; +    long operator()(S const &strides, array_tuple<Ty, M> const &indices) const;      template <class S, class Ty, size_t M, class pS> -    long operator()(S const &strides, array<Ty, M> const &indices, +    long operator()(S const &strides, array_tuple<Ty, M> const &indices,                      pS const &shape) const;    }; @@ -175,11 +175,11 @@ namespace types        return numpy_iexpr_helper<value>::get(std::move(*this), i);      } -    dtype const &fast(array<long, value> const &indices) const; -    dtype &fast(array<long, value> const &indices); +    dtype const &fast(array_tuple<long, value> const &indices) const; +    dtype &fast(array_tuple<long, value> const &indices);      template <size_t M> -    auto fast(array<long, M> const &indices) const +    auto fast(array_tuple<long, M> const &indices) const          -> decltype(nget<M - 1>()(*this, indices))      {        return nget<M - 1>()(*this, indices); @@ -197,7 +197,8 @@ namespace types      {        static_assert(is_dtype<E>::value, "valid store");        assert(buffer); -      *(buffer + noffset<value>{}(*this, array<long, value>{{indices...}})) = +      *(buffer + +        noffset<value>{}(*this, array_tuple<long, value>{{indices...}})) =            static_cast<E>(elt);      }      template <class... Indices> @@ -205,16 +206,16 @@ namespace types      {        assert(buffer);        return *(buffer + -               noffset<value>{}(*this, array<long, value>{{indices...}})); +               noffset<value>{}(*this, array_tuple<long, value>{{indices...}}));      }      template <class Op, class E, class... Indices>      void update(E elt, Indices... indices) const      {        static_assert(is_dtype<E>::value, "valid store");        assert(buffer); -      Op{}( -          *(buffer + noffset<value>{}(*this, array<long, value>{{indices...}})), -          static_cast<E>(elt)); +      Op{}(*(buffer + +             noffset<value>{}(*this, array_tuple<long, value>{{indices...}})), +           static_cast<E>(elt));      }  #ifdef USE_XSIMD @@ -258,10 +259,10 @@ namespace types                              numpy_gexpr<numpy_iexpr, normalize_t<Sp>>>::type      operator[](Sp const &s0) const; -    dtype const &operator[](array<long, value> const &indices) const; -    dtype &operator[](array<long, value> const &indices); +    dtype const &operator[](array_tuple<long, value> const &indices) const; +    dtype &operator[](array_tuple<long, value> const &indices);      template <size_t M> -    auto operator[](array<long, M> const &indices) +    auto operator[](array_tuple<long, M> const &indices)          const & -> decltype(nget<M - 1>()(*this, indices))      {        return nget<M - 1>()(*this, indices); diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_nary_expr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_nary_expr.hpp index df7142e881b..dd42278b3ba 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_nary_expr.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_nary_expr.hpp @@ -26,10 +26,11 @@ namespace functor      NUMPY_NARY_EXTRA_METHOD      template <typename... T> -    auto operator()(T &&... args) const -> typename std::enable_if< -        !types::valid_numexpr_parameters< -            typename std::decay<T>::type...>::value, -        decltype(NUMPY_NARY_FUNC_SYM(std::forward<T>(args)...))>::type; +    auto operator()(T &&...args) const -> +        typename std::enable_if< +            !types::valid_numexpr_parameters< +                typename std::decay<T>::type...>::value, +            decltype(NUMPY_NARY_FUNC_SYM(std::forward<T>(args)...))>::type;      template <class... E>      typename std::enable_if< @@ -37,14 +38,14 @@ namespace functor          types::numpy_expr<              NUMPY_NARY_FUNC_NAME,              typename types::NUMPY_NARY_RESHAPE_MODE<E, E...>::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/contrib/python/pythran/pythran/pythonic/include/types/numpy_op_helper.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_op_helper.hpp index 226c883ffbf..d61e0b875bf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_op_helper.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_op_helper.hpp @@ -63,6 +63,12 @@ namespace types    template <class T, class S>    struct any_numop_arg<sliced_list<T, S>> : std::false_type {    }; +  template <class T> +  struct any_numop_arg<array<T>> : std::false_type { +  }; +  template <class T, class S> +  struct any_numop_arg<sliced_array<T, S>> : std::false_type { +  };    template <class T, size_t N, class V>    struct any_numop_arg<array_base<T, N, V>> : std::false_type {    }; @@ -217,7 +223,7 @@ namespace types    struct is_array_index : std::false_type {    };    template <size_t N> -  struct is_array_index<array<long, N>> : std::true_type { +  struct is_array_index<array_tuple<long, N>> : std::true_type {    };  } // namespace types  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_operators.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_operators.hpp index 6a8a1dacc12..4348df93d0c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_operators.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/numpy_texpr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_texpr.hpp index 5f7f29f2187..592bbaf76e7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_texpr.hpp +++ b/contrib/python/pythran/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<long, value> const &indices) -        -> decltype(arg.fast(array<long, 2>{{indices[1], indices[0]}})) +    auto fast(array_tuple<long, value> const &indices) +        -> decltype(arg.fast(array_tuple<long, 2>{{indices[1], indices[0]}}))      { -      return arg.fast(array<long, 2>{{indices[1], indices[0]}}); +      return arg.fast(array_tuple<long, 2>{{indices[1], indices[0]}});      } -    auto fast(array<long, value> const &indices) const -        -> decltype(arg.fast(array<long, 2>{{indices[1], indices[0]}})) +    auto fast(array_tuple<long, value> const &indices) const +        -> decltype(arg.fast(array_tuple<long, 2>{{indices[1], indices[0]}}))      { -      return arg.fast(array<long, 2>{{indices[1], indices[0]}}); +      return arg.fast(array_tuple<long, 2>{{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 <class T> -    auto operator[](array<T, value> const &indices) -        -> decltype(arg[array<T, 2>{{indices[1], indices[0]}}]) +    auto operator[](array_tuple<T, value> const &indices) +        -> decltype(arg[array_tuple<T, 2>{{indices[1], indices[0]}}])      { -      return arg[array<T, 2>{{indices[1], indices[0]}}]; +      return arg[array_tuple<T, 2>{{indices[1], indices[0]}}];      }      template <class T> -    auto operator[](array<T, value> const &indices) const -        -> decltype(arg[array<T, 2>{{indices[1], indices[0]}}]) +    auto operator[](array_tuple<T, value> const &indices) const +        -> decltype(arg[array_tuple<T, 2>{{indices[1], indices[0]}}])      { -      return arg[array<T, 2>{{indices[1], indices[0]}}]; +      return arg[array_tuple<T, 2>{{indices[1], indices[0]}}];      }      template <class T0, class T1>      auto operator[](std::tuple<T0, T1> const &indices) @@ -188,20 +188,22 @@ namespace types      }      template <class S> -    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 <class S> -    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_texpr<decltype(this->arg( +                                fast_contiguous_slice(pythonic::builtins::None, +                                                      pythonic::builtins::None), +                                (s0.step, s0)))>;      template <class S, size_t... I>      auto _reverse_index(S const &indices, utils::index_sequence<I...>) const -        -> decltype( -            numpy::functor::transpose{}(this->arg(std::get<I>(indices)...))) +        -> decltype(numpy::functor::transpose{}( +            this->arg(std::get<I>(indices)...)))      {        return numpy::functor::transpose{}(arg(std::get<I>(indices)...));      } @@ -211,19 +213,20 @@ namespace types      }      template <class Tp, size_t... Is> -    auto recast() -        -> decltype(numpy::functor::transpose{}(arg.template recast<Tp>())) +    auto +    recast() -> decltype(numpy::functor::transpose{}(arg.template recast<Tp>()))      {        return numpy::functor::transpose{}(arg.template recast<Tp>());      }      template <class S0, class... S> -    auto -    operator()(S0 const &s0, S const &...s) const -> typename std::enable_if< -        !is_numexpr_arg<S0>::value, -        decltype(this->_reverse_index( -            std::tuple<S0 const &, S const &...>{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<S0>::value, +            decltype(this->_reverse_index( +                std::tuple<S0 const &, S const &...>{s0, s...}, +                utils::make_reversed_index_sequence<1 + sizeof...(S)>()))>:: +            type;      template <class S0, class... S>      auto operator()(S0 const &s0, S const &...s) const -> @@ -280,16 +283,16 @@ namespace types      using numpy_texpr_2<ndarray<T, pshape<S0, S1>>>::operator=;    };    template <class T> -  struct numpy_texpr<ndarray<T, array<long, 2>>> -      : numpy_texpr_2<ndarray<T, array<long, 2>>> { +  struct numpy_texpr<ndarray<T, array_tuple<long, 2>>> +      : numpy_texpr_2<ndarray<T, array_tuple<long, 2>>> {      numpy_texpr() = default;      numpy_texpr(numpy_texpr const &) = default;      numpy_texpr(numpy_texpr &&) = default; -    numpy_texpr(ndarray<T, array<long, 2>> const &arg); +    numpy_texpr(ndarray<T, array_tuple<long, 2>> const &arg);      numpy_texpr &operator=(numpy_texpr const &) = default; -    using numpy_texpr_2<ndarray<T, array<long, 2>>>::operator=; +    using numpy_texpr_2<ndarray<T, array_tuple<long, 2>>>::operator=;    };    template <class E, class... S> @@ -314,7 +317,7 @@ namespace types      static constexpr auto value = broadcasted<E>::value;      using value_type = broadcast<typename E::dtype, typename E::dtype>;      using dtype = typename broadcasted<E>::dtype; -    using shape_t = types::array<long, value>; +    using shape_t = types::array_tuple<long, value>;      using iterator = nditerator<numpy_texpr<broadcasted<E>>>;      using const_iterator = const_nditerator<numpy_texpr<broadcasted<E>>>;      // FIXME: I've got the feeling that this could be improved diff --git a/contrib/python/pythran/pythran/pythonic/include/types/numpy_vexpr.hpp b/contrib/python/pythran/pythran/pythonic/include/types/numpy_vexpr.hpp index 02c5f1e5cf9..a58d796f910 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/numpy_vexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/numpy_vexpr.hpp @@ -48,7 +48,7 @@ namespace types      numpy_vexpr &operator=(numpy_vexpr const &); -    using shape_t = array<long, value>; +    using shape_t = array_tuple<long, value>;      template <size_t I>      long shape() const      { @@ -97,8 +97,8 @@ namespace types        return data_.fast(view_.fast(i));      }      template <class... S> -    auto operator()(S const &... slices) const -        -> decltype(ndarray<dtype, array<long, value>>{*this}(slices...)); +    auto operator()(S const &...slices) const +        -> decltype(ndarray<dtype, array_tuple<long, value>>{*this}(slices...));      auto operator[](long i) const -> decltype(data_[i])      { @@ -171,7 +171,7 @@ namespace types      template <class E>      numpy_vexpr &operator^=(E const &expr);    }; -} +} // namespace types  template <class T, class F>  struct assignable<types::numpy_vexpr<T, F>> { diff --git a/contrib/python/pythran/pythran/pythonic/include/types/pointer.hpp b/contrib/python/pythran/pythran/pythonic/include/types/pointer.hpp index cdb85130930..ee6fddb21cf 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/pointer.hpp +++ b/contrib/python/pythran/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<I, pythonic::types::pointer<T>> {      typedef typename pythonic::types::pointer<T>::value_type type;    }; -} +} // namespace std  #ifdef ENABLE_PYTHON_MODULE diff --git a/contrib/python/pythran/pythran/pythonic/include/types/raw_array.hpp b/contrib/python/pythran/pythran/pythonic/include/types/raw_array.hpp index b27bcc83956..55f35488374 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/raw_array.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/types/static_if.hpp b/contrib/python/pythran/pythran/pythonic/include/types/static_if.hpp index 86e4b6c9461..f5cb1f7038a 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/static_if.hpp +++ b/contrib/python/pythran/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<size_t, I>{});    } -} +} // namespace std  /* type inference stuff { */  #include "pythonic/include/types/combined.hpp" diff --git a/contrib/python/pythran/pythran/pythonic/include/types/str.hpp b/contrib/python/pythran/pythran/pythonic/include/types/str.hpp index 4771a181fb4..ca373c734fc 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/str.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/str.hpp @@ -328,8 +328,9 @@ namespace operator_  {    template <size_t N, class Arg> -  auto mod(const char (&fmt)[N], Arg &&arg) -      -> decltype(pythonic::types::str(fmt) % std::forward<Arg>(arg)); +  auto mod(const char (&fmt)[N], +           Arg &&arg) -> decltype(pythonic::types::str(fmt) % +                                  std::forward<Arg>(arg));    pythonic::types::str add(char const *self, char const *other); @@ -355,7 +356,9 @@ struct assignable<char[N]> {    using type = types::str;  };  template <size_t N> -struct assignable<char const [N]> { using type = types::str; }; +struct assignable<char const[N]> { +  using type = types::str; +};  PYTHONIC_NS_END  namespace std diff --git a/contrib/python/pythran/pythran/pythonic/include/types/traits.hpp b/contrib/python/pythran/pythran/pythonic/include/types/traits.hpp index 1434466419c..c14ca8fce6f 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/traits.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/traits.hpp @@ -47,8 +47,9 @@ namespace types      static std::integral_constant<bool, true> _test(decltype(&C::member));     \      template <class C>                                                         \      static std::integral_constant<bool, false> _test(...);                     \ -    static const bool value = decltype(                                        \ -        _test<typename std::remove_reference<T>::type>(nullptr))::value;       \ +    static const bool value =                                                  \ +        decltype(_test<typename std::remove_reference<T>::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/contrib/python/pythran/pythran/pythonic/include/types/tuple.hpp b/contrib/python/pythran/pythran/pythonic/include/types/tuple.hpp index 40c6f55a9f2..a5eed3475e1 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/tuple.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/tuple.hpp @@ -66,7 +66,7 @@ namespace types    };    template <class T, size_t N> -  using array = array_base<T, N, tuple_version>; +  using array_tuple = array_base<T, N, tuple_version>;    template <class T, size_t N>    using static_list = array_base<T, N, list_version>; @@ -134,7 +134,7 @@ namespace types    template <class... Tys>    struct iterator<pshape<Tys...>> { -    using type = array<long, sizeof...(Tys)>; +    using type = array_tuple<long, sizeof...(Tys)>;    };    template <long N> @@ -230,16 +230,17 @@ namespace types      pshape &operator=(pshape &&) = default;      template <size_t... Is> -    types::array<long, sizeof...(Tys)> array(utils::index_sequence<Is...>) const +    types::array_tuple<long, sizeof...(Tys)> +    array(utils::index_sequence<Is...>) const      {        return {{get<Is>()...}};      } -    types::array<long, sizeof...(Tys)> array() const +    types::array_tuple<long, sizeof...(Tys)> array() const      {        return array(utils::make_index_sequence<sizeof...(Tys)>());      } -    operator types::array<long, sizeof...(Tys)>() const +    operator types::array_tuple<long, sizeof...(Tys)>() const      {        return array();      } @@ -275,14 +276,14 @@ namespace types    struct array_base_slicer {      template <class T, size_t N> -    dynamic_tuple<T> operator()(array<T, N> const &b, slice const &s); +    dynamic_tuple<T> operator()(array_tuple<T, N> const &b, slice const &s);      template <class T, size_t N, long stride> -    dynamic_tuple<T> operator()(array<T, N> const &b, +    dynamic_tuple<T> operator()(array_tuple<T, N> const &b,                                  cstride_slice<stride> const &s);      template <class T, size_t N> -    dynamic_tuple<T> operator()(array<T, N> const &b, +    dynamic_tuple<T> operator()(array_tuple<T, N> const &b,                                  fast_contiguous_slice const &s);      template <class T, size_t N, class S> @@ -404,8 +405,8 @@ namespace types      const_reference operator[](long __n) const noexcept;      template <class S> -    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<array_base, value>::type;      template <size_t I> -    auto shape() const -        -> decltype(details::extract_shape(*this, utils::int_<I>{})) +    auto shape() const -> decltype(details::extract_shape(*this, +                                                          utils::int_<I>{}))      {        return details::extract_shape(*this, utils::int_<I>{});      } @@ -587,7 +588,7 @@ namespace types    template <class... Types>    struct _make_tuple<true, Types...> { -    types::array<typename alike<Types...>::type, sizeof...(Types)> +    types::array_tuple<typename alike<Types...>::type, sizeof...(Types)>      operator()(Types &&...types)      {        return {{std::forward<Types>(types)...}}; @@ -609,14 +610,14 @@ namespace types    using make_tuple_t = decltype(types::make_tuple(std::declval<Tys>()...));    template <class T, class Tuple, size_t... S> -  types::array<T, sizeof...(S)> _to_array(Tuple const &t, -                                          utils::index_sequence<S...>) +  types::array_tuple<T, sizeof...(S)> _to_array(Tuple const &t, +                                                utils::index_sequence<S...>)    {      return {{static_cast<T>(std::get<S>(t))...}};    }    template <class T, class... Tys> -  types::array<T, sizeof...(Tys)> to_array(std::tuple<Tys...> const &t) +  types::array_tuple<T, sizeof...(Tys)> to_array(std::tuple<Tys...> const &t)    {      return _to_array<T>(t, utils::make_index_sequence<sizeof...(Tys)>());    } @@ -734,8 +735,9 @@ struct __combined<pythonic::types::static_list<T, N>,  };  template <class T, size_t N> -struct __combined<pythonic::types::array<T, N>, pythonic::types::array<T, N>> { -  using type = pythonic::types::array<T, N>; +struct __combined<pythonic::types::array_tuple<T, N>, +                  pythonic::types::array_tuple<T, N>> { +  using type = pythonic::types::array_tuple<T, N>;  };  template <class T0, class T1, size_t N, class V> @@ -833,8 +835,9 @@ struct __combined<std::tuple<t0...>,    static std::tuple<typename pythonic::details::pick_combined<        typename std::tuple_element<Is, holder>::type, t, I == Is>::type...>        make_type(pythonic::utils::index_sequence<Is...>); -  static auto make_type() -> decltype(make_type( -      pythonic::utils::make_index_sequence<sizeof...(t0)>())); +  static auto +  make_type() -> decltype(make_type( +                  pythonic::utils::make_index_sequence<sizeof...(t0)>()));    using type = decltype(make_type());  }; @@ -844,23 +847,23 @@ struct __combined<indexable_container<k, t>, std::tuple<t0...>>  };  template <class t, size_t n, class... types> -struct __combined<pythonic::types::array<t, n>, std::tuple<types...>> { +struct __combined<pythonic::types::array_tuple<t, n>, std::tuple<types...>> {    using type = std::tuple<typename __combined<t, types>::type...>;  };  template <class t, size_t n, class... types> -struct __combined<pythonic::types::array<t, n>, +struct __combined<pythonic::types::array_tuple<t, n>,                    pythonic::types::pshape<types...>> { -  using type = pythonic::types::array<t, n>; +  using type = pythonic::types::array_tuple<t, n>;  };  template <class t, size_t n, class... types>  struct __combined<pythonic::types::pshape<types...>, -                  pythonic::types::array<t, n>> { -  using type = pythonic::types::array<t, n>; +                  pythonic::types::array_tuple<t, n>> { +  using type = pythonic::types::array_tuple<t, n>;  };  template <class t, size_t n, class... types> -struct __combined<std::tuple<types...>, pythonic::types::array<t, n>> { +struct __combined<std::tuple<types...>, pythonic::types::array_tuple<t, n>> {    using type = std::tuple<typename __combined<types, t>::type...>;  };  template <class t00, class t01, class t10, class t11> @@ -946,7 +949,7 @@ namespace sutils    template <typename T, size_t N, class V>    struct make_shape<types::array_base<T, N, V>> { -    using type = types::array<long, N>; +    using type = types::array_tuple<long, N>;    };    template <class T> @@ -1050,8 +1053,8 @@ namespace sutils    template <class T>    struct transpose;    template <class T> -  struct transpose<types::array<T, 2>> { -    using type = types::array<T, 2>; +  struct transpose<types::array_tuple<T, 2>> { +    using type = types::array_tuple<T, 2>;    };    template <class T0, class T1> @@ -1118,7 +1121,7 @@ namespace sutils    };    template <typename T, size_t N, class V>    struct pop_tail<types::array_base<T, N, V>> { -    using type = types::array<T, N - 1>; +    using type = types::array_tuple<T, N - 1>;    };    template <class T> @@ -1130,7 +1133,7 @@ namespace sutils    };    template <typename T, size_t N, class V>    struct pop_head<types::array_base<T, N, V>> { -    using type = types::array<T, N - 1>; +    using type = types::array_tuple<T, N - 1>;    };    template <class T> @@ -1155,7 +1158,8 @@ namespace sutils    using head_t = typename head<T>::type;    template <class... Tys> -  types::array<long, sizeof...(Tys)> array(types::pshape<Tys...> const &pS) +  types::array_tuple<long, sizeof...(Tys)> +  array(types::pshape<Tys...> const &pS)    {      return pS.array();    } @@ -1166,8 +1170,8 @@ namespace sutils      return pS;    }    template <class E, size_t... Is> -  types::array<long, sizeof...(Is)> getshape(E const &e, -                                             utils::index_sequence<Is...>) +  types::array_tuple<long, sizeof...(Is)> getshape(E const &e, +                                                   utils::index_sequence<Is...>)    {      return {(long)(e.template shape<Is>())...};    } @@ -1192,27 +1196,27 @@ namespace sutils    };    template <class... Tys> -  struct concat<types::pshape<Tys...>, types::array<long, 0>> { +  struct concat<types::pshape<Tys...>, types::array_tuple<long, 0>> {      using type = types::pshape<Tys...>;    };    template <class... Tys, size_t N> -  struct concat<types::pshape<Tys...>, types::array<long, N>> -      : concat<types::pshape<Tys..., long>, types::array<long, N - 1>> { +  struct concat<types::pshape<Tys...>, types::array_tuple<long, N>> +      : concat<types::pshape<Tys..., long>, types::array_tuple<long, N - 1>> {    };    template <class... Ty1s> -  struct concat<types::array<long, 0>, types::pshape<Ty1s...>> { +  struct concat<types::array_tuple<long, 0>, types::pshape<Ty1s...>> {      using type = types::pshape<Ty1s...>;    };    template <size_t N, class... Ty1s> -  struct concat<types::array<long, N>, types::pshape<Ty1s...>> -      : concat<types::array<long, N - 1>, types::pshape<long, Ty1s...>> { +  struct concat<types::array_tuple<long, N>, types::pshape<Ty1s...>> +      : concat<types::array_tuple<long, N - 1>, types::pshape<long, Ty1s...>> {    };    template <size_t N, size_t M> -  struct concat<types::array<long, N>, types::array<long, M>> { -    using type = types::array<long, N + M>; +  struct concat<types::array_tuple<long, N>, types::array_tuple<long, M>> { +    using type = types::array_tuple<long, N + M>;    };    template <class... Tys> @@ -1619,12 +1623,12 @@ struct to_python<std::tuple<Types...>> {  };  template <typename T, size_t N> -struct to_python<types::array<T, N>> { +struct to_python<types::array_tuple<T, N>> {    template <size_t... S> -  static PyObject *do_convert(types::array<T, N> const &t, +  static PyObject *do_convert(types::array_tuple<T, N> const &t,                                utils::index_sequence<S...>); -  static PyObject *convert(types::array<T, N> const &t); +  static PyObject *convert(types::array_tuple<T, N> const &t);  };  template <typename T, size_t N> @@ -1652,14 +1656,14 @@ struct from_python<std::tuple<Types...>> {  };  template <typename T, size_t N> -struct from_python<types::array<T, N>> { +struct from_python<types::array_tuple<T, N>> {    static bool is_convertible(PyObject *obj);    template <size_t... S> -  static types::array<T, N> do_convert(PyObject *obj, -                                       typename utils::index_sequence<S...>); -  static types::array<T, N> convert(PyObject *obj); +  static types::array_tuple<T, N> +  do_convert(PyObject *obj, typename utils::index_sequence<S...>); +  static types::array_tuple<T, N> convert(PyObject *obj);  };  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/variant_functor.hpp b/contrib/python/pythran/pythran/pythonic/include/types/variant_functor.hpp index 2225cb029a8..46df29576d8 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/variant_functor.hpp +++ b/contrib/python/pythran/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 <utility> @@ -80,11 +80,11 @@ namespace types        void assign(char mem[], variant_functor<OtherType> const &);        template <class... Args> -      auto operator()(Args &&... args) +      auto operator()(Args &&...args)            -> decltype(std::declval<Type>()(std::forward<Args>(args)...));        template <class... Args> -      auto operator()(Args &&... args) const +      auto operator()(Args &&...args) const            -> decltype(std::declval<Type>()(std::forward<Args>(args)...));      }; @@ -98,7 +98,7 @@ namespace types        variant_functor_impl(variant_functor_impl const &) = delete;        template <class... OtherTypes> -      variant_functor_impl(char mem[], OtherTypes const &... t); +      variant_functor_impl(char mem[], OtherTypes const &...t);        template <class... OtherTypes>        variant_functor_impl(char mem[], @@ -112,16 +112,20 @@ namespace types        void assign(char mem[], OtherType const &);        template <class... Args> -      auto operator()(Args &&... args) -> typename __combined< -          decltype(std::declval<Type>()(std::forward<Args>(args)...)), -          decltype(std::declval<Types>()(std::forward<Args>(args)...))...>::type; +      auto operator()(Args &&...args) -> +          typename __combined< +              decltype(std::declval<Type>()(std::forward<Args>(args)...)), +              decltype(std::declval<Types>()( +                  std::forward<Args>(args)...))...>::type;        template <class... Args> -      auto operator()(Args &&... args) const -> typename __combined< -          decltype(std::declval<Type>()(std::forward<Args>(args)...)), -          decltype(std::declval<Types>()(std::forward<Args>(args)...))...>::type; +      auto operator()(Args &&...args) const -> +          typename __combined< +              decltype(std::declval<Type>()(std::forward<Args>(args)...)), +              decltype(std::declval<Types>()( +                  std::forward<Args>(args)...))...>::type;      }; -  } +  } // namespace details    template <class... Types>    struct variant_functor : details::variant_functor_impl<Types...> { @@ -144,11 +148,11 @@ namespace types      variant_functor &operator=(variant_functor<OtherTypes...> const &);      template <class... OtherTypes> -    variant_functor(OtherTypes const &... t); +    variant_functor(OtherTypes const &...t);      template <class... OtherTypes>      variant_functor(variant_functor<OtherTypes...> const &t);    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/types/vectorizable_type.hpp b/contrib/python/pythran/pythran/pythonic/include/types/vectorizable_type.hpp index 4c1ea987883..e8a3f773426 100644 --- a/contrib/python/pythran/pythran/pythonic/include/types/vectorizable_type.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/types/vectorizable_type.hpp @@ -14,14 +14,14 @@ namespace types    };    struct vectorizer {      template <class E> -    static auto vbegin(E &&expr) -        -> decltype(std::forward<E>(expr).vbegin(vectorize{})) +    static auto +    vbegin(E &&expr) -> decltype(std::forward<E>(expr).vbegin(vectorize{}))      {        return std::forward<E>(expr).vbegin(vectorize{});      }      template <class E> -    static auto vend(E &&expr) -        -> decltype(std::forward<E>(expr).vend(vectorize{})) +    static auto +    vend(E &&expr) -> decltype(std::forward<E>(expr).vend(vectorize{}))      {        return std::forward<E>(expr).vend(vectorize{});      } @@ -52,7 +52,7 @@ namespace types    };    /* trait to check if is T is an array-like type that supports vectorization -  */ +   */    template <class T, bool scalar = has_vectorizable<T>::value>    struct is_vectorizable_array; @@ -77,7 +77,7 @@ namespace types    template <class Op, class... Args>    struct numpy_expr; -} +} // namespace types  namespace utils  { @@ -111,6 +111,6 @@ namespace utils    {      return true;    } -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/array_helper.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/array_helper.hpp index 694e117aebd..2a309b23224 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/array_helper.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/array_helper.hpp @@ -13,20 +13,20 @@ PYTHONIC_NS_BEGIN  template <size_t L>  struct nget {    template <class A, size_t M> -  auto operator()(A &&self, types::array<long, M> const &indices) +  auto operator()(A &&self, types::array_tuple<long, M> const &indices)        -> decltype(nget<L - 1>()(std::forward<A>(self)[0], indices));    template <class A, size_t M> -  auto fast(A &&self, types::array<long, M> const &indices) +  auto fast(A &&self, types::array_tuple<long, M> const &indices)        -> decltype(nget<L - 1>().fast(std::forward<A>(self).fast(0), indices));  };  template <>  struct nget<0> {    template <class A, size_t M> -  auto operator()(A &&self, types::array<long, M> const &indices) +  auto operator()(A &&self, types::array_tuple<long, M> const &indices)        -> decltype(std::forward<A>(self)[indices[M - 1]]);    template <class A, size_t M> -  auto fast(A &&self, types::array<long, M> const &indices) +  auto fast(A &&self, types::array_tuple<long, M> const &indices)        -> decltype(std::forward<A>(self).fast(indices[M - 1]));  };  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/functor.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/functor.hpp index 5c40c6b4951..260e4d597a4 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/functor.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/functor.hpp @@ -11,7 +11,7 @@      struct name {                                                              \        using callable = void;                                                   \        template <typename... Types>                                             \ -      auto operator()(Types && ... types) const                                \ +      auto operator()(Types &&...types) const                                  \            -> decltype(f(std::forward<Types>(types)...))                        \        {                                                                        \          return f(std::forward<Types>(types)...);                               \ diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/fwd.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/fwd.hpp index 102d9c27cac..fb3a962005c 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/fwd.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/fwd.hpp @@ -7,7 +7,7 @@ namespace utils  {    template <typename... Types> -  void fwd(Types const &... types); +  void fwd(Types const &...types);  }  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/int_.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/int_.hpp index 7f1d30b4f73..4790c074dfe 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/int_.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/int_.hpp @@ -8,7 +8,7 @@ namespace utils    template <size_t>    struct int_ {    }; // compile-time counter -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/iterator.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/iterator.hpp index 398ffd03c24..306d96376a5 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/iterator.hpp +++ b/contrib/python/pythran/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 <class T> @@ -60,7 +60,7 @@ namespace utils                       std::forward_iterator_tag>::value,          std::forward_iterator_tag, typename iterator_min<Iters...>::type>::type;    }; -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/meta.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/meta.hpp index e955d212670..f2962595da0 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/meta.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/include/utils/nested_container.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/nested_container.hpp index aaedefa8c42..e53703a1ce3 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/nested_container.hpp +++ b/contrib/python/pythran/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 <limits>  #include "pythonic/include/types/traits.hpp"  #include "pythonic/include/utils/numpy_traits.hpp" +#include <limits>  PYTHONIC_NS_BEGIN  namespace types @@ -12,11 +12,15 @@ namespace types    class sliced_list;    template <class T>    class list; +  template <class T, class S> +  class sliced_array; +  template <class T> +  class array;    template <class T, size_t N, class V>    struct array_base;    template <class T>    struct dynamic_tuple; -} +} // namespace types  namespace utils  { @@ -52,6 +56,16 @@ namespace utils    };    template <class T> +  struct nested_container_depth<types::array<T>> { +    static const int value = 1; +  }; + +  template <class T, class S> +  struct nested_container_depth<types::sliced_array<T, S>> { +    static const int value = 1; +  }; + +  template <class T>    struct nested_container_depth<types::dynamic_tuple<T>> {      static const int value = 1 + nested_container_depth<T>::value;    }; @@ -120,6 +134,16 @@ namespace utils      using type = typename nested_container_value_type<T>::type;    }; +  template <class T> +  struct nested_container_value_type<types::array<T>> { +    using type = T; +  }; + +  template <class T, class S> +  struct nested_container_value_type<types::sliced_array<T, S>> { +    using type = T; +  }; +    template <class T, size_t N, class V>    struct nested_container_value_type<types::array_base<T, N, V>> {      using type = typename nested_container_value_type<T>::type; @@ -129,7 +153,7 @@ namespace utils    struct nested_container_value_type<types::ndarray<T, sP>> {      using type = T;    }; -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/neutral.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/neutral.hpp index 8ddc471013e..21eecd2b8d7 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/neutral.hpp +++ b/contrib/python/pythran/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 <class T>    T const neutral<operator_::functor::ixor, T>::value = 0; -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/numpy_conversion.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/numpy_conversion.hpp index da399d29e58..8fafd52d791 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/numpy_conversion.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/numpy_conversion.hpp @@ -15,8 +15,8 @@  #else  #define NUMPY_EXPR_TO_NDARRAY0_DECL(fname)                                     \    template <class E, class... Types>                                           \ -  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<E>::value && types::is_numexpr_arg<E>::value,     \            decltype(fname(                                                      \                types::ndarray<typename E::dtype, typename E::shape_t>{expr},    \ diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/numpy_traits.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/numpy_traits.hpp index 967d385a431..112ff7a9491 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/numpy_traits.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/numpy_traits.hpp @@ -36,6 +36,12 @@ namespace types    struct empty_list; +  template <class T> +  class array; + +  template <class T, class S> +  class sliced_array; +    template <class T, size_t N, class V>    struct array_base; @@ -130,9 +136,7 @@ namespace types    };    template <class T, class S> -  struct is_numexpr_arg<sliced_list<T, S>> { -    static constexpr bool value = -        is_numexpr_arg<T>::value || is_dtype<T>::value; +  struct is_numexpr_arg<sliced_list<T, S>> : is_numexpr_arg<list<T>> {    };    template <> @@ -141,6 +145,15 @@ namespace types    };    template <class T> +  struct is_numexpr_arg<array<T>> : is_numexpr_arg<list<T>> { +  }; + +  template <class T, class S> +  struct is_numexpr_arg<sliced_array<T, S>> +      : is_numexpr_arg<sliced_list<T, S>> { +  }; + +  template <class T>    struct is_numexpr_arg<broadcasted<T>> {      static constexpr bool value =          is_numexpr_arg<T>::value || is_dtype<T>::value; @@ -172,7 +185,7 @@ namespace types      static T get(...);      using type = decltype(get<E>(nullptr));    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/seq.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/seq.hpp index 470e9860ad7..abb47fe97be 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/seq.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/seq.hpp @@ -27,7 +27,7 @@ namespace utils      struct make_integer_sequence<T, 0, S...> {        using type = integer_sequence<T, S...>;      }; -  } +  } // namespace details    template <class T, std::size_t N>    using make_integer_sequence = @@ -50,7 +50,7 @@ namespace utils      struct make_reversed_integer_sequence<T, 0, S...> {        using type = integer_sequence<T, S...>;      }; -  } +  } // namespace details    template <class T, std::size_t N>    using make_reversed_integer_sequence = @@ -74,14 +74,14 @@ namespace utils      struct repeated_type<T, 0, Tys...> {        using type = type_sequence<Tys...>;      }; -  } +  } // namespace details    template <class T, std::size_t N>    struct repeated_type : details::repeated_type<T, N> {    };    template <class T, std::size_t N>    using make_repeated_type = typename repeated_type<T, N>::type; -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/include/utils/tags.hpp b/contrib/python/pythran/pythran/pythonic/include/utils/tags.hpp index 00687a6b181..593bfcdbd1d 100644 --- a/contrib/python/pythran/pythran/pythonic/include/utils/tags.hpp +++ b/contrib/python/pythran/pythran/pythonic/include/utils/tags.hpp @@ -12,7 +12,7 @@ namespace purity    struct pure_tag {    }; -} +} // namespace purity  template <class T>  struct purity_of { diff --git a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/close.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/close.hpp index a6baf27edbc..3bd77d7fdf4 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/close.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp index 8df4ed963e2..e00a67b2da5 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/fileno.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp index b082f39d250..3b7676e7ea8 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/flush.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp index 10c3faa4f33..9e393a649c7 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/isatty.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/next.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/next.hpp index f3728768715..80356c84016 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/next.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/read.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/read.hpp index b684eb8a56c..ed108854184 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/read.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp index 326bec25f8a..0b47014dc4f 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readline.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp index d3aa0b16697..680dab661ee 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/readlines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp index ecc145890b4..51b045754e9 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/seek.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp index 616d5c4cd0d..15e7c3898ba 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/tell.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp index 26f1ad63223..d489e96b0b6 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/truncate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/write.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/write.hpp index 2a229ebcd35..1bd33acfec3 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/write.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp b/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp index f0749fd41af..00fb4dd3bd2 100644 --- a/contrib/python/pythran/pythran/pythonic/io/_io/TextIOWrapper/writelines.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/itertools/islice.hpp b/contrib/python/pythran/pythran/pythonic/itertools/islice.hpp index f8bda4f878c..5220c0f15da 100644 --- a/contrib/python/pythran/pythran/pythonic/itertools/islice.hpp +++ b/contrib/python/pythran/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 <iterator>  PYTHONIC_NS_BEGIN @@ -50,29 +50,29 @@ namespace itertools    }    template <typename Iterable> -  bool islice_iterator<Iterable>:: -  operator==(islice_iterator<Iterable> const &other) const +  bool islice_iterator<Iterable>::operator==( +      islice_iterator<Iterable> const &other) const    {      return (state == other.state);    }    template <typename Iterable> -  bool islice_iterator<Iterable>:: -  operator!=(islice_iterator<Iterable> const &other) const +  bool islice_iterator<Iterable>::operator!=( +      islice_iterator<Iterable> const &other) const    {      return state != other.state;    }    template <typename Iterable> -  bool islice_iterator<Iterable>:: -  operator<(islice_iterator<Iterable> const &other) const +  bool islice_iterator<Iterable>::operator<( +      islice_iterator<Iterable> const &other) const    {      return state != other.state;    }    template <typename Iterable> -  int islice_iterator<Iterable>:: -  operator-(islice_iterator<Iterable> const &other) const +  int islice_iterator<Iterable>::operator-( +      islice_iterator<Iterable> 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/contrib/python/pythran/pythran/pythonic/itertools/permutations.hpp b/contrib/python/pythran/pythran/pythonic/itertools/permutations.hpp index 2dd2e4feabe..cba48890fde 100644 --- a/contrib/python/pythran/pythran/pythonic/itertools/permutations.hpp +++ b/contrib/python/pythran/pythran/pythonic/itertools/permutations.hpp @@ -37,7 +37,8 @@ namespace itertools      return res;    }    template <class T, size_t N> -  types::array<T, N> init_permut_from(size_t n, types::array<T, N> *) +  types::array_tuple<T, N> init_permut_from(size_t n, +                                            types::array_tuple<T, N> *)    {      assert(N == n && "consistent init");      return {}; @@ -60,9 +61,10 @@ namespace itertools      return {begin, end};    }    template <class T, size_t N, class I> -  types::array<T, N> init_permut_from(I begin, I end, types::array<T, N> *) +  types::array_tuple<T, N> init_permut_from(I begin, I end, +                                            types::array_tuple<T, N> *)    { -    types::array<T, N> res; +    types::array_tuple<T, N> res;      std::copy(begin, end, res.begin());      return res;    } @@ -167,7 +169,7 @@ namespace itertools    }    template <typename T, long N> -  _permutations<T, types::array<typename T::value_type, (size_t)N>> +  _permutations<T, types::array_tuple<typename T::value_type, (size_t)N>>    permutations(T iter, std::integral_constant<long, N>)    {      return {iter, N}; diff --git a/contrib/python/pythran/pythran/pythonic/itertools/product.hpp b/contrib/python/pythran/pythran/pythonic/itertools/product.hpp index db31e83c780..7572ed249f5 100644 --- a/contrib/python/pythran/pythran/pythonic/itertools/product.hpp +++ b/contrib/python/pythran/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 <typename... Iters>      types::make_tuple_t<typename Iters::value_type...> -        product_iterator<Iters...>::operator*() const +    product_iterator<Iters...>::operator*() const      {        return get_value(utils::make_index_sequence<sizeof...(Iters)>{});      } @@ -73,27 +73,27 @@ namespace itertools      template <typename... Iters>      product_iterator<Iters...> &product_iterator<Iters...>::operator++()      { -      advance(utils::int_<sizeof...(Iters)-1>{}); +      advance(utils::int_<sizeof...(Iters) - 1>{});        return *this;      }      template <typename... Iters> -    bool product_iterator<Iters...>:: -    operator==(product_iterator<Iters...> const &other) const +    bool product_iterator<Iters...>::operator==( +        product_iterator<Iters...> const &other) const      {        return end == other.end;      }      template <typename... Iters> -    bool product_iterator<Iters...>:: -    operator!=(product_iterator<Iters...> const &other) const +    bool product_iterator<Iters...>::operator!=( +        product_iterator<Iters...> const &other) const      {        return end != other.end;      }      template <typename... Iters> -    bool product_iterator<Iters...>:: -    operator<(product_iterator<Iters...> const &other) const +    bool product_iterator<Iters...>::operator<( +        product_iterator<Iters...> 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 <typename... Iters> -    product<Iters...>::product(Iters const &... _iters) +    product<Iters...>::product(Iters const &..._iters)          : utils::iterator_reminder<true, Iters...>(_iters...),            iterator(this->values,                     utils::make_index_sequence<sizeof...(Iters)>{}), @@ -129,16 +129,16 @@ namespace itertools      {        return end_iter;      } -  } +  } // namespace details    template <typename... Iter>    details::product<typename std::remove_cv<        typename std::remove_reference<Iter>::type>::type...> -  product(Iter &&... iters) +  product(Iter &&...iters)    {      return {std::forward<Iter>(iters)...};    } -} +} // namespace itertools  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/itertools/repeat.hpp b/contrib/python/pythran/pythran/pythonic/itertools/repeat.hpp index cbaffb86265..7e9f3ab6743 100644 --- a/contrib/python/pythran/pythran/pythonic/itertools/repeat.hpp +++ b/contrib/python/pythran/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 <class T, bool Endless> -  bool repeat_iterator<T, Endless>:: -  operator!=(repeat_iterator<T, Endless> const &other) const +  bool repeat_iterator<T, Endless>::operator!=( +      repeat_iterator<T, Endless> const &other) const    {      return Endless || count_ != other.count_;    }    template <class T, bool Endless> -  bool repeat_iterator<T, Endless>:: -  operator==(repeat_iterator<T, Endless> const &other) const +  bool repeat_iterator<T, Endless>::operator==( +      repeat_iterator<T, Endless> const &other) const    {      return !Endless && count_ == other.count_;    }    template <class T, bool Endless> -  bool repeat_iterator<T, Endless>:: -  operator<(repeat_iterator<T, Endless> const &other) const +  bool repeat_iterator<T, Endless>::operator<( +      repeat_iterator<T, Endless> 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/contrib/python/pythran/pythran/pythonic/math/ceil.hpp b/contrib/python/pythran/pythran/pythonic/math/ceil.hpp index f39319198d7..b29180fadc8 100644 --- a/contrib/python/pythran/pythran/pythonic/math/ceil.hpp +++ b/contrib/python/pythran/pythran/pythonic/math/ceil.hpp @@ -15,7 +15,7 @@ namespace math    {      return std::ceil(x);    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/math/degrees.hpp b/contrib/python/pythran/pythran/pythonic/math/degrees.hpp index b3d43b2a4d1..5b79001046e 100644 --- a/contrib/python/pythran/pythran/pythonic/math/degrees.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/math/factorial.hpp b/contrib/python/pythran/pythran/pythonic/math/factorial.hpp index 5b7b4d63845..dfb4963e965 100644 --- a/contrib/python/pythran/pythran/pythonic/math/factorial.hpp +++ b/contrib/python/pythran/pythran/pythonic/math/factorial.hpp @@ -18,7 +18,7 @@ namespace math        res *= i;      return res;    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/math/floor.hpp b/contrib/python/pythran/pythran/pythonic/math/floor.hpp index f30c2bac631..a7d88a5470f 100644 --- a/contrib/python/pythran/pythran/pythonic/math/floor.hpp +++ b/contrib/python/pythran/pythran/pythonic/math/floor.hpp @@ -15,7 +15,7 @@ namespace math    {      return std::floor(x);    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/math/frexp.hpp b/contrib/python/pythran/pythran/pythonic/math/frexp.hpp index 2a694c703df..36c04249315 100644 --- a/contrib/python/pythran/pythran/pythonic/math/frexp.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -18,7 +18,7 @@ namespace math      double sig = std::frexp(x, &exp);      return std::tuple<double, long>(sig, exp);    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/math/gamma.hpp b/contrib/python/pythran/pythran/pythonic/math/gamma.hpp index caf5ed5c926..537ef39e764 100644 --- a/contrib/python/pythran/pythran/pythonic/math/gamma.hpp +++ b/contrib/python/pythran/pythran/pythonic/math/gamma.hpp @@ -14,7 +14,7 @@ namespace math    {      return std::tgamma(x);    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/math/modf.hpp b/contrib/python/pythran/pythran/pythonic/math/modf.hpp index fef342fe01a..26c62292c51 100644 --- a/contrib/python/pythran/pythran/pythonic/math/modf.hpp +++ b/contrib/python/pythran/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 <cmath> @@ -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/contrib/python/pythran/pythran/pythonic/math/radians.hpp b/contrib/python/pythran/pythran/pythonic/math/radians.hpp index e45ee692edf..14f81246fc9 100644 --- a/contrib/python/pythran/pythran/pythonic/math/radians.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/math/trunc.hpp b/contrib/python/pythran/pythran/pythonic/math/trunc.hpp index a45a7c7f1f6..220ac4d5146 100644 --- a/contrib/python/pythran/pythran/pythonic/math/trunc.hpp +++ b/contrib/python/pythran/pythran/pythonic/math/trunc.hpp @@ -15,7 +15,7 @@ namespace math    {      return x;    } -} +} // namespace math  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/abs.hpp b/contrib/python/pythran/pythran/pythonic/numpy/abs.hpp index 3c13b5f5a92..779fee43606 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/abs.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/add.hpp b/contrib/python/pythran/pythran/pythonic/numpy/add.hpp index cfb74a8f3f2..1a0352888c3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/add.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/alen.hpp b/contrib/python/pythran/pythran/pythonic/numpy/alen.hpp index 0b34f032826..b5ef5ccc75c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/alen.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/all.hpp b/contrib/python/pythran/pythran/pythonic/numpy/all.hpp index 3c4a8c750da..516e0dff9d3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/all.hpp +++ b/contrib/python/pythran/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 <class E>    bool _all(E begin, E end, utils::int_<1>)    { -    return std::all_of(begin, end, -                       [](typename std::iterator_traits<E>::value_type e) -                           -> bool { return e; }); +    return std::all_of( +        begin, end, [](typename std::iterator_traits<E>::value_type e) -> bool { +          return e; +        });    }    template <class E, size_t N> @@ -67,7 +68,8 @@ namespace numpy    template <class E>    typename std::enable_if<        E::value != 1, -      types::ndarray<typename E::dtype, types::array<long, E::value - 1>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value - 1>>>::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<long, N - 1> shp; +      types::array_tuple<long, N - 1> shp;        sutils::copy_shape<0, 1>(shp, array, utils::make_index_sequence<N - 1>()); -      types::ndarray<bool, types::array<long, N - 1>> out(shp, true); +      types::ndarray<bool, types::array_tuple<long, N - 1>> out(shp, true);        return std::accumulate(array.begin(), array.end(), out,                               functor::multiply());      } else { -      types::array<long, N - 1> shp; +      types::array_tuple<long, N - 1> shp;        sutils::copy_shape<0, 0>(shp, array, utils::make_index_sequence<N - 1>()); -      types::ndarray<bool, types::array<long, N - 1>> ally(shp, builtins::None); +      types::ndarray<bool, types::array_tuple<long, N - 1>> ally( +          shp, builtins::None);        std::transform(            array.begin(), array.end(), ally.begin(), -          [=](types::ndarray<T, types::array<long, N - 1>> const &other) { +          [=](types::ndarray<T, types::array_tuple<long, N - 1>> const &other) {              return all(other, axis - 1);            });        return ally;      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/allclose.hpp b/contrib/python/pythran/pythran/pythonic/numpy/allclose.hpp index 3a78e441f0f..d630a99ba2f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/allclose.hpp +++ b/contrib/python/pythran/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 <class U, class V>    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_<U::value>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/alltrue.hpp b/contrib/python/pythran/pythran/pythonic/numpy/alltrue.hpp index 98674c88ef1..296f63cb55e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/alltrue.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/alltrue.hpp @@ -10,12 +10,11 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class... Types> -  auto alltrue(Types &&... types) -      -> decltype(all(std::forward<Types>(types)...)) +  auto alltrue(Types &&...types) -> decltype(all(std::forward<Types>(types)...))    {      return all(std::forward<Types>(types)...);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/angle.hpp b/contrib/python/pythran/pythran/pythonic/numpy/angle.hpp index 78ef2fd7f5c..eae62451b80 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/angle.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/angle_in_deg.hpp b/contrib/python/pythran/pythran/pythonic/numpy/angle_in_deg.hpp index a77eb7e1b92..376a0111d06 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/angle_in_deg.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/angle_in_rad.hpp b/contrib/python/pythran/pythran/pythonic/numpy/angle_in_rad.hpp index 7e955d1a9fa..5bcbfc39d8b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/angle_in_rad.hpp +++ b/contrib/python/pythran/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 <class T> -    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/contrib/python/pythran/pythran/pythonic/numpy/any.hpp b/contrib/python/pythran/pythran/pythonic/numpy/any.hpp index 9f15c2d961b..a234db5b37e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/any.hpp +++ b/contrib/python/pythran/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 <class E>    typename std::enable_if<        E::value != 1, -      types::ndarray<typename E::dtype, types::array<long, E::value - 1>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value - 1>>>::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<long, N> shp; +      types::array_tuple<long, N> shp;        shp[0] = 1;        sutils::copy_shape<1, 0>(shp, array, utils::make_index_sequence<N - 1>()); -      types::ndarray<bool, types::array<long, N>> out(shp, false); +      types::ndarray<bool, types::array_tuple<long, N>> out(shp, false);        return std::accumulate(array.begin(), array.end(), *out.begin(),                               numpy::functor::add());      } else { -      types::array<long, N - 1> shp; +      types::array_tuple<long, N - 1> shp;        sutils::copy_shape<0, 0>(shp, array, utils::make_index_sequence<N - 1>()); -      types::ndarray<bool, types::array<long, N - 1>> anyy(shp, builtins::None); +      types::ndarray<bool, types::array_tuple<long, N - 1>> anyy( +          shp, builtins::None);        std::transform(            array.begin(), array.end(), anyy.begin(), -          [=](types::ndarray<T, types::array<long, N - 1>> const &other) { +          [=](types::ndarray<T, types::array_tuple<long, N - 1>> const &other) {              return any(other, axis - 1);            });        return anyy;      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/append.hpp b/contrib/python/pythran/pythran/pythonic/numpy/append.hpp index c2d4590a72d..82779af5521 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/append.hpp +++ b/contrib/python/pythran/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<T, typename types::dtype_of<F>::type>::type,          types::pshape<long>> -    out(types::pshape<long>(nsize), builtins::None); +        out(types::pshape<long>(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<T, typename types::dtype_of<F>::type>::type,          types::pshape<long>> -    out(types::pshape<long>(nsize), builtins::None); +        out(types::pshape<long>(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/contrib/python/pythran/pythran/pythonic/numpy/arange.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arange.hpp index 14e1d0ad445..a483e1dba3c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arange.hpp +++ b/contrib/python/pythran/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, T, T, types::dtype_t<T>>(T(0), end);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/arccos.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arccos.hpp index a1d827daa53..f323c65a268 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arccos.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/arccosh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arccosh.hpp index b915e8bbb5b..d0e7bd18c92 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arccosh.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/arcsin.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arcsin.hpp index cbec9c23865..5a8d57bfd92 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arcsin.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/arcsinh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arcsinh.hpp index 96edf5d2526..d5d43130895 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arcsinh.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/arctan.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arctan.hpp index c7239fcf461..e7e50808592 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arctan.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/numpy/arctan2.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arctan2.hpp index 1c79695feb4..40302bf9114 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arctan2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/arctanh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/arctanh.hpp index 0b9d267dca5..50a5716a6bc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/arctanh.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/argmax.hpp b/contrib/python/pythran/pythran/pythonic/numpy/argmax.hpp index a2887c16304..4be4ce60447 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/argmax.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/argmax.hpp @@ -36,8 +36,8 @@ namespace numpy    }    template <class E> -  types::ndarray<long, types::array<long, E::value - 1>> argmax(E const &expr, -                                                                long axis) +  types::ndarray<long, types::array_tuple<long, E::value - 1>> +  argmax(E const &expr, long axis)    {      return argminmax<argmax_op<E>>(expr, axis);    } diff --git a/contrib/python/pythran/pythran/pythonic/numpy/argmin.hpp b/contrib/python/pythran/pythran/pythonic/numpy/argmin.hpp index 35652a89f21..e146da20d82 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/argmin.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/argmin.hpp @@ -37,8 +37,8 @@ namespace numpy    }    template <class E> -  types::ndarray<long, types::array<long, E::value - 1>> argmin(E const &expr, -                                                                long axis) +  types::ndarray<long, types::array_tuple<long, E::value - 1>> +  argmin(E const &expr, long axis)    {      return argminmax<argmin_op<E>>(expr, axis);    } diff --git a/contrib/python/pythran/pythran/pythonic/numpy/argminmax.hpp b/contrib/python/pythran/pythran/pythonic/numpy/argminmax.hpp index c1286d6348b..11aca63b3ac 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/argminmax.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/argminmax.hpp @@ -225,7 +225,7 @@ namespace numpy    _argminmax_head(T &&out, E const &expr, std::integral_constant<size_t, N>)    {      static_assert(N > 1, "specialization ok"); -    types::ndarray<typename E::dtype, types::array<long, N - 1>> val{ +    types::ndarray<typename E::dtype, types::array_tuple<long, N - 1>> val{          sutils::getshape(out), Op::limit()};      long i = 0;      for (auto &&elt : expr) { @@ -258,7 +258,7 @@ namespace numpy    }    template <class Op, class E> -  types::ndarray<long, types::array<long, E::value - 1>> +  types::ndarray<long, types::array_tuple<long, E::value - 1>>    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<long, E::value - 1> shp; +    types::array_tuple<long, E::value - 1> shp;      auto next = std::copy(shape.begin(), shape.begin() + axis, shp.begin());      std::copy(shape.begin() + axis + 1, shape.end(), next); -    types::ndarray<long, types::array<long, E::value - 1>> out{shp, -                                                               builtins::None}; +    types::ndarray<long, types::array_tuple<long, E::value - 1>> out{ +        shp, builtins::None};      _argminmax_pick_axis<Op, E::value>(axis, out, array,                                         utils::make_index_sequence<E::value>());      return out; diff --git a/contrib/python/pythran/pythran/pythonic/numpy/argsort.hpp b/contrib/python/pythran/pythran/pythonic/numpy/argsort.hpp index 8ed208e9ac4..68bf4b76fba 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/argsort.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/argsort.hpp @@ -9,15 +9,16 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E> -  types::ndarray<long, types::array<long, 1>> argsort(E const &expr, -                                                      types::none_type, types::none_type) +  types::ndarray<long, types::array_tuple<long, 1>> +  argsort(E const &expr, types::none_type, types::none_type)    {      auto out = functor::array{}(expr).flat();      return argsort(out);    }    template <class T, class pS, class Sorter> -  types::ndarray<long, pS> _argsort(types::ndarray<T, pS> const &a, long axis, Sorter sorter) +  types::ndarray<long, pS> _argsort(types::ndarray<T, pS> const &a, long axis, +                                    Sorter sorter)    {      constexpr auto N = std::tuple_size<pS>::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 <class T, class pS> -  types::ndarray<long, pS> argsort(types::ndarray<T, pS> const &a, long axis, types::none_type) { +  types::ndarray<long, pS> argsort(types::ndarray<T, pS> const &a, long axis, +                                   types::none_type) +  {      return _argsort(a, axis, ndarray::quicksorter());    }    template <class T, class pS> -  types::ndarray<long, pS> argsort(types::ndarray<T, pS> const &a, long axis, types::str const& kind) +  types::ndarray<long, pS> argsort(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/argwhere.hpp b/contrib/python/pythran/pythran/pythonic/numpy/argwhere.hpp index 30186da5d30..0a366decfb5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/argwhere.hpp +++ b/contrib/python/pythran/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 <class E> -  typename types::ndarray<long, types::array<long, 2>> argwhere(E const &expr) +  typename types::ndarray<long, types::array_tuple<long, 2>> +  argwhere(E const &expr)    {      constexpr long N = E::value;      auto arr = asarray(expr); @@ -37,10 +38,10 @@ namespace numpy          buffer_iter += N;        }      } -    types::array<long, 2> shape = {real_sz, N}; +    types::array_tuple<long, 2> shape = {real_sz, N};      return {buffer, shape};    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/around.hpp b/contrib/python/pythran/pythran/pythonic/numpy/around.hpp index 1b467e523bb..920e53e92a0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/around.hpp +++ b/contrib/python/pythran/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 <class E> -  auto around(E &&a, long decimals) -> typename std::enable_if< -      !std::is_integral< -          typename types::dtype_of<typename std::decay<E>::type>::type>::value, -      decltype(functor::rint{}(functor::multiply{}( -                   std::forward<E>(a), +  auto around(E &&a, long decimals) -> +      typename std::enable_if< +          !std::is_integral<typename types::dtype_of< +              typename std::decay<E>::type>::type>::value, +          decltype(functor::rint{}(functor::multiply{}( +                       std::forward<E>(a), +                       std::declval<typename types::dtype_of< +                           typename std::decay<E>::type>::type>())) /                     std::declval<typename types::dtype_of< -                       typename std::decay<E>::type>::type>())) / -               std::declval<typename types::dtype_of< -                   typename std::decay<E>::type>::type>())>::type +                       typename std::decay<E>::type>::type>())>::type    {      typename types::dtype_of<typename std::decay<E>::type>::type const fact =          functor::power{}(10., decimals); @@ -41,15 +42,16 @@ namespace numpy    // the integer version is only relevant when decimals < 0    template <class E> -  auto around(E &&a, long decimals) -> typename std::enable_if< -      std::is_integral< -          typename types::dtype_of<typename std::decay<E>::type>::type>::value, -      decltype(numpy::functor::floor_divide{}( -                   functor::float64{}(std::forward<E>(a)), +  auto around(E &&a, long decimals) -> +      typename std::enable_if< +          std::is_integral<typename types::dtype_of< +              typename std::decay<E>::type>::type>::value, +          decltype(numpy::functor::floor_divide{}( +                       functor::float64{}(std::forward<E>(a)), +                       std::declval<typename types::dtype_of< +                           typename std::decay<E>::type>::type>()) *                     std::declval<typename types::dtype_of< -                       typename std::decay<E>::type>::type>()) * -               std::declval<typename types::dtype_of< -                   typename std::decay<E>::type>::type>())>::type +                       typename std::decay<E>::type>::type>())>::type    {      typename types::dtype_of<typename std::decay<E>::type>::type const fact =          functor::power{}(10L, std::max(0L, -decimals)); @@ -57,7 +59,7 @@ namespace numpy                 functor::float64{}(std::forward<E>(a)), fact) *             fact;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/array.hpp b/contrib/python/pythran/pythran/pythonic/numpy/array.hpp index 284dbba8b43..2feaf5cd70f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/array.hpp +++ b/contrib/python/pythran/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<typename std::decay<T>::type>::value,        types::ndarray<typename dtype::type, -                     types::array<long, std::decay<T>::type::value>>>::type -  array(T &&iterable, dtype d) +                     types::array_tuple<long, std::decay<T>::type::value>>>:: +      type +      array(T &&iterable, dtype d)    {      return {std::forward<T>(iterable)};    } @@ -25,8 +26,9 @@ namespace numpy        !types::has_size<typename std::decay<T>::type>::value &&            !types::is_dtype<typename std::decay<T>::type>::value,        types::ndarray<typename dtype::type, -                     types::array<long, std::decay<T>::type::value>>>::type -  array(T &&iterable, dtype d) +                     types::array_tuple<long, std::decay<T>::type::value>>>:: +      type +      array(T &&iterable, dtype d)    {      types::list<typename std::decay<T>::type::value_type> tmp{iterable.begin(),                                                                iterable.end()}; @@ -46,7 +48,7 @@ namespace numpy    template <class dtype>    types::ndarray<typename dtype::type,                   types::pshape<std::integral_constant<long, 0>>> -      array(std::tuple<>, dtype) +  array(std::tuple<>, dtype)    {      return {types::pshape<std::integral_constant<long, 0>>{},              types::none_type{}}; @@ -73,7 +75,7 @@ namespace numpy    {      return {std::move(a)};    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/array2string.hpp b/contrib/python/pythran/pythran/pythonic/numpy/array2string.hpp index d27984a8a16..d4c8cdbc7b8 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/array2string.hpp +++ b/contrib/python/pythran/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<E>(a);      return oss.str();    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/array_equal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/array_equal.hpp index 606444c6756..962450002b8 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/array_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/array_equiv.hpp b/contrib/python/pythran/pythran/pythonic/numpy/array_equiv.hpp index aa576deb69c..77b45bae840 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/array_equiv.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/array_equiv.hpp @@ -20,7 +20,7 @@ namespace numpy            return false;        return true;      } -  } +  } // namespace    template <class U, class V>    typename std::enable_if<U::value == V::value, bool>::type @@ -45,7 +45,7 @@ namespace numpy    {      return array_equiv(v, u);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/asarray.hpp b/contrib/python/pythran/pythran/pythonic/numpy/asarray.hpp index ceb8d68df0d..a1e19f7121a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/asarray.hpp +++ b/contrib/python/pythran/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 <class E, class dtype>    template <class... Types> -  auto _asarray<E, dtype>::operator()(Types &&... args) +  auto _asarray<E, dtype>::operator()(Types &&...args)        -> decltype(array(std::forward<Types>(args)...))    {      return array(std::forward<Types>(args)...); @@ -28,9 +28,10 @@ namespace numpy    }    template <class E> -  auto asarray(E &&e, types::none_type d) -> decltype( -      _asarray<typename std::decay<E>::type, -               typename types::dtype_of<typename std::decay<E>::type>::type>{}( +  auto asarray(E &&e, types::none_type d) +      -> decltype(_asarray<typename std::decay<E>::type, +                           typename types::dtype_of< +                               typename std::decay<E>::type>::type>{}(            std::forward<E>(e)))    {      return _asarray< @@ -47,7 +48,7 @@ namespace numpy      return _asarray<typename std::decay<E>::type, typename dtype::type>{}(          std::forward<E>(e), d);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/asarray_chkfinite.hpp b/contrib/python/pythran/pythran/pythonic/numpy/asarray_chkfinite.hpp index 78df26bcf55..3454a7d9d8a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/asarray_chkfinite.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/asfarray.hpp b/contrib/python/pythran/pythran/pythonic/numpy/asfarray.hpp index 4b1629c35a8..6ca0bae10b4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/asfarray.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/asfarray.hpp @@ -15,7 +15,7 @@ namespace numpy                    "expected a floating point type");      return asarray(std::forward<E>(e), d);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/asscalar.hpp b/contrib/python/pythran/pythran/pythonic/numpy/asscalar.hpp index 06631f0d62a..23213ad4394 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/asscalar.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/atleast_1d.hpp b/contrib/python/pythran/pythran/pythonic/numpy/atleast_1d.hpp index a154d9f7a8e..f5d5c6c7679 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/atleast_1d.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/atleast_1d.hpp @@ -25,7 +25,7 @@ namespace numpy    {      return asarray(t);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/atleast_2d.hpp b/contrib/python/pythran/pythran/pythonic/numpy/atleast_2d.hpp index 6ff35ab3f40..e26f8abde95 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/atleast_2d.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/atleast_2d.hpp @@ -22,30 +22,32 @@ namespace numpy    }    template <class T> -          auto atleast_2d(T const &t) -> -          typename std::enable_if < (!types::is_dtype<T>::value) && -      T::value<2, types::ndarray< -                      typename T::dtype, -                      types::pshape<std::integral_constant<long, 1>, -                                    typename std::tuple_element< -                                        0, typename T::shape_t>::type>>>::type +  auto atleast_2d(T const &t) -> +      typename std::enable_if < (!types::is_dtype<T>::value) && +          T::value<2, +                   types::ndarray< +                       typename T::dtype, +                       types::pshape<std::integral_constant<long, 1>, +                                     typename std::tuple_element< +                                         0, typename T::shape_t>::type>>>::type    {      return t.reshape(types::pshape< -        std::integral_constant<long, 1>, -        typename std::tuple_element<0, typename T::shape_t>::type>( +                     std::integral_constant<long, 1>, +                     typename std::tuple_element<0, typename T::shape_t>::type>(          std::integral_constant<long, 1>(), t.template shape<0>()));    }    template <class T> -  auto atleast_2d(T &&t) -> typename std::enable_if< -      (!types::is_dtype<typename std::remove_cv< -          typename std::remove_reference<T>::type>::type>::value) && -          std::decay<T>::type::value >= 2, -      decltype(std::forward<T>(t))>::type +  auto atleast_2d(T &&t) -> +      typename std::enable_if< +          (!types::is_dtype<typename std::remove_cv< +               typename std::remove_reference<T>::type>::type>::value) && +              std::decay<T>::type::value >= 2, +          decltype(std::forward<T>(t))>::type    {      return std::forward<T>(t);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/atleast_3d.hpp b/contrib/python/pythran/pythran/pythonic/numpy/atleast_3d.hpp index 1ce01bf89b0..3bf8a3fbe4c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/atleast_3d.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/atleast_3d.hpp @@ -24,13 +24,14 @@ namespace numpy    }    template <class T> -  auto atleast_3d(T const &t) -> typename std::enable_if< -      (!types::is_dtype<T>::value) && (T::value == 1), -      types::ndarray<typename T::dtype, -                     types::pshape<std::integral_constant<long, 1>, -                                   typename std::tuple_element< -                                       0, typename T::shape_t>::type, -                                   std::integral_constant<long, 1>>>>::type +  auto atleast_3d(T const &t) -> +      typename std::enable_if< +          (!types::is_dtype<T>::value) && (T::value == 1), +          types::ndarray<typename T::dtype, +                         types::pshape<std::integral_constant<long, 1>, +                                       typename std::tuple_element< +                                           0, typename T::shape_t>::type, +                                       std::integral_constant<long, 1>>>>::type    {      auto r = asarray(t);      return r.reshape( @@ -42,14 +43,15 @@ namespace numpy    }    template <class T> -  auto atleast_3d(T const &t) -> typename std::enable_if< -      (!types::is_dtype<T>::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<long, 1>>>>::type +  auto atleast_3d(T const &t) -> +      typename std::enable_if< +          (!types::is_dtype<T>::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<long, 1>>>>::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/contrib/python/pythran/pythran/pythonic/numpy/average.hpp b/contrib/python/pythran/pythran/pythonic/numpy/average.hpp index ff01b3a2331..3be4975aa7e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/average.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/average.hpp @@ -11,8 +11,8 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E> -  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 <class E, class W>    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/contrib/python/pythran/pythran/pythonic/numpy/base_repr.hpp b/contrib/python/pythran/pythran/pythonic/numpy/base_repr.hpp index a8e5fc64364..5c83c69b31d 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/base_repr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/bincount.hpp b/contrib/python/pythran/pythran/pythonic/numpy/bincount.hpp index 2402d0c0966..0805a71ce0b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/bincount.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/bincount.hpp @@ -42,10 +42,9 @@ namespace numpy      length = std::max<long>(length, 1 + max(expr));      typename std::enable_if<          std::tuple_size<pS>::value == 1, -        types::ndarray<decltype(std::declval<long>() * -                                std::declval<typename E::dtype>()), -                       types::pshape<long>>>::type -    out(types::pshape<long>(length), 0L); +        types::ndarray< +            decltype(std::declval<long>() * std::declval<typename E::dtype>()), +            types::pshape<long>>>::type out(types::pshape<long>(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/contrib/python/pythran/pythran/pythonic/numpy/bitwise_and.hpp b/contrib/python/pythran/pythran/pythonic/numpy/bitwise_and.hpp index 51df6420e21..a692ccdc70a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/bitwise_and.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/bitwise_or.hpp b/contrib/python/pythran/pythran/pythonic/numpy/bitwise_or.hpp index 17905110c2d..0c737b98086 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/bitwise_or.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/bitwise_xor.hpp b/contrib/python/pythran/pythran/pythonic/numpy/bitwise_xor.hpp index ee95e635575..622990436a7 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/bitwise_xor.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/broadcast_to.hpp b/contrib/python/pythran/pythran/pythonic/numpy/broadcast_to.hpp index 930b1e0e945..8498a767e5e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/broadcast_to.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/cbrt.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cbrt.hpp index c8208e84c1a..fc4e0b81da9 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cbrt.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ceil.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ceil.hpp index b157d358036..557e054088c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ceil.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/clip.hpp b/contrib/python/pythran/pythran/pythonic/numpy/clip.hpp index 6a5efe4a979..94b59b3837f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/clip.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/concatenate.hpp b/contrib/python/pythran/pythran/pythonic/numpy/concatenate.hpp index 9efd5cce073..9d49c83ba5a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/concatenate.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/concatenate.hpp @@ -63,11 +63,12 @@ namespace numpy                                      std::get<I>(from).end(), out_iter),                 1)...};          } else { -          types::array<typename A::value_type::const_iterator, sizeof...(I)> +          types::array_tuple<typename A::value_type::const_iterator, +                             sizeof...(I)>                ifroms = {std::get<I>(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 <class... Types> -  auto -  concatenate(std::tuple<Types...> const &args, long axis) -> types::ndarray< -      typename __combined<typename std::decay<Types>::type::dtype...>::type, -      types::array<long, -                   std::tuple_element<0, std::tuple<Types...>>::type::value>> +  auto concatenate(std::tuple<Types...> const &args, long axis) +      -> types::ndarray< +          typename __combined<typename std::decay<Types>::type::dtype...>::type, +          types::array_tuple< +              long, std::tuple_element<0, std::tuple<Types...>>::type::value>>    {      using T =          typename __combined<typename std::decay<Types>::type::dtype...>::type; @@ -149,8 +150,8 @@ namespace numpy      types::ndarray<          typename __combined<typename std::decay<Types>::type::dtype...>::type, -        types::array<long, -                     std::decay<decltype(std::get<0>(args))>::type::value>> +        types::array_tuple< +            long, std::decay<decltype(std::get<0>(args))>::type::value>>          result{shape, types::none_type{}};      details::concatenate_helper<N>()(          result, args, axis, utils::make_index_sequence<sizeof...(Types)>{}); @@ -158,7 +159,7 @@ namespace numpy    }    template <class E, size_t M, class V> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    concatenate(types::array_base<E, M, V> 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<M>{}); -    types::ndarray<typename E::dtype, types::array<long, E::value>> out( +    types::ndarray<typename E::dtype, types::array_tuple<long, E::value>> out(          shape, types::none_type{});      details::concatenate_helper<N>()(out, args, axis,                                       utils::make_index_sequence<M>{}); @@ -174,11 +175,11 @@ namespace numpy    }    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    concatenate(types::list<E> const &ai, long axis)    {      using return_type = -        types::ndarray<typename E::dtype, types::array<long, E::value>>; +        types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>;      using T = typename return_type::dtype;      auto constexpr N = return_type::value;      auto shape = sutils::getshape(ai[0]); diff --git a/contrib/python/pythran/pythran/pythonic/numpy/conjugate.hpp b/contrib/python/pythran/pythran/pythonic/numpy/conjugate.hpp index 0aa38048798..dd7fbe7a49f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/conjugate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/convolve.hpp b/contrib/python/pythran/pythran/pythonic/numpy/convolve.hpp index 49ef2bd28eb..d078d06702f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/convolve.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/copy.hpp b/contrib/python/pythran/pythran/pythonic/numpy/copy.hpp index 03660150303..0b29116d81a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/copy.hpp +++ b/contrib/python/pythran/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 <class E>    typename std::enable_if<        !types::is_array<E>::value && !types::is_dtype<E>::value, -      types::ndarray<typename E::dtype, types::array<long, E::value>>>::type +      types::ndarray<typename E::dtype, +                     types::array_tuple<long, E::value>>>::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/contrib/python/pythran/pythran/pythonic/numpy/copysign.hpp b/contrib/python/pythran/pythran/pythonic/numpy/copysign.hpp index 35c44dafe0f..6107ac20d76 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/copysign.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/copyto.hpp b/contrib/python/pythran/pythran/pythonic/numpy/copyto.hpp index 1a455451a08..26fcbe3d507 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/copyto.hpp +++ b/contrib/python/pythran/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<T, pS>;      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<E>::value, -             out_type::is_vectorizable && -                 std::is_same<typename out_type::dtype, typename types::dtype_of<E>::type>::value && -                 types::is_vectorizable<E>::value > (out, aexpr); -    } -    else { -      utils::broadcast_copy < out_type &, E, out_type::value, -             (int)out_type::value - (int)utils::dim_of<E>::value, -             out_type::is_vectorizable && -                 std::is_same<typename out_type::dtype, typename types::dtype_of<E>::type>::value && -                 types::is_vectorizable<E>::value > (out, expr); +      utils::broadcast_copy< +          out_type &, decltype(aexpr), out_type::value, +          (int)out_type::value - (int)utils::dim_of<E>::value, +          out_type::is_vectorizable && +              std::is_same<typename out_type::dtype, +                           typename types::dtype_of<E>::type>::value && +              types::is_vectorizable<E>::value>(out, aexpr); +    } else { +      utils::broadcast_copy< +          out_type &, E, out_type::value, +          (int)out_type::value - (int)utils::dim_of<E>::value, +          out_type::is_vectorizable && +              std::is_same<typename out_type::dtype, +                           typename types::dtype_of<E>::type>::value && +              types::is_vectorizable<E>::value>(out, expr);      }      return {};    } @@ -39,33 +42,38 @@ namespace numpy    }    template <class T, class pS, class E> -  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &out, E const &expr) +  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &out, +                          E const &expr)    {      using out_type = types::numpy_texpr<types::ndarray<T, pS>>;      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<E>::value, -             out_type::is_vectorizable && -                 std::is_same<typename out_type::dtype, typename types::dtype_of<E>::type>::value && -                 types::is_vectorizable<E>::value > (out, aexpr); -    } -    else { -      utils::broadcast_copy < out_type &, E, out_type::value, -             (int)out_type::value - (int)utils::dim_of<E>::value, -             out_type::is_vectorizable && -                 std::is_same<typename out_type::dtype, typename types::dtype_of<E>::type>::value && -                 types::is_vectorizable<E>::value > (out, expr); +      utils::broadcast_copy< +          out_type &, decltype(aexpr), out_type::value, +          (int)out_type::value - (int)utils::dim_of<E>::value, +          out_type::is_vectorizable && +              std::is_same<typename out_type::dtype, +                           typename types::dtype_of<E>::type>::value && +              types::is_vectorizable<E>::value>(out, aexpr); +    } else { +      utils::broadcast_copy< +          out_type &, E, out_type::value, +          (int)out_type::value - (int)utils::dim_of<E>::value, +          out_type::is_vectorizable && +              std::is_same<typename out_type::dtype, +                           typename types::dtype_of<E>::type>::value && +              types::is_vectorizable<E>::value>(out, expr);      }      return {};    }    template <class T, class pS, class E> -  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &&out, E const &expr) +  types::none_type copyto(types::numpy_texpr<types::ndarray<T, pS>> &&out, +                          E const &expr)    {      return copyto(out, expr);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/cos.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cos.hpp index b433cfda55a..401314aec42 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cos.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/cosh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cosh.hpp index 92354b55606..8375d39d705 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cosh.hpp +++ b/contrib/python/pythran/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 <xsimd/xsimd.hpp> @@ -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/contrib/python/pythran/pythran/pythonic/numpy/count_nonzero.hpp b/contrib/python/pythran/pythran/pythonic/numpy/count_nonzero.hpp index 95d92948998..0fe9e6a132f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/count_nonzero.hpp +++ b/contrib/python/pythran/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_<E::value>());      return count;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/cross.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cross.hpp index 574a87ff02d..bb69d50af34 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cross.hpp +++ b/contrib/python/pythran/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 <class E, class F>    types::ndarray<        typename __combined<typename E::dtype, typename F::dtype>::type, -      types::array<long, E::value>> +      types::array_tuple<long, E::value>>    cross(E const &e, F const &f)    {      using dtype =          typename __combined<typename E::dtype, typename F::dtype>::type; -    types::array<long, E::value> out_shape; +    types::array_tuple<long, E::value> out_shape;      sutils::copy_shape<0, 0>(out_shape, e,                               utils::make_index_sequence<E::value - 1>());      if (e.template shape<E::value - 1>() == 2) {        if (f.template shape<F::value - 1>() == 2) {          out_shape[E::value - 1] = 1; -        types::ndarray<dtype, types::array<long, E::value>> out{ +        types::ndarray<dtype, types::array_tuple<long, E::value>> out{              out_shape, types::none_type{}};          _cross<E::value, 2, 2>{}(out.begin(), out.end(), e.begin(), f.begin());          return out;        } else {          out_shape[E::value - 1] = 3; -        types::ndarray<dtype, types::array<long, E::value>> out{ +        types::ndarray<dtype, types::array_tuple<long, E::value>> out{              out_shape, types::none_type{}};          _cross<E::value, 2, 3>{}(out.begin(), out.end(), e.begin(), f.begin());          return out; @@ -129,20 +129,20 @@ namespace numpy      } else {        if (f.template shape<F::value - 1>() == 2) {          out_shape[E::value - 1] = 3; -        types::ndarray<dtype, types::array<long, E::value>> out{ +        types::ndarray<dtype, types::array_tuple<long, E::value>> out{              out_shape, types::none_type{}};          _cross<E::value, 3, 2>{}(out.begin(), out.end(), e.begin(), f.begin());          return out;        } else {          out_shape[E::value - 1] = 3; -        types::ndarray<dtype, types::array<long, E::value>> out{ +        types::ndarray<dtype, types::array_tuple<long, E::value>> out{              out_shape, types::none_type{}};          _cross<E::value, 3, 3>{}(out.begin(), out.end(), e.begin(), f.begin());          return out;        }      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ctypeslib/as_array.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ctypeslib/as_array.hpp index 5566ddc85b4..7532bea5626 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ctypeslib/as_array.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ctypeslib/as_array.hpp @@ -25,8 +25,8 @@ namespace numpy      {        return as_array(ptr, types::pshape<long>{size});      } -  } -} +  } // namespace ctypeslib +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/cumprod.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cumprod.hpp index d8685e40967..962871b833a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cumprod.hpp +++ b/contrib/python/pythran/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 <class E, class... Opts> -  auto cumprod(E &&e, Opts &&... opts) +  auto cumprod(E &&e, Opts &&...opts)        -> decltype(partial_sum<operator_::functor::imul>(            std::forward<E>(e), std::forward<Opts>(opts)...))    { @@ -22,7 +22,7 @@ namespace numpy    }    NUMPY_EXPR_TO_NDARRAY0_IMPL(cumprod); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/cumsum.hpp b/contrib/python/pythran/pythran/pythonic/numpy/cumsum.hpp index 2415ff3c11c..2f54a703b54 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/cumsum.hpp +++ b/contrib/python/pythran/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 <class E, class... Opts> -  auto cumsum(E &&e, Opts &&... opts) +  auto cumsum(E &&e, Opts &&...opts)        -> decltype(partial_sum<operator_::functor::add>(            std::forward<E>(e), std::forward<Opts>(opts)...))    {      return partial_sum<operator_::functor::add>(std::forward<E>(e),                                                  std::forward<Opts>(opts)...);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/deg2rad.hpp b/contrib/python/pythran/pythran/pythonic/numpy/deg2rad.hpp index 6fb4e5a9823..8dab2e16b94 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/deg2rad.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/delete_.hpp b/contrib/python/pythran/pythran/pythonic/numpy/delete_.hpp index b5ac3415c08..6520eae3884 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/delete_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/diag.hpp b/contrib/python/pythran/pythran/pythonic/numpy/diag.hpp index a5e12357b7a..7f4dde7d5e5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/diag.hpp +++ b/contrib/python/pythran/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 <class T, class pS>    typename std::enable_if<std::tuple_size<pS>::value == 1, -                          types::ndarray<T, types::array<long, 2>>>::type +                          types::ndarray<T, types::array_tuple<long, 2>>>::type    diag(types::ndarray<T, pS> const &a, long k)    {      long n = a.flat_size() + std::abs(k); -    types::ndarray<T, types::array<long, 2>> out(types::make_tuple(n, n), 0); +    types::ndarray<T, types::array_tuple<long, 2>> 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/contrib/python/pythran/pythran/pythonic/numpy/diff.hpp b/contrib/python/pythran/pythran/pythonic/numpy/diff.hpp index 5863201ad1c..763d1cefe5c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/diff.hpp +++ b/contrib/python/pythran/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 <class E> -    types::ndarray<typename E::dtype, types::array<long, E::value>> +    types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>      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 <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    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/contrib/python/pythran/pythran/pythonic/numpy/digitize.hpp b/contrib/python/pythran/pythran/pythonic/numpy/digitize.hpp index e5e374f1968..65655aba634 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/digitize.hpp +++ b/contrib/python/pythran/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_<N - 1>());      } -  } +  } // namespace    template <class E, class F>    types::ndarray<long, types::pshape<long>> digitize(E const &expr, F const &b) @@ -50,7 +50,7 @@ namespace numpy                  operator_::functor::gt(), utils::int_<E::value>());      return out;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/divide.hpp b/contrib/python/pythran/pythran/pythonic/numpy/divide.hpp index 2be148fb071..d212dcce78b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/dot.hpp b/contrib/python/pythran/pythran/pythonic/numpy/dot.hpp index 46d93dae997..2c1f65b3d73 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/dot.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/dot.hpp @@ -3,6 +3,7 @@  #include "pythonic/include/numpy/dot.hpp" +#include "pythonic/numpy/asarray.hpp"  #include "pythonic/numpy/multiply.hpp"  #include "pythonic/numpy/sum.hpp"  #include "pythonic/types/ndarray.hpp" @@ -12,6 +13,1286 @@  #error pythran configured without BLAS but BLAS seem needed  #endif +#if defined(PYTHRAN_BLAS_SCIPY_OPENBLAS) +#define BLAS_MANGLE(s) scipy_##s##64_ + +/* FIXED VENDORED HEADER { */ +#include "openblas_config.h" +#include <stddef.h> + +extern "C" { +/* Assume C declarations for C++ */ + +/*Set the number of threads on runtime.*/ +void scipy_openblas_set_num_threads64_(int num_threads); +void scipy_goto_set_num_threads64_(int num_threads); +int scipy_openblas_set_num_threads_local64_(int num_threads); + +/*Get the number of threads on runtime.*/ +int scipy_openblas_get_num_threads64_(void); + +/*Get the number of physical processors (cores).*/ +int scipy_openblas_get_num_procs64_(void); + +/*Get the build configure on runtime.*/ +char *scipy_openblas_get_config64_(void); + +/*Get the CPU corename on runtime.*/ +char *scipy_openblas_get_corename64_(void); + +/*Set the threading backend to a custom callback.*/ +typedef void (*scipy_openblas_dojob_callback64_)(int thread_num, void *jobdata, +                                                 int dojob_data); +typedef void (*scipy_openblas_threads_callback64_)( +    int sync, scipy_openblas_dojob_callback64_ dojob, int numjobs, +    size_t jobdata_elsize, void *jobdata, int dojob_data); +void scipy_openblas_set_threads_callback_function64_( +    scipy_openblas_threads_callback64_ callback); + +#ifdef OPENBLAS_OS_LINUX +/* Sets thread affinity for OpenBLAS threads. `thread_idx` is in [0, + * scipy_openblas_get_num_threads64_()-1]. */ +int scipy_openblas_setaffinity64_(int thread_idx, size_t cpusetsize, +                                  cpu_set_t *cpu_set); +/* Queries thread affinity for OpenBLAS threads. `thread_idx` is in [0, + * scipy_openblas_get_num_threads64_()-1]. */ +int scipy_openblas_getaffinity64_(int thread_idx, size_t cpusetsize, +                                  cpu_set_t *cpu_set); +#endif + +/* Get the parallelization type which is used by OpenBLAS */ +int scipy_openblas_get_parallel64_(void); +/* OpenBLAS is compiled for sequential use  */ +#define OPENBLAS_SEQUENTIAL 0 +/* OpenBLAS is compiled using normal threading model */ +#define OPENBLAS_THREAD 1 +/* OpenBLAS is compiled using OpenMP threading model */ +#define OPENBLAS_OPENMP 2 + +/* + * Since all of GotoBlas was written without const, + * we disable it at build time. + */ +#ifndef OPENBLAS_CONST +#define OPENBLAS_CONST const +#endif + +#define CBLAS_INDEX size_t + +typedef enum CBLAS_ORDER { +  CblasRowMajor = 101, +  CblasColMajor = 102 +} CBLAS_ORDER; +typedef enum CBLAS_TRANSPOSE { +  CblasNoTrans = 111, +  CblasTrans = 112, +  CblasConjTrans = 113, +  CblasConjNoTrans = 114 +} CBLAS_TRANSPOSE; +typedef enum CBLAS_UPLO { CblasUpper = 121, CblasLower = 122 } CBLAS_UPLO; +typedef enum CBLAS_DIAG { CblasNonUnit = 131, CblasUnit = 132 } CBLAS_DIAG; +typedef enum CBLAS_SIDE { CblasLeft = 141, CblasRight = 142 } CBLAS_SIDE; +typedef CBLAS_ORDER CBLAS_LAYOUT; + +float scipy_cblas_sdsdot64_(OPENBLAS_CONST blasint n, +                            OPENBLAS_CONST float alpha, OPENBLAS_CONST float *x, +                            OPENBLAS_CONST blasint incx, +                            OPENBLAS_CONST float *y, +                            OPENBLAS_CONST blasint incy); +double scipy_cblas_dsdot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                            OPENBLAS_CONST blasint incx, +                            OPENBLAS_CONST float *y, +                            OPENBLAS_CONST blasint incy); +float scipy_cblas_sdot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                          OPENBLAS_CONST blasint incx, OPENBLAS_CONST float *y, +                          OPENBLAS_CONST blasint incy); +double scipy_cblas_ddot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                           OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST double *y, +                           OPENBLAS_CONST blasint incy); + +openblas_complex_float scipy_cblas_cdotu64_(OPENBLAS_CONST blasint n, +                                            OPENBLAS_CONST void *x, +                                            OPENBLAS_CONST blasint incx, +                                            OPENBLAS_CONST void *y, +                                            OPENBLAS_CONST blasint incy); +openblas_complex_float scipy_cblas_cdotc64_(OPENBLAS_CONST blasint n, +                                            OPENBLAS_CONST void *x, +                                            OPENBLAS_CONST blasint incx, +                                            OPENBLAS_CONST void *y, +                                            OPENBLAS_CONST blasint incy); +openblas_complex_double scipy_cblas_zdotu64_(OPENBLAS_CONST blasint n, +                                             OPENBLAS_CONST void *x, +                                             OPENBLAS_CONST blasint incx, +                                             OPENBLAS_CONST void *y, +                                             OPENBLAS_CONST blasint incy); +openblas_complex_double scipy_cblas_zdotc64_(OPENBLAS_CONST blasint n, +                                             OPENBLAS_CONST void *x, +                                             OPENBLAS_CONST blasint incx, +                                             OPENBLAS_CONST void *y, +                                             OPENBLAS_CONST blasint incy); + +void scipy_cblas_cdotu_sub64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                              OPENBLAS_CONST blasint incx, +                              OPENBLAS_CONST void *y, +                              OPENBLAS_CONST blasint incy, void *ret); +void scipy_cblas_cdotc_sub64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                              OPENBLAS_CONST blasint incx, +                              OPENBLAS_CONST void *y, +                              OPENBLAS_CONST blasint incy, void *ret); +void scipy_cblas_zdotu_sub64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                              OPENBLAS_CONST blasint incx, +                              OPENBLAS_CONST void *y, +                              OPENBLAS_CONST blasint incy, void *ret); +void scipy_cblas_zdotc_sub64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                              OPENBLAS_CONST blasint incx, +                              OPENBLAS_CONST void *y, +                              OPENBLAS_CONST blasint incy, void *ret); + +float scipy_cblas_sasum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                           OPENBLAS_CONST blasint incx); +double scipy_cblas_dasum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                            OPENBLAS_CONST blasint incx); +float scipy_cblas_scasum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                            OPENBLAS_CONST blasint incx); +double scipy_cblas_dzasum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                             OPENBLAS_CONST blasint incx); + +float scipy_cblas_ssum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                          OPENBLAS_CONST blasint incx); +double scipy_cblas_dsum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                           OPENBLAS_CONST blasint incx); +float scipy_cblas_scsum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                           OPENBLAS_CONST blasint incx); +double scipy_cblas_dzsum64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                            OPENBLAS_CONST blasint incx); + +float scipy_cblas_snrm264_(OPENBLAS_CONST blasint N, OPENBLAS_CONST float *X, +                           OPENBLAS_CONST blasint incX); +double scipy_cblas_dnrm264_(OPENBLAS_CONST blasint N, OPENBLAS_CONST double *X, +                            OPENBLAS_CONST blasint incX); +float scipy_cblas_scnrm264_(OPENBLAS_CONST blasint N, OPENBLAS_CONST void *X, +                            OPENBLAS_CONST blasint incX); +double scipy_cblas_dznrm264_(OPENBLAS_CONST blasint N, OPENBLAS_CONST void *X, +                             OPENBLAS_CONST blasint incX); + +CBLAS_INDEX scipy_cblas_isamax64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST float *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_idamax64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST double *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_icamax64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST void *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_izamax64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST void *x, +                                  OPENBLAS_CONST blasint incx); + +CBLAS_INDEX scipy_cblas_isamin64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST float *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_idamin64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST double *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_icamin64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST void *x, +                                  OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_izamin64_(OPENBLAS_CONST blasint n, +                                  OPENBLAS_CONST void *x, +                                  OPENBLAS_CONST blasint incx); + +float scipy_cblas_samax64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                           OPENBLAS_CONST blasint incx); +double scipy_cblas_damax64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                            OPENBLAS_CONST blasint incx); +float scipy_cblas_scamax64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                            OPENBLAS_CONST blasint incx); +double scipy_cblas_dzamax64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                             OPENBLAS_CONST blasint incx); + +float scipy_cblas_samin64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                           OPENBLAS_CONST blasint incx); +double scipy_cblas_damin64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                            OPENBLAS_CONST blasint incx); +float scipy_cblas_scamin64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                            OPENBLAS_CONST blasint incx); +double scipy_cblas_dzamin64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                             OPENBLAS_CONST blasint incx); + +CBLAS_INDEX scipy_cblas_ismax64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST float *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_idmax64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST double *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_icmax64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST void *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_izmax64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST void *x, +                                 OPENBLAS_CONST blasint incx); + +CBLAS_INDEX scipy_cblas_ismin64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST float *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_idmin64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST double *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_icmin64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST void *x, +                                 OPENBLAS_CONST blasint incx); +CBLAS_INDEX scipy_cblas_izmin64_(OPENBLAS_CONST blasint n, +                                 OPENBLAS_CONST void *x, +                                 OPENBLAS_CONST blasint incx); + +void scipy_cblas_saxpy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *x, OPENBLAS_CONST blasint incx, +                          float *y, OPENBLAS_CONST blasint incy); +void scipy_cblas_daxpy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *x, OPENBLAS_CONST blasint incx, +                          double *y, OPENBLAS_CONST blasint incy); +void scipy_cblas_caxpy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                          void *y, OPENBLAS_CONST blasint incy); +void scipy_cblas_zaxpy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                          void *y, OPENBLAS_CONST blasint incy); + +void scipy_cblas_caxpyc64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                           OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                           void *y, OPENBLAS_CONST blasint incy); +void scipy_cblas_zaxpyc64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                           OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                           void *y, OPENBLAS_CONST blasint incy); + +void scipy_cblas_scopy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *x, +                          OPENBLAS_CONST blasint incx, float *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_dcopy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *x, +                          OPENBLAS_CONST blasint incx, double *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_ccopy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_zcopy64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incy); + +void scipy_cblas_sswap64_(OPENBLAS_CONST blasint n, float *x, +                          OPENBLAS_CONST blasint incx, float *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_dswap64_(OPENBLAS_CONST blasint n, double *x, +                          OPENBLAS_CONST blasint incx, double *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_cswap64_(OPENBLAS_CONST blasint n, void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_zswap64_(OPENBLAS_CONST blasint n, void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incy); + +void scipy_cblas_srot64_(OPENBLAS_CONST blasint N, float *X, +                         OPENBLAS_CONST blasint incX, float *Y, +                         OPENBLAS_CONST blasint incY, OPENBLAS_CONST float c, +                         OPENBLAS_CONST float s); +void scipy_cblas_drot64_(OPENBLAS_CONST blasint N, double *X, +                         OPENBLAS_CONST blasint incX, double *Y, +                         OPENBLAS_CONST blasint incY, OPENBLAS_CONST double c, +                         OPENBLAS_CONST double s); +void scipy_cblas_csrot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incY, OPENBLAS_CONST float c, +                          OPENBLAS_CONST float s); +void scipy_cblas_zdrot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, void *y, +                          OPENBLAS_CONST blasint incY, OPENBLAS_CONST double c, +                          OPENBLAS_CONST double s); + +void scipy_cblas_srotg64_(float *a, float *b, float *c, float *s); +void scipy_cblas_drotg64_(double *a, double *b, double *c, double *s); +void scipy_cblas_crotg64_(void *a, void *b, float *c, void *s); +void scipy_cblas_zrotg64_(void *a, void *b, double *c, void *s); + +void scipy_cblas_srotm64_(OPENBLAS_CONST blasint N, float *X, +                          OPENBLAS_CONST blasint incX, float *Y, +                          OPENBLAS_CONST blasint incY, OPENBLAS_CONST float *P); +void scipy_cblas_drotm64_(OPENBLAS_CONST blasint N, double *X, +                          OPENBLAS_CONST blasint incX, double *Y, +                          OPENBLAS_CONST blasint incY, +                          OPENBLAS_CONST double *P); + +void scipy_cblas_srotmg64_(float *d1, float *d2, float *b1, +                           OPENBLAS_CONST float b2, float *P); +void scipy_cblas_drotmg64_(double *d1, double *d2, double *b1, +                           OPENBLAS_CONST double b2, double *P); + +void scipy_cblas_sscal64_(OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                          float *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_dscal64_(OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                          double *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_cscal64_(OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_zscal64_(OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_csscal64_(OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                           void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_zdscal64_(OPENBLAS_CONST blasint N, +                           OPENBLAS_CONST double alpha, void *X, +                           OPENBLAS_CONST blasint incX); + +void scipy_cblas_sgemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, +                          OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *a, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *x, +                          OPENBLAS_CONST blasint incx, +                          OPENBLAS_CONST float beta, float *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_dgemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, +                          OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *a, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST double *x, +                          OPENBLAS_CONST blasint incx, +                          OPENBLAS_CONST double beta, double *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_cgemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, +                          OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *a, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, +                          OPENBLAS_CONST void *beta, void *y, +                          OPENBLAS_CONST blasint incy); +void scipy_cblas_zgemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, +                          OPENBLAS_CONST blasint m, OPENBLAS_CONST blasint n, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *a, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *x, +                          OPENBLAS_CONST blasint incx, +                          OPENBLAS_CONST void *beta, void *y, +                          OPENBLAS_CONST blasint incy); + +void scipy_cblas_sger64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                         OPENBLAS_CONST float alpha, OPENBLAS_CONST float *X, +                         OPENBLAS_CONST blasint incX, OPENBLAS_CONST float *Y, +                         OPENBLAS_CONST blasint incY, float *A, +                         OPENBLAS_CONST blasint lda); +void scipy_cblas_dger64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                         OPENBLAS_CONST double alpha, OPENBLAS_CONST double *X, +                         OPENBLAS_CONST blasint incX, OPENBLAS_CONST double *Y, +                         OPENBLAS_CONST blasint incY, double *A, +                         OPENBLAS_CONST blasint lda); +void scipy_cblas_cgeru64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, OPENBLAS_CONST void *Y, +                          OPENBLAS_CONST blasint incY, void *A, +                          OPENBLAS_CONST blasint lda); +void scipy_cblas_cgerc64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, OPENBLAS_CONST void *Y, +                          OPENBLAS_CONST blasint incY, void *A, +                          OPENBLAS_CONST blasint lda); +void scipy_cblas_zgeru64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, OPENBLAS_CONST void *Y, +                          OPENBLAS_CONST blasint incY, void *A, +                          OPENBLAS_CONST blasint lda); +void scipy_cblas_zgerc64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, OPENBLAS_CONST void *Y, +                          OPENBLAS_CONST blasint incY, void *A, +                          OPENBLAS_CONST blasint lda); + +void scipy_cblas_strsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, float *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_dtrsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, double *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_ctrsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_ztrsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *X, +                          OPENBLAS_CONST blasint incX); + +void scipy_cblas_strmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, float *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_dtrmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, double *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_ctrmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *X, +                          OPENBLAS_CONST blasint incX); +void scipy_cblas_ztrmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *X, +                          OPENBLAS_CONST blasint incX); + +void scipy_cblas_ssyr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                         OPENBLAS_CONST float *X, OPENBLAS_CONST blasint incX, +                         float *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_dsyr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                         OPENBLAS_CONST double *X, OPENBLAS_CONST blasint incX, +                         double *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_cher64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                         OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                         void *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_zher64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                         OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                         void *A, OPENBLAS_CONST blasint lda); + +void scipy_cblas_ssyr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float *Y, OPENBLAS_CONST blasint incY, +                          float *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_dsyr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double *Y, OPENBLAS_CONST blasint incY, +                          double *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_cher264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *Y, OPENBLAS_CONST blasint incY, +                          void *A, OPENBLAS_CONST blasint lda); +void scipy_cblas_zher264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *Y, OPENBLAS_CONST blasint incY, +                          void *A, OPENBLAS_CONST blasint lda); + +void scipy_cblas_sgbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint KL, OPENBLAS_CONST blasint KU, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float beta, float *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_dgbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint KL, OPENBLAS_CONST blasint KU, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST double *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double beta, double *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_cgbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint KL, OPENBLAS_CONST blasint KU, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_zgbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint KL, OPENBLAS_CONST blasint KU, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_ssbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float beta, float *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_dsbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST double *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double beta, double *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_stbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST float *A, OPENBLAS_CONST blasint lda, +                          float *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_dtbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                          double *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ctbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ztbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          void *X, OPENBLAS_CONST blasint incX); + +void scipy_cblas_stbsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST float *A, OPENBLAS_CONST blasint lda, +                          float *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_dtbsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                          double *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ctbsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ztbsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          void *X, OPENBLAS_CONST blasint incX); + +void scipy_cblas_stpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float *Ap, +                          float *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_dtpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double *Ap, +                          double *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ctpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *Ap, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ztpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *Ap, +                          void *X, OPENBLAS_CONST blasint incX); + +void scipy_cblas_stpsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float *Ap, +                          float *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_dtpsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double *Ap, +                          double *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ctpsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *Ap, +                          void *X, OPENBLAS_CONST blasint incX); +void scipy_cblas_ztpsv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *Ap, +                          void *X, OPENBLAS_CONST blasint incX); + +void scipy_cblas_ssymv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST float *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float beta, float *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_dsymv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST double *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double beta, double *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_chemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_zhemv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_sspmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *Ap, OPENBLAS_CONST float *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float beta, float *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_dspmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *Ap, OPENBLAS_CONST double *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double beta, double *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_sspr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                         OPENBLAS_CONST float *X, OPENBLAS_CONST blasint incX, +                         float *Ap); +void scipy_cblas_dspr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                         OPENBLAS_CONST double *X, OPENBLAS_CONST blasint incX, +                         double *Ap); + +void scipy_cblas_chpr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                         OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                         void *A); +void scipy_cblas_zhpr64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                         OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                         OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                         OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                         void *A); + +void scipy_cblas_sspr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST float *Y, OPENBLAS_CONST blasint incY, +                          float *A); +void scipy_cblas_dspr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST double *Y, OPENBLAS_CONST blasint incY, +                          double *A); +void scipy_cblas_chpr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *Y, OPENBLAS_CONST blasint incY, +                          void *Ap); +void scipy_cblas_zhpr264_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *X, OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *Y, OPENBLAS_CONST blasint incY, +                          void *Ap); + +void scipy_cblas_chbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_zhbmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_chpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *Ap, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); +void scipy_cblas_zhpmv64_(OPENBLAS_CONST enum CBLAS_ORDER order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *Ap, OPENBLAS_CONST void *X, +                          OPENBLAS_CONST blasint incX, +                          OPENBLAS_CONST void *beta, void *Y, +                          OPENBLAS_CONST blasint incY); + +void scipy_cblas_sgemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint K, OPENBLAS_CONST float alpha, +                          OPENBLAS_CONST float *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST float *B, OPENBLAS_CONST blasint ldb, +                          OPENBLAS_CONST float beta, float *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_dgemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint K, OPENBLAS_CONST double alpha, +                          OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST double *B, OPENBLAS_CONST blasint ldb, +                          OPENBLAS_CONST double beta, double *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_cgemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint K, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST void *B, OPENBLAS_CONST blasint ldb, +                          OPENBLAS_CONST void *beta, void *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_cgemm3m64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                            OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                            OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                            OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                            OPENBLAS_CONST blasint K, +                            OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                            OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                            OPENBLAS_CONST blasint ldb, +                            OPENBLAS_CONST void *beta, void *C, +                            OPENBLAS_CONST blasint ldc); +void scipy_cblas_zgemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST blasint K, OPENBLAS_CONST void *alpha, +                          OPENBLAS_CONST void *A, OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST void *B, OPENBLAS_CONST blasint ldb, +                          OPENBLAS_CONST void *beta, void *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_zgemm3m64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                            OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                            OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                            OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                            OPENBLAS_CONST blasint K, +                            OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                            OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                            OPENBLAS_CONST blasint ldb, +                            OPENBLAS_CONST void *beta, void *C, +                            OPENBLAS_CONST blasint ldc); + +void scipy_cblas_sgemmt64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                           OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST float beta, float *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_dgemmt64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                           OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST double alpha, +                           OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                           OPENBLAS_CONST double *B, OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST double beta, double *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_cgemmt64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                           OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST void *beta, void *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_zgemmt64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                           OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST void *beta, void *C, +                           OPENBLAS_CONST blasint ldc); + +void scipy_cblas_ssymm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *B, +                          OPENBLAS_CONST blasint ldb, OPENBLAS_CONST float beta, +                          float *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_dsymm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST double *B, +                          OPENBLAS_CONST blasint ldb, +                          OPENBLAS_CONST double beta, double *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_csymm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                          OPENBLAS_CONST blasint ldb, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_zsymm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                          OPENBLAS_CONST blasint ldb, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); + +void scipy_cblas_ssyrk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float beta, +                          float *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_dsyrk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST double beta, double *C, +                          OPENBLAS_CONST blasint ldc); +void scipy_cblas_csyrk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_zsyrk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); + +void scipy_cblas_ssyr2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST float *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST float beta, float *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_dsyr2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST double alpha, +                           OPENBLAS_CONST double *A, OPENBLAS_CONST blasint lda, +                           OPENBLAS_CONST double *B, OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST double beta, double *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_csyr2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST void *beta, void *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_zsyr2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST void *beta, void *C, +                           OPENBLAS_CONST blasint ldc); + +void scipy_cblas_strmm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, float *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_dtrmm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, double *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_ctrmm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_ztrmm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *B, +                          OPENBLAS_CONST blasint ldb); + +void scipy_cblas_strsm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST float *A, +                          OPENBLAS_CONST blasint lda, float *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_dtrsm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST double *A, +                          OPENBLAS_CONST blasint lda, double *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_ctrsm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *B, +                          OPENBLAS_CONST blasint ldb); +void scipy_cblas_ztrsm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                          OPENBLAS_CONST enum CBLAS_DIAG Diag, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, void *B, +                          OPENBLAS_CONST blasint ldb); + +void scipy_cblas_chemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                          OPENBLAS_CONST blasint ldb, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_zhemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_SIDE Side, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                          OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                          OPENBLAS_CONST blasint ldb, OPENBLAS_CONST void *beta, +                          void *C, OPENBLAS_CONST blasint ldc); + +void scipy_cblas_cherk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST float alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, OPENBLAS_CONST float beta, +                          void *C, OPENBLAS_CONST blasint ldc); +void scipy_cblas_zherk64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                          OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                          OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                          OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                          OPENBLAS_CONST double alpha, OPENBLAS_CONST void *A, +                          OPENBLAS_CONST blasint lda, +                          OPENBLAS_CONST double beta, void *C, +                          OPENBLAS_CONST blasint ldc); + +void scipy_cblas_cher2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST float beta, void *C, +                           OPENBLAS_CONST blasint ldc); +void scipy_cblas_zher2k64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_UPLO Uplo, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE Trans, +                           OPENBLAS_CONST blasint N, OPENBLAS_CONST blasint K, +                           OPENBLAS_CONST void *alpha, OPENBLAS_CONST void *A, +                           OPENBLAS_CONST blasint lda, OPENBLAS_CONST void *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST double beta, void *C, +                           OPENBLAS_CONST blasint ldc); + +void scipy_cblas_xerbla64_(blasint p, OPENBLAS_CONST char *rout, +                           OPENBLAS_CONST char *form, ...); + +/*** BLAS extensions ***/ + +void scipy_cblas_saxpby64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST float alpha, +                           OPENBLAS_CONST float *x, OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST float beta, float *y, +                           OPENBLAS_CONST blasint incy); + +void scipy_cblas_daxpby64_(OPENBLAS_CONST blasint n, +                           OPENBLAS_CONST double alpha, +                           OPENBLAS_CONST double *x, +                           OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST double beta, double *y, +                           OPENBLAS_CONST blasint incy); + +void scipy_cblas_caxpby64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                           OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST void *beta, void *y, +                           OPENBLAS_CONST blasint incy); + +void scipy_cblas_zaxpby64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *alpha, +                           OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST void *beta, void *y, +                           OPENBLAS_CONST blasint incy); + +void scipy_cblas_somatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST float calpha, +                              OPENBLAS_CONST float *a, +                              OPENBLAS_CONST blasint clda, float *b, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_domatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST double calpha, +                              OPENBLAS_CONST double *a, +                              OPENBLAS_CONST blasint clda, double *b, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_comatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST float *calpha, +                              OPENBLAS_CONST float *a, +                              OPENBLAS_CONST blasint clda, float *b, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_zomatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST double *calpha, +                              OPENBLAS_CONST double *a, +                              OPENBLAS_CONST blasint clda, double *b, +                              OPENBLAS_CONST blasint cldb); + +void scipy_cblas_simatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST float calpha, float *a, +                              OPENBLAS_CONST blasint clda, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_dimatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST double calpha, double *a, +                              OPENBLAS_CONST blasint clda, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_cimatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST float *calpha, float *a, +                              OPENBLAS_CONST blasint clda, +                              OPENBLAS_CONST blasint cldb); +void scipy_cblas_zimatcopy64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                              OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, +                              OPENBLAS_CONST blasint crows, +                              OPENBLAS_CONST blasint ccols, +                              OPENBLAS_CONST double *calpha, double *a, +                              OPENBLAS_CONST blasint clda, +                              OPENBLAS_CONST blasint cldb); + +void scipy_cblas_sgeadd64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                           OPENBLAS_CONST blasint crows, +                           OPENBLAS_CONST blasint ccols, +                           OPENBLAS_CONST float calpha, float *a, +                           OPENBLAS_CONST blasint clda, +                           OPENBLAS_CONST float cbeta, float *c, +                           OPENBLAS_CONST blasint cldc); +void scipy_cblas_dgeadd64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                           OPENBLAS_CONST blasint crows, +                           OPENBLAS_CONST blasint ccols, +                           OPENBLAS_CONST double calpha, double *a, +                           OPENBLAS_CONST blasint clda, +                           OPENBLAS_CONST double cbeta, double *c, +                           OPENBLAS_CONST blasint cldc); +void scipy_cblas_cgeadd64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                           OPENBLAS_CONST blasint crows, +                           OPENBLAS_CONST blasint ccols, +                           OPENBLAS_CONST float *calpha, float *a, +                           OPENBLAS_CONST blasint clda, +                           OPENBLAS_CONST float *cbeta, float *c, +                           OPENBLAS_CONST blasint cldc); +void scipy_cblas_zgeadd64_(OPENBLAS_CONST enum CBLAS_ORDER CORDER, +                           OPENBLAS_CONST blasint crows, +                           OPENBLAS_CONST blasint ccols, +                           OPENBLAS_CONST double *calpha, double *a, +                           OPENBLAS_CONST blasint clda, +                           OPENBLAS_CONST double *cbeta, double *c, +                           OPENBLAS_CONST blasint cldc); + +/*** BFLOAT16 and INT8 extensions ***/ +/* convert float array to BFLOAT16 array by rounding */ +void scipy_cblas_sbstobf1664_(OPENBLAS_CONST blasint n, +                              OPENBLAS_CONST float *in, +                              OPENBLAS_CONST blasint incin, bfloat16 *out, +                              OPENBLAS_CONST blasint incout); +/* convert double array to BFLOAT16 array by rounding */ +void scipy_cblas_sbdtobf1664_(OPENBLAS_CONST blasint n, +                              OPENBLAS_CONST double *in, +                              OPENBLAS_CONST blasint incin, bfloat16 *out, +                              OPENBLAS_CONST blasint incout); +/* convert BFLOAT16 array to float array */ +void scipy_cblas_sbf16tos64_(OPENBLAS_CONST blasint n, +                             OPENBLAS_CONST bfloat16 *in, +                             OPENBLAS_CONST blasint incin, float *out, +                             OPENBLAS_CONST blasint incout); +/* convert BFLOAT16 array to double array */ +void scipy_cblas_dbf16tod64_(OPENBLAS_CONST blasint n, +                             OPENBLAS_CONST bfloat16 *in, +                             OPENBLAS_CONST blasint incin, double *out, +                             OPENBLAS_CONST blasint incout); +/* dot production of BFLOAT16 input arrays, and output as float */ +float scipy_cblas_sbdot64_(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *x, +                           OPENBLAS_CONST blasint incx, +                           OPENBLAS_CONST bfloat16 *y, +                           OPENBLAS_CONST blasint incy); +void scipy_cblas_sbgemv64_( +    OPENBLAS_CONST enum CBLAS_ORDER order, +    OPENBLAS_CONST enum CBLAS_TRANSPOSE trans, OPENBLAS_CONST blasint m, +    OPENBLAS_CONST blasint n, OPENBLAS_CONST float alpha, +    OPENBLAS_CONST bfloat16 *a, OPENBLAS_CONST blasint lda, +    OPENBLAS_CONST bfloat16 *x, OPENBLAS_CONST blasint incx, +    OPENBLAS_CONST float beta, float *y, OPENBLAS_CONST blasint incy); + +void scipy_cblas_sbgemm64_(OPENBLAS_CONST enum CBLAS_ORDER Order, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA, +                           OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB, +                           OPENBLAS_CONST blasint M, OPENBLAS_CONST blasint N, +                           OPENBLAS_CONST blasint K, OPENBLAS_CONST float alpha, +                           OPENBLAS_CONST bfloat16 *A, +                           OPENBLAS_CONST blasint lda, +                           OPENBLAS_CONST bfloat16 *B, +                           OPENBLAS_CONST blasint ldb, +                           OPENBLAS_CONST float beta, float *C, +                           OPENBLAS_CONST blasint ldc); +} +/* } VENDORED HEADER */ + +#else +#define BLAS_MANGLE(s) s  #if defined(PYTHRAN_BLAS_ATLAS) || defined(PYTHRAN_BLAS_SATLAS)  extern "C" {  #endif @@ -19,6 +1300,7 @@ extern "C" {  #if defined(PYTHRAN_BLAS_ATLAS) || defined(PYTHRAN_BLAS_SATLAS)  }  #endif +#endif  PYTHONIC_NS_BEGIN @@ -48,8 +1330,8 @@ namespace numpy      }    };    template <class T, size_t N> -  struct blas_buffer_t<types::array<T, N>> { -    T const *operator()(types::array<T, N> const &e) const +  struct blas_buffer_t<types::array_tuple<T, N>> { +    T const *operator()(types::array_tuple<T, N> const &e) const      {        return e.data();      } @@ -61,12 +1343,18 @@ namespace numpy      return blas_buffer_t<E>{}(e);    } +  template <class E, class... S> +  typename E::dtype const *blas_buffer(types::numpy_gexpr<E, S...> const &e) +  { +    return e.data(); +  } +    template <class E, class F>    typename std::enable_if<        types::is_numexpr_arg<E>::value &&            types::is_numexpr_arg<F>::value   // Arguments are array_like            && E::value == 1 && F::value == 1 // It is a two vectors. -          && (!is_blas_array<E>::value || !is_blas_array<F>::value || +          && (!is_blas_expr<E>::value || !is_blas_expr<F>::value ||                !std::is_same<typename E::dtype, typename F::dtype>::value),        typename __combined<typename E::dtype, typename F::dtype>::type>::type    dot(E const &e, F const &f) @@ -83,7 +1371,8 @@ namespace numpy                            float>::type    dot(E const &e, F const &f)    { -    return cblas_sdot(e.size(), blas_buffer(e), 1, blas_buffer(f), 1); +    return BLAS_MANGLE(cblas_sdot)(e.size(), blas_buffer(e), 1, blas_buffer(f), +                                   1);    }    template <class E, class F> @@ -95,7 +1384,8 @@ namespace numpy                            double>::type    dot(E const &e, F const &f)    { -    return cblas_ddot(e.size(), blas_buffer(e), 1, blas_buffer(f), 1); +    return BLAS_MANGLE(cblas_ddot)(e.size(), blas_buffer(e), 1, blas_buffer(f), +                                   1);    }    template <class E, class F> @@ -108,7 +1398,8 @@ namespace numpy    dot(E const &e, F const &f)    {      std::complex<float> out; -    cblas_cdotu_sub(e.size(), blas_buffer(e), 1, blas_buffer(f), 1, &out); +    BLAS_MANGLE(cblas_cdotu_sub) +    (e.size(), blas_buffer(e), 1, blas_buffer(f), 1, &out);      return out;    } @@ -122,17 +1413,98 @@ namespace numpy    dot(E const &e, F const &f)    {      std::complex<double> out; -    cblas_zdotu_sub(e.size(), blas_buffer(e), 1, blas_buffer(f), 1, &out); +    BLAS_MANGLE(cblas_zdotu_sub) +    (e.size(), blas_buffer(e), 1, blas_buffer(f), 1, &out);      return out;    } +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, float>::value && +          std::is_same<typename F::dtype, float>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      float>::type +  dot(E const &e, F const &f) +  { +    if (e.template strides<0>() >= 1 && f.template strides<0>() >= 1) { +      return BLAS_MANGLE(cblas_sdot)(e.size(), blas_buffer(e), +                                     e.template strides<0>(), blas_buffer(f), +                                     f.template strides<0>()); +    } else { +      return dot(asarray(e), asarray(f)); +    } +  } + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, double>::value && +          std::is_same<typename F::dtype, double>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      double>::type +  dot(E const &e, F const &f) +  { +    if (e.template strides<0>() >= 1 && f.template strides<0>() >= 1) { +      return BLAS_MANGLE(cblas_ddot)(e.size(), blas_buffer(e), +                                     e.template strides<0>(), blas_buffer(f), +                                     f.template strides<0>()); +    } else { +      return dot(asarray(e), asarray(f)); +    } +  } + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, std::complex<float>>::value && +          std::is_same<typename F::dtype, std::complex<float>>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      std::complex<float>>::type +  dot(E const &e, F const &f) +  { +    if (e.template strides<0>() >= 1 && f.template strides<0>() >= 1) { +      std::complex<float> out; +      BLAS_MANGLE(cblas_cdotu_sub) +      (e.size(), blas_buffer(e), e.template strides<0>(), blas_buffer(f), +       f.template strides<0>(), &out); +      return out; +    } else { +      return dot(asarray(e), asarray(f)); +    } +  } + +  template <class E, class F> +  typename std::enable_if< +      E::value == 1 && F::value == 1 && +          std::is_same<typename E::dtype, std::complex<double>>::value && +          std::is_same<typename F::dtype, std::complex<double>>::value && +          (is_blas_expr<E>::value && is_blas_expr<F>::value && +           !(is_blas_array<E>::value && is_blas_array<F>::value)), +      std::complex<double>>::type +  dot(E const &e, F const &f) +  { +    if (e.template strides<0>() >= 1 && f.template strides<0>() >= 1) { +      std::complex<double> out; +      BLAS_MANGLE(cblas_zdotu_sub) +      (e.size(), blas_buffer(e), e.template strides<0>(), blas_buffer(f), +       f.template strides<0>(), &out); +      return out; +    } else { +      return dot(asarray(e), asarray(f)); +    } +  } +    /// Matrice / Vector multiplication  #define MV_DEF(T, L)                                                           \    inline void mv(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \ -    cblas_##L##gemv(CblasRowMajor, CblasNoTrans, n, m, 1, A, m, B, 1, 0, C,    \ -                    1);                                                        \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasNoTrans, n, m, 1, A, m, B, 1, 0, C, 1);               \    }    MV_DEF(double, d) @@ -143,7 +1515,8 @@ namespace numpy  #define TV_DEF(T, L)                                                           \    inline void tv(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \ -    cblas_##L##gemv(CblasRowMajor, CblasTrans, m, n, 1, A, n, B, 1, 0, C, 1);  \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasTrans, m, n, 1, A, n, B, 1, 0, C, 1);                 \    }    TV_DEF(double, d) @@ -155,8 +1528,9 @@ namespace numpy    inline void mv(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemv(CblasRowMajor, CblasNoTrans, n, m, (K *)&alpha, (K *)A, m, \ -                    (K *)B, 1, (K *)&beta, (K *)C, 1);                         \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasNoTrans, n, m, (K *)&alpha, (K *)A, m, (K *)B, 1,     \ +     (K *)&beta, (K *)C, 1);                                                   \    }    MV_DEF(std::complex<float>, float, c)    MV_DEF(std::complex<double>, double, z) @@ -195,7 +1569,8 @@ namespace numpy  #define VM_DEF(T, L)                                                           \    inline void vm(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \ -    cblas_##L##gemv(CblasRowMajor, CblasTrans, n, m, 1, A, m, B, 1, 0, C, 1);  \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasTrans, n, m, 1, A, m, B, 1, 0, C, 1);                 \    }    VM_DEF(double, d) @@ -205,8 +1580,8 @@ namespace numpy  #define VT_DEF(T, L)                                                           \    inline void vt(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \ -    cblas_##L##gemv(CblasRowMajor, CblasNoTrans, m, n, 1, A, n, B, 1, 0, C,    \ -                    1);                                                        \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasNoTrans, m, n, 1, A, n, B, 1, 0, C, 1);               \    }    VT_DEF(double, d) @@ -217,8 +1592,9 @@ namespace numpy    inline void vm(int m, int n, T *A, T *B, T *C)                               \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemv(CblasRowMajor, CblasTrans, n, m, (K *)&alpha, (K *)A, m,   \ -                    (K *)B, 1, (K *)&beta, (K *)C, 1);                         \ +    BLAS_MANGLE(cblas_##L##gemv)                                               \ +    (CblasRowMajor, CblasTrans, n, m, (K *)&alpha, (K *)A, m, (K *)B, 1,       \ +     (K *)&beta, (K *)C, 1);                                                   \    }    VM_DEF(std::complex<float>, float, c)    VM_DEF(std::complex<double>, double, z) @@ -327,7 +1703,7 @@ namespace numpy          out(types::pshape<long>{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<long, 2>{{j, i}}]; +        out[i] += e[j] * f[types::array_tuple<long, 2>{{j, i}}];      return out;    } @@ -349,7 +1725,7 @@ namespace numpy          out(types::pshape<long>{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<long, 2>{{i, j}}] * f[j]; +        out[i] += e[types::array_tuple<long, 2>{{i, j}}] * f[j];      return out;    } @@ -358,8 +1734,9 @@ namespace numpy  #define MM_DEF(T, L)                                                           \    inline void mm(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \ -    cblas_##L##gemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k, 1, A,  \ -                    k, B, n, 0, C, n);                                         \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k, 1, A, k, B, n, 0, C,  \ +     n);                                                                       \    }    MM_DEF(double, d)    MM_DEF(float, s) @@ -368,8 +1745,9 @@ namespace numpy    inline void mm(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k,        \ -                    (K *)&alpha, (K *)A, k, (K *)B, n, (K *)&beta, (K *)C, n); \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k, (K *)&alpha, (K *)A,  \ +     k, (K *)B, n, (K *)&beta, (K *)C, n);                                     \    }    MM_DEF(std::complex<float>, float, c)    MM_DEF(std::complex<double>, double, z) @@ -379,14 +1757,14 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::ndarray<E, pS0> const &a, types::ndarray<E, pS1> const &b)    {      int n = b.template shape<1>(), m = a.template shape<0>(),          k = b.template shape<0>(); -    types::ndarray<E, types::array<long, 2>> out(types::array<long, 2>{{m, n}}, -                                                 builtins::None); +    types::ndarray<E, types::array_tuple<long, 2>> out( +        types::array_tuple<long, 2>{{m, n}}, builtins::None);      mm(m, n, k, a.buffer, b.buffer, out.buffer);      return out;    } @@ -409,8 +1787,9 @@ namespace numpy  #define TM_DEF(T, L)                                                           \    inline void tm(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \ -    cblas_##L##gemm(CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k, 1, A, m, \ -                    B, n, 0, C, n);                                            \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k, 1, A, m, B, n, 0, C,    \ +     n);                                                                       \    }    TM_DEF(double, d)    TM_DEF(float, s) @@ -419,8 +1798,9 @@ namespace numpy    inline void tm(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemm(CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k,          \ -                    (K *)&alpha, (K *)A, m, (K *)B, n, (K *)&beta, (K *)C, n); \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasTrans, CblasNoTrans, m, n, k, (K *)&alpha, (K *)A, m, \ +     (K *)B, n, (K *)&beta, (K *)C, n);                                        \    }    TM_DEF(std::complex<float>, float, c)    TM_DEF(std::complex<double>, double, z) @@ -430,15 +1810,15 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::numpy_texpr<types::ndarray<E, pS0>> const &a,        types::ndarray<E, pS1> const &b)    {      int n = b.template shape<1>(), m = a.template shape<0>(),          k = b.template shape<0>(); -    types::ndarray<E, types::array<long, 2>> out(types::array<long, 2>{{m, n}}, -                                                 builtins::None); +    types::ndarray<E, types::array_tuple<long, 2>> out( +        types::array_tuple<long, 2>{{m, n}}, builtins::None);      tm(m, n, k, a.arg.buffer, b.buffer, out.buffer);      return out;    } @@ -446,8 +1826,9 @@ namespace numpy  #define MT_DEF(T, L)                                                           \    inline void mt(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \ -    cblas_##L##gemm(CblasRowMajor, CblasNoTrans, CblasTrans, m, n, k, 1, A, k, \ -                    B, k, 0, C, n);                                            \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasNoTrans, CblasTrans, m, n, k, 1, A, k, B, k, 0, C,    \ +     n);                                                                       \    }    MT_DEF(double, d)    MT_DEF(float, s) @@ -456,8 +1837,9 @@ namespace numpy    inline void mt(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemm(CblasRowMajor, CblasNoTrans, CblasTrans, m, n, k,          \ -                    (K *)&alpha, (K *)A, k, (K *)B, k, (K *)&beta, (K *)C, n); \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasNoTrans, CblasTrans, m, n, k, (K *)&alpha, (K *)A, k, \ +     (K *)B, k, (K *)&beta, (K *)C, n);                                        \    }    MT_DEF(std::complex<float>, float, c)    MT_DEF(std::complex<double>, double, z) @@ -467,15 +1849,15 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::ndarray<E, pS0> const &a,        types::numpy_texpr<types::ndarray<E, pS1>> const &b)    {      int n = b.template shape<1>(), m = a.template shape<0>(),          k = b.template shape<0>(); -    types::ndarray<E, types::array<long, 2>> out(types::array<long, 2>{{m, n}}, -                                                 builtins::None); +    types::ndarray<E, types::array_tuple<long, 2>> out( +        types::array_tuple<long, 2>{{m, n}}, builtins::None);      mt(m, n, k, a.buffer, b.arg.buffer, out.buffer);      return out;    } @@ -483,8 +1865,8 @@ namespace numpy  #define TT_DEF(T, L)                                                           \    inline void tt(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \ -    cblas_##L##gemm(CblasRowMajor, CblasTrans, CblasTrans, m, n, k, 1, A, m,   \ -                    B, k, 0, C, n);                                            \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasTrans, CblasTrans, m, n, k, 1, A, m, B, k, 0, C, n);  \    }    TT_DEF(double, d)    TT_DEF(float, s) @@ -493,8 +1875,9 @@ namespace numpy    inline void tt(int m, int n, int k, T *A, T *B, T *C)                        \    {                                                                            \      T alpha = 1, beta = 0;                                                     \ -    cblas_##L##gemm(CblasRowMajor, CblasTrans, CblasTrans, m, n, k,            \ -                    (K *)&alpha, (K *)A, m, (K *)B, k, (K *)&beta, (K *)C, n); \ +    BLAS_MANGLE(cblas_##L##gemm)                                               \ +    (CblasRowMajor, CblasTrans, CblasTrans, m, n, k, (K *)&alpha, (K *)A, m,   \ +     (K *)B, k, (K *)&beta, (K *)C, n);                                        \    }    TT_DEF(std::complex<float>, float, c)    TT_DEF(std::complex<double>, double, z) @@ -504,15 +1887,15 @@ namespace numpy    typename std::enable_if<is_blas_type<E>::value &&                                std::tuple_size<pS0>::value == 2 &&                                std::tuple_size<pS1>::value == 2, -                          types::ndarray<E, types::array<long, 2>>>::type +                          types::ndarray<E, types::array_tuple<long, 2>>>::type    dot(types::numpy_texpr<types::ndarray<E, pS0>> const &a,        types::numpy_texpr<types::ndarray<E, pS1>> const &b)    {      int n = b.template shape<1>(), m = a.template shape<0>(),          k = b.template shape<0>(); -    types::ndarray<E, types::array<long, 2>> out(types::array<long, 2>{{m, n}}, -                                                 builtins::None); +    types::ndarray<E, types::array_tuple<long, 2>> out( +        types::array_tuple<long, 2>{{m, n}}, builtins::None);      tt(m, n, k, a.arg.buffer, b.arg.buffer, out.buffer);      return out;    } @@ -531,7 +1914,7 @@ namespace numpy            && E::value == 2 && F::value == 2,     // And both are matrix        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, 2>>>::type +          types::array_tuple<long, 2>>>::type    dot(E const &e, F const &f)    {      types::ndarray< @@ -554,21 +1937,21 @@ namespace numpy            E::value == 2 && F::value == 2, // And it is matrix / matrix        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, 2>>>::type +          types::array_tuple<long, 2>>>::type    dot(E const &e, F const &f)    {      types::ndarray<          typename __combined<typename E::dtype, typename F::dtype>::type, -        types::array<long, 2>> -        out(types::array<long, 2>{{e.template shape<0>(), -                                   f.template shape<1>()}}, +        types::array_tuple<long, 2>> +        out(types::array_tuple<long, 2>{{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<long, 2>{{i, j}}] += -              e[types::array<long, 2>{{i, k}}] * -              f[types::array<long, 2>{{k, j}}]; +          out[types::array_tuple<long, 2>{{i, j}}] += +              e[types::array_tuple<long, 2>{{i, k}}] * +              f[types::array_tuple<long, 2>{{k, j}}];      return out;    } @@ -577,12 +1960,13 @@ namespace numpy        (E::value >= 3 && F::value == 1), // And it is matrix / matrix        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, E::value - 1>>>::type +          types::array_tuple<long, E::value - 1>>>::type    dot(E const &e, F const &f)    { -    auto out = dot( -        e.reshape(types::array<long, 2>{{sutils::prod_head(e), f.size()}}), f); -    types::array<long, E::value - 1> out_shape; +    auto out = dot(e.reshape(types::array_tuple<long, 2>{ +                       {sutils::prod_head(e), f.size()}}), +                   f); +    types::array_tuple<long, E::value - 1> out_shape;      auto tmp = sutils::getshape(e);      std::copy(tmp.begin(), tmp.end() - 1, out_shape.begin());      return out.reshape(out_shape); @@ -593,7 +1977,7 @@ namespace numpy        (E::value >= 3 && F::value >= 2),        types::ndarray<            typename __combined<typename E::dtype, typename F::dtype>::type, -          types::array<long, E::value - 1>>>::type +          types::array_tuple<long, E::value - 1>>>::type    dot(E const &e, F const &f)    {      static_assert(E::value == 0, "not implemented yet"); @@ -601,4 +1985,6 @@ namespace numpy  } // namespace numpy  PYTHONIC_NS_END +#undef BLAS_MANGLE +  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/double_.hpp b/contrib/python/pythran/pythran/pythonic/numpy/double_.hpp index e5fa42b3de9..dd7c3dfccd7 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/double_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/dtype/type.hpp b/contrib/python/pythran/pythran/pythonic/numpy/dtype/type.hpp index 894286b9386..7587ac5b313 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/dtype/type.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ediff1d.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ediff1d.hpp index cbde610ee5d..d194e4cb351 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ediff1d.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ediff1d.hpp @@ -28,7 +28,7 @@ namespace numpy    {      return ediff1d(asarray(expr));    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/empty.hpp b/contrib/python/pythran/pythran/pythonic/numpy/empty.hpp index 1005c351816..373f5f4dad4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/empty.hpp +++ b/contrib/python/pythran/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 <class dtype> -  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<std::integral_constant<long, N>>({}), d);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/empty_like.hpp b/contrib/python/pythran/pythran/pythonic/numpy/empty_like.hpp index f0e742cdb40..d1776b0def9 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/empty_like.hpp +++ b/contrib/python/pythran/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 <class E, class dtype> -  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<typename E::dtype>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/equal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/equal.hpp index ba51ed6d7db..1cf4d7cb444 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/exp.hpp b/contrib/python/pythran/pythran/pythonic/numpy/exp.hpp index 4c4ecc3415b..72ce335fc4a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/exp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/expand_dims.hpp b/contrib/python/pythran/pythran/pythonic/numpy/expand_dims.hpp index 1a7501b7a9e..3dd5b25050d 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/expand_dims.hpp +++ b/contrib/python/pythran/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 <typename T> -  types::ndarray<typename T::dtype, types::array<long, T::value + 1>> +  types::ndarray<typename T::dtype, types::array_tuple<long, T::value + 1>>    expand_dims(T const &input, int axis)    {      const long N = T::value;      if (axis == -1)        axis += N + 1; -    types::array<long, N + 1> dim_array; +    types::array_tuple<long, N + 1> 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/contrib/python/pythran/pythran/pythonic/numpy/expm1.hpp b/contrib/python/pythran/pythran/pythonic/numpy/expm1.hpp index eee79f19ac4..208d9bfc8e3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/expm1.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/eye.hpp b/contrib/python/pythran/pythran/pythonic/numpy/eye.hpp index 8bed2d4a339..816a3351782 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/eye.hpp +++ b/contrib/python/pythran/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 <class dtype> -  types::ndarray<typename dtype::type, types::array<long, 2>> +  types::ndarray<typename dtype::type, types::array_tuple<long, 2>>    eye(long N, long M, long k, dtype d)    { -    types::ndarray<typename dtype::type, types::array<long, 2>> out = +    types::ndarray<typename dtype::type, types::array_tuple<long, 2>> 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 <class dtype> -  types::ndarray<typename dtype::type, types::array<long, 2>> +  types::ndarray<typename dtype::type, types::array_tuple<long, 2>>    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/contrib/python/pythran/pythran/pythonic/numpy/fft/c2c.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/c2c.hpp index aae6de63158..bb84da4eaa3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/c2c.hpp +++ b/contrib/python/pythran/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 <array> -#include <cstring>  #include <cmath> +#include <cstring>  #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<sizeof(long double) == sizeof(double), double,                                    long double>::type; @@ -31,7 +31,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<          typename std::enable_if<std::is_integral<T>::value, double>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      _copy_to_double(types::ndarray<T, pS> const &in_array)      {        auto out_shape = sutils::getshape(in_array); @@ -44,7 +44,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      _copy_to_complex(types::ndarray<T, pS> const &in_array)      {        auto out_shape = sutils::getshape(in_array); @@ -58,7 +58,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      _copy_to_complex(types::ndarray<T, pS> 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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      _pad_in_array(types::ndarray<T, pS> const &in_array, long axis, long n)      { -      types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>            extended_array;        auto tmp_shape = sutils::getshape(in_array);        tmp_shape[axis] = n;        auto tmp_array = zeros(tmp_shape, types::dtype_t<T>());        types::list<types::ndarray< -          T, types::array<long, std::tuple_size<pS>::value>>> bi(0); +          T, types::array_tuple<long, std::tuple_size<pS>::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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      c2r(types::ndarray<std::complex<T>, 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<T, types::array<long, std::tuple_size<pS>::value>> +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>            out_array(out_shape, builtins::None);        std::complex<T> *d_in;        types::ndarray<std::complex<T>, -                     types::array<long, std::tuple_size<pS>::value>> +                     types::array_tuple<long, std::tuple_size<pS>::value>>            extended_array;        stride_t in_strides;        auto out_strides = create_strides(out_array); @@ -192,7 +193,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<std::complex<T>, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      c2c(types::ndarray<std::complex<T>, 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<std::complex<T>, -                     types::array<long, std::tuple_size<pS>::value>> +                     types::array_tuple<long, std::tuple_size<pS>::value>>            out_array(out_shape, builtins::None);        std::complex<T> *d_in;        types::ndarray<std::complex<T>, -                     types::array<long, std::tuple_size<pS>::value>> +                     types::array_tuple<long, std::tuple_size<pS>::value>>            extended_array;        stride_t in_strides;        if (n > npts) { @@ -242,7 +243,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      r2c(types::ndarray<T, pS> 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<std::complex<T>, -                     types::array<long, std::tuple_size<pS>::value>> +                     types::array_tuple<long, std::tuple_size<pS>::value>>            out_array(out_shape, builtins::None);        T *d_in; -      types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::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/contrib/python/pythran/pythran/pythonic/numpy/fft/fft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/fft.hpp index d8eed26b823..87d093367a2 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/fft.hpp +++ b/contrib/python/pythran/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 <class T, class pS, class N, class Norm>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &in_array, N const& n, long axis, +        types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> 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 <class T, class pS, class N, class Norm>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &in_array, N const & n, long axis, +                   types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> 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 <class T, class pS, class N, class Norm>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> -    fft(types::ndarray<T, pS> const &in_array, N const& n, long axis, +                   types::array_tuple<long, std::tuple_size<pS>::value>> +    fft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fft/fftn.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/fftn.hpp index 37cf60a7483..28ce369592c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/fftn.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/fft/fftn.hpp @@ -27,12 +27,12 @@ namespace numpy        }        template <size_t K, size_t S> -          types::array < long, +          types::array_tuple < long,            K<S ? K : S> normalize_axes(types::none_type const &)        {          if (S == 1)            return {-1}; // FIXME: understand why this is needed -        types::array < long, K<S ? K : S> result; +        types::array_tuple < long, K<S ? K : S> 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 <class T, class pS, class Axes, class Norm>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &in_array, types::none_type s,           Axes const &axes, Norm const &norm)      { @@ -61,7 +61,7 @@ namespace numpy      template <class T, class pS, class Axes, class Norm>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &in_array, types::none_type s,           Axes const &axes, Norm const &norm)      { @@ -76,7 +76,7 @@ namespace numpy      template <class T, class pS, class Axes, class Norm>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &in_array, types::none_type s,           Axes const &axes, Norm const &norm)      { @@ -93,7 +93,7 @@ namespace numpy                class Norm>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> const &s,           Axes const &axes, Norm const &norm)      { @@ -105,7 +105,7 @@ namespace numpy                class Norm>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> const &s,           Axes const &axes, Norm const &norm)      { @@ -123,7 +123,7 @@ namespace numpy                class Norm>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      fftn(types::ndarray<T, pS> const &a, types::array_base<I, N, V> const &s,           Axes const &axes, Norm const &norm)      { diff --git a/contrib/python/pythran/pythran/pythonic/numpy/fft/hfft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/hfft.hpp index 3820ba44a11..bf230a19bfc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/hfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &in_array,           types::none_type n, long axis, types::str const &norm)      { @@ -24,7 +24,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &in_array,           types::none_type n, long axis, types::none_type norm)      { @@ -32,7 +32,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -40,7 +40,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<std::complex<T>, pS> const &in_array, long n, long axis,           types::str const &norm)      { @@ -52,7 +52,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -65,7 +65,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -78,7 +78,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -91,7 +91,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      hfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fft/ifft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/ifft.hpp index 23aad1d0c77..743615e9923 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/ifft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -28,7 +28,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -38,7 +38,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -48,7 +48,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<          typename std::enable_if<types::is_complex<T>::value, T>::type, -        types::array<long, std::tuple_size<pS>::value>> +        types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::str const &norm)      { @@ -58,7 +58,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -68,7 +68,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -78,7 +78,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -88,7 +88,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::str const &norm)      { @@ -98,7 +98,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -109,7 +109,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -120,7 +120,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -131,7 +131,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ifft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fft/ihfft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/ihfft.hpp index 44fe008bb53..e8c1fed129e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/ihfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::str const &norm)      { @@ -27,7 +27,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::none_type norm)      { @@ -37,7 +37,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, long n, long axis,            types::none_type norm)      { @@ -47,7 +47,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, long n, long axis,            types::str const &norm)      { @@ -57,7 +57,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::str const &norm)      { @@ -68,7 +68,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::none_type norm)      { @@ -79,7 +79,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> const &in_array, long n, long axis,            types::none_type norm)      { @@ -90,7 +90,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      ihfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fft/irfft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/irfft.hpp index acc24765e24..6d3c5a97114 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/irfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &in_array,            types::none_type n, long axis, types::str const &norm)      { @@ -24,7 +24,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &in_array,            types::none_type n, long axis, types::none_type norm)      { @@ -32,7 +32,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &in_array, long n,            long axis, types::none_type norm)      { @@ -40,7 +40,7 @@ namespace numpy      }      template <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<std::complex<T>, pS> const &in_array, long n,            long axis, types::str const &norm)      { @@ -52,7 +52,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::str const &norm)      { @@ -65,7 +65,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,            types::none_type norm)      { @@ -78,7 +78,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> const &in_array, long n, long axis,            types::none_type norm)      { @@ -91,7 +91,7 @@ namespace numpy                         !types::is_complex<T>::value,                         typename std::conditional<std::is_integral<T>::value,                                                   double, T>::type>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      irfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fft/pocketfft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/pocketfft.hpp index be696d0d3dc..3ad32f425d0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/pocketfft.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/fft/pocketfft.hpp @@ -53,24 +53,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  #endif  #include <cmath> -#include <cstring> +#include <complex>  #include <cstdlib> -#include <stdexcept> +#include <cstring>  #include <memory> +#include <stdexcept>  #include <vector> -#include <complex>  #if POCKETFFT_CACHE_SIZE != 0  #include <array>  #include <mutex>  #endif  #ifndef POCKETFFT_NO_MULTITHREADING -#include <mutex> -#include <condition_variable> -#include <thread> -#include <queue>  #include <atomic> +#include <condition_variable>  #include <functional> +#include <mutex> +#include <queue> +#include <thread>  #ifdef POCKETFFT_PTHREADS  #include <pthread.h> @@ -93,8 +93,8 @@ namespace pocketfft    namespace detail    { -    using std::size_t;      using std::ptrdiff_t; +    using std::size_t;      // Always use std:: for <cmath> functions      template <typename T> @@ -145,7 +145,7 @@ namespace pocketfft      struct VLEN<double> {        static constexpr size_t val = 8;      }; -#elif(defined(__AVX__)) +#elif (defined(__AVX__))      template <>      struct VLEN<float> {        static constexpr size_t val = 8; @@ -154,7 +154,7 @@ namespace pocketfft      struct VLEN<double> {        static constexpr size_t val = 4;      }; -#elif(defined(__SSE2__)) +#elif (defined(__SSE2__))      template <>      struct VLEN<float> {        static constexpr size_t val = 4; @@ -163,7 +163,7 @@ namespace pocketfft      struct VLEN<double> {        static constexpr size_t val = 2;      }; -#elif(defined(__VSX__)) +#elif (defined(__VSX__))      template <>      struct VLEN<float> {        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 <typename T2> -      auto operator*(const T2 &other) const -> cmplx<decltype(r *other)> +      auto operator*(const T2 &other) const -> cmplx<decltype(r * other)>        {          return {r * other, i * other};        }        template <typename T2> -      auto operator+(const cmplx<T2> &other) const -          -> cmplx<decltype(r + other.r)> +      auto +      operator+(const cmplx<T2> &other) const -> cmplx<decltype(r + other.r)>        {          return {r + other.r, i + other.i};        }        template <typename T2> -      auto operator-(const cmplx<T2> &other) const -          -> cmplx<decltype(r + other.r)> +      auto +      operator-(const cmplx<T2> &other) const -> cmplx<decltype(r + other.r)>        {          return {r - other.r, i - other.i};        }        template <typename T2> -      auto operator*(const cmplx<T2> &other) const -          -> cmplx<decltype(r + other.r)> +      auto +      operator*(const cmplx<T2> &other) const -> cmplx<decltype(r + other.r)>        {          return {r * other.r - i * other.i, r * other.i + i * other.r};        }        template <bool fwd, typename T2> -      auto special_mul(const cmplx<T2> &other) const -          -> cmplx<decltype(r + other.r)> +      auto +      special_mul(const cmplx<T2> &other) const -> cmplx<decltype(r + other.r)>        {          using Tres = cmplx<decltype(r + other.r)>;          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<T0> *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<T0> *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<T0> *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<cmplx<T0>> wal(ip);          wal[0] = cmplx<T0>(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<float> { -      using type = float -          __attribute__((vector_size(VLEN<float>::val * sizeof(float)))); +      using type = +          float __attribute__((vector_size(VLEN<float>::val * sizeof(float))));      };      template <>      struct VTYPE<double> { @@ -3348,9 +3409,8 @@ namespace pocketfft      };      template <>      struct VTYPE<long double> { -      using type = long double -          __attribute__((vector_size(VLEN<long double>::val * -                                     sizeof(long double)))); +      using type = long double __attribute__(( +          vector_size(VLEN<long double>::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/contrib/python/pythran/pythran/pythonic/numpy/fft/rfft.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fft/rfft.hpp index 91e6fab8291..84d1300c8db 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fft/rfft.hpp +++ b/contrib/python/pythran/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 <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -27,7 +27,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -37,7 +37,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -47,7 +47,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_floating_point<T>::value,                                             std::complex<T>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::str const &norm)      { @@ -57,7 +57,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::str const &norm)      { @@ -68,7 +68,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, types::none_type n, long axis,           types::none_type norm)      { @@ -79,7 +79,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> const &in_array, long n, long axis,           types::none_type norm)      { @@ -90,7 +90,7 @@ namespace numpy      template <class T, class pS>      types::ndarray<typename std::enable_if<std::is_integral<T>::value,                                             std::complex<double>>::type, -                   types::array<long, std::tuple_size<pS>::value>> +                   types::array_tuple<long, std::tuple_size<pS>::value>>      rfft(types::ndarray<T, pS> 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/contrib/python/pythran/pythran/pythonic/numpy/fill_diagonal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fill_diagonal.hpp index 5be8b09d212..dd5bc0889bc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fill_diagonal.hpp +++ b/contrib/python/pythran/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<E>::type::dtype fill_value)    {      constexpr auto N = std::decay<E>::type::value; -    types::array<long, N> indices; +    types::array_tuple<long, N> 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/contrib/python/pythran/pythran/pythonic/numpy/finfo.hpp b/contrib/python/pythran/pythran/pythonic/numpy/finfo.hpp index cb9c2b10bab..cb13966269e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/finfo.hpp +++ b/contrib/python/pythran/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<typename dtype::type>();    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/fix.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fix.hpp index 5b1b020dc29..84773b61cf5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fix.hpp +++ b/contrib/python/pythran/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 @@ -13,9 +13,9 @@ namespace numpy  {  #define NUMPY_NARY_FUNC_NAME fix -#define NUMPY_NARY_FUNC_SYM std::trunc +#define NUMPY_NARY_FUNC_SYM wrapper::fix  #include "pythonic/types/numpy_nary_expr.hpp" -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/flatnonzero.hpp b/contrib/python/pythran/pythran/pythonic/numpy/flatnonzero.hpp index 221574cb59c..987a2069006 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/flatnonzero.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/flatnonzero.hpp @@ -26,7 +26,7 @@ namespace numpy          _flatnonzero((*begin).begin(), (*begin).end(), out, i,                       utils::int_<N - 1>());      } -  } +  } // namespace    template <class E>    types::ndarray<long, types::pshape<long>> flatnonzero(E const &expr)    { @@ -38,7 +38,7 @@ namespace numpy      types::pshape<long> shape = iter - buffer->data;      return types::ndarray<long, types::pshape<long>>(std::move(buffer), shape);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/flip.hpp b/contrib/python/pythran/pythran/pythonic/numpy/flip.hpp index 27241f061d9..3bcdaf7f198 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/flip.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/flip.hpp @@ -14,12 +14,12 @@ namespace numpy    namespace details    {      template <class E, class S, size_t... I> -    auto flip(E const &expr, S const &slices, utils::index_sequence<I...>) -        -> decltype(expr(slices[I]...)) +    auto flip(E const &expr, S const &slices, +              utils::index_sequence<I...>) -> decltype(expr(slices[I]...))      {        return expr(slices[I]...);      } -  } +  } // namespace details    template <class E>    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<E::value>{});    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/fliplr.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fliplr.hpp index e7354ff2150..d19474358fa 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fliplr.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/fliplr.hpp @@ -11,9 +11,10 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class E> -  auto fliplr(E &&expr) -> decltype(std::forward<E>(expr)( -      types::cstride_slice<1>{builtins::None, builtins::None}, -      types::slice{builtins::None, builtins::None, -1})) +  auto +  fliplr(E &&expr) -> decltype(std::forward<E>(expr)( +                       types::cstride_slice<1>{builtins::None, builtins::None}, +                       types::slice{builtins::None, builtins::None, -1}))    {      return std::forward<E>(expr)(          types::cstride_slice<1>{builtins::None, builtins::None}, diff --git a/contrib/python/pythran/pythran/pythonic/numpy/flipud.hpp b/contrib/python/pythran/pythran/pythonic/numpy/flipud.hpp index 3e2799dd945..a5a0331f8ad 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/flipud.hpp +++ b/contrib/python/pythran/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 <class E> -  auto flipud(E &&expr) -> decltype( -      std::forward<E>(expr)[types::slice{builtins::None, builtins::None, -1}]) +  auto +  flipud(E &&expr) -> decltype(std::forward<E>( +                       expr)[types::slice{builtins::None, builtins::None, -1}])    {      return std::forward<E>(          expr)[types::slice{builtins::None, builtins::None, -1}];    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/float_.hpp b/contrib/python/pythran/pythran/pythonic/numpy/float_.hpp index 356ae7d1a84..721101c1b86 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/float_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/floor.hpp b/contrib/python/pythran/pythran/pythonic/numpy/floor.hpp index 121f5c03eb4..c359bc9c93a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/floor.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/floor_divide.hpp b/contrib/python/pythran/pythran/pythonic/numpy/floor_divide.hpp index f68d2fca1b2..6f7f551e073 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/floor_divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/fmod.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fmod.hpp index cfb9ecc66cc..bc102497241 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fmod.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/frexp.hpp b/contrib/python/pythran/pythran/pythonic/numpy/frexp.hpp index 1d9bc102436..57bf14cd1e1 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/frexp.hpp +++ b/contrib/python/pythran/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_<N - 1>());      } -  } +  } // namespace    template <class E>    typename std::enable_if< @@ -56,7 +56,7 @@ namespace numpy             utils::int_<E::value>());      return std::make_tuple(significands, exps);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/fromfile.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fromfile.hpp index ea8c4aa7cec..771062f49ed 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fromfile.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/fromfunction.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fromfunction.hpp index 1d60afb6478..857ecf35cce 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fromfunction.hpp +++ b/contrib/python/pythran/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 <class pS>    types::ndarray<typename std::remove_cv<typename std::remove_reference<                       typename std::result_of<F(dtype)>::type>::type>::type, -                 pS> fromfunction_helper<F, 1, dtype, purity_tag>:: -  operator()(F &&f, pS const &shape, dtype d) +                 pS> +  fromfunction_helper<F, 1, dtype, purity_tag>::operator()(F &&f, +                                                           pS const &shape, +                                                           dtype d)    {      types::ndarray<typename std::remove_cv<typename std::remove_reference<                         typename std::result_of<F(dtype)>::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<typename std::remove_reference<            typename std::result_of<F(dtype, dtype)>::type>::type>::type, -      pS> fromfunction_helper<F, 2, dtype, purity_tag>:: -  operator()(F &&f, pS const &shape, dtype d) +      pS> +  fromfunction_helper<F, 2, dtype, purity_tag>::operator()(F &&f, +                                                           pS const &shape, +                                                           dtype d)    {      types::ndarray<          typename std::remove_cv<typename std::remove_reference<              typename std::result_of<F(dtype, dtype)>::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/contrib/python/pythran/pythran/pythonic/numpy/fromiter.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fromiter.hpp index f2b31e6f1e9..7bbe112370c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fromiter.hpp +++ b/contrib/python/pythran/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<types::raw_array<T>> buffer(count);        std::copy_n(iterable.begin(), count, buffer->data); -      types::array<long, 1> shape = {count}; +      types::array_tuple<long, 1> shape = {count};        return {buffer, shape};      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/fromstring.hpp b/contrib/python/pythran/pythran/pythonic/numpy/fromstring.hpp index c7e548bff5b..d744824deb9 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/fromstring.hpp +++ b/contrib/python/pythran/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 <limits>  #include <sstream> @@ -50,7 +50,7 @@ namespace numpy        return {buffer, shape};      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/full.hpp b/contrib/python/pythran/pythran/pythonic/numpy/full.hpp index 9153abd8716..cca07499544 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/full.hpp +++ b/contrib/python/pythran/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<std::integral_constant<long, N>>({}), fill_value,                  nt);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/full_like.hpp b/contrib/python/pythran/pythran/pythonic/numpy/full_like.hpp index 75421404f52..721893baa4f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/full_like.hpp +++ b/contrib/python/pythran/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<typename E::dtype>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/greater.hpp b/contrib/python/pythran/pythran/pythonic/numpy/greater.hpp index 687d8d546f1..c283d575dab 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/greater.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/greater_equal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/greater_equal.hpp index d19a51054d2..09cde4949ff 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/greater_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/heaviside.hpp b/contrib/python/pythran/pythran/pythonic/numpy/heaviside.hpp index 0bec76ec7da..bb33f5381e6 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/heaviside.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/hstack.hpp b/contrib/python/pythran/pythran/pythonic/numpy/hstack.hpp index b707c41f1c3..de2e6f69372 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/hstack.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/hstack.hpp @@ -18,7 +18,7 @@ namespace numpy           1);      return concatenate(std::forward<ArraySequence>(seq), concatenate_axis);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/hypot.hpp b/contrib/python/pythran/pythran/pythonic/numpy/hypot.hpp index 366ab8bbbbb..9ae4a9eb36a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/hypot.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/identity.hpp b/contrib/python/pythran/pythran/pythonic/numpy/identity.hpp index e065c307074..4f0e7e454b1 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/identity.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/imag.hpp b/contrib/python/pythran/pythran/pythonic/numpy/imag.hpp index b27c313eaa3..d974c4c7cde 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/imag.hpp +++ b/contrib/python/pythran/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 <class E> -  auto imag(E &&expr) -      -> decltype(builtins::getattr(types::attr::IMAG{}, std::forward<E>(expr))) +  auto imag(E &&expr) -> decltype(builtins::getattr(types::attr::IMAG{}, +                                                    std::forward<E>(expr)))    {      return builtins::getattr(types::attr::IMAG{}, std::forward<E>(expr));    } @@ -25,7 +25,7 @@ namespace numpy    {      return imag(numpy::functor::asarray{}(expr));    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/indices.hpp b/contrib/python/pythran/pythran/pythonic/numpy/indices.hpp index 01b6dc7994e..d22b05549a2 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/indices.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/insert.hpp b/contrib/python/pythran/pythran/pythonic/numpy/insert.hpp index ea09fade897..8b71eda74db 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/insert.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -73,7 +73,7 @@ namespace numpy    {      throw std::runtime_error("insert only partially supported");    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/invert.hpp b/contrib/python/pythran/pythran/pythonic/numpy/invert.hpp index 0bccba8bf0c..631703ef45b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/invert.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isclose.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isclose.hpp index 84d5068eadc..c48e0006208 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isclose.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/iscomplex.hpp b/contrib/python/pythran/pythran/pythonic/numpy/iscomplex.hpp index 3d0b8361910..b2b529b73fc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/iscomplex.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isfinite.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isfinite.hpp index fd07a6abc77..6ed26423b90 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isfinite.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isinf.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isinf.hpp index c17e9277da9..eb684dc1bb1 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isinf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isnan.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isnan.hpp index 781907281c8..a946eeeee74 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isnan.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/isnan.hpp @@ -20,25 +20,28 @@ namespace numpy      }      template <class T> -    auto isnan(T const &v) -> typename std::enable_if< -        std::is_floating_point<typename std::decay<T>::type>::value, bool>::type +    auto isnan(T const &v) -> +        typename std::enable_if< +            std::is_floating_point<typename std::decay<T>::type>::value, +            bool>::type      {        return std::isnan(v);      }      template <class T> -    auto isnan(T const &v) -> typename std::enable_if< -        !std::is_floating_point<typename std::decay<T>::type>::value, -        bool>::type +    auto isnan(T const &v) -> +        typename std::enable_if< +            !std::is_floating_point<typename std::decay<T>::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/contrib/python/pythran/pythran/pythonic/numpy/isneginf.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isneginf.hpp index e6fdc781328..79a55fea1ef 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isneginf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isposinf.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isposinf.hpp index b1952a792e2..c54dfae02f3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isposinf.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isreal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isreal.hpp index 2e3e17d2d8c..134fdc307d4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isreal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/isrealobj.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isrealobj.hpp index f8207f9a98b..92a1f29ff09 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isrealobj.hpp +++ b/contrib/python/pythran/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<typename E::dtype>::value;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/isscalar.hpp b/contrib/python/pythran/pythran/pythonic/numpy/isscalar.hpp index 56b5fcc289e..a06887f991a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/isscalar.hpp +++ b/contrib/python/pythran/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 <type_traits> @@ -18,7 +18,7 @@ namespace numpy    {      return types::is_dtype<E>::value || std::is_same<E, types::str>::value;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/issctype.hpp b/contrib/python/pythran/pythran/pythonic/numpy/issctype.hpp index 368fbd02d31..45fdedec58b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/issctype.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/issctype.hpp @@ -26,7 +26,7 @@ namespace numpy    {      return false;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ldexp.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ldexp.hpp index 3671315d6ee..4764037d187 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ldexp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/left_shift.hpp b/contrib/python/pythran/pythran/pythonic/numpy/left_shift.hpp index c4b2c747631..078bc62af44 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/left_shift.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/less.hpp b/contrib/python/pythran/pythran/pythonic/numpy/less.hpp index e1ef9744f68..654b1e043d5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/less.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/less_equal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/less_equal.hpp index 258e83108e2..19b4a65d334 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/less_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/lexsort.hpp b/contrib/python/pythran/pythran/pythonic/numpy/lexsort.hpp index eef50a93fdb..c8b1afa04bf 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/lexsort.hpp +++ b/contrib/python/pythran/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<std::tuple_size<K>::value>{}(keys, i0, i1);        }      }; -  } +  } // namespace details    template <class pS>    types::ndarray<long, types::pshape<long>> lexsort(pS const &keys) @@ -62,7 +62,7 @@ namespace numpy      pdqsort(out.buffer, out.buffer + n, details::lexcmp<pS>(keys));      return out;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/linalg/matrix_power.hpp b/contrib/python/pythran/pythran/pythonic/numpy/linalg/matrix_power.hpp index 7c76b77df28..7d873ab274c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/linalg/matrix_power.hpp +++ b/contrib/python/pythran/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 <class E> -    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/contrib/python/pythran/pythran/pythonic/numpy/linalg/norm.hpp b/contrib/python/pythran/pythran/pythonic/numpy/linalg/norm.hpp index 4a9c5aa13cb..1f24579776e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/linalg/norm.hpp +++ b/contrib/python/pythran/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 <class Array>      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>(array)))))      { @@ -38,7 +38,7 @@ namespace numpy          return norm(std::forward<Array>(x), ord, 0L);        case 2:          return norm(std::forward<Array>(x), ord, -                    types::array<long, 2>{{0L, 1L}}); +                    types::array_tuple<long, 2>{{0L, 1L}});        default:          throw pythonic::builtins::NotImplementedError(              "Invalid norm order for matrices."); @@ -80,17 +80,18 @@ namespace numpy        return norm(std::forward<Array>(x), 2., axis);      }      template <class Array> -    norm_t<Array> norm(Array &&x, double ord, types::array<long, 1> axis) +    norm_t<Array> norm(Array &&x, double ord, types::array_tuple<long, 1> axis)      {        return norm(std::forward<Array>(x), ord, axis[0]);      }      template <class Array> -    norm_t<Array> norm(Array &&array, double ord, types::array<long, 2> axis) +    norm_t<Array> norm(Array &&array, double ord, +                       types::array_tuple<long, 2> axis)      {        throw pythonic::builtins::NotImplementedError("We need more dev!");      } -  } -} +  } // namespace linalg +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/linspace.hpp b/contrib/python/pythran/pythran/pythonic/numpy/linspace.hpp index 9d08a984266..9ee28f1276b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/linspace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/log.hpp b/contrib/python/pythran/pythran/pythonic/numpy/log.hpp index c21b213e4de..e7b198c853c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/log.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/log10.hpp b/contrib/python/pythran/pythran/pythonic/numpy/log10.hpp index 6548a7bc39e..758b8619097 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/log10.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/log1p.hpp b/contrib/python/pythran/pythran/pythonic/numpy/log1p.hpp index 68622caf83f..031a0506ed5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/log1p.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/log2.hpp b/contrib/python/pythran/pythran/pythonic/numpy/log2.hpp index ff251e7766d..74c7c43ee90 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/log2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/logaddexp.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logaddexp.hpp index 6db4baa5d46..f198ee7fa22 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logaddexp.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/logaddexp2.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logaddexp2.hpp index 5a210edf6ac..b776d5e01ac 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logaddexp2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/logical_and.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logical_and.hpp index c9b92e52fdc..1d70dca3024 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logical_and.hpp +++ b/contrib/python/pythran/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 <class T0, class T1> -    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/contrib/python/pythran/pythran/pythonic/numpy/logical_not.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logical_not.hpp index 00b1e63a282..efd99116161 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logical_not.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/logical_or.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logical_or.hpp index 5c8614bbbde..3aa92f6b2aa 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logical_or.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/logical_xor.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logical_xor.hpp index a01ac9d30e2..6758609df34 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logical_xor.hpp +++ b/contrib/python/pythran/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 <class T0, class T1> -    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/contrib/python/pythran/pythran/pythonic/numpy/logspace.hpp b/contrib/python/pythran/pythran/pythonic/numpy/logspace.hpp index a9e9a5e656d..8f33b1c38fa 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/logspace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/max.hpp b/contrib/python/pythran/pythran/pythonic/numpy/max.hpp index 27012a4f14a..6286642752b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/max.hpp +++ b/contrib/python/pythran/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 <class... Args> -  auto max(Args &&... args) +  auto max(Args &&...args)        -> decltype(reduce<operator_::functor::imax>(std::forward<Args>(args)...))    {      return reduce<operator_::functor::imax>(std::forward<Args>(args)...);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/maximum.hpp b/contrib/python/pythran/pythran/pythonic/numpy/maximum.hpp index c53d7f070fa..568d2e8439c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/maximum.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/mean.hpp b/contrib/python/pythran/pythran/pythonic/numpy/mean.hpp index 5553f9e228f..a4266b7633b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/mean.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/median.hpp b/contrib/python/pythran/pythran/pythonic/numpy/median.hpp index f25ac303a17..939d2a3dd12 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/median.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/median.hpp @@ -85,21 +85,22 @@ namespace numpy    template <class T, class pS>    typename std::enable_if<        std::tuple_size<pS>::value != 1, -      types::ndarray<decltype(std::declval<T>() + 1.), -                     types::array<long, std::tuple_size<pS>::value - 1>>>::type +      types::ndarray< +          decltype(std::declval<T>() + 1.), +          types::array_tuple<long, std::tuple_size<pS>::value - 1>>>::type    median(types::ndarray<T, pS> const &arr, long axis)    {      constexpr auto N = std::tuple_size<pS>::value;      if (axis < 0)        axis += N; -    types::array<long, std::tuple_size<pS>::value - 1> shp; +    types::array_tuple<long, std::tuple_size<pS>::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<decltype(std::declval<T>() + 1.), -                   types::array<long, std::tuple_size<pS>::value - 1>> +                   types::array_tuple<long, std::tuple_size<pS>::value - 1>>          out(shp, types::none_type{});      _median(out.buffer, arr, axis);      return out; diff --git a/contrib/python/pythran/pythran/pythonic/numpy/min.hpp b/contrib/python/pythran/pythran/pythonic/numpy/min.hpp index aef1293633b..3bff120ae69 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/min.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/min.hpp @@ -13,12 +13,12 @@ namespace numpy  {    template <class... Args> -  auto min(Args &&... args) +  auto min(Args &&...args)        -> decltype(reduce<operator_::functor::imin>(std::forward<Args>(args)...))    {      return reduce<operator_::functor::imin>(std::forward<Args>(args)...);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/minimum.hpp b/contrib/python/pythran/pythran/pythonic/numpy/minimum.hpp index 503c7573daf..851e5e8e64a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/minimum.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/multiply.hpp b/contrib/python/pythran/pythran/pythonic/numpy/multiply.hpp index a62644f9c38..10aef3f9a2e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/multiply.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/nan_to_num.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nan_to_num.hpp index 0a4bbe2ba44..91bee3eceed 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nan_to_num.hpp +++ b/contrib/python/pythran/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 <limits> @@ -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/contrib/python/pythran/pythran/pythonic/numpy/nanargmax.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nanargmax.hpp index a64f8cbb319..931e14a2127 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nanargmax.hpp +++ b/contrib/python/pythran/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_<N - 1>());      } -  } +  } // namespace    template <class E>    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/contrib/python/pythran/pythran/pythonic/numpy/nanargmin.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nanargmin.hpp index 3ea1be21299..5a1ec075579 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nanargmin.hpp +++ b/contrib/python/pythran/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_<N - 1>());      } -  } +  } // namespace    template <class E>    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/contrib/python/pythran/pythran/pythonic/numpy/nanmax.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nanmax.hpp index 618fba3ae58..ed69f52f52f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nanmax.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/nanmax.hpp @@ -37,7 +37,7 @@ namespace numpy                           utils::int_<N - 1>());        return found;      } -  } +  } // namespace    template <class E>    typename E::dtype nanmax(E const &expr) @@ -49,7 +49,7 @@ namespace numpy        max = std::numeric_limits<typename E::dtype>::quiet_NaN();      return max;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/nanmin.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nanmin.hpp index f80f98086e2..6f06df15ac3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nanmin.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/nanmin.hpp @@ -37,7 +37,7 @@ namespace numpy                           utils::int_<N - 1>());        return found;      } -  } +  } // namespace    template <class E>    typename E::dtype nanmin(E const &expr) @@ -49,7 +49,7 @@ namespace numpy        min = std::numeric_limits<typename E::dtype>::quiet_NaN();      return min;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/nansum.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nansum.hpp index 65b2e1508bf..abd2790cb02 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nansum.hpp +++ b/contrib/python/pythran/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_<E::value>());      return s;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndarray.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray.hpp index 663cc823d3a..cf84d27eab6 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray.hpp +++ b/contrib/python/pythran/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<std::integral_constant<long, N>>({}), d);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/astype.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/astype.hpp index d054f80a683..5b48d3ae0ad 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/astype.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/astype.hpp @@ -16,8 +16,8 @@ namespace numpy      {        return asarray(std::forward<E>(e), d);      } -  } -} +  } // namespace ndarray +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/fill.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/fill.hpp index f4690a3ffcb..a69e1e84e36 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/fill.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp index 6e0afe6fb3f..1c260db223f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/flatten.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ndarray/item.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/item.hpp index cb2ba3626be..e08caf0698a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/item.hpp +++ b/contrib/python/pythran/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 <class E, size_t N> -    auto item(E &&expr, types::array<long, N> const &i) -> decltype(expr[i]) +    auto item(E &&expr, +              types::array_tuple<long, N> const &i) -> decltype(expr[i])      {        return expr[i];      } @@ -37,7 +38,7 @@ namespace numpy          i += expr.flat_size();        return asarray(std::forward<E>(expr)).flat()[i];      } -  } -} +  } // namespace ndarray +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/reshape.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/reshape.hpp index b8b6cc68d38..9e0c29678dc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/reshape.hpp +++ b/contrib/python/pythran/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<bool>{              (i == Is && (sutils::assign(std::get<Is>(p), v), true))...};        } -    } +    } // namespace misc      template <class T, class pS, class NpS>      typename std::enable_if<!std::is_integral<NpS>::value,                              types::ndarray<T, NpS>>::type @@ -84,7 +84,7 @@ namespace numpy      template <class T, class pS, class S0, class S1, class... S>      auto reshape(types::ndarray<T, pS> const &expr, S0 i0, S1 i1, -                 S const &... indices) +                 S const &...indices)          -> decltype(reshape(expr,                              types::pshape<S0, S1, S...>{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/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tofile.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tofile.hpp index 8a10719f732..8c64f1cde10 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tofile.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tolist.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tolist.hpp index e7b07052f0e..8731ca87541 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tolist.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tostring.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tostring.hpp index bb04b615df8..9b01099a71e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndarray/tostring.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ndenumerate.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndenumerate.hpp index 150edfda89c..5ef52f452c0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndenumerate.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ndenumerate.hpp @@ -21,10 +21,10 @@ namespace numpy    }    template <class E> -  std::tuple<types::array<long, E::value>, typename E::dtype> -      ndenumerate_iterator<E>::operator*() const +  std::tuple<types::array_tuple<long, E::value>, typename E::dtype> +  ndenumerate_iterator<E>::operator*() const    { -    types::array<long, E::value> out; +    types::array_tuple<long, E::value> 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<types::array<long, E::value>, typename E::dtype>{out, -                                                                       *iter}; +    return std::tuple<types::array_tuple<long, E::value>, typename E::dtype>{ +        out, *iter};    }    template <class E> @@ -51,22 +51,22 @@ namespace numpy    }    template <class E> -  bool ndenumerate_iterator<E>:: -  operator!=(ndenumerate_iterator<E> const &other) const +  bool ndenumerate_iterator<E>::operator!=( +      ndenumerate_iterator<E> const &other) const    {      return index != other.index;    }    template <class E> -  bool ndenumerate_iterator<E>:: -  operator<(ndenumerate_iterator<E> const &other) const +  bool +  ndenumerate_iterator<E>::operator<(ndenumerate_iterator<E> const &other) const    {      return index < other.index;    }    template <class E> -  long ndenumerate_iterator<E>:: -  operator-(ndenumerate_iterator<E> const &other) const +  long +  ndenumerate_iterator<E>::operator-(ndenumerate_iterator<E> 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/contrib/python/pythran/pythran/pythonic/numpy/ndim.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndim.hpp index 1455284a575..34ddfb3d594 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndim.hpp +++ b/contrib/python/pythran/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<decltype(shape(e))>::value;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ndindex.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ndindex.hpp index 24010dc5b38..e32e6bab84f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ndindex.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ndindex.hpp @@ -17,16 +17,16 @@ namespace numpy    }    template <size_t N> -  ndindex_iterator<N>::ndindex_iterator(types::array<long, N> const &shape, -                                        long first) +  ndindex_iterator<N>::ndindex_iterator( +      types::array_tuple<long, N> const &shape, long first)        : index(first), shape(shape)    {    }    template <size_t N> -  types::array<long, N> ndindex_iterator<N>::operator*() const +  types::array_tuple<long, N> ndindex_iterator<N>::operator*() const    { -    types::array<long, N> out; +    types::array_tuple<long, N> 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 <size_t N> -  _ndindex<N>::_ndindex(types::array<long, N> const &shape) +  _ndindex<N>::_ndindex(types::array_tuple<long, N> const &shape)        : ndindex_iterator<N>(shape, 0), shape(shape),          end_iter(shape, std::accumulate(shape.begin(), shape.end(), 1L,                                          std::multiplies<long>())) @@ -106,7 +106,7 @@ namespace numpy    }    template <size_t N> -  _ndindex<N> ndindex(types::array<long, N> const &args) +  _ndindex<N> ndindex(types::array_tuple<long, N> const &args)    {      return {args};    } @@ -115,7 +115,7 @@ namespace numpy    {      return {args};    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/negative.hpp b/contrib/python/pythran/pythran/pythonic/numpy/negative.hpp index bce0f54d22e..f4aed3ff218 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/negative.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/nextafter.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nextafter.hpp index cb2406107fe..6dab2b00b54 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nextafter.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/nonzero.hpp b/contrib/python/pythran/pythran/pythonic/numpy/nonzero.hpp index 401b7ce6e21..5b22e8ba571 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/nonzero.hpp +++ b/contrib/python/pythran/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 <class I, class O, size_t M> -    void _nonzero(I begin, I end, O &out, types::array<long, M> &curr, +    void _nonzero(I begin, I end, O &out, types::array_tuple<long, M> &curr,                    utils::int_<1>)      {        I start = begin; @@ -29,7 +29,7 @@ namespace numpy      }      template <class I, class O, size_t M, size_t N> -    void _nonzero(I begin, I end, O &out, types::array<long, M> &curr, +    void _nonzero(I begin, I end, O &out, types::array_tuple<long, M> &curr,                    utils::int_<N>)      {        I start = begin; @@ -39,10 +39,10 @@ namespace numpy                   utils::int_<N - 1>());        }      } -  } +  } // namespace    template <size_t... Is> -  types::array<utils::shared_ref<types::raw_array<long>>, sizeof...(Is)> +  types::array_tuple<utils::shared_ref<types::raw_array<long>>, sizeof...(Is)>    init_buffers(long sz, utils::index_sequence<Is...>)    {      auto fwd = [](long ret, long) { return ret; }; // just to avoid a warning @@ -51,33 +51,35 @@ namespace numpy    template <class E>    auto nonzero(E const &expr) -      -> types::array<types::ndarray<long, types::array<long, 1>>, E::value> +      -> types::array_tuple<types::ndarray<long, types::array_tuple<long, 1>>, +                            E::value>    {      constexpr long N = E::value; -    typedef types::array<types::ndarray<long, types::array<long, 1>>, E::value> +    typedef types::array_tuple< +        types::ndarray<long, types::array_tuple<long, 1>>, E::value>          out_type;      long sz = expr.flat_size(); -    types::array<utils::shared_ref<types::raw_array<long>>, N> out_buffers = -        init_buffers(sz, utils::make_index_sequence<N>()); -    types::array<long *, N> out_iters; +    types::array_tuple<utils::shared_ref<types::raw_array<long>>, N> +        out_buffers = init_buffers(sz, utils::make_index_sequence<N>()); +    types::array_tuple<long *, N> out_iters;      for (size_t i = 0; i < N; ++i)        out_iters[i] = out_buffers[i]->data; -    types::array<long, N> indices; +    types::array_tuple<long, N> indices;      _nonzero(expr.begin(), expr.end(), out_iters, indices, utils::int_<N>()); -    types::array<long, 1> shape = { +    types::array_tuple<long, 1> shape = {          {(long)(out_iters[0] - out_buffers[0]->data)}};      out_type out;      for (size_t i = 0; i < N; ++i) -      out[i] = types::ndarray<long, types::array<long, 1>>( +      out[i] = types::ndarray<long, types::array_tuple<long, 1>>(            std::move(out_buffers[i]), shape);      return out;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/not_equal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/not_equal.hpp index 27fafd66333..6ca0a4513aa 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/not_equal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ones.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ones.hpp index e7db4e7c012..13a94109807 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ones.hpp +++ b/contrib/python/pythran/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 <class dtype> -  typename dtype::type -  ones(std::tuple<> const &shape, dtype d) +  typename dtype::type ones(std::tuple<> const &shape, dtype d)    {      return static_cast<typename dtype::type>(1);    } @@ -39,7 +38,7 @@ namespace numpy    {      return ones(types::pshape<std::integral_constant<long, N>>({}), d);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ones_like.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ones_like.hpp index fff0667d25b..b6070aa733c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ones_like.hpp +++ b/contrib/python/pythran/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 <class E, class dtype> -  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<typename E::dtype>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/outer.hpp b/contrib/python/pythran/pythran/pythonic/numpy/outer.hpp index 53da26e133f..99d9983bffe 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/outer.hpp +++ b/contrib/python/pythran/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<decltype(std::declval<T0>() + std::declval<T1>()),                     types::pshape<long, long>> -    out(types::pshape<long, long>{a.flat_size(), b.flat_size()}, -        builtins::None); +        out(types::pshape<long, long>{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 <class T0, class pS0, class E1> -  auto outer(types::ndarray<T0, pS0> const &a, E1 const &b) -      -> decltype(outer(a, asarray(b))) +  auto outer(types::ndarray<T0, pS0> const &a, +             E1 const &b) -> decltype(outer(a, asarray(b)))    {      return outer(a, asarray(b));    }    template <class E0, class T1, class pS1> -  auto outer(E0 const &a, types::ndarray<T1, pS1> const &b) -      -> decltype(outer(asarray(a), b)) +  auto outer(E0 const &a, +             types::ndarray<T1, pS1> const &b) -> decltype(outer(asarray(a), b))    {      return outer(asarray(a), b);    }    template <class E0, class E1> -  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/contrib/python/pythran/pythran/pythonic/numpy/partial_sum.hpp b/contrib/python/pythran/pythran/pythonic/numpy/partial_sum.hpp index baf029c0d18..2074d7ca0f3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/partial_sum.hpp +++ b/contrib/python/pythran/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 <class Op, class E, class dtype>    types::ndarray<typename dtype::type, types::pshape<long>> @@ -109,13 +109,13 @@ namespace numpy      } else {        std::transform(            expr.begin(), expr.end(), the_partial_sum.begin(), -          [axis, d]( -              typename std::iterator_traits<typename E::iterator>::value_type +          [axis, +           d](typename std::iterator_traits<typename E::iterator>::value_type                    other) { return partial_sum<Op>(other, axis - 1, d); });      }      return the_partial_sum;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/place.hpp b/contrib/python/pythran/pythran/pythonic/numpy/place.hpp index 5e21e7f8af3..5cf1da62caa 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/place.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/power.hpp b/contrib/python/pythran/pythran/pythonic/numpy/power.hpp index b50a6c84a95..ef3c9e04bba 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/power.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/prod.hpp b/contrib/python/pythran/pythran/pythonic/numpy/prod.hpp index 428c039daa5..d6409da68fd 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/prod.hpp +++ b/contrib/python/pythran/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 <class... Args> -  auto prod(Args &&... args) +  auto prod(Args &&...args)        -> decltype(reduce<operator_::functor::imul>(std::forward<Args>(args)...))    {      return reduce<operator_::functor::imul>(std::forward<Args>(args)...);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ptp.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ptp.hpp index 572f7b2e236..5db6f7036f3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ptp.hpp +++ b/contrib/python/pythran/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 <class E> -  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/contrib/python/pythran/pythran/pythonic/numpy/put.hpp b/contrib/python/pythran/pythran/pythonic/numpy/put.hpp index 627c07992bf..fc7b27d34a0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/put.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/putmask.hpp b/contrib/python/pythran/pythran/pythonic/numpy/putmask.hpp index 1640cbed4ad..8b9b9f14aaf 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/putmask.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/rad2deg.hpp b/contrib/python/pythran/pythran/pythonic/numpy/rad2deg.hpp index 977848da0c5..6eb74de1f8b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/rad2deg.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/random/binomial.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/binomial.hpp index 5d9dbda7ca3..b0b556bc113 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/binomial.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(binomial(n, p, types::array_tuple<long, 1>{{size}}))      { -      return binomial(n, p, types::array<long, 1>{{size}}); +      return binomial(n, p, types::array_tuple<long, 1>{{size}});      }      inline long binomial(double n, double p, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/chisquare.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/chisquare.hpp index d66fd816abf..b2292f93bd3 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/chisquare.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/chisquare.hpp @@ -29,10 +29,10 @@ namespace numpy      }      inline auto chisquare(double df, long size) -        -> decltype(chisquare(df, types::array<long, 1>{{size}})) +        -> decltype(chisquare(df, types::array_tuple<long, 1>{{size}}))      { -      return chisquare(df, types::array<long, 1>{{size}}); +      return chisquare(df, types::array_tuple<long, 1>{{size}});      }      inline double chisquare(double df, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/choice.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/choice.hpp index 680789cde0d..1027cd81136 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/choice.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/choice.hpp @@ -46,8 +46,8 @@ namespace numpy      }      template <class T> -    auto choice(long max, T &&size) -        -> decltype(randint(0, max, std::forward<T>(size))) +    auto choice(long max, +                T &&size) -> decltype(randint(0, max, std::forward<T>(size)))      {        return randint(0, max, std::forward<T>(size));      } diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/dirichlet.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/dirichlet.hpp index 0eea6cf8279..dcebd4199f4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/dirichlet.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/dirichlet.hpp @@ -29,10 +29,10 @@ namespace numpy      }      inline auto dirichlet(double alpha, long size) -        -> decltype(dirichlet(alpha, types::array<long, 1>{{size}})) +        -> decltype(dirichlet(alpha, types::array_tuple<long, 1>{{size}}))      { -      return dirichlet(alpha, types::array<long, 1>{{size}}); +      return dirichlet(alpha, types::array_tuple<long, 1>{{size}});      }      inline double dirichlet(double alpha, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/exponential.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/exponential.hpp index 37d2d019d13..ae3abd473fe 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/exponential.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/exponential.hpp @@ -29,10 +29,10 @@ namespace numpy      }      inline auto exponential(double scale, long size) -        -> decltype(exponential(scale, types::array<long, 1>{{size}})) +        -> decltype(exponential(scale, types::array_tuple<long, 1>{{size}}))      { -      return exponential(scale, types::array<long, 1>{{size}}); +      return exponential(scale, types::array_tuple<long, 1>{{size}});      }      inline double exponential(double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/f.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/f.hpp index fbc43228563..d6dcf1bcd5a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/f.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +    inline auto f(double dfnum, double dfden, +                  long size) -> decltype(f(dfnum, dfden, +                                           types::array_tuple<long, 1>{{size}}))      { -      return f(dfnum, dfden, types::array<long, 1>{{size}}); +      return f(dfnum, dfden, types::array_tuple<long, 1>{{size}});      }      inline double f(double dfnum, double dfden, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/gamma.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/gamma.hpp index 55bbe5a7a2b..9d6cc1fb831 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/gamma.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(gamma(shape, scale, types::array_tuple<long, 1>{{size}}))      { -      return gamma(shape, scale, types::array<long, 1>{{size}}); +      return gamma(shape, scale, types::array_tuple<long, 1>{{size}});      }      inline double gamma(double shape, double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/geometric.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/geometric.hpp index b1f661f86e3..fffb8ce8e95 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/geometric.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/geometric.hpp @@ -29,9 +29,9 @@ namespace numpy      }      inline auto geometric(double p, long size) -        -> decltype(geometric(p, types::array<long, 1>{{size}})) +        -> decltype(geometric(p, types::array_tuple<long, 1>{{size}}))      { -      return geometric(p, types::array<long, 1>{{size}}); +      return geometric(p, types::array_tuple<long, 1>{{size}});      }      inline double geometric(double p, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/gumbel.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/gumbel.hpp index d74adeb3496..666c6906f9a 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/gumbel.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(gumbel(loc, scale, types::array_tuple<long, 1>{{size}}))      { -      return gumbel(loc, scale, types::array<long, 1>{{size}}); +      return gumbel(loc, scale, types::array_tuple<long, 1>{{size}});      }      inline double gumbel(double loc, double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/laplace.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/laplace.hpp index ce2eac46f0a..a000332971f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/laplace.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(laplace(loc, scale, types::array_tuple<long, 1>{{size}}))      { -      return laplace(loc, scale, types::array<long, 1>{{size}}); +      return laplace(loc, scale, types::array_tuple<long, 1>{{size}});      }      inline double laplace(double loc, double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/logistic.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/logistic.hpp index 6537964c3f5..bb9cbb4e665 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/logistic.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(logistic(loc, scale, types::array_tuple<long, 1>{{size}}))      { -      return logistic(loc, scale, types::array<long, 1>{{size}}); +      return logistic(loc, scale, types::array_tuple<long, 1>{{size}});      }      inline double logistic(double loc, double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/lognormal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/lognormal.hpp index 91d2843b1d7..be6b5705713 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/lognormal.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(lognormal(mean, sigma, types::array_tuple<long, 1>{{size}}))      { -      return lognormal(mean, sigma, types::array<long, 1>{{size}}); +      return lognormal(mean, sigma, types::array_tuple<long, 1>{{size}});      }      inline double lognormal(double mean, double sigma, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/logseries.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/logseries.hpp index c99fb95a63a..89bf6d377be 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/logseries.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/logseries.hpp @@ -29,9 +29,9 @@ namespace numpy      }      inline auto logseries(double p, long size) -        -> decltype(logseries(p, types::array<long, 1>{{size}})) +        -> decltype(logseries(p, types::array_tuple<long, 1>{{size}}))      { -      return logseries(p, types::array<long, 1>{{size}}); +      return logseries(p, types::array_tuple<long, 1>{{size}});      }      inline double logseries(double p, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/negative_binomial.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/negative_binomial.hpp index 3f015f3f5d3..1e09660f815 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/negative_binomial.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(negative_binomial(n, p, +                                      types::array_tuple<long, 1>{{size}}))      { -      return negative_binomial(n, p, types::array<long, 1>{{size}}); +      return negative_binomial(n, p, types::array_tuple<long, 1>{{size}});      }      inline long negative_binomial(long n, double p, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/normal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/normal.hpp index 3c755d14325..962ec6c5e41 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/normal.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(normal(loc, scale, types::array_tuple<long, 1>{{size}}))      { -      return normal(loc, scale, types::array<long, 1>{{size}}); +      return normal(loc, scale, types::array_tuple<long, 1>{{size}});      }      inline double normal(double loc, double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/pareto.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/pareto.hpp index 3cd7349d375..8900b2a5c54 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/pareto.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/pareto.hpp @@ -30,10 +30,10 @@ namespace numpy      }      inline auto pareto(double a, long size) -        -> decltype(pareto(a, types::array<long, 1>{{size}})) +        -> decltype(pareto(a, types::array_tuple<long, 1>{{size}}))      { -      return pareto(a, types::array<long, 1>{{size}}); +      return pareto(a, types::array_tuple<long, 1>{{size}});      }      inline double pareto(double a, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/poisson.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/poisson.hpp index 27249929bda..d52671aa6b8 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/poisson.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/poisson.hpp @@ -29,9 +29,9 @@ namespace numpy      }      inline auto poisson(double lam, long size) -        -> decltype(poisson(lam, types::array<long, 1>{{size}})) +        -> decltype(poisson(lam, types::array_tuple<long, 1>{{size}}))      { -      return poisson(lam, types::array<long, 1>{{size}}); +      return poisson(lam, types::array_tuple<long, 1>{{size}});      }      inline double poisson(double lam, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/power.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/power.hpp index 8178ff4f96c..36db5bcdd4e 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/power.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/power.hpp @@ -29,9 +29,9 @@ namespace numpy      }      inline auto power(double a, long size) -        -> decltype(power(a, types::array<long, 1>{{size}})) +        -> decltype(power(a, types::array_tuple<long, 1>{{size}}))      { -      return power(a, types::array<long, 1>{{size}}); +      return power(a, types::array_tuple<long, 1>{{size}});      }      inline double power(double a, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/rand.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/rand.hpp index 234e32f31a2..677fd5e6ff4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/rand.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/rand.hpp @@ -15,9 +15,10 @@ namespace numpy    {      template <class... T> -    types::ndarray<double, types::array<long, sizeof...(T)>> rand(T... shape) +    types::ndarray<double, types::array_tuple<long, sizeof...(T)>> +    rand(T... shape)      { -      return random(types::array<long, sizeof...(T)>{{shape...}}); +      return random(types::array_tuple<long, sizeof...(T)>{{shape...}});      }      inline double rand() diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/randint.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/randint.hpp index bed34f861c5..9911415453b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/randint.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/randint.hpp @@ -37,16 +37,16 @@ namespace numpy      }      template <class pS> -    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<long, 1>{{size}})) +        -> decltype(randint(min, max, types::array_tuple<long, 1>{{size}}))      { -      return randint(min, max, types::array<long, 1>{{size}}); +      return randint(min, max, types::array_tuple<long, 1>{{size}});      }      inline long randint(long max, types::none_type) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/randn.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/randn.hpp index 75198a9c514..c732058fd32 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/randn.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/randn.hpp @@ -15,9 +15,11 @@ namespace numpy    {      template <class... T> -    types::ndarray<double, types::array<long, sizeof...(T)>> randn(T... shape) +    types::ndarray<double, types::array_tuple<long, sizeof...(T)>> +    randn(T... shape)      { -      return standard_normal(types::array<long, sizeof...(T)>{{shape...}}); +      return standard_normal( +          types::array_tuple<long, sizeof...(T)>{{shape...}});      }      inline double randn() diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/random.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/random.hpp index 6c131c10f7a..7bd6e85e9e1 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/random.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/random.hpp @@ -28,10 +28,10 @@ namespace numpy        return result;      } -    inline auto random(long size) -        -> decltype(random(types::array<long, 1>{{size}})) +    inline auto +    random(long size) -> decltype(random(types::array_tuple<long, 1>{{size}}))      { -      return random(types::array<long, 1>{{size}}); +      return random(types::array_tuple<long, 1>{{size}});      }      inline double random(types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/rayleigh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/rayleigh.hpp index c8f5d44a896..659d2d66d72 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/rayleigh.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/rayleigh.hpp @@ -29,9 +29,9 @@ namespace numpy      }      inline auto rayleigh(double scale, long size) -        -> decltype(rayleigh(scale, types::array<long, 1>{{size}})) +        -> decltype(rayleigh(scale, types::array_tuple<long, 1>{{size}}))      { -      return rayleigh(scale, types::array<long, 1>{{size}}); +      return rayleigh(scale, types::array_tuple<long, 1>{{size}});      }      inline double rayleigh(double scale, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/shuffle.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/shuffle.hpp index 13e1451b82f..e42200ef61f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/shuffle.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/random/standard_exponential.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/standard_exponential.hpp index f7c57b4dca6..7aa72c55b44 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/standard_exponential.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/standard_exponential.hpp @@ -26,9 +26,9 @@ namespace numpy      }      inline auto standard_exponential(long size) -        -> decltype(standard_exponential(types::array<long, 1>{{size}})) +        -> decltype(standard_exponential(types::array_tuple<long, 1>{{size}}))      { -      return standard_exponential(types::array<long, 1>{{size}}); +      return standard_exponential(types::array_tuple<long, 1>{{size}});      }      inline double standard_exponential(types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/standard_gamma.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/standard_gamma.hpp index 8deed136a99..ffe82446dba 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/standard_gamma.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(standard_gamma(s, types::array_tuple<long, 1>{{size}}))      { -      return standard_gamma(s, types::array<long, 1>{{size}}); +      return standard_gamma(s, types::array_tuple<long, 1>{{size}});      }      inline double standard_gamma(double s, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/standard_normal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/standard_normal.hpp index fb7b40712e4..3b983ffae1d 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/standard_normal.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/standard_normal.hpp @@ -26,9 +26,9 @@ namespace numpy      }      inline auto standard_normal(long size) -        -> decltype(standard_normal(types::array<long, 1>{{size}})) +        -> decltype(standard_normal(types::array_tuple<long, 1>{{size}}))      { -      return standard_normal(types::array<long, 1>{{size}}); +      return standard_normal(types::array_tuple<long, 1>{{size}});      }      inline double standard_normal(types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/uniform.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/uniform.hpp index cedfd74eca3..29df0df1b55 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/uniform.hpp +++ b/contrib/python/pythran/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<long, 1>{{size}})) +        -> decltype(uniform(low, high, types::array_tuple<long, 1>{{size}}))      { -      return uniform(low, high, types::array<long, 1>{{size}}); +      return uniform(low, high, types::array_tuple<long, 1>{{size}});      }      inline double uniform(double low, double high, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/random/weibull.hpp b/contrib/python/pythran/pythran/pythonic/numpy/random/weibull.hpp index ee5b6030321..2a78f0fe0d0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/random/weibull.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/random/weibull.hpp @@ -29,10 +29,10 @@ namespace numpy      }      inline auto weibull(double a, long size) -        -> decltype(weibull(a, types::array<long, 1>{{size}})) +        -> decltype(weibull(a, types::array_tuple<long, 1>{{size}}))      { -      return weibull(a, types::array<long, 1>{{size}}); +      return weibull(a, types::array_tuple<long, 1>{{size}});      }      inline double weibull(double a, types::none_type d) diff --git a/contrib/python/pythran/pythran/pythonic/numpy/ravel.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ravel.hpp index ae5b256f54c..f8257fa3996 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ravel.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/real.hpp b/contrib/python/pythran/pythran/pythonic/numpy/real.hpp index afa77bf7733..28a4143ff89 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/real.hpp +++ b/contrib/python/pythran/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 <class E> -  auto real(E &&expr) -      -> decltype(builtins::getattr(types::attr::REAL{}, std::forward<E>(expr))) +  auto real(E &&expr) -> decltype(builtins::getattr(types::attr::REAL{}, +                                                    std::forward<E>(expr)))    {      return builtins::getattr(types::attr::REAL{}, std::forward<E>(expr));    } @@ -25,7 +25,7 @@ namespace numpy    {      return real(numpy::functor::asarray{}(expr));    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/reciprocal.hpp b/contrib/python/pythran/pythran/pythonic/numpy/reciprocal.hpp index 8d2286fc268..62c8b883b46 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/reciprocal.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/reduce.hpp b/contrib/python/pythran/pythran/pythonic/numpy/reduce.hpp index a42f3bc3321..e1b2588f140 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/reduce.hpp +++ b/contrib/python/pythran/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<long, E::value - 1> shp; +    types::array_tuple<long, E::value - 1> 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/contrib/python/pythran/pythran/pythonic/numpy/remainder.hpp b/contrib/python/pythran/pythran/pythonic/numpy/remainder.hpp index cd7e8b683c2..ddb1e6e750f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/remainder.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/repeat.hpp b/contrib/python/pythran/pythran/pythonic/numpy/repeat.hpp index 5ea1085dac6..a7acb2d9060 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/repeat.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    repeat(types::ndarray<T, pS> const &expr, long repeats, long axis)    {      constexpr auto N = std::tuple_size<pS>::value; @@ -25,7 +25,7 @@ namespace numpy                                          1L, std::multiplies<long>());      shape[axis] *= repeats; -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> out( +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::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/contrib/python/pythran/pythran/pythonic/numpy/resize.hpp b/contrib/python/pythran/pythran/pythonic/numpy/resize.hpp index 2a247c516b4..31c41e2bd8f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/resize.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/right_shift.hpp b/contrib/python/pythran/pythran/pythonic/numpy/right_shift.hpp index bf81419626c..554e80de7d4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/right_shift.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/rint.hpp b/contrib/python/pythran/pythran/pythonic/numpy/rint.hpp index 8fe7e613507..b85810c9b50 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/rint.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/roll.hpp b/contrib/python/pythran/pythran/pythonic/numpy/roll.hpp index ef9d71e358f..a17d1db88dc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/roll.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/roll.hpp @@ -32,7 +32,7 @@ namespace numpy    {      template <class To, class From, size_t N>      To _roll(To to, From from, long shift, long axis, -             types::array<long, N> const &shape, utils::int_<N - 1>) +             types::array_tuple<long, N> const &shape, utils::int_<N - 1>)      {        long dim = shape[N - 1];        if (axis == N - 1) { @@ -47,7 +47,7 @@ namespace numpy      template <class To, class From, size_t N, size_t M>      typename std::enable_if<M != N - 1, To>::type      _roll(To to, From from, long shift, long axis, -          types::array<long, N> const &shape, utils::int_<M>) +          types::array_tuple<long, N> const &shape, utils::int_<M>)      {        long dim = shape[M];        long offset = std::accumulate(shape.begin() + M + 1, shape.end(), 1L, @@ -90,7 +90,7 @@ namespace numpy    {      template <class To, class From, size_t N>      To _rolls(To to, From from, long shifts[N], -              types::array<long, N> const &shape, utils::int_<N - 1>) +              types::array_tuple<long, N> const &shape, utils::int_<N - 1>)      {        long dim = shape[N - 1];        if (long shift = shifts[N - 1]) { @@ -104,8 +104,8 @@ namespace numpy      template <class To, class From, size_t N, size_t M>      typename std::enable_if<M != N - 1, To>::type -    _rolls(To to, From from, long shifts[N], types::array<long, N> const &shape, -           utils::int_<M>) +    _rolls(To to, From from, long shifts[N], +           types::array_tuple<long, N> const &shape, utils::int_<M>)      {        long dim = shape[M];        long offset = std::accumulate(shape.begin() + M + 1, shape.end(), 1L, @@ -128,8 +128,8 @@ namespace numpy    template <class T, class pS, size_t N>    types::ndarray<T, pS> roll(types::ndarray<T, pS> const &expr, -                             types::array<long, N> shifts, -                             types::array<long, N> axes) +                             types::array_tuple<long, N> shifts, +                             types::array_tuple<long, N> axes)    {      constexpr long ndim = types::ndarray<T, pS>::value;      auto expr_shape = sutils::array(expr._shape); diff --git a/contrib/python/pythran/pythran/pythonic/numpy/rollaxis.hpp b/contrib/python/pythran/pythran/pythonic/numpy/rollaxis.hpp index 3c034b0e1bf..63da505b58d 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/rollaxis.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    rollaxis(types::ndarray<T, pS> const &a, long axis, long start)    {      long constexpr N = std::tuple_size<pS>::value; @@ -37,7 +37,7 @@ namespace numpy    }    NUMPY_EXPR_TO_NDARRAY0_IMPL(rollaxis); -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/rot90.hpp b/contrib/python/pythran/pythran/pythonic/numpy/rot90.hpp index 584ed5229c4..6650d2d14a5 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/rot90.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>    rot90(types::ndarray<T, pS> const &expr, int k)    {      auto constexpr N = std::tuple_size<pS>::value;      if (k % 4 == 0)        return copy(expr); -    types::array<long, N> shape = sutils::getshape(expr); +    types::array_tuple<long, N> shape = sutils::getshape(expr);      if (k % 4 != 2)        std::swap(shape[0], shape[1]); -    types::ndarray<T, types::array<long, N>> out(shape, builtins::None); +    types::ndarray<T, types::array_tuple<long, N>> 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/contrib/python/pythran/pythran/pythonic/numpy/searchsorted.hpp b/contrib/python/pythran/pythran/pythonic/numpy/searchsorted.hpp index 3346ca06ce9..fc88ab0f1b7 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/searchsorted.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -39,7 +39,7 @@ namespace numpy          throw types::ValueError("'" + side +                                  "' is an invalid value for keyword 'side'");      } -  } +  } // namespace details    template <class T, class U>    typename std::enable_if<!types::is_numexpr_arg<T>::value, long>::type @@ -67,25 +67,25 @@ namespace numpy          _search_sorted(a, (*ibegin).begin(), (*ibegin).end(), (*obegin).begin(),                         left, utils::int_<N - 1>());      } -  } +  } // namespace    template <class E, class T>    typename std::enable_if<        types::is_numexpr_arg<E>::value, -      types::ndarray<long, types::array<long, E::value>>>::type +      types::ndarray<long, types::array_tuple<long, E::value>>>::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<long, types::array<long, E::value>> out(asarray(v)._shape, -                                                           builtins::None); +    types::ndarray<long, types::array_tuple<long, E::value>> out( +        asarray(v)._shape, builtins::None);      _search_sorted(a, v.begin(), v.end(), out.begin(), left,                     utils::int_<E::value>());      return out;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/select.hpp b/contrib/python/pythran/pythran/pythonic/numpy/select.hpp index 0d76091acd3..3b00ce46ef0 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/select.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/select.hpp @@ -44,17 +44,17 @@ namespace numpy                         utils::int_<N - 1>());        return size;      } -  } +  } // namespace    template <class C, class L> -  types::ndarray<typename L::dtype, types::array<long, L::value - 1>> +  types::ndarray<typename L::dtype, types::array_tuple<long, L::value - 1>>    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<typename L::dtype, types::array<long, N>> out( +    types::ndarray<typename L::dtype, types::array_tuple<long, N>> out(          choicelist0_shape, _default); -    types::ndarray<typename L::dtype, types::array<long, N>> selected( +    types::ndarray<typename L::dtype, types::array_tuple<long, N>> 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/contrib/python/pythran/pythran/pythonic/numpy/shape.hpp b/contrib/python/pythran/pythran/pythonic/numpy/shape.hpp index 630e53aa229..e4e73f75041 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/shape.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/sin.hpp b/contrib/python/pythran/pythran/pythonic/numpy/sin.hpp index 2034ed52480..00930fb9c50 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/sin.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/sinh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/sinh.hpp index be22034ec83..c38c5833f7b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/sinh.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/size.hpp b/contrib/python/pythran/pythran/pythonic/numpy/size.hpp index 813bc257e3b..88e288828e7 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/size.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/sort.hpp b/contrib/python/pythran/pythran/pythonic/numpy/sort.hpp index 2f0a58b603b..1fb91dccdcc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/sort.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/sort.hpp @@ -9,7 +9,7 @@ namespace numpy  {    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    sort(E const &expr, long axis)    {      auto out = functor::array{}(expr); @@ -18,7 +18,7 @@ namespace numpy    }    template <class E> -  types::ndarray<typename E::dtype, types::array<long, 1>> +  types::ndarray<typename E::dtype, types::array_tuple<long, 1>>    sort(E const &expr, types::none_type)    {      auto out = functor::array{}(expr).flat(); @@ -27,14 +27,14 @@ namespace numpy    }    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    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/contrib/python/pythran/pythran/pythonic/numpy/sort_complex.hpp b/contrib/python/pythran/pythran/pythonic/numpy/sort_complex.hpp index 3bb53b2837d..ad737e4cb77 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/sort_complex.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/spacing.hpp b/contrib/python/pythran/pythran/pythonic/numpy/spacing.hpp index 11bb465f6a3..064298d18a9 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/spacing.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/split.hpp b/contrib/python/pythran/pythran/pythonic/numpy/split.hpp index 03436e9d7d6..9e22cef39d2 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/split.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -  types::list<types::ndarray<T, types::array<long, std::tuple_size<pS>::value>>> +  types::list< +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>>    split(types::ndarray<T, pS> 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<I>::value,        types::list<types::ndarray< -          T, types::array<long, std::tuple_size<pS>::value>>>>::type +          T, types::array_tuple<long, std::tuple_size<pS>::value>>>>::type    split(types::ndarray<T, pS> const &a, I const &split_mask)    {      return array_split(a, split_mask);    }    template <class E, class I> -  types::list<types::ndarray<typename E::dtype, types::array<long, E::value>>> +  types::list< +      types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>>    split(E const &a, I const &)    {      throw std::runtime_error("split only partially implemented");    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/sqrt.hpp b/contrib/python/pythran/pythran/pythonic/numpy/sqrt.hpp index fc22aac4d6b..86e5c90695c 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/sqrt.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/square.hpp b/contrib/python/pythran/pythran/pythonic/numpy/square.hpp index 1fd8c68a2b8..d166285e821 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/square.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/stack.hpp b/contrib/python/pythran/pythran/pythonic/numpy/stack.hpp index f5a6b96856c..2d5de6b7091 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/stack.hpp +++ b/contrib/python/pythran/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 <pythonic/include/numpy/stack.hpp>  #include <pythonic/numpy/concatenate.hpp> @@ -13,17 +13,18 @@ namespace numpy    template <class ArraySequence>    types::ndarray<typename ArraySequence::value_type::dtype, -                 types::array<long, ArraySequence::value_type::value + 1>> +                 types::array_tuple<long, ArraySequence::value_type::value + 1>>    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<decltype( -        shape)>::value; // The length of the shape array. +    constexpr long N = +        std::tuple_size<decltype(shape)>::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<long, N + 1> +    types::array_tuple<long, N + 1>          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<types::ndarray<          typename ArraySequence::value_type::dtype, -        types::array<long, ArraySequence::value_type::value + 1>>> bi(0); +        types::array_tuple<long, ArraySequence::value_type::value + 1>>> +        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 <size_t... Is, class... Tys> -  types::ndarray<typename details::stack_helper_t<Tys...>::dtype, -                 types::array<long, details::stack_helper_t<Tys...>::value + 1>> +  types::ndarray< +      typename details::stack_helper_t<Tys...>::dtype, +      types::array_tuple<long, details::stack_helper_t<Tys...>::value + 1>>    stack(std::tuple<Tys...> const &args, long axis, utils::index_sequence<Is...>)    { -    types::array< +    types::array_tuple<          types::ndarray<              typename details::stack_helper_t<Tys...>::dtype, -            types::array<long, details::stack_helper_t<Tys...>::value>>, -        sizeof...(Tys)> vargs{{std::get<Is>(args)...}}; +            types::array_tuple<long, details::stack_helper_t<Tys...>::value>>, +        sizeof...(Tys)> +        vargs{{std::get<Is>(args)...}};      return stack(vargs, axis);    }    template <class... Tys> -  types::ndarray<typename details::stack_helper_t<Tys...>::dtype, -                 types::array<long, details::stack_helper_t<Tys...>::value + 1>> +  types::ndarray< +      typename details::stack_helper_t<Tys...>::dtype, +      types::array_tuple<long, details::stack_helper_t<Tys...>::value + 1>>    stack(std::tuple<Tys...> const &args, long axis)    {      return stack(args, axis, utils::make_index_sequence<sizeof...(Tys)>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/std_.hpp b/contrib/python/pythran/pythran/pythonic/numpy/std_.hpp index 5ff8a402c78..76be6d48b30 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/std_.hpp +++ b/contrib/python/pythran/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 <class... Args> -  auto std_(Args &&... args) +  auto std_(Args &&...args)        -> decltype(functor::sqrt{}(var(std::forward<Args>(args)...)))    {      return functor::sqrt{}(var(std::forward<Args>(args)...));    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/subtract.hpp b/contrib/python/pythran/pythran/pythonic/numpy/subtract.hpp index 335aff7424f..dea8af22dfe 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/subtract.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/swapaxes.hpp b/contrib/python/pythran/pythran/pythonic/numpy/swapaxes.hpp index 0148bfde460..bc83a64a458 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/swapaxes.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/swapaxes.hpp @@ -10,18 +10,19 @@ PYTHONIC_NS_BEGIN  namespace numpy  {    template <class T> -  auto swapaxes(T &&a, int axis1, int axis2) -> decltype(functor::transpose{}( -      std::forward<T>(a), -      std::declval<types::array<long, std::decay<T>::type::value>>())) +  auto swapaxes(T &&a, int axis1, int axis2) +      -> decltype(functor::transpose{}( +          std::forward<T>(a), +          std::declval<types::array_tuple<long, std::decay<T>::type::value>>()))    {      constexpr long N = std::decay<T>::type::value; -    types::array<long, N> t; +    types::array_tuple<long, N> t;      for (unsigned long i = 0; i < N; ++i)        t[i] = i;      std::swap(t[axis1], t[axis2]);      return functor::transpose{}(std::forward<T>(a), t);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/take.hpp b/contrib/python/pythran/pythran/pythonic/numpy/take.hpp index ed39c7cc9b8..7ab952f8702 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/take.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/take.hpp @@ -13,7 +13,7 @@ namespace numpy    {      return expr[indices];    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/tan.hpp b/contrib/python/pythran/pythran/pythonic/numpy/tan.hpp index fb53ab091b8..5f416f55891 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/tan.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/tanh.hpp b/contrib/python/pythran/pythran/pythonic/numpy/tanh.hpp index e2bb22c7fab..3332e3f8669 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/tanh.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/tile.hpp b/contrib/python/pythran/pythran/pythonic/numpy/tile.hpp index 2eb0a52f442..a9590003a3f 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/tile.hpp +++ b/contrib/python/pythran/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_<N - 1>());      } -  } +  } // namespace    template <class E> -  types::ndarray<typename E::dtype, types::array<long, E::value>> +  types::ndarray<typename E::dtype, types::array_tuple<long, E::value>>    tile(E const &expr, long reps)    {      size_t n = expr.flat_size(); -    types::ndarray<typename E::dtype, types::array<long, E::value>> out( -        types::array<long, 1>{{long(n * reps)}}, builtins::None); +    types::ndarray<typename E::dtype, types::array_tuple<long, E::value>> out( +        types::array_tuple<long, 1>{{long(n * reps)}}, builtins::None);      auto out_iter = out.fbegin();      _tile(expr.begin(), expr.end(), out_iter, 1, utils::int_<E::value>());      for (long i = 1; i < reps; ++i) @@ -42,27 +42,27 @@ namespace numpy    }    template <size_t Shift, class R, class S, size_t... Is> -  types::array<long, sizeof...(Is)> +  types::array_tuple<long, sizeof...(Is)>    tile_init_shape(R const &reps, S const &expr_shape,                    utils::index_sequence<Is...>)    {      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 <class E, size_t N> -  types::ndarray<typename E::dtype, types::array<long, N>> -  tile(E const &expr, types::array<long, N> const &reps) +  types::ndarray<typename E::dtype, types::array_tuple<long, N>> +  tile(E const &expr, types::array_tuple<long, N> const &reps)    {      size_t n = expr.flat_size(); -    types::array<long, N> shape = tile_init_shape<N - E::value>( +    types::array_tuple<long, N> shape = tile_init_shape<N - E::value>(          reps, expr, utils::make_index_sequence<N>());      long last_rep = (E::value == N) ? std::get<N - 1>(reps) : 1; -    types::ndarray<typename E::dtype, types::array<long, N>> out( +    types::ndarray<typename E::dtype, types::array_tuple<long, N>> 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/contrib/python/pythran/pythran/pythonic/numpy/trace.hpp b/contrib/python/pythran/pythran/pythonic/numpy/trace.hpp index 2677331529c..9ec8b874a0b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/trace.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/transpose.hpp b/contrib/python/pythran/pythran/pythonic/numpy/transpose.hpp index 348cd9bddfd..36f5fdba803 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/transpose.hpp +++ b/contrib/python/pythran/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 <class T, class pS> -    types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +    types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>      _transposer(types::ndarray<T, pS> const &a,                  long const l[std::tuple_size<pS>::value])      {        auto shape = sutils::getshape(a); -      types::array<long, std::tuple_size<pS>::value> shp; +      types::array_tuple<long, std::tuple_size<pS>::value> shp;        for (unsigned long i = 0; i < std::tuple_size<pS>::value; ++i)          shp[i] = shape[l[i]]; -      types::array<long, std::tuple_size<pS>::value> perm; +      types::array_tuple<long, std::tuple_size<pS>::value> perm;        for (std::size_t i = 0; i < std::tuple_size<pS>::value; ++i)          perm[l[i]] = i; -      types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>            new_array(shp, builtins::None);        auto const *iter = a.buffer; -      types::array<long, std::tuple_size<pS>::value> indices; +      types::array_tuple<long, std::tuple_size<pS>::value> indices;        _transposer(new_array, iter, indices, shape, perm, utils::int_<0>{});        return new_array;      } -  } +  } // namespace    template <class T, class pS>    typename std::enable_if<        (std::tuple_size<pS>::value > 2), -      types::ndarray<T, types::array<long, std::tuple_size<pS>::value>>>::type -  transpose(types::ndarray<T, pS> const &a) +      types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>>>:: +      type +      transpose(types::ndarray<T, pS> const &a)    {      long t[std::tuple_size<pS>::value];      for (unsigned long i = 0; i < std::tuple_size<pS>::value; ++i) @@ -81,8 +82,9 @@ namespace numpy    }    template <class T, class pS, size_t M> -  types::ndarray<T, types::array<long, std::tuple_size<pS>::value>> -  transpose(types::ndarray<T, pS> const &a, types::array<long, M> const &t) +  types::ndarray<T, types::array_tuple<long, std::tuple_size<pS>::value>> +  transpose(types::ndarray<T, pS> const &a, +            types::array_tuple<long, M> const &t)    {      static_assert(std::tuple_size<pS>::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/contrib/python/pythran/pythran/pythonic/numpy/tri.hpp b/contrib/python/pythran/pythran/pythonic/numpy/tri.hpp index fb39c9ca58f..8e42ba0e0b7 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/tri.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/tril.hpp b/contrib/python/pythran/pythran/pythonic/numpy/tril.hpp index d6e9a12d5da..44d92ee9722 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/tril.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/triu.hpp b/contrib/python/pythran/pythran/pythonic/numpy/triu.hpp index b02116d0aab..3f6ce9b95db 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/triu.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/true_divide.hpp b/contrib/python/pythran/pythran/pythonic/numpy/true_divide.hpp index 0aedca78e1a..6c78a12791d 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/true_divide.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/trunc.hpp b/contrib/python/pythran/pythran/pythonic/numpy/trunc.hpp index d5e42e1fb40..46d7b9c5953 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/trunc.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/numpy/ufunc_accumulate.hpp b/contrib/python/pythran/pythran/pythonic/numpy/ufunc_accumulate.hpp index 295d45b9e3b..601fbd98017 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/ufunc_accumulate.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/ufunc_accumulate.hpp @@ -5,8 +5,8 @@  // clang-format off  #include INCLUDE_FILE(pythonic/numpy,UFUNC_NAME)  // clang-format on -#include <pythonic/numpy/partial_sum.hpp>  #include "pythonic/utils/functor.hpp" +#include <pythonic/numpy/partial_sum.hpp>  PYTHONIC_NS_BEGIN  namespace numpy @@ -21,6 +21,6 @@ namespace numpy        return partial_sum<numpy::functor::UFUNC_NAME>(std::forward<T>(a), axis,                                                       d);      } -  } -} +  } // namespace UFUNC_NAME +} // namespace numpy  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/numpy/union1d.hpp b/contrib/python/pythran/pythran/pythonic/numpy/union1d.hpp index 275d4d816bd..e9e7ff67775 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/union1d.hpp +++ b/contrib/python/pythran/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 <set> @@ -27,7 +27,7 @@ namespace numpy        for (; begin != end; ++begin)          _union1d((*begin).begin(), (*begin).end(), out, utils::int_<N - 1>());      } -  } +  } // namespace    template <class E, class F>    types::ndarray< @@ -41,7 +41,7 @@ namespace numpy      _union1d(f.begin(), f.end(), res, utils::int_<F::value>());      return {res};    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/unravel_index.hpp b/contrib/python/pythran/pythran/pythonic/numpy/unravel_index.hpp index e72ef8e48ba..8c885aad4ea 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/unravel_index.hpp +++ b/contrib/python/pythran/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 <class E, class S> -  typename std::enable_if<std::is_scalar<E>::value, -                          types::array<long, std::tuple_size<S>::value>>::type +  typename std::enable_if< +      std::is_scalar<E>::value, +      types::array_tuple<long, std::tuple_size<S>::value>>::type    unravel_index(E const &expr, S const &shape, types::str const &order)    { -    types::array<long, std::tuple_size<S>::value> ret; +    types::array_tuple<long, std::tuple_size<S>::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/contrib/python/pythran/pythran/pythonic/numpy/unwrap.hpp b/contrib/python/pythran/pythran/pythonic/numpy/unwrap.hpp index 3eee2077372..23da0b6a7a4 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/unwrap.hpp +++ b/contrib/python/pythran/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 <pythonic/numpy/maximum.hpp>  #include <pythonic/numpy/abs.hpp> +#include <pythonic/numpy/maximum.hpp>  #include <pythonic/numpy/round.hpp>  PYTHONIC_NS_BEGIN @@ -40,7 +40,7 @@ namespace numpy          _unwrap((*ibegin).begin(), (*ibegin).end(), (*obegin).begin(), discont,                  utils::int_<N - 1>());      } -  } +  } // namespace    template <class E>    types::ndarray<double, typename E::shape_t> unwrap(E const &expr, @@ -53,7 +53,7 @@ namespace numpy              utils::int_<E::value>());      return out;    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/var.hpp b/contrib/python/pythran/pythran/pythonic/numpy/var.hpp index fcfba97ab34..981b6678d9b 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/var.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -24,8 +24,8 @@ namespace numpy    template <class E>    auto var(E const &expr, types::none_type axis, types::none_type dtype, -           types::none_type out, long ddof) -      -> decltype(var_type<E>(std::real(mean(expr)))) +           types::none_type out, +           long ddof) -> decltype(var_type<E>(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_<N - 1>());      } -  } +  } // namespace    template <class E>    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<E>(expr.template shape<0>() - ddof);      } else { -      types::array<long, E::value> shp = sutils::getshape(expr); +      types::array_tuple<long, E::value> shp = sutils::getshape(expr);        shp[axis] = 1;        auto mp = m.reshape(shp); @@ -80,7 +80,7 @@ namespace numpy               var_type<E>(sutils::getshape(expr)[axis] - ddof);      }    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/vectorize.hpp b/contrib/python/pythran/pythran/pythonic/numpy/vectorize.hpp index 8452922d1da..4b0836a6b68 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/vectorize.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/vectorize.hpp @@ -12,9 +12,10 @@ namespace numpy  {    template <typename F>    template <typename... T> -  auto vectorized<F>::operator()(T &&...args) const -> typename std::enable_if< -      !types::valid_numexpr_parameters<typename std::decay<T>::type...>::value, -      decltype(F{}(std::forward<T>(args)...))>::type +  auto vectorized<F>::operator()(T &&...args) const -> +      typename std::enable_if<!types::valid_numexpr_parameters< +                                  typename std::decay<T>::type...>::value, +                              decltype(F{}(std::forward<T>(args)...))>::type    {      return F{}(std::forward<T>(args)...);    } diff --git a/contrib/python/pythran/pythran/pythonic/numpy/vstack.hpp b/contrib/python/pythran/pythran/pythonic/numpy/vstack.hpp index ac933cead50..3b4de4a0dff 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/vstack.hpp +++ b/contrib/python/pythran/pythran/pythonic/numpy/vstack.hpp @@ -19,17 +19,18 @@ namespace numpy    }    template <class ArraySequence> -  auto vstack(ArraySequence &&seq) -> typename std::enable_if< -      (impl::vstack_helper<ArraySequence>::value == 1), -      decltype(std::declval<impl::vstack_helper<ArraySequence>>().reshape( -          std::declval<types::array<long, 2>>()))>::type +  auto vstack(ArraySequence &&seq) -> +      typename std::enable_if< +          (impl::vstack_helper<ArraySequence>::value == 1), +          decltype(std::declval<impl::vstack_helper<ArraySequence>>().reshape( +              std::declval<types::array_tuple<long, 2>>()))>::type    {      auto &&temp = concatenate(std::forward<ArraySequence>(seq), 0);      long const seq_size = seq.size(), temp_size = temp.size(); -    types::array<long, 2> new_shape{{seq_size, temp_size / seq_size}}; +    types::array_tuple<long, 2> new_shape{{seq_size, temp_size / seq_size}};      return temp.reshape(new_shape);    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/where.hpp b/contrib/python/pythran/pythran/pythonic/numpy/where.hpp index fd5ee998025..7d917562944 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/where.hpp +++ b/contrib/python/pythran/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<I>(iters)...);      }    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/numpy/zeros_like.hpp b/contrib/python/pythran/pythran/pythonic/numpy/zeros_like.hpp index 38024b1d159..435089004cc 100644 --- a/contrib/python/pythran/pythran/pythonic/numpy/zeros_like.hpp +++ b/contrib/python/pythran/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 <class E, class dtype> -  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<typename E::dtype>());    } -} +} // namespace numpy  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/get_num_threads.hpp b/contrib/python/pythran/pythran/pythonic/omp/get_num_threads.hpp index 73b81f0a9cc..aea6b54d67f 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/get_num_threads.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/get_num_threads.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/get_num_threads.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace omp    {      return omp_get_num_threads();    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/get_thread_num.hpp b/contrib/python/pythran/pythran/pythonic/omp/get_thread_num.hpp index 652684eafef..5598a04a70d 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/get_thread_num.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/get_thread_num.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/get_thread_num.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp    {      return omp_get_thread_num();    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/get_wtick.hpp b/contrib/python/pythran/pythran/pythonic/omp/get_wtick.hpp index c31f1e25db3..c9e4242ebd7 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/get_wtick.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/get_wtick.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/get_wtick.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -14,7 +14,7 @@ namespace omp    {      return omp_get_wtick();    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/get_wtime.hpp b/contrib/python/pythran/pythran/pythonic/omp/get_wtime.hpp index c45c7de5f6b..0131962811c 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/get_wtime.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/get_wtime.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/get_wtime.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp    {      return omp_get_wtime();    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/in_parallel.hpp b/contrib/python/pythran/pythran/pythonic/omp/in_parallel.hpp index 80f053f5d61..731da8f7863 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/in_parallel.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/in_parallel.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/in_parallel.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp    {      return omp_in_parallel();    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/set_nested.hpp b/contrib/python/pythran/pythran/pythonic/omp/set_nested.hpp index 3d5228de05d..4a246a6c3b8 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/set_nested.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/set_nested.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/set_nested.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  PYTHONIC_NS_BEGIN @@ -15,7 +15,7 @@ namespace omp    {      return omp_set_nested(val);    } -} +} // namespace omp  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/omp/set_num_threads.hpp b/contrib/python/pythran/pythran/pythonic/omp/set_num_threads.hpp index 305d88a1d34..30e41caa1f7 100644 --- a/contrib/python/pythran/pythran/pythonic/omp/set_num_threads.hpp +++ b/contrib/python/pythran/pythran/pythonic/omp/set_num_threads.hpp @@ -3,8 +3,8 @@  #include "pythonic/include/omp/set_num_threads.hpp" -#include <omp.h>  #include "pythonic/utils/functor.hpp" +#include <omp.h>  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/contrib/python/pythran/pythran/pythonic/operator_/__abs__.hpp b/contrib/python/pythran/pythran/pythonic/operator_/__abs__.hpp index a8c386ae6b6..318cfdf4720 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/__abs__.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/__xor__.hpp b/contrib/python/pythran/pythran/pythonic/operator_/__xor__.hpp index 0bc39c59af6..f875024a0ac 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/__xor__.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/abs.hpp b/contrib/python/pythran/pythran/pythonic/operator_/abs.hpp index 47ee998c25a..b8002087850 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/abs.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/add.hpp b/contrib/python/pythran/pythran/pythonic/operator_/add.hpp index d234f366fa5..1e594a143a1 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/add.hpp +++ b/contrib/python/pythran/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<decltype(b)>::max() - b) -                         : (std::numeric_limits<decltype(b)>::min() - b <= a)))) -} +      add, +, +      (((b >= 0) ? (a <= std::numeric_limits<decltype(b)>::max() - b) +                 : (std::numeric_limits<decltype(b)>::min() - b <= a)))) +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/and_.hpp b/contrib/python/pythran/pythran/pythonic/operator_/and_.hpp index f81e104c161..77da5249f70 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/and_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/concat.hpp b/contrib/python/pythran/pythran/pythonic/operator_/concat.hpp index 17e8e817788..3df3c7163cc 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/concat.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/concat.hpp @@ -15,7 +15,7 @@ namespace operator_    {      return std::forward<A>(a) + std::forward<B>(b);    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/contains.hpp b/contrib/python/pythran/pythran/pythonic/operator_/contains.hpp index 9da329f31e3..d1f739c7dee 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/contains.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto contains(A &&a, B &&b) -      -> decltype(in(std::forward<A>(a), std::forward<B>(b))) +  auto contains(A &&a, +                B &&b) -> decltype(in(std::forward<A>(a), std::forward<B>(b)))    {      return in(std::forward<A>(a), std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/countOf.hpp b/contrib/python/pythran/pythran/pythonic/operator_/countOf.hpp index a3f4203bd69..718416c9216 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/countOf.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/countOf.hpp @@ -15,7 +15,7 @@ namespace operator_    {      return std::count(a.begin(), a.end(), std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/delitem.hpp b/contrib/python/pythran/pythran/pythonic/operator_/delitem.hpp index 0a44fa1c826..daf5c2cffbc 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/delitem.hpp +++ b/contrib/python/pythran/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>(a).remove(std::forward<B>(b));      return builtins::None;    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/getitem.hpp b/contrib/python/pythran/pythran/pythonic/operator_/getitem.hpp index 1d5b21347e6..f3362b0328d 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/getitem.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/getitem.hpp @@ -14,7 +14,7 @@ namespace operator_    {      return std::forward<A>(a)[std::forward<B>(b)];    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/iadd.hpp b/contrib/python/pythran/pythran/pythonic/operator_/iadd.hpp index 6e77849ebd5..564fd9b4504 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/iadd.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/icommon.hpp b/contrib/python/pythran/pythran/pythonic/operator_/icommon.hpp index d7b4140fa35..bff2016246d 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/icommon.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/icommon.hpp @@ -21,8 +21,9 @@ namespace operator_  {    template <class A, class B> -  auto OPERATOR_NAME(bool, A &&a, B &&b, ...) -      -> decltype(std::forward<A>(a) OPERATOR_SYMBOL std::forward<B>(b)) +  auto OPERATOR_NAME(bool, A &&a, B &&b, +                     ...) -> decltype(std::forward<A>(a) +                                          OPERATOR_SYMBOL std::forward<B>(b))    {      return std::forward<A>(a) OPERATOR_SYMBOL std::forward<B>(b);    } @@ -32,7 +33,7 @@ namespace operator_    {      return std::forward<A>(a) OPERATOR_ISYMBOL std::forward<B>(b);    } -} +} // namespace operator_  PYTHONIC_NS_END  #undef OPERATOR_NAME  #undef OPERATOR_SYMBOL diff --git a/contrib/python/pythran/pythran/pythonic/operator_/iconcat.hpp b/contrib/python/pythran/pythran/pythonic/operator_/iconcat.hpp index ea80f1ee60c..adad2d09001 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/iconcat.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/ifloordiv.hpp b/contrib/python/pythran/pythran/pythonic/operator_/ifloordiv.hpp index d10087483e2..caea2ca5470 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/ifloordiv.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/imax.hpp b/contrib/python/pythran/pythran/pythonic/operator_/imax.hpp index 63d6f0b53d2..44127928727 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/imax.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto imax(A &&a, B &&b) -> typename std::enable_if< -      std::is_const<A>::value || !std::is_assignable<A, B>::value, -      decltype(numpy::functor::maximum{}(std::forward<A>(a), -                                         std::forward<B>(b)))>::type +  auto imax(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_const<A>::value || !std::is_assignable<A, B>::value, +          decltype(numpy::functor::maximum{}(std::forward<A>(a), +                                             std::forward<B>(b)))>::type    {      return numpy::functor::maximum{}(std::forward<A>(a), std::forward<B>(b));    }    template <class A, class B> -  auto imax(A &&a, B &&b) -> typename std::enable_if< -      !std::is_const<A>::value && std::is_assignable<A, B>::value, -      decltype(a = numpy::functor::maximum{}(std::forward<A>(a), -                                             std::forward<B>(b)))>::type +  auto imax(A &&a, B &&b) -> +      typename std::enable_if< +          !std::is_const<A>::value && std::is_assignable<A, B>::value, +          decltype(a = numpy::functor::maximum{}(std::forward<A>(a), +                                                 std::forward<B>(b)))>::type    {      return a = numpy::functor::maximum{}(a, std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/imin.hpp b/contrib/python/pythran/pythran/pythonic/operator_/imin.hpp index 8405872a690..e1f32ea1521 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/imin.hpp +++ b/contrib/python/pythran/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 <class A, class B> -  auto imin(A &&a, B &&b) -> typename std::enable_if< -      std::is_const<A>::value || !std::is_assignable<A, B>::value, -      decltype(numpy::functor::minimum{}(std::forward<A>(a), -                                         std::forward<B>(b)))>::type +  auto imin(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_const<A>::value || !std::is_assignable<A, B>::value, +          decltype(numpy::functor::minimum{}(std::forward<A>(a), +                                             std::forward<B>(b)))>::type    {      return numpy::functor::minimum{}(std::forward<A>(a), std::forward<B>(b));    }    template <class A, class B> -  auto imin(A &&a, B &&b) -> typename std::enable_if< -      !std::is_const<A>::value && std::is_assignable<A, B>::value, -      decltype(a = numpy::functor::minimum{}(std::forward<A>(a), -                                             std::forward<B>(b)))>::type +  auto imin(A &&a, B &&b) -> +      typename std::enable_if< +          !std::is_const<A>::value && std::is_assignable<A, B>::value, +          decltype(a = numpy::functor::minimum{}(std::forward<A>(a), +                                                 std::forward<B>(b)))>::type    {      return a = numpy::functor::minimum{}(a, std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/imod.hpp b/contrib/python/pythran/pythran/pythonic/operator_/imod.hpp index 60378e768ea..6825f2ddbec 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/imod.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/imod.hpp @@ -20,7 +20,7 @@ namespace operator_    {      return a %= std::forward<B>(b);    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/indexOf.hpp b/contrib/python/pythran/pythran/pythonic/operator_/indexOf.hpp index d007553e125..28def8bff81 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/indexOf.hpp +++ b/contrib/python/pythran/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 <algorithm> @@ -23,7 +23,7 @@ namespace operator_                                " is not in this sequence");      return where - a.begin();    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/invert.hpp b/contrib/python/pythran/pythran/pythonic/operator_/invert.hpp index 6985d3e36c0..def3cff64cb 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/invert.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/invert.hpp @@ -15,7 +15,7 @@ namespace operator_    {      return ~std::forward<A>(a);    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/ipow.hpp b/contrib/python/pythran/pythran/pythonic/operator_/ipow.hpp index 0a69cf7b9e8..708985ef595 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/ipow.hpp +++ b/contrib/python/pythran/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>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/is_.hpp b/contrib/python/pythran/pythran/pythonic/operator_/is_.hpp index f15fd01be0f..b9eff92b606 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/is_.hpp +++ b/contrib/python/pythran/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>(a)) == builtins::id(std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/is_not.hpp b/contrib/python/pythran/pythran/pythonic/operator_/is_not.hpp index a2fbb1a98d5..63c4c9839d5 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/is_not.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/is_not.hpp @@ -16,7 +16,7 @@ namespace operator_    {      return builtins::id(std::forward<A>(a)) != builtins::id(std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/itruediv.hpp b/contrib/python/pythran/pythran/pythonic/operator_/itruediv.hpp index a52ac09eddd..ad6feb5b9ce 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/itruediv.hpp +++ b/contrib/python/pythran/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>(b));    }    template <class A, class B> -  auto itruediv(A &a, B &&b) -> typename std::enable_if< -      std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, -      A &>::type +  auto itruediv(A &a, B &&b) -> +      typename std::enable_if< +          std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, +          A &>::type    {      return a = truediv(a, std::forward<B>(b));    }    template <class A, class B> -  auto itruediv(A &a, B &&b) -> typename std::enable_if< -      !std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, -      decltype(truediv(a, std::forward<B>(b)))>::type +  auto itruediv(A &a, B &&b) -> +      typename std::enable_if< +          !std::is_same<A, decltype(truediv(a, std::forward<B>(b)))>::value, +          decltype(truediv(a, std::forward<B>(b)))>::type    {      return truediv(a, std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/lshift.hpp b/contrib/python/pythran/pythran/pythonic/operator_/lshift.hpp index 995340125d5..a758fc9afde 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/lshift.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/lshift.hpp @@ -12,8 +12,8 @@ namespace operator_  {    template <class A, class B> -  auto lshift(A &&a, B &&b) -      -> decltype(std::forward<A>(a) << std::forward<B>(b)) +  auto lshift(A &&a, B &&b) -> decltype(std::forward<A>(a) +                                        << std::forward<B>(b))    {      return std::forward<A>(a) << std::forward<B>(b);    } diff --git a/contrib/python/pythran/pythran/pythonic/operator_/matmul.hpp b/contrib/python/pythran/pythran/pythonic/operator_/matmul.hpp index 3a0ed65f720..49bbbea3ba2 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/matmul.hpp +++ b/contrib/python/pythran/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>(a), std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/mod.hpp b/contrib/python/pythran/pythran/pythonic/operator_/mod.hpp index 7cc333ce3ad..60f0047e8d7 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/mod.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/mod.hpp @@ -11,10 +11,11 @@ namespace operator_  {    template <class A, class B> -  auto mod(A &&a, B &&b) -> typename std::enable_if< -      std::is_fundamental<typename std::decay<A>::type>::value && -          std::is_fundamental<typename std::decay<B>::type>::value, -      decltype(std::forward<A>(a) % std::forward<B>(b))>::type +  auto mod(A &&a, B &&b) -> +      typename std::enable_if< +          std::is_fundamental<typename std::decay<A>::type>::value && +              std::is_fundamental<typename std::decay<B>::type>::value, +          decltype(std::forward<A>(a) % std::forward<B>(b))>::type    {      auto t = std::forward<A>(a) % b;      return t < 0 ? (t + b) : t; @@ -41,7 +42,7 @@ namespace operator_    {      return std::forward<A>(a) % std::forward<B>(b);    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/neg.hpp b/contrib/python/pythran/pythran/pythonic/operator_/neg.hpp index e20b49a2cdc..326460282ba 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/neg.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/neg.hpp @@ -15,7 +15,7 @@ namespace operator_    {      return -std::forward<A>(a);    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/not_.hpp b/contrib/python/pythran/pythran/pythonic/operator_/not_.hpp index dca674fbec4..76602f2c5ee 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/not_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/or_.hpp b/contrib/python/pythran/pythran/pythonic/operator_/or_.hpp index 7a7a0f453d3..69092b4c5bf 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/or_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/pos.hpp b/contrib/python/pythran/pythran/pythonic/operator_/pos.hpp index fa72eb61d79..239294a1427 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/pos.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/pos.hpp @@ -15,7 +15,7 @@ namespace operator_    {      return a;    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/pow.hpp b/contrib/python/pythran/pythran/pythonic/operator_/pow.hpp index fb18687f08a..7f801d6e179 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/pow.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/operator_/rshift.hpp b/contrib/python/pythran/pythran/pythonic/operator_/rshift.hpp index ee335f9c9ab..b656ae28af8 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/rshift.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/rshift.hpp @@ -11,14 +11,14 @@ PYTHONIC_NS_BEGIN  namespace operator_  {    template <class A, class B> -  auto rshift(A &&a, B &&b) -      -> decltype(std::forward<A>(a) >> std::forward<B>(b)) +  auto rshift(A &&a, +              B &&b) -> decltype(std::forward<A>(a) >> std::forward<B>(b))    {      return std::forward<A>(a) >> std::forward<B>(b);    }    DEFINE_ALL_OPERATOR_OVERLOADS_IMPL(rshift, >>, true) -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/sub.hpp b/contrib/python/pythran/pythran/pythonic/operator_/sub.hpp index cb07f36a416..a91e3942000 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/sub.hpp +++ b/contrib/python/pythran/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<decltype(b)>::max() + b) -                        : (std::numeric_limits<decltype(b)>::min() + b <= a)))) -} +      sub, -, +      (((b < 0) ? (a <= std::numeric_limits<decltype(b)>::max() + b) +                : (std::numeric_limits<decltype(b)>::min() + b <= a)))) +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/truediv.hpp b/contrib/python/pythran/pythran/pythonic/operator_/truediv.hpp index e9e5c144fe0..285da274894 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/truediv.hpp +++ b/contrib/python/pythran/pythran/pythonic/operator_/truediv.hpp @@ -10,12 +10,12 @@ PYTHONIC_NS_BEGIN  namespace operator_  {    template <class A, class B> -  auto truediv(A &&a, B &&b) -      -> decltype(std::forward<A>(a) / (double)std::forward<B>(b)) +  auto truediv(A &&a, B &&b) -> decltype(std::forward<A>(a) / +                                         (double)std::forward<B>(b))    {      return std::forward<A>(a) / ((double)std::forward<B>(b));    } -} +} // namespace operator_  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/operator_/xor_.hpp b/contrib/python/pythran/pythran/pythonic/operator_/xor_.hpp index d37bb64e323..a25137ad5bd 100644 --- a/contrib/python/pythran/pythran/pythonic/operator_/xor_.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/random/shuffle.hpp b/contrib/python/pythran/pythran/pythonic/random/shuffle.hpp index 19b74344fdc..43f0366a79b 100644 --- a/contrib/python/pythran/pythran/pythonic/random/shuffle.hpp +++ b/contrib/python/pythran/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 <limits> @@ -47,7 +47,7 @@ namespace random        function randf;      }; -  } +  } // namespace details    template <class T, class function>    types::none_type shuffle(T &seq, function &&randf) @@ -56,7 +56,7 @@ namespace random                   details::URG<function>(std::forward<function>(randf)));      return builtins::None;    } -} +} // namespace random  PYTHONIC_NS_END diff --git a/contrib/python/pythran/pythran/pythonic/scipy/special/binom.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/binom.hpp index 47204a73996..e9182c797a7 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/binom.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/binom.hpp @@ -28,13 +28,13 @@ namespace scipy          return boost::math::binomial_coefficient<double>(              n, k, make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/chbevl.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/chbevl.hpp index 2e3b5b68f90..6d1c06a4123 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/chbevl.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/chbevl.hpp @@ -14,7 +14,7 @@ namespace scipy    namespace special    {      template <size_t N> -    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/contrib/python/pythran/pythran/pythonic/scipy/special/gamma.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/gamma.hpp index 2ee3b2b96de..2353157b96e 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/gamma.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/gammaincinv.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/gammaincinv.hpp index 63eb790b05e..f972ed8d9b6 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/gammaincinv.hpp +++ b/contrib/python/pythran/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<true>())); +                                        make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/gammaln.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/gammaln.hpp index 82ad0f65532..5dc55a84c71 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/gammaln.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/hankel1.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/hankel1.hpp index 0f20cd37b71..1fa9a83ad2c 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/hankel1.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/hankel2.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/hankel2.hpp index ddce9a019d6..518c3d89682 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/hankel2.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/i0.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/i0.hpp index e32de34b682..7a365e60a88 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/i0.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/i0e.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/i0e.hpp index f1ee8428f2b..702f5d974ea 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/i0e.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/iv.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/iv.hpp index 06a92836097..658a3f3010c 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/iv.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/iv.hpp @@ -25,13 +25,13 @@ namespace scipy          return boost::math::cyl_bessel_i(x, y,                                           make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/ivp.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/ivp.hpp index 3834f543558..db689f15000 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/ivp.hpp +++ b/contrib/python/pythran/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<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/jv.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/jv.hpp index 944228be942..8485907ac90 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/jv.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/jv.hpp @@ -25,13 +25,13 @@ namespace scipy          return boost::math::cyl_bessel_j(x, y,                                           make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/jvp.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/jvp.hpp index 99ad7974c10..c9a674c2a7f 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/jvp.hpp +++ b/contrib/python/pythran/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<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/kv.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/kv.hpp index 151acd0bb5a..406bb1a96d8 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/kv.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/kv.hpp @@ -25,13 +25,13 @@ namespace scipy          return boost::math::cyl_bessel_k(x, y,                                           make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/kvp.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/kvp.hpp index dcfc6d37913..3f916ef3620 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/kvp.hpp +++ b/contrib/python/pythran/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<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/ndtr.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/ndtr.hpp index 4245fbf4e78..1316b49edad 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/ndtr.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/ndtri.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/ndtri.hpp index f19df228562..bde9632328a 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/ndtri.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_jn.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_jn.hpp index 643847c53a9..da92301c2cb 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_jn.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_jn.hpp @@ -33,13 +33,13 @@ namespace scipy                                           make_policy(promote_double<true>()));          }        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_yn.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_yn.hpp index cde3816dff4..952587984a2 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_yn.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/spherical_yn.hpp @@ -33,13 +33,13 @@ namespace scipy                                            make_policy(promote_double<true>()));          }        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/yv.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/yv.hpp index 7367ea69ef5..42462a1edba 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/yv.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/yv.hpp @@ -25,13 +25,13 @@ namespace scipy          return boost::math::cyl_neumann(x, y,                                          make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/scipy/special/yvp.hpp b/contrib/python/pythran/pythran/pythonic/scipy/special/yvp.hpp index f08bf1fd954..b8cb59ab67b 100644 --- a/contrib/python/pythran/pythran/pythonic/scipy/special/yvp.hpp +++ b/contrib/python/pythran/pythran/pythonic/scipy/special/yvp.hpp @@ -25,13 +25,13 @@ namespace scipy          return boost::math::cyl_neumann_prime(              x, y, make_policy(promote_double<true>()));        } -    } +    } // 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/contrib/python/pythran/pythran/pythonic/string/find.hpp b/contrib/python/pythran/pythran/pythonic/string/find.hpp index da093eed90a..a787184055e 100644 --- a/contrib/python/pythran/pythran/pythonic/string/find.hpp +++ b/contrib/python/pythran/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<T>(val));    } -} +} // namespace string  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/time/sleep.hpp b/contrib/python/pythran/pythran/pythonic/time/sleep.hpp index 7da71a02924..605bc8b6347 100644 --- a/contrib/python/pythran/pythran/pythonic/time/sleep.hpp +++ b/contrib/python/pythran/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 <thread>  #include <chrono> +#include <thread>  PYTHONIC_NS_BEGIN @@ -18,7 +18,7 @@ namespace time      std::this_thread::sleep_for(std::chrono::duration<double>(value));      return builtins::None;    } -} +} // namespace time  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/time/time.hpp b/contrib/python/pythran/pythran/pythonic/time/time.hpp index 44ed54c76e9..3dac449d7d2 100644 --- a/contrib/python/pythran/pythran/pythonic/time/time.hpp +++ b/contrib/python/pythran/pythran/pythonic/time/time.hpp @@ -16,10 +16,11 @@ namespace time      std::chrono::time_point<std::chrono::steady_clock> tp =          std::chrono::steady_clock::now();      return std::chrono::duration_cast<std::chrono::milliseconds>( -               tp.time_since_epoch()).count() / +               tp.time_since_epoch()) +               .count() /             1000.;    } -} +} // namespace time  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/types/array.hpp b/contrib/python/pythran/pythran/pythonic/types/array.hpp new file mode 100644 index 00000000000..e7b3966793d --- /dev/null +++ b/contrib/python/pythran/pythran/pythonic/types/array.hpp @@ -0,0 +1,755 @@ +#ifndef PYTHONIC_TYPES_ARRAY_HPP +#define PYTHONIC_TYPES_ARRAY_HPP + +#include "pythonic/include/types/array.hpp" +#include "pythonic/types/nditerator.hpp" + +#include "pythonic/builtins/len.hpp" +#include "pythonic/types/bool.hpp" +#include "pythonic/types/slice.hpp" +#include "pythonic/types/tuple.hpp" +#include "pythonic/utils/allocate.hpp" +#include "pythonic/utils/reserve.hpp" +#include "pythonic/utils/shared_ref.hpp" + +#include "pythonic/builtins/NotImplementedError.hpp" + +#include <algorithm> +#include <cassert> + +PYTHONIC_NS_BEGIN + +namespace types +{ + +  /// Sliced array + +  // Constructors +  template <class T, class S> +  sliced_array<T, S>::sliced_array() : _data(utils::no_memory()) +  { +  } +  template <class T, class S> +  sliced_array<T, S>::sliced_array(sliced_array<T, S> const &s) +      : _data(s._data), slicing(s.slicing) +  { +  } +  template <class T, class S> +  sliced_array<T, S>::sliced_array(array<T> const &other, S const &s) +      : _data(other._data), slicing(s.normalize(other.size())) +  { +  } +  template <class T, class S> +  template <class Sn> +  sliced_array<T, S>::sliced_array( +      utils::shared_ref<container_type> const &other, Sn const &s) +      : _data(other), slicing(s) +  { +  } + +  // iterators +  template <class T, class S> +  typename sliced_array<T, S>::iterator sliced_array<T, S>::begin() +  { +    return {*this, 0}; +  } +  template <class T, class S> +  typename sliced_array<T, S>::const_iterator sliced_array<T, S>::begin() const +  { +    return {*this, 0}; +  } +  template <class T, class S> +  typename sliced_array<T, S>::iterator sliced_array<T, S>::end() +  { +    return {*this, size()}; +  } +  template <class T, class S> +  typename sliced_array<T, S>::const_iterator sliced_array<T, S>::end() const +  { +    return {*this, size()}; +  } + +  // size +  template <class T, class S> +  long sliced_array<T, S>::size() const +  { +    return slicing.size(); +  } +  template <class T, class S> +  sliced_array<T, S>::operator bool() const +  { +    return slicing.size(); +  } + +  // accessor +  template <class T, class S> +  typename sliced_array<T, S>::const_reference +  sliced_array<T, S>::fast(long i) const +  { +    assert(0 <= i && i < size()); +    auto const index = slicing.get(i); +    assert(0 <= index && index < (long)_data->size()); +    return (*_data)[index]; +  } +  template <class T, class S> +  typename sliced_array<T, S>::reference sliced_array<T, S>::fast(long i) +  { +    assert(0 <= i && i < size()); +    auto const index = slicing.get(i); +    assert(0 <= index && index < (long)_data->size()); +    return (*_data)[index]; +  } +  template <class T, class S> +  typename sliced_array<T, S>::const_reference +  sliced_array<T, S>::operator[](long i) const +  { +    assert(i < size()); +    auto const index = slicing.get(i); +    assert(0 <= index && index < (long)_data->size()); +    return (*_data)[index]; +  } +  template <class T, class S> +  typename sliced_array<T, S>::reference sliced_array<T, S>::operator[](long i) +  { +    assert(i < size()); +    auto const index = slicing.get(i); +    assert(0 <= index && index < (long)_data->size()); +    return (*_data)[index]; +  } + +  template <class T, class S> +  template <class Sp> +  typename std::enable_if< +      is_slice<Sp>::value, +      sliced_array<T, decltype(std::declval<S>() * std::declval<Sp>())>>::type +  sliced_array<T, S>::operator[](Sp s) const +  { +    return {_data, slicing * s.normalize(this->size())}; +  } + +  // io +  template <class Tp, class Sp> +  std::ostream &operator<<(std::ostream &os, sliced_array<Tp, Sp> const &v) +  { +    os << '['; +    auto iter = v.begin(); +    if (iter != v.end()) { +      while (iter + 1 != v.end()) { +        os << *iter << ", "; +        ++iter; +      } +      os << *iter; +    } +    return os << ']'; +  } + +  // comparison +  template <class T, class S> +  template <class K> +  bool sliced_array<T, S>::operator==(array<K> const &other) const +  { +    if (size() != other.size()) +      return false; +    return std::equal(begin(), end(), other.begin()); +  } +  template <class T, class S> +  inline sliced_array<T, S> & +  sliced_array<T, S>::operator=(sliced_array<T, S> const &s) +  { +    if (slicing.step == 1) { +      // inserting before erasing in case of self-copy +      auto insert_pt = _data->begin() + slicing.lower; +      _data->insert(insert_pt, s.begin(), s.end()); +      auto erase_pt = _data->begin() + s.size(); +      _data->erase(erase_pt + slicing.lower, erase_pt + slicing.upper); +    } else +      assert(!"not implemented yet"); +    return *this; +  } +  template <class T, class S> +  sliced_array<T, S> &sliced_array<T, S>::operator=(array<T> const &seq) +  { +    if (slicing.step == 1) { +      // inserting before erasing in case of self-copy +      auto insert_pt = _data->begin() + slicing.lower; +      _data->insert(insert_pt, seq.begin(), seq.end()); +      auto erase_pt = _data->begin() + seq.size(); +      _data->erase(erase_pt + slicing.lower, erase_pt + slicing.upper); +    } else +      assert(!"not implemented yet"); +    return *this; +  } +  template <class T, class S> +  array<T> sliced_array<T, S>::operator+(array<T> const &s) const +  { +    array<T> out(size() + s.size()); +    std::copy(s.begin(), s.end(), std::copy(begin(), end(), out.begin())); +    return out; +  } +  template <class T, class S> +  template <size_t N, class V> +  array<T> sliced_array<T, S>::operator+(array_base<T, N, V> const &s) const +  { +    array<T> out(size() + s.size()); +    std::copy(s.begin(), s.end(), std::copy(begin(), end(), out.begin())); +    return out; +  } +  template <class T, class S> +  template <class Tp, class Sp> +  array<typename __combined<T, Tp>::type> +  sliced_array<T, S>::operator+(sliced_array<Tp, Sp> const &s) const +  { +    array<typename __combined<T, Tp>::type> out(size() + s.size()); +    std::copy(s.begin(), s.end(), std::copy(begin(), end(), out.begin())); +    return out; +  } +  template <class N, class T> +  array<T> operator*(N n, array<T> const &l) +  { +    return l * n; +  } +#ifdef USE_XSIMD +  template <class T, class S> +  template <class vectorizer> +  typename sliced_array<T, S>::simd_iterator +  sliced_array<T, S>::vbegin(vectorizer) const +  { +    return {_data->data() + slicing.lower}; +  } + +  template <class T, class S> +  template <class vectorizer> +  typename sliced_array<T, S>::simd_iterator +  sliced_array<T, S>::vend(vectorizer) const +  { +    using vector_type = typename xsimd::batch<dtype>; +    static const std::size_t vector_size = vector_type::size; +    return {_data->data() + slicing.lower + +            long(size() / vector_size * vector_size)}; +  } + +#endif + +  // other operations +  template <class T, class S> +  template <class V> +  bool sliced_array<T, S>::contains(V const &v) const +  { +    return std::find(_data->begin(), _data->end(), v) != _data->end(); +  } +  template <class T, class S> +  intptr_t sliced_array<T, S>::id() const +  { +    // sharing is not implemented for sliced array +    return reinterpret_cast<intptr_t>(this); +  } + +  template <class T, class S> +  long sliced_array<T, S>::count(T const &x) const +  { +    return std::count(begin(), end(), x); +  } + +  /// List + +  // constructors +  template <class T> +  array<T>::array() : _data(utils::no_memory()) +  { +  } +  template <class T> +  template <class InputIterator> +  array<T>::array(InputIterator start, InputIterator stop) : _data() +  { +    if (std::is_same< +            typename std::iterator_traits<InputIterator>::iterator_category, +            std::random_access_iterator_tag>::value) +      _data->reserve(std::distance(start, stop)); +    else +      _data->reserve(DEFAULT_CAPACITY); +    std::copy(start, stop, std::back_inserter(*_data)); +  } +  template <class T> +  array<T>::array(size_type sz) : _data(sz) +  { +  } +  template <class T> +  array<T>::array(array<T> &&other) : _data(std::move(other._data)) +  { +  } +  template <class T> +  array<T>::array(array<T> const &other) : _data(other._data) +  { +  } +  template <class T> +  template <class F> +  array<T>::array(array<F> const &other) : _data(other.size()) +  { +    std::copy(other.begin(), other.end(), begin()); +  } +  template <class T> +  template <class Tp, class S> +  array<T>::array(sliced_array<Tp, S> const &other) +      : _data(other.begin(), other.end()) +  { +  } + +  // operators +  template <class T> +  array<T> &array<T>::operator=(array<T> &&other) +  { +    _data = std::move(other._data); +    return *this; +  } +  template <class T> +  template <class F> +  array<T> &array<T>::operator=(array<F> const &other) +  { +    _data = utils::shared_ref<container_type>{other.size()}; +    std::copy(other.begin(), other.end(), begin()); +    return *this; +  } +  template <class T> +  array<T> &array<T>::operator=(array<T> const &other) +  { +    _data = other._data; +    return *this; +  } +  template <class T> +  template <class Tp, size_t N, class V> +  array<T> &array<T>::operator=(array_base<Tp, N, V> const &other) +  { +    _data = utils::shared_ref<container_type>(other.begin(), other.end()); +    return *this; +  } +  template <class T> +  template <class Tp, class S> +  array<T> &array<T>::operator=(sliced_array<Tp, S> const &other) +  { +    if (other._data == _data) { +      auto it = std::copy(other.begin(), other.end(), _data->begin()); +      _data->resize(it - _data->begin()); +    } else +      _data = utils::shared_ref<container_type>(other.begin(), other.end()); +    return *this; +  } + +  template <class T> +  template <class S> +  array<T> &array<T>::operator+=(sliced_array<T, S> const &other) +  { +    _data->resize(size() + other.size()); +    std::copy(other.begin(), other.end(), _data->begin()); +    return *this; +  } + +  template <class T> +  template <class S> +  array<T> array<T>::operator+(sliced_array<T, S> const &other) const +  { +    array<T> new_array(begin(), end()); +    new_array.reserve(size() + other.size()); +    std::copy(other.begin(), other.end(), std::back_inserter(new_array)); +    return new_array; +  } + +  template <class T> +  template <size_t N, class V> +  array<T> array<T>::operator+(array_base<T, N, V> const &other) const +  { +    array<T> new_array(begin(), end()); +    new_array.reserve(size() + other.size()); +    std::copy(other.begin(), other.end(), std::back_inserter(new_array)); +    return new_array; +  } + +  // io +  template <class T> +  std::ostream &operator<<(std::ostream &os, array<T> const &v) +  { +    os << '['; +    auto iter = v.begin(); +    if (iter != v.end()) { +      while (iter + 1 != v.end()) +        os << *iter++ << ", "; +      os << *iter; +    } +    return os << ']'; +  } + +  // comparison +  template <class T> +  template <class K> +  bool array<T>::operator==(array<K> const &other) const +  { +    if (size() != other.size()) +      return false; +    return std::equal(begin(), end(), other.begin()); +  } +  template <class T> +  template <class K> +  bool array<T>::operator!=(array<K> const &other) const +  { +    return !operator==(other); +  } + +  // iterators +  template <class T> +  typename array<T>::iterator array<T>::begin() +  { +    return {*this, 0}; +  } +  template <class T> +  typename array<T>::const_iterator array<T>::begin() const +  { +    return {*this, 0}; +  } +  template <class T> +  typename array<T>::iterator array<T>::end() +  { +    return {*this, size()}; +  } +  template <class T> +  typename array<T>::const_iterator array<T>::end() const +  { +    return {*this, size()}; +  } + +  // comparison +  template <class T> +  bool array<T>::operator<(array<T> const &other) const +  { +    return std::lexicographical_compare(begin(), end(), other.begin(), +                                        other.end()); +  } +  template <class T> +  bool array<T>::operator>(array<T> const &other) const +  { +    return std::lexicographical_compare(other.begin(), other.end(), begin(), +                                        end()); +  } +  template <class T> +  bool array<T>::operator<=(array<T> const &other) const +  { +    return !(*this > other); +  } +  template <class T> +  bool array<T>::operator>=(array<T> const &other) const +  { +    return !(*this < other); +  } + +// element access +#ifdef USE_XSIMD +  template <class T> +  template <class vectorizer> +  typename array<T>::simd_iterator array<T>::vbegin(vectorizer) const +  { +    return {_data->data()}; +  } + +  template <class T> +  template <class vectorizer> +  typename array<T>::simd_iterator array<T>::vend(vectorizer) const +  { +    using vector_type = typename xsimd::batch<dtype>; +    static const std::size_t vector_size = vector_type::size; +    return {_data->data() + long(size() / vector_size * vector_size)}; +  } + +#endif +  template <class T> +  typename array<T>::reference array<T>::fast(long n) +  { +    return (*_data)[n]; +  } +  template <class T> +  typename array<T>::reference array<T>::operator[](long n) +  { +    if (n < 0) +      n += size(); +    assert(0 <= n && n < size()); +    return fast(n); +  } +  template <class T> +  typename array<T>::const_reference array<T>::fast(long n) const +  { +    assert(n < size()); +    return (*_data)[n]; +  } +  template <class T> +  typename array<T>::const_reference array<T>::operator[](long n) const +  { +    if (n < 0) +      n += size(); +    assert(0 <= n && n < size()); +    return fast(n); +  } + +  template <class T> +  template <class Sp> +  typename std::enable_if<is_slice<Sp>::value, sliced_array<T, Sp>>::type +  array<T>::operator[](Sp const &s) const +  { +    return {*this, s}; +  } + +  // modifiers +  template <class T> +  template <class Tp> +  void array<T>::push_back(Tp &&x) +  { +    // FIXME: clang-3.4 doesn't support emplace_back for vector of bool +    _data->push_back(std::forward<Tp>(x)); +  } +  template <class T> +  template <class Tp> +  void array<T>::insert(long i, Tp &&x) +  { +    if (i == size()) +      _data->emplace_back(std::forward<Tp>(x)); +    else +      _data->insert(_data->begin() + i, std::forward<Tp>(x)); +  } +  template <class T> +  void array<T>::reserve(size_t n) +  { +    if (n > _data->capacity()) +      _data->reserve((n / 2) * 3); +  } +  template <class T> +  void array<T>::resize(size_t n) +  { +    _data->resize(n); +  } +  template <class T> +  void array<T>::erase(size_t n) +  { +    _data->erase(_data->begin() + n); +  } +  template <class T> +  T array<T>::pop(long x) +  { +    long sz = size(); +    x = x % sz; +    if (x < 0) +      x += sz; +    T res = fast(x); +    erase(x); +    return res; +  } +  template <class T> +  void array<T>::clear() +  { +    _data->clear(); +  } + +  // TODO: have to raise a valueError +  template <class T> +  none_type array<T>::remove(T const &x) +  { +    erase(index(x)); +    return {}; +  } + +  // Misc +  template <class T> +  long array<T>::index(T const &x) const +  { +    return std::find(begin(), end(), x) - begin(); +  } + +  // array interface +  template <class T> +  array<T>::operator bool() const +  { +    return !_data->empty(); +  } + +  template <class T> +  template <class F> +  array<typename __combined<T, F>::type> +  array<T>::operator+(array<F> const &s) const +  { +    array<typename __combined<T, F>::type> clone(size() + s.size()); +    std::copy(s.begin(), s.end(), std::copy(begin(), end(), clone.begin())); +    return clone; +  } + +  template <class T> +  template <class F, class S> +  array<decltype(std::declval<T>() + +                 std::declval<typename sliced_array<F, S>::value_type>())> +  array<T>::operator+(sliced_array<F, S> const &s) const +  { +    array<decltype(std::declval<T>() + +                   std::declval<typename sliced_array<F, S>::value_type>())> +        clone(size() + len(s)); +    std::copy(s.begin(), s.end(), std::copy(begin(), end(), clone.begin())); +    return clone; +  } + +  template <class T> +  array<T> array<T>::operator*(long n) const +  { +    if (size() == 1) { +      return array<T>(fast(0), single_value{}, n); +    } else { +      array<T> r(size() * n); +      auto start = r.begin(); +      while (start != r.end()) +        start = std::copy(this->begin(), this->end(), start); +      return r; +    } +  } +  template <class T> +  array<T> const &array<T>::operator*=(long n) +  { +    if (size() == 1) { +      resize(n); +      std::fill(begin() + 1, end(), fast(0)); +    } else { +      auto const initial_size = size(); +      resize(n * initial_size); +      // FIXME: could use less calls to std::copy +      auto tgt = begin() + initial_size; +      for (long i = 1; i < n; ++i) +        tgt = std::copy(begin(), begin() + initial_size, tgt); +    } +    return *this; +  } + +  template <class T> +  template <class F> +  array<T> &array<T>::operator+=(F const &s) +  { +    reserve(size() + s.size()); +    std::copy(s.begin(), s.end(), std::back_inserter(*this)); +    return *this; +  } + +  template <class T> +  long array<T>::size() const +  { +    return _data->size(); +  } +  template <class T> +  template <class E> +  long array<T>::_flat_size(E const &e, utils::int_<1>) const +  { +    return std::distance(e.begin(), e.end()); +  } +  template <class T> +  template <class E, size_t L> +  long array<T>::_flat_size(E const &e, utils::int_<L>) const +  { +    return std::distance(e.begin(), e.end()) * +           _flat_size(e[0], utils::int_<L - 1>{}); +  } +  template <class T> +  long array<T>::flat_size() const +  { +    return _flat_size(*this, utils::int_<value>{}); +  } + +  template <class T> +  template <class V> +  bool array<T>::contains(V const &v) const +  { +    return std::find(_data->begin(), _data->end(), v) != _data->end(); +  } +  template <class T> +  intptr_t array<T>::id() const +  { +    return reinterpret_cast<intptr_t>(&(*_data)); +  } + +  template <class T> +  long array<T>::count(T const &x) const +  { +    return std::count(begin(), end(), x); +  } + +} // namespace types + +namespace utils +{ + +  template <class T, class From> +  void reserve(types::array<T> &l, From const &f, +               typename From::const_iterator *) +  { +    l.reserve(builtins::len(f)); +  } +} // namespace utils +PYTHONIC_NS_END + +/* overload std::get */ +namespace std +{ +  template <size_t I, class T> +  typename pythonic::types::array<T>::reference +  get(pythonic::types::array<T> &t) +  { +    return t[I]; +  } + +  template <size_t I, class T> +  typename pythonic::types::array<T>::const_reference +  get(pythonic::types::array<T> const &t) +  { +    return t[I]; +  } + +  template <size_t I, class T> +  typename pythonic::types::array<T>::value_type +  get(pythonic::types::array<T> &&t) +  { +    return std::move(t)[I]; +  } + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::reference +  get(pythonic::types::sliced_array<T, S> &t) +  { +    return t[I]; +  } + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::const_reference +  get(pythonic::types::sliced_array<T, S> const &t) +  { +    return t[I]; +  } + +  template <size_t I, class T, class S> +  typename pythonic::types::sliced_array<T, S>::value_type +  get(pythonic::types::sliced_array<T, S> &&t) +  { +    return std::move(t)[I]; +  } +} // namespace std + +#ifdef ENABLE_PYTHON_MODULE + +PYTHONIC_NS_BEGIN + +template <class T> +PyObject *to_python<types::array<T>>::convert(types::array<T> const &v) +{ +  throw types::NotImplementedError( +      "Pythran cannot efficiently convert array::array values"); +} +template <class T, class S> +PyObject *to_python<types::sliced_array<T, S>>::convert( +    types::sliced_array<T, S> const &v) +{ +  throw types::NotImplementedError( +      "Pythran cannot efficiently convert array::array values"); +} + +PYTHONIC_NS_END + +#endif + +#endif diff --git a/contrib/python/pythran/pythran/pythonic/types/bool.hpp b/contrib/python/pythran/pythran/pythonic/types/bool.hpp index 21456be4109..35ac01d37d9 100644 --- a/contrib/python/pythran/pythran/pythonic/types/bool.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/bool.hpp @@ -18,13 +18,17 @@ inline PyObject *to_python<bool>::convert(bool b)  inline bool from_python<bool>::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<bool>::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/contrib/python/pythran/pythran/pythonic/types/cfun.hpp b/contrib/python/pythran/pythran/pythonic/types/cfun.hpp index f5b355a258a..058f7080ed7 100644 --- a/contrib/python/pythran/pythran/pythonic/types/cfun.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/cfun.hpp @@ -8,8 +8,7 @@ PYTHONIC_NS_BEGIN  namespace types  {    template <class ReturnType, class... ArgsType> -  cfun<ReturnType(ArgsType...)>::cfun(ReturnType (*fun)(ArgsType...)) -      : ptr(fun) +  cfun<ReturnType(ArgsType...)>::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/contrib/python/pythran/pythran/pythonic/types/dynamic_tuple.hpp b/contrib/python/pythran/pythran/pythonic/types/dynamic_tuple.hpp index e20f08c03f6..9e516b43f07 100644 --- a/contrib/python/pythran/pythran/pythonic/types/dynamic_tuple.hpp +++ b/contrib/python/pythran/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 <algorithm>  #include <functional> @@ -86,22 +86,22 @@ namespace types    }    template <typename T> -  dynamic_tuple<T> dynamic_tuple<T>:: -  operator+(dynamic_tuple<T> const &other) const +  dynamic_tuple<T> +  dynamic_tuple<T>::operator+(dynamic_tuple<T> const &other) const    {      dynamic_tuple<T> 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 <class T> -  size_t hash<pythonic::types::dynamic_tuple<T>>:: -  operator()(pythonic::types::dynamic_tuple<T> const &l) const +  size_t hash<pythonic::types::dynamic_tuple<T>>::operator()( +      pythonic::types::dynamic_tuple<T> const &l) const    {      std::hash<T> 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/contrib/python/pythran/pythran/pythonic/types/file.hpp b/contrib/python/pythran/pythran/pythonic/types/file.hpp index 04c72d46038..70c9bf2954d 100644 --- a/contrib/python/pythran/pythran/pythonic/types/file.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/file.hpp @@ -173,6 +173,14 @@ namespace types      return res;    } +  template <class T> +  inline void file::read_as(long n, T *buffer) +  { +    if (fread(buffer, sizeof(T), n, **data) < size_t(n)) { +      throw EOFError("read() didn't return enough bytes"); +    } +  } +    inline types::str file::readline(long size)    {      if (!is_open) @@ -266,7 +274,7 @@ namespace types    inline file_iterator::file_iterator()        : f(nullptr), set(false), curr(), -        position(std::numeric_limits<long>::max()){}; +        position(std::numeric_limits<long>::max()) {};    inline bool file_iterator::operator==(file_iterator const &f2) const    { diff --git a/contrib/python/pythran/pythran/pythonic/types/finfo.hpp b/contrib/python/pythran/pythran/pythonic/types/finfo.hpp index e3c3d7d2785..348d3299bec 100644 --- a/contrib/python/pythran/pythran/pythonic/types/finfo.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/finfo.hpp @@ -22,7 +22,7 @@ namespace types    {      return std::numeric_limits<T>::epsilon();    } -} +} // namespace types  PYTHONIC_NS_END  /* pythran attribute system { */ @@ -30,12 +30,12 @@ PYTHONIC_NS_BEGIN  namespace builtins  {    template <class T> -  auto getattr(types::attr::EPS, pythonic::types::finfo<T> const &f) -      -> decltype(f.eps()) +  auto getattr(types::attr::EPS, +               pythonic::types::finfo<T> const &f) -> decltype(f.eps())    {      return f.eps();    } -} +} // namespace builtins  PYTHONIC_NS_END  /* } */  #endif diff --git a/contrib/python/pythran/pythran/pythonic/types/generator.hpp b/contrib/python/pythran/pythran/pythonic/types/generator.hpp index 19f8efb53e6..4a3ef67e749 100644 --- a/contrib/python/pythran/pythran/pythonic/types/generator.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/generator.hpp @@ -11,8 +11,7 @@ PYTHONIC_NS_BEGIN  namespace types  {    template <class T> -  generator_iterator<T>::generator_iterator() -      : the_generator() +  generator_iterator<T>::generator_iterator() : the_generator()    {      the_generator.__generator_state = -1;    } // this represents the end @@ -41,8 +40,8 @@ namespace types    }    template <class T> -  bool generator_iterator<T>:: -  operator!=(generator_iterator<T> const &other) const +  bool +  generator_iterator<T>::operator!=(generator_iterator<T> const &other) const    {      assert(other.the_generator.__generator_state == -1 ||             the_generator.__generator_state == -1); @@ -51,8 +50,8 @@ namespace types    }    template <class T> -  bool generator_iterator<T>:: -  operator==(generator_iterator<T> const &other) const +  bool +  generator_iterator<T>::operator==(generator_iterator<T> const &other) const    {      assert(other.the_generator.__generator_state == -1 ||             the_generator.__generator_state == -1); @@ -61,15 +60,15 @@ namespace types    }    template <class T> -  bool generator_iterator<T>:: -  operator<(generator_iterator<T> const &other) const +  bool +  generator_iterator<T>::operator<(generator_iterator<T> 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/contrib/python/pythran/pythran/pythonic/types/list.hpp b/contrib/python/pythran/pythran/pythonic/types/list.hpp index 7f1de3c4990..9c346b07059 100644 --- a/contrib/python/pythran/pythran/pythonic/types/list.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/list.hpp @@ -261,7 +261,7 @@ namespace types              std::random_access_iterator_tag>::value)        _data->reserve(std::distance(start, stop));      else -      _data->reserve(DEFAULT_LIST_CAPACITY); +      _data->reserve(DEFAULT_CAPACITY);      std::copy(start, stop, std::back_inserter(*_data));    }    template <class T> diff --git a/contrib/python/pythran/pythran/pythonic/types/ndarray.hpp b/contrib/python/pythran/pythran/pythonic/types/ndarray.hpp index 191933ccd61..d3fecbed70d 100644 --- a/contrib/python/pythran/pythran/pythonic/types/ndarray.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/ndarray.hpp @@ -73,10 +73,10 @@ PYTHONIC_NS_BEGIN  namespace types  {    template <class pS, size_t... Is> -  array<long, std::tuple_size<pS>::value> +  array_tuple<long, std::tuple_size<pS>::value>    make_strides(pS const &shape, utils::index_sequence<Is...>)    { -    array<long, std::tuple_size<pS>::value> out; +    array_tuple<long, std::tuple_size<pS>::value> out;      out[std::tuple_size<pS>::value - 1] = 1;      (void)std::initializer_list<long>{          (out[std::tuple_size<pS>::value - Is - 2] = @@ -86,7 +86,7 @@ namespace types    }    template <class pS> -  array<long, std::tuple_size<pS>::value> make_strides(pS const &shape) +  array_tuple<long, std::tuple_size<pS>::value> make_strides(pS const &shape)    {      return make_strides(          shape, utils::make_index_sequence<std::tuple_size<pS>::value - 1>()); @@ -226,24 +226,24 @@ namespace types    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>>>::iterator -  type_helper<ndarray<T, array<pS, 1>>>::make_iterator( -      ndarray<T, array<pS, 1>> &n, long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>>>::iterator +  type_helper<ndarray<T, array_tuple<pS, 1>>>::make_iterator( +      ndarray<T, array_tuple<pS, 1>> &n, long i)    {      return n.buffer + i;    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>>>::const_iterator -  type_helper<ndarray<T, array<pS, 1>>>::make_iterator( -      ndarray<T, array<pS, 1>> const &n, long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>>>::const_iterator +  type_helper<ndarray<T, array_tuple<pS, 1>>>::make_iterator( +      ndarray<T, array_tuple<pS, 1>> const &n, long i)    {      return n.buffer + i;    }    template <class T, class pS>    template <class S, class Iter> -  T *type_helper<ndarray<T, array<pS, 1>>>::initialize_from_iterable( +  T *type_helper<ndarray<T, array_tuple<pS, 1>>>::initialize_from_iterable(        S &shape, T *from, Iter &&iter)    {      sutils::assign(std::get<std::tuple_size<S>::value - 1>(shape), iter.size()); @@ -251,41 +251,41 @@ namespace types    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>>>::type -  type_helper<ndarray<T, array<pS, 1>>>::get(ndarray<T, array<pS, 1>> &&self, -                                             long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>>>::type +  type_helper<ndarray<T, array_tuple<pS, 1>>>::get( +      ndarray<T, array_tuple<pS, 1>> &&self, long i)    {      return self.buffer[i];    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>> const &>::iterator -  type_helper<ndarray<T, array<pS, 1>> const &>::make_iterator( -      ndarray<T, array<pS, 1>> &n, long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>> const &>::iterator +  type_helper<ndarray<T, array_tuple<pS, 1>> const &>::make_iterator( +      ndarray<T, array_tuple<pS, 1>> &n, long i)    {      return n.buffer + i;    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>> const &>::const_iterator -  make_iterator(ndarray<T, array<pS, 1>> const &n, long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>> const &>::const_iterator +  make_iterator(ndarray<T, array_tuple<pS, 1>> const &n, long i)    {      return n.buffer + i;    }    template <class T, class pS>    template <class S, class Iter> -  T *type_helper<ndarray<T, array<pS, 1>> const &>::initialize_from_iterable( -      S &shape, T *from, Iter &&iter) +  T *type_helper<ndarray<T, array_tuple<pS, 1>> const &>:: +      initialize_from_iterable(S &shape, T *from, Iter &&iter)    {      sutils::assign(std::get<std::tuple_size<S>::value - 1>(shape), iter.size());      return std::copy(iter.begin(), iter.end(), from);    }    template <class T, class pS> -  typename type_helper<ndarray<T, array<pS, 1>> const &>::type & -  type_helper<ndarray<T, array<pS, 1>> const &>::get( -      ndarray<T, array<pS, 1>> const &self, long i) +  typename type_helper<ndarray<T, array_tuple<pS, 1>> const &>::type & +  type_helper<ndarray<T, array_tuple<pS, 1>> const &>::get( +      ndarray<T, array_tuple<pS, 1>> const &self, long i)    {      return self.buffer[i];    } @@ -303,7 +303,7 @@ namespace types    template <size_t L>    template <class S, class Ty, size_t M>    long noffset<L>::operator()(S const &strides, -                              array<Ty, M> const &indices) const +                              array_tuple<Ty, M> const &indices) const    {      auto index = patch_index(          indices[M - L], @@ -315,7 +315,8 @@ namespace types    template <size_t L>    template <class S, class Ty, size_t M, class pS> -  long noffset<L>::operator()(S const &strides, array<Ty, M> const &indices, +  long noffset<L>::operator()(S const &strides, +                              array_tuple<Ty, M> const &indices,                                pS const &shape) const    {      auto index = patch_index( @@ -332,7 +333,7 @@ namespace types    template <>    template <class S, class Ty, size_t M>    long noffset<1>::operator()(S const &strides, -                              array<Ty, M> const &indices) const +                              array_tuple<Ty, M> const &indices) const    {      auto index = patch_index(          indices[M - 1], @@ -342,7 +343,8 @@ namespace types    template <>    template <class S, class Ty, size_t M, class pS> -  long noffset<1>::operator()(S const &strides, array<Ty, M> const &indices, +  long noffset<1>::operator()(S const &strides, +                              array_tuple<Ty, M> const &indices,                                pS const &shape) const    {      auto index = patch_index( @@ -603,7 +605,7 @@ namespace types    template <class T, class pS>    template <class Ty>    typename std::enable_if<std::is_integral<Ty>::value, T &>::type -  ndarray<T, pS>::fast(array<Ty, value> const &indices) +  ndarray<T, pS>::fast(array_tuple<Ty, value> const &indices)    {      assert(inbound_indices(indices));      return *(buffer + noffset<std::tuple_size<pS>::value>{}(*this, indices)); @@ -612,7 +614,7 @@ namespace types    template <class T, class pS>    template <class Ty>    typename std::enable_if<std::is_integral<Ty>::value, T>::type -  ndarray<T, pS>::fast(array<Ty, value> const &indices) const +  ndarray<T, pS>::fast(array_tuple<Ty, value> const &indices) const    {      assert(inbound_indices(indices));      return *(buffer + noffset<std::tuple_size<pS>::value>{}(*this, indices)); @@ -620,7 +622,7 @@ namespace types    template <class T, class pS>    template <class Ty, size_t M> -  auto ndarray<T, pS>::fast(array<Ty, M> const &indices) const & -> +  auto ndarray<T, pS>::fast(array_tuple<Ty, M> const &indices) const & ->        typename std::enable_if<std::is_integral<Ty>::value,                                decltype(nget<M - 1>().fast(*this,                                                            indices))>::type @@ -630,7 +632,7 @@ namespace types    template <class T, class pS>    template <class Ty, size_t M> -  auto ndarray<T, pS>::fast(array<Ty, M> const &indices) && -> +  auto ndarray<T, pS>::fast(array_tuple<Ty, M> const &indices) && ->        typename std::enable_if<std::is_integral<Ty>::value,                                decltype(nget<M - 1>().fast(std::move(*this),                                                            indices))>::type @@ -641,7 +643,7 @@ namespace types    template <class T, class pS>    template <class Ty>    typename std::enable_if<std::is_integral<Ty>::value, T const &>::type -  ndarray<T, pS>::operator[](array<Ty, value> const &indices) const +  ndarray<T, pS>::operator[](array_tuple<Ty, value> const &indices) const    {      return *(buffer +               noffset<std::tuple_size<pS>::value>{}(*this, indices, _shape)); @@ -650,7 +652,7 @@ namespace types    template <class T, class pS>    template <class Ty>    typename std::enable_if<std::is_integral<Ty>::value, T &>::type -  ndarray<T, pS>::operator[](array<Ty, value> const &indices) +  ndarray<T, pS>::operator[](array_tuple<Ty, value> const &indices)    {      return *(buffer +               noffset<std::tuple_size<pS>::value>{}(*this, indices, _shape)); @@ -658,7 +660,7 @@ namespace types    template <class T, class pS>    template <class Ty, size_t M> -  auto ndarray<T, pS>::operator[](array<Ty, M> const &indices) const & -> +  auto ndarray<T, pS>::operator[](array_tuple<Ty, M> const &indices) const & ->        typename std::enable_if<std::is_integral<Ty>::value,                                decltype(nget<M - 1>()(*this, indices))>::type    { @@ -667,7 +669,7 @@ namespace types    template <class T, class pS>    template <class Ty, size_t M> -  auto ndarray<T, pS>::operator[](array<Ty, M> const &indices) && -> +  auto ndarray<T, pS>::operator[](array_tuple<Ty, M> const &indices) && ->        typename std::enable_if<std::is_integral<Ty>::value,                                decltype(nget<M - 1>()(std::move(*this),                                                       indices))>::type @@ -755,7 +757,7 @@ namespace types    template <class S0, class... S>    auto ndarray<T, pS>::operator()(S0 const &s0, S const &...s)        && -> decltype(extended_slice<count_new_axis<S0, S...>::value>{}( -          std::move(*this), s0, s...)) +             std::move(*this), s0, s...))    {      return extended_slice<count_new_axis<S0, S...>::value>{}(std::move(*this),                                                               s0, s...); @@ -844,9 +846,9 @@ namespace types    template <class T, class pS>    template <class Ty0, class Ty1, class... Tys, class _> -  auto -  ndarray<T, pS>::operator[](std::tuple<Ty0, Ty1, Tys...> const &indices) const -      -> typename std::enable_if< +  auto ndarray<T, pS>::operator[]( +      std::tuple<Ty0, Ty1, Tys...> const &indices) const -> +      typename std::enable_if<            is_numexpr_arg<Ty0>::value,            decltype(this->_fwdindex(                indices, utils::make_index_sequence<2 + sizeof...(Tys)>()))>::type @@ -1068,10 +1070,11 @@ namespace std  {    template <size_t I, class E> -  auto get(E &&a) -> typename std::enable_if< -      pythonic::types::is_array<typename std::remove_cv< -          typename std::remove_reference<E>::type>::type>::value, -      decltype(std::forward<E>(a)[I])>::type +  auto get(E &&a) -> +      typename std::enable_if< +          pythonic::types::is_array<typename std::remove_cv< +              typename std::remove_reference<E>::type>::type>::value, +          decltype(std::forward<E>(a)[I])>::type    {      return std::forward<E>(a)[I];    } @@ -1095,9 +1098,8 @@ namespace builtins      }      template <class E, class... S> -    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<E::value>{}(              types::ndarray<typename types::is_complex<typename E::dtype>::type, -                           types::array<long, E::value>>{}, +                           types::array_tuple<long, E::value>>{},              types::slice()))      {        using stype = typename types::is_complex<typename E::dtype>::type; @@ -1122,7 +1124,7 @@ namespace builtins        auto translated_mem =            reinterpret_cast<utils::shared_ref<types::raw_array<stype>> const &>(                a.mem); -      types::ndarray<stype, types::array<long, E::value>> translated{ +      types::ndarray<stype, types::array_tuple<long, E::value>> translated{            translated_mem, new_shape};        return _build_gexpr<E::value>{}(            translated, types::slice{0, std::get<E::value - 1>(new_shape), 2}); @@ -1144,19 +1146,22 @@ namespace builtins      template <class E>      auto _make_real(types::numpy_iexpr<E> const &a, utils::int_<1>)          -> decltype(_build_gexpr<types::numpy_iexpr<E>::value>{}( -            std::declval<types::ndarray<typename types::is_complex<typename types::numpy_iexpr<E>::dtype>::type, -                           types::array<long, types::numpy_iexpr<E>::value + 1>>>(), +            std::declval<types::ndarray< +                typename types::is_complex< +                    typename types::numpy_iexpr<E>::dtype>::type, +                types::array_tuple<long, types::numpy_iexpr<E>::value + 1>>>(),              long(), types::slice()))      {        constexpr size_t value = types::numpy_iexpr<E>::value; -      using stype = typename types::is_complex<typename types::numpy_iexpr<E>::dtype>::type; +      using stype = typename types::is_complex< +          typename types::numpy_iexpr<E>::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<utils::shared_ref<types::raw_array<stype>> const &>(                a.arg.mem); -      types::ndarray<stype, types::array<long, value + 1>> translated{ +      types::ndarray<stype, types::array_tuple<long, value + 1>> translated{            translated_mem, new_shape};        long offset = (a.buffer - a.arg.buffer) / a.arg.template strides<0>();        return _build_gexpr<value>{}( @@ -1188,19 +1193,22 @@ namespace builtins      template <class E>      auto _make_imag(types::numpy_iexpr<E> const &a, utils::int_<1>)          -> decltype(_build_gexpr<types::numpy_iexpr<E>::value>{}( -            std::declval<types::ndarray<typename types::is_complex<typename types::numpy_iexpr<E>::dtype>::type, -                           types::array<long, types::numpy_iexpr<E>::value + 1>>>(), +            std::declval<types::ndarray< +                typename types::is_complex< +                    typename types::numpy_iexpr<E>::dtype>::type, +                types::array_tuple<long, types::numpy_iexpr<E>::value + 1>>>(),              long(), types::slice()))      {        constexpr size_t value = types::numpy_iexpr<E>::value; -      using stype = typename types::is_complex<typename types::numpy_iexpr<E>::dtype>::type; +      using stype = typename types::is_complex< +          typename types::numpy_iexpr<E>::dtype>::type;        auto new_shape = sutils::getshape(a.arg);        std::get<types::numpy_iexpr<E>::value>(new_shape) *= 2;        // this is tricky and dangerous!        auto translated_mem =            reinterpret_cast<utils::shared_ref<types::raw_array<stype>> const &>(                a.arg.mem); -      types::ndarray<stype, types::array<long, value + 1>> translated{ +      types::ndarray<stype, types::array_tuple<long, value + 1>> translated{            translated_mem, new_shape};        long offset = (a.buffer - a.arg.buffer) / a.arg.template strides<0>();        return _build_gexpr<value>{}( @@ -1211,7 +1219,7 @@ namespace builtins      auto _make_imag(E const &a, utils::int_<1>)          -> decltype(_build_gexpr<E::value>{}(              types::ndarray<typename types::is_complex<typename E::dtype>::type, -                           types::array<long, E::value>>{}, +                           types::array_tuple<long, E::value>>{},              types::slice()))      {        using stype = typename types::is_complex<typename E::dtype>::type; @@ -1221,7 +1229,7 @@ namespace builtins        auto translated_mem =            reinterpret_cast<utils::shared_ref<types::raw_array<stype>> const &>(                a.mem); -      types::ndarray<stype, types::array<long, E::value>> translated{ +      types::ndarray<stype, types::array_tuple<long, E::value>> translated{            translated_mem, new_shape};        return _build_gexpr<E::value>{}(            translated, types::slice{1, std::get<E::value - 1>(new_shape), 2}); @@ -1229,7 +1237,7 @@ namespace builtins    } // namespace details    template <class E> -  types::array<long, E::value> getattr(types::attr::SHAPE, E const &a) +  types::array_tuple<long, E::value> getattr(types::attr::SHAPE, E const &a)    {      return sutils::getshape(a);    } @@ -1247,9 +1255,9 @@ namespace builtins    }    template <class E> -  types::array<long, E::value> getattr(types::attr::STRIDES, E const &a) +  types::array_tuple<long, E::value> getattr(types::attr::STRIDES, E const &a)    { -    types::array<long, E::value> strides; +    types::array_tuple<long, E::value> 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<E>::dtype>::value>{}))    {      return details::_make_real( -        e, utils::int_<types::is_complex< -               typename types::numpy_iexpr<E>::dtype>::value>{}); +        e, +        utils::int_< +            types::is_complex<typename types::numpy_iexpr<E>::dtype>::value>{});    }    template <class Op, class... Args> @@ -1554,7 +1563,7 @@ namespace impl    template <class pS, class T, size_t... Is>    bool check_shape(T const *dims, utils::index_sequence<Is...>)    { -    types::array<bool, sizeof...(Is)> dims_match = { +    types::array_tuple<bool, sizeof...(Is)> dims_match = {          (is_integral_constant<typename std::tuple_element<Is, pS>::type>::value               ? (dims[Is] ==                  std::conditional< diff --git a/contrib/python/pythran/pythran/pythonic/types/nditerator.hpp b/contrib/python/pythran/pythran/pythonic/types/nditerator.hpp index e809776c0ee..2cb2b904798 100644 --- a/contrib/python/pythran/pythran/pythonic/types/nditerator.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/nditerator.hpp @@ -13,8 +13,7 @@ namespace types    /* Iterator over whatever provides a fast(long) method to access its element     */    template <class E> -  nditerator<E>::nditerator(E &data, long index) -      : data(data), index(index) +  nditerator<E>::nditerator(E &data, long index) : data(data), index(index)    {    } @@ -190,8 +189,8 @@ namespace types    }    template <class E> -  const_nditerator<E> &const_nditerator<E>:: -  operator=(const_nditerator const &other) +  const_nditerator<E> & +  const_nditerator<E>::operator=(const_nditerator const &other)    {      index = other.index;      return *this; @@ -245,36 +244,36 @@ namespace types    }    template <class E> -  long const_simd_nditerator<E>:: -  operator-(const_simd_nditerator<E> const &other) const +  long const_simd_nditerator<E>::operator-( +      const_simd_nditerator<E> const &other) const    {      return (data - other.data) / vector_size;    }    template <class E> -  bool const_simd_nditerator<E>:: -  operator!=(const_simd_nditerator<E> const &other) const +  bool const_simd_nditerator<E>::operator!=( +      const_simd_nditerator<E> const &other) const    {      return data != other.data;    }    template <class E> -  bool const_simd_nditerator<E>:: -  operator==(const_simd_nditerator<E> const &other) const +  bool const_simd_nditerator<E>::operator==( +      const_simd_nditerator<E> const &other) const    {      return data == other.data;    }    template <class E> -  bool const_simd_nditerator<E>:: -  operator<(const_simd_nditerator<E> const &other) const +  bool const_simd_nditerator<E>::operator<( +      const_simd_nditerator<E> const &other) const    {      return data < other.data;    }    template <class E> -  const_simd_nditerator<E> &const_simd_nditerator<E>:: -  operator=(const_simd_nditerator const &other) +  const_simd_nditerator<E> & +  const_simd_nditerator<E>::operator=(const_simd_nditerator const &other)    {      data = other.data;      return *this; @@ -305,12 +304,12 @@ namespace types    }    template <class T> -  typename T::dtype const *make_const_nditerator<false>:: -  operator()(T const &self, long i) const +  typename T::dtype const * +  make_const_nditerator<false>::operator()(T const &self, long i) const    {      return self.buffer + i;    } -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_broadcast.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_broadcast.hpp index 31b1cd8be0f..6f63445a095 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_broadcast.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_broadcast.hpp @@ -97,7 +97,7 @@ namespace types    template <class T, class B>    template <size_t N>    typename broadcast<T, B>::dtype -  broadcast<T, B>::operator[](array<long, N>) const +  broadcast<T, B>::operator[](array_tuple<long, N>) const    {      return _base._value;    } diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_expr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_expr.hpp index 9f139ffe085..20331cd9a9c 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_expr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_expr.hpp @@ -205,17 +205,17 @@ namespace types    template <class... Indices>    auto numpy_expr<Op, Args...>::map_fast(Indices... indices) const        -> decltype(this->_map_fast( -          array<long, sizeof...(Indices)>{{indices...}}, +          array_tuple<long, sizeof...(Indices)>{{indices...}},            utils::make_index_sequence<sizeof...(Args)>{}))    {      static_assert(sizeof...(Indices) == sizeof...(Args), "compatible call"); -    return _map_fast(array<long, sizeof...(Indices)>{{indices...}}, +    return _map_fast(array_tuple<long, sizeof...(Indices)>{{indices...}},                       utils::make_index_sequence<sizeof...(Args)>{});    }    template <class Op, class... Args> -  auto numpy_expr<Op, Args...>::operator[](long i) const -      -> decltype(this->fast(i)) +  auto +  numpy_expr<Op, Args...>::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<long, value> first = {0}; +    array_tuple<long, value> first = {0};      return operator[](first);    } diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_gexpr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_gexpr.hpp index 88afc93f7f2..f5b61fdf4af 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_gexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_gexpr.hpp @@ -472,6 +472,13 @@ namespace types                            numpy_gexpr<Arg, S...> &>::type    numpy_gexpr<Arg, S...>::_copy(E const &expr)    { +    return _copy_restrict(expr); +  } + +  template <class Arg, class... S> +  template <class E> +  numpy_gexpr<Arg, S...> &numpy_gexpr<Arg, S...>::_copy_restrict(E const &expr) +  {      constexpr bool vectorize =          is_vectorizable &&          std::is_same<dtype, typename dtype_of<E>::type>::value && @@ -727,8 +734,8 @@ namespace types  #endif    template <class Arg, class... S> -  auto numpy_gexpr<Arg, S...>::operator[](long i) const -      -> decltype(this->fast(i)) +  auto +  numpy_gexpr<Arg, S...>::operator[](long i) const -> decltype(this->fast(i))    {      if (i < 0)        i += std::get<0>(_shape); @@ -762,7 +769,7 @@ namespace types    template <class Arg, class... S>    template <size_t M> -  auto numpy_gexpr<Arg, S...>::fast(array<long, M> const &indices) +  auto numpy_gexpr<Arg, S...>::fast(array_tuple<long, M> const &indices)        const & -> decltype(nget<M - 1>().fast(*this, indices))    {      return nget<M - 1>().fast(*this, indices); @@ -770,7 +777,7 @@ namespace types    template <class Arg, class... S>    template <size_t M> -  auto numpy_gexpr<Arg, S...>::fast(array<long, M> const &indices) +  auto numpy_gexpr<Arg, S...>::fast(array_tuple<long, M> const &indices)        && -> decltype(nget<M - 1>().fast(std::move(*this), indices))    {      return nget<M - 1>().fast(std::move(*this), indices); @@ -778,7 +785,7 @@ namespace types    template <class Arg, class... S>    template <size_t M> -  auto numpy_gexpr<Arg, S...>::operator[](array<long, M> const &indices) +  auto numpy_gexpr<Arg, S...>::operator[](array_tuple<long, M> const &indices)        const & -> decltype(nget<M - 1>()(*this, indices))    {      return nget<M - 1>()(*this, indices); @@ -786,7 +793,7 @@ namespace types    template <class Arg, class... S>    template <size_t M> -  auto numpy_gexpr<Arg, S...>::operator[](array<long, M> const &indices) +  auto numpy_gexpr<Arg, S...>::operator[](array_tuple<long, M> const &indices)        && -> decltype(nget<M - 1>()(std::move(*this), indices))    {      return nget<M - 1>()(std::move(*this), indices); diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_iexpr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_iexpr.hpp index 7489974e8de..d4faef64896 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_iexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_iexpr.hpp @@ -283,7 +283,7 @@ namespace types    template <class Arg>    typename numpy_iexpr<Arg>::dtype const & -  numpy_iexpr<Arg>::fast(array<long, value> const &indices) const +  numpy_iexpr<Arg>::fast(array_tuple<long, value> const &indices) const    {      return buffer[compute_fast_offset(          indices[value - 1], arg.template shape<value>(), indices, arg, @@ -292,7 +292,7 @@ namespace types    template <class Arg>    typename numpy_iexpr<Arg>::dtype & -  numpy_iexpr<Arg>::fast(array<long, value> const &indices) +  numpy_iexpr<Arg>::fast(array_tuple<long, value> const &indices)    {      return const_cast<dtype &>(          const_cast<numpy_iexpr const &>(*this).fast(indices)); @@ -413,7 +413,7 @@ namespace types    template <class Arg>    typename numpy_iexpr<Arg>::dtype const & -  numpy_iexpr<Arg>::operator[](array<long, value> const &indices) const +  numpy_iexpr<Arg>::operator[](array_tuple<long, value> const &indices) const    {      return buffer[compute_offset(indices[value - 1] < 0                                       ? indices[value - 1] + @@ -425,7 +425,7 @@ namespace types    template <class Arg>    typename numpy_iexpr<Arg>::dtype & -  numpy_iexpr<Arg>::operator[](array<long, value> const &indices) +  numpy_iexpr<Arg>::operator[](array_tuple<long, value> const &indices)    {      return const_cast<dtype &>(const_cast<numpy_iexpr const &>(*this)[indices]);    } diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_nary_expr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_nary_expr.hpp index 6a8724b35f4..66644875fc4 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_nary_expr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_nary_expr.hpp @@ -18,10 +18,11 @@ namespace functor  {    template <typename... T> -  auto NUMPY_NARY_FUNC_NAME:: -  operator()(T &&... args) const -> typename std::enable_if< -      !types::valid_numexpr_parameters<typename std::decay<T>::type...>::value, -      decltype(NUMPY_NARY_FUNC_SYM(std::forward<T>(args)...))>::type +  auto NUMPY_NARY_FUNC_NAME::operator()(T &&...args) const -> +      typename std::enable_if< +          !types::valid_numexpr_parameters< +              typename std::decay<T>::type...>::value, +          decltype(NUMPY_NARY_FUNC_SYM(std::forward<T>(args)...))>::type    {      return NUMPY_NARY_FUNC_SYM(std::forward<T>(args)...);    } @@ -32,12 +33,11 @@ namespace functor        types::numpy_expr<            NUMPY_NARY_FUNC_NAME,            typename types::NUMPY_NARY_RESHAPE_MODE<E, E...>::type...>>::type -      NUMPY_NARY_FUNC_NAME:: -      operator()(E &&... args) const +  NUMPY_NARY_FUNC_NAME::operator()(E &&...args) const    {      return {std::forward<E>(args)...};    } -} +} // namespace functor  #undef NUMPY_NARY_FUNC_NAME  #undef NUMPY_NARY_FUNC_SYM diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_operators.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_operators.hpp index 2da2315945e..836613246ae 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_operators.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/types/numpy_texpr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_texpr.hpp index 5de28bf7a52..47c47881b6d 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_texpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_texpr.hpp @@ -113,10 +113,11 @@ namespace types    template <class E>    template <class S> -  auto numpy_texpr_2<E>::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<E>::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 <class E>    template <class S> -  auto -  numpy_texpr_2<E>::operator[](S const &s0) -> numpy_texpr<decltype(this->arg( -      fast_contiguous_slice(pythonic::builtins::None, pythonic::builtins::None), -      (s0.step, s0)))> +  auto numpy_texpr_2<E>::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 <class T> -  numpy_texpr<ndarray<T, array<long, 2>>>::numpy_texpr( -      ndarray<T, array<long, 2>> const &arg) -      : numpy_texpr_2<ndarray<T, array<long, 2>>>{arg} +  numpy_texpr<ndarray<T, array_tuple<long, 2>>>::numpy_texpr( +      ndarray<T, array_tuple<long, 2>> const &arg) +      : numpy_texpr_2<ndarray<T, array_tuple<long, 2>>>{arg}    {    } diff --git a/contrib/python/pythran/pythran/pythonic/types/numpy_vexpr.hpp b/contrib/python/pythran/pythran/pythonic/types/numpy_vexpr.hpp index 889420b93c1..9bb66b6e177 100644 --- a/contrib/python/pythran/pythran/pythonic/types/numpy_vexpr.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/numpy_vexpr.hpp @@ -61,9 +61,9 @@ namespace types    template <class T, class F>    template <class... S>    auto numpy_vexpr<T, F>::operator()(S const &...slices) const -      -> decltype(ndarray<dtype, array<long, value>>{*this}(slices...)) +      -> decltype(ndarray<dtype, array_tuple<long, value>>{*this}(slices...))    { -    return ndarray<dtype, array<long, value>>{*this}(slices...); +    return ndarray<dtype, array_tuple<long, value>>{*this}(slices...);    }  #ifdef USE_XSIMD    template <class T, class F> diff --git a/contrib/python/pythran/pythran/pythonic/types/pointer.hpp b/contrib/python/pythran/pythran/pythonic/types/pointer.hpp index 7cca903197b..b55efcdf57e 100644 --- a/contrib/python/pythran/pythran/pythonic/types/pointer.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/types/str.hpp b/contrib/python/pythran/pythran/pythonic/types/str.hpp index 1f7a9816a35..e5dbe6083b1 100644 --- a/contrib/python/pythran/pythran/pythonic/types/str.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/str.hpp @@ -689,8 +689,8 @@ namespace operator_  {    template <size_t N, class Arg> -  auto mod(const char (&fmt)[N], Arg &&arg) -      -> decltype(types::str(fmt) % std::forward<Arg>(arg)) +  auto mod(const char (&fmt)[N], +           Arg &&arg) -> decltype(types::str(fmt) % std::forward<Arg>(arg))    {      return types::str(fmt) % std::forward<Arg>(arg);    } diff --git a/contrib/python/pythran/pythran/pythonic/types/tuple.hpp b/contrib/python/pythran/pythran/pythonic/types/tuple.hpp index 0316b52c87a..a91670a2f1c 100644 --- a/contrib/python/pythran/pythran/pythonic/types/tuple.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/tuple.hpp @@ -403,25 +403,25 @@ namespace types    }    template <class T, size_t N> -  dynamic_tuple<T> array_base_slicer::operator()(array<T, N> const &b, +  dynamic_tuple<T> array_base_slicer::operator()(array_tuple<T, N> const &b,                                                   slice const &s)    {      normalized_slice ns = s.normalize(b.size()); -    array<T, N> tmp; +    array_tuple<T, N> tmp;      for (long j = 0; j < ns.size(); ++j)        tmp[j] = b[ns.lower + j * ns.step];      return {&tmp[0], &tmp[ns.size()]};    }    template <class T, size_t N, long stride> -  dynamic_tuple<T> array_base_slicer::operator()(array<T, N> const &b, +  dynamic_tuple<T> array_base_slicer::operator()(array_tuple<T, N> const &b,                                                   cstride_slice<stride> const &s)    {      auto ns = s.normalize(b.size());      if (stride == 1) {        return {&b[ns.lower], &b[ns.upper]};      } else { -      array<T, N> tmp; +      array_tuple<T, N> 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 <class T, size_t N> -  dynamic_tuple<T> array_base_slicer::operator()(array<T, N> const &b, +  dynamic_tuple<T> array_base_slicer::operator()(array_tuple<T, N> const &b,                                                   fast_contiguous_slice const &s)    {      auto cns = s.normalize(b.size()); @@ -569,8 +569,8 @@ to_python<std::tuple<Types...>>::convert(std::tuple<Types...> const &t)  template <typename T, size_t N>  template <size_t... S> -PyObject *to_python<types::array<T, N>>::do_convert(types::array<T, N> const &t, -                                                    utils::index_sequence<S...>) +PyObject *to_python<types::array_tuple<T, N>>::do_convert( +    types::array_tuple<T, N> const &t, utils::index_sequence<S...>)  {    PyObject *out = PyTuple_New(N);    (void)std::initializer_list<bool>{ @@ -590,7 +590,8 @@ PyObject *to_python<types::static_list<T, N>>::do_convert(  }  template <typename T, size_t N> -PyObject *to_python<types::array<T, N>>::convert(types::array<T, N> const &t) +PyObject * +to_python<types::array_tuple<T, N>>::convert(types::array_tuple<T, N> const &t)  {    return do_convert(t, utils::make_index_sequence<N>());  } @@ -644,7 +645,7 @@ std::tuple<Types...> from_python<std::tuple<Types...>>::convert(PyObject *obj)  }  template <typename T, size_t N> -bool from_python<types::array<T, N>>:: +bool from_python<types::array_tuple<T, N>>::      is_convertible(PyObject *obj)  { @@ -659,13 +660,13 @@ bool from_python<types::array<T, N>>::  template <typename T, size_t N>  template <size_t... S> -types::array<T, N> from_python<types::array<T, N>>::do_convert( +types::array_tuple<T, N> from_python<types::array_tuple<T, N>>::do_convert(      PyObject *obj, typename utils::index_sequence<S...>)  {    return {::from_python<T>(PyTuple_GET_ITEM(obj, S))...};  }  template <typename T, size_t N> -types::array<T, N> from_python<types::array<T, N>>:: +types::array_tuple<T, N> from_python<types::array_tuple<T, N>>::      convert(PyObject *obj)  { diff --git a/contrib/python/pythran/pythran/pythonic/types/variant_functor.hpp b/contrib/python/pythran/pythran/pythonic/types/variant_functor.hpp index b777fad2cc8..75dfcd11f11 100644 --- a/contrib/python/pythran/pythran/pythonic/types/variant_functor.hpp +++ b/contrib/python/pythran/pythran/pythonic/types/variant_functor.hpp @@ -4,8 +4,8 @@  #include "pythonic/include/types/variant_functor.hpp"  #include "pythonic/utils/meta.hpp" -#include <utility>  #include <cassert> +#include <utility>  PYTHONIC_NS_BEGIN @@ -17,7 +17,7 @@ namespace types      template <class Type>      variant_functor_impl<Type>::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 <class Type>      variant_functor_impl<Type>::variant_functor_impl(          char mem[], variant_functor_impl<Type> 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 <class Type>      template <class... Args> -    auto variant_functor_impl<Type>::operator()(Args &&... args) +    auto variant_functor_impl<Type>::operator()(Args &&...args)          -> decltype(std::declval<Type>()(std::forward<Args>(args)...))      {        assert(fun && "handler defined"); @@ -135,7 +135,7 @@ namespace types      template <class Type>      template <class... Args> -    auto variant_functor_impl<Type>::operator()(Args &&... args) const +    auto variant_functor_impl<Type>::operator()(Args &&...args) const          -> decltype(std::declval<Type>()(std::forward<Args>(args)...))      {        assert(fun && "handler defined"); @@ -145,7 +145,7 @@ namespace types      template <class Type, class... Types>      template <class... OtherTypes>      variant_functor_impl<Type, Types...>::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 <class Type, class... Types>      template <class... Args> -    auto variant_functor_impl<Type, Types...>::operator()(Args &&... args) -> -        typename __combined<decltype(std::declval<Type>()(std::forward<Args>(args)...)), -                            decltype(std::declval<Types>()(std::forward<Args>(args)...))...>::type +    auto variant_functor_impl<Type, Types...>::operator()(Args &&...args) -> +        typename __combined< +            decltype(std::declval<Type>()(std::forward<Args>(args)...)), +            decltype(std::declval<Types>()( +                std::forward<Args>(args)...))...>::type      {        if (head.fun)          return head(std::forward<Args>(args)...); @@ -189,17 +191,19 @@ namespace types      template <class Type, class... Types>      template <class... Args> -    auto variant_functor_impl<Type, Types...>::operator()(Args &&... args) const -        -> -        typename __combined<decltype(std::declval<Type>()(std::forward<Args>(args)...)), -                            decltype(std::declval<Types>()(std::forward<Args>(args)...))...>::type +    auto +    variant_functor_impl<Type, Types...>::operator()(Args &&...args) const -> +        typename __combined< +            decltype(std::declval<Type>()(std::forward<Args>(args)...)), +            decltype(std::declval<Types>()( +                std::forward<Args>(args)...))...>::type      {        if (head.fun)          return head(std::forward<Args>(args)...);        else          return tail(std::forward<Args>(args)...);      } -  } +  } // namespace details    template <class... Types>    variant_functor<Types...>::variant_functor(variant_functor const &other) @@ -210,8 +214,8 @@ namespace types    }    template <class... Types> -  variant_functor<Types...> &variant_functor<Types...>:: -  operator=(variant_functor<Types...> const &other) +  variant_functor<Types...> & +  variant_functor<Types...>::operator=(variant_functor<Types...> const &other)    {      details::variant_functor_impl<Types...>::assign(mem, other);      return *this; @@ -219,8 +223,8 @@ namespace types    template <class... Types>    template <class... OtherTypes> -  variant_functor<Types...> &variant_functor<Types...>:: -  operator=(variant_functor<OtherTypes...> const &other) +  variant_functor<Types...> &variant_functor<Types...>::operator=( +      variant_functor<OtherTypes...> const &other)    {      details::variant_functor_impl<Types...>::assign(mem, other);      return *this; @@ -228,8 +232,8 @@ namespace types    template <class... Types>    template <class OtherType> -  variant_functor<Types...> &variant_functor<Types...>:: -  operator=(OtherType const &other) +  variant_functor<Types...> & +  variant_functor<Types...>::operator=(OtherType const &other)    {      static_assert(          utils::any_of<std::is_same<OtherType, Types>::value...>::value, @@ -240,7 +244,7 @@ namespace types    template <class... Types>    template <class... OtherTypes> -  variant_functor<Types...>::variant_functor(OtherTypes const &... t) +  variant_functor<Types...>::variant_functor(OtherTypes const &...t)        : details::variant_functor_impl<Types...>(mem, t...)    {    } @@ -255,6 +259,6 @@ namespace types                  t))    {    } -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/types/vectorizable_type.hpp b/contrib/python/pythran/pythran/pythonic/types/vectorizable_type.hpp index 81e0d90432e..01f61e462ce 100644 --- a/contrib/python/pythran/pythran/pythonic/types/vectorizable_type.hpp +++ b/contrib/python/pythran/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 <class O, class... Args> @@ -185,7 +185,7 @@ namespace types          //          true;    }; -} +} // namespace types  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/utils/allocate.hpp b/contrib/python/pythran/pythran/pythonic/utils/allocate.hpp index a09cda14e27..f9247a85f91 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/allocate.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/utils/array_helper.hpp b/contrib/python/pythran/pythran/pythonic/utils/array_helper.hpp index fa8722533cc..35d5352c9e1 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/array_helper.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/array_helper.hpp @@ -13,7 +13,7 @@ PYTHONIC_NS_BEGIN   */  template <size_t L>  template <class A, size_t M> -auto nget<L>::operator()(A &&self, types::array<long, M> const &indices) +auto nget<L>::operator()(A &&self, types::array_tuple<long, M> const &indices)      -> decltype(nget<L - 1>()(std::forward<A>(self)[0], indices))  {    return nget<L - 1>()(std::forward<A>(self)[indices[M - L - 1]], indices); @@ -21,7 +21,7 @@ auto nget<L>::operator()(A &&self, types::array<long, M> const &indices)  template <size_t L>  template <class A, size_t M> -auto nget<L>::fast(A &&self, types::array<long, M> const &indices) +auto nget<L>::fast(A &&self, types::array_tuple<long, M> const &indices)      -> decltype(nget<L - 1>().fast(std::forward<A>(self).fast(0), indices))  {    return nget<L - 1>().fast(std::forward<A>(self).fast(indices[M - L - 1]), @@ -29,14 +29,14 @@ auto nget<L>::fast(A &&self, types::array<long, M> const &indices)  }  template <class A, size_t M> -auto nget<0>::operator()(A &&self, types::array<long, M> const &indices) +auto nget<0>::operator()(A &&self, types::array_tuple<long, M> const &indices)      -> decltype(std::forward<A>(self)[indices[M - 1]])  {    return std::forward<A>(self)[indices[M - 1]];  }  template <class A, size_t M> -auto nget<0>::fast(A &&self, types::array<long, M> const &indices) +auto nget<0>::fast(A &&self, types::array_tuple<long, M> const &indices)      -> decltype(std::forward<A>(self).fast(indices[M - 1]))  {    return std::forward<A>(self).fast(indices[M - 1]); diff --git a/contrib/python/pythran/pythran/pythonic/utils/broadcast_copy.hpp b/contrib/python/pythran/pythran/pythonic/utils/broadcast_copy.hpp index d44ef84bd0b..d892e4d580d 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/broadcast_copy.hpp +++ b/contrib/python/pythran/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<E, F, N, (size_t)D, vectorize>{}(self, other);      } @@ -264,11 +265,10 @@ namespace utils                             std::integral_constant<bool, true>,                             std::integral_constant<bool, true>)    { -    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<E, F, N, D, vector_form>(            self, other, std::integral_constant<bool, true>(),            std::integral_constant<bool, false>{}); @@ -285,11 +285,11 @@ namespace utils          self, reshaped, std::true_type(), is_plain);    } -  template<class T, bool = types::is_dtype<T>::value> +  template <class T, bool = types::is_dtype<T>::value>    struct is_flat {      static const bool value = T::is_flat;    }; -  template<class T> +  template <class T>    struct is_flat<T, true> {      static const bool value = false;    }; @@ -299,7 +299,9 @@ namespace utils    {      return broadcast_copy_helper<E, F, N, D, vector_form>(          self, other, std::integral_constant<bool, (D >= 0)>(), -        std::integral_constant<bool, std::decay<E>::type::is_flat && is_flat<typename std::decay<F>::type>::value>{}); +        std::integral_constant < bool, +        std::decay<E>::type::is_flat +                &&is_flat<typename std::decay<F>::type>::value > {});    }    /* update diff --git a/contrib/python/pythran/pythran/pythonic/utils/fwd.hpp b/contrib/python/pythran/pythran/pythonic/utils/fwd.hpp index 66438d6561c..f3c460d2192 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/fwd.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/fwd.hpp @@ -9,10 +9,10 @@ namespace utils  {    template <typename... Types> -  void fwd(Types const &... types) +  void fwd(Types const &...types)    {    } -} +} // namespace utils  PYTHONIC_NS_END  #endif diff --git a/contrib/python/pythran/pythran/pythonic/utils/iterator.hpp b/contrib/python/pythran/pythran/pythonic/utils/iterator.hpp index 5ab35a95ef9..cda0e6b2e17 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/iterator.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/iterator.hpp @@ -9,14 +9,12 @@ namespace utils  {    template <class T> -  comparable_iterator<T>::comparable_iterator() -      : T() +  comparable_iterator<T>::comparable_iterator() : T()    {    }    template <class T> -  comparable_iterator<T>::comparable_iterator(T const &t) -      : T(t) +  comparable_iterator<T>::comparable_iterator(T const &t) : T(t)    {    } @@ -27,24 +25,22 @@ namespace utils    }    template <class T> -  iterator_reminder<false, T>::iterator_reminder(T const &v) -      : values(v) +  iterator_reminder<false, T>::iterator_reminder(T const &v) : values(v)    {    }    template <class T> -  iterator_reminder<true, T>::iterator_reminder(T const &v) -      : values(v) +  iterator_reminder<true, T>::iterator_reminder(T const &v) : values(v)    {    }    template <class T, class... Others>    iterator_reminder<true, T, Others...>::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/contrib/python/pythran/pythran/pythonic/utils/nested_container.hpp b/contrib/python/pythran/pythran/pythonic/utils/nested_container.hpp index f11bc73b403..2996e4e2e18 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/nested_container.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/nested_container.hpp @@ -3,9 +3,9 @@  #include "pythonic/include/utils/nested_container.hpp" -#include <limits>  #include "pythonic/types/traits.hpp"  #include "pythonic/utils/numpy_traits.hpp" +#include <limits>  PYTHONIC_NS_BEGIN  namespace utils @@ -16,10 +16,11 @@ namespace utils    {      auto n = t.size();      return n ? n * nested_container_size<typename std::conditional< -               // If we have a scalar or a complex, we want to stop -               // recursion, and then dispatch to bool specialization -               types::is_dtype<typename Type::value_type>::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<typename Type::value_type>::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/contrib/python/pythran/pythran/pythonic/utils/neutral.hpp b/contrib/python/pythran/pythran/pythonic/utils/neutral.hpp index 62b1d7d6d72..ab1f2061070 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/neutral.hpp +++ b/contrib/python/pythran/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/contrib/python/pythran/pythran/pythonic/utils/numpy_conversion.hpp b/contrib/python/pythran/pythran/pythonic/utils/numpy_conversion.hpp index 05382b7e74d..82c1638b114 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/numpy_conversion.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/numpy_conversion.hpp @@ -18,8 +18,8 @@  #else  #define NUMPY_EXPR_TO_NDARRAY0_IMPL(fname)                                     \    template <class E, class... Types>                                           \ -  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<E>::value && types::is_numexpr_arg<E>::value,     \            decltype(fname(                                                      \                types::ndarray<typename E::dtype, typename E::shape_t>{expr},    \ diff --git a/contrib/python/pythran/pythran/pythonic/utils/pdqsort.hpp b/contrib/python/pythran/pythran/pythonic/utils/pdqsort.hpp index 384f5c6f1c4..7fce8403d8d 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/pdqsort.hpp +++ b/contrib/python/pythran/pythran/pythonic/utils/pdqsort.hpp @@ -32,8 +32,8 @@  #include <algorithm>  #include <cstddef>  #include <functional> -#include <utility>  #include <iterator> +#include <utility>  #if __cplusplus >= 201103L  #include <cstdint> @@ -641,7 +641,7 @@ namespace pdqsort_detail        leftmost = false;      }    } -} +} // namespace pdqsort_detail  template <class Iter, class Compare>  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<Compare>::type>::value && -                         std::is_arithmetic<typename std::iterator_traits< -                             Iter>::value_type>::value>( +      Iter, Compare, +      pdqsort_detail::is_default_compare< +          typename std::decay<Compare>::type>::value && +          std::is_arithmetic< +              typename std::iterator_traits<Iter>::value_type>::value>(        begin, end, comp, pdqsort_detail::log2(end - begin));  #else    pdqsort_detail::pdqsort_loop<Iter, Compare, false>( diff --git a/contrib/python/pythran/pythran/pythonic/utils/reserve.hpp b/contrib/python/pythran/pythran/pythonic/utils/reserve.hpp index 564457467a5..44bd765e1b2 100644 --- a/contrib/python/pythran/pythran/pythonic/utils/reserve.hpp +++ b/contrib/python/pythran/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 diff --git a/contrib/python/pythran/pythran/pythran.cfg b/contrib/python/pythran/pythran/pythran.cfg index e9671598323..677677657a6 100644 --- a/contrib/python/pythran/pythran/pythran.cfg +++ b/contrib/python/pythran/pythran/pythran.cfg @@ -18,6 +18,7 @@ optimizations = pythran.optimizations.InlineBuiltins                  pythran.optimizations.PatternTransform                  pythran.optimizations.Square                  pythran.optimizations.CopyTo +                pythran.optimizations.FastGExpr                  pythran.optimizations.RangeLoopUnfolding                  pythran.optimizations.RangeBasedSimplify                  pythran.optimizations.ListToTuple diff --git a/contrib/python/pythran/pythran/run.py b/contrib/python/pythran/pythran/run.py index b5c26f0f3a5..e11ca6e5271 100644 --- a/contrib/python/pythran/pythran/run.py +++ b/contrib/python/pythran/pythran/run.py @@ -199,6 +199,9 @@ def run():                          "E: " + str(e))          sys.exit(1)      except ValueError as e: +        from traceback import format_exception +        msg = "".join(format_exception(type(e), e, e.__traceback__)) +        logger.info(msg)          logger.critical("Chair to keyboard interface error\n"                          "E: " + str(e))          sys.exit(1) @@ -214,6 +217,17 @@ def run():          logger.critical("Cover me Jack. Jack? Jaaaaack!!!!\n"                          "E: " + str(e))          sys.exit(1) +    except SyntaxError as se: +        # pythran syntax error formatter is just nicer +        pse = PythranSyntaxError(se.args[0]) +        pse.filename, pse.lineno, pse.offset = se.args[1][:3] +        if pse.filename == '<unknown>': +            pse.filename = args.input_file +        pse.offset -= 1 + +        logger.critical("I think in all humility that your input code is not valid Python, " +                        "that's a bit too much for me :-/\n" + str(pse)) +        sys.exit(1)      except NotImplementedError:          logger.critical("MAYDAY, MAYDAY, MAYDAY; pythran compiler; "                          "code area out of control\n" diff --git a/contrib/python/pythran/pythran/tables.py b/contrib/python/pythran/pythran/tables.py index 60fac63ee35..d62abe11c05 100644 --- a/contrib/python/pythran/pythran/tables.py +++ b/contrib/python/pythran/pythran/tables.py @@ -179,6 +179,21 @@ CLASSES = {      "dtype": {          "type": MethodIntr(),      }, +    "array": { +        # array have fixed type, no need for signature +        "append": MethodIntr(), +        "buffer_info": ConstMethodIntr(), +        "byteswap": MethodIntr(), +        "count": ConstMethodIntr(), +        "extend": MethodIntr(), +        "fromfile": MethodIntr(), +        "fromlist": MethodIntr(), +        "frombytes": MethodIntr(), +        "insert": MethodIntr(), +        "pop": MethodIntr(), +        "remove": MethodIntr(), +        "reverse": MethodIntr(), +    },      "list": {          "append": MethodIntr(signature=Fun[[List[T0], T0], None]),          "extend": MethodIntr(update_effects), @@ -800,30 +815,6 @@ CLASSES = {              ]          ),          "T": AttributeIntr(signature=Fun[[NDArray[T0, :]], NDArray[T0, :]]), -        "tolist": ConstMethodIntr( -            signature=Union[ -                # 1d -                Fun[[NDArray[bool, :]], List[bool]], -                Fun[[NDArray[int, :]], List[int]], -                Fun[[NDArray[float, :]], List[float]], -                Fun[[NDArray[complex, :]], List[complex]], -                # 2d -                Fun[[NDArray[bool, :, :]], List[bool]], -                Fun[[NDArray[int, :, :]], List[int]], -                Fun[[NDArray[float, :, :]], List[float]], -                Fun[[NDArray[complex, :, :]], List[complex]], -                # 3d -                Fun[[NDArray[bool, :, :, :]], List[bool]], -                Fun[[NDArray[int, :, :, :]], List[int]], -                Fun[[NDArray[float, :, :, :]], List[float]], -                Fun[[NDArray[complex, :, :, :]], List[complex]], -                # 4d -                Fun[[NDArray[bool, :, :, :, :]], List[bool]], -                Fun[[NDArray[int, :, :, :, :]], List[int]], -                Fun[[NDArray[float, :, :, :, :]], List[float]], -                Fun[[NDArray[complex, :, :, :, :]], List[complex]], -            ] -        ),          "tofile": ConstMethodIntr(signature=Fun[[NDArray[T0, :]], str, str], global_effects=True),          "tostring": ConstMethodIntr(signature=Fun[[NDArray[T0, :]], str]),          "view": MethodIntr(), @@ -2569,6 +2560,7 @@ MODULES = {              "kwonly": ConstFunctionIntr(),              "len_set": ConstFunctionIntr(signature=Fun[[Iterable[T0]], int]),              "make_shape": ConstFunctionIntr(), +            "restrict_assign": FunctionIntr(),              "static_if": ConstFunctionIntr(),              "StaticIfBreak": ConstFunctionIntr(),              "StaticIfCont": ConstFunctionIntr(), @@ -2835,6 +2827,12 @@ MODULES = {              return_range=lambda _: interval.Range(1, 1)          ),      }, +    "array": { +            "typecodes": ConstantIntr(signature=str), +            "array": ClassWithReadOnceConstructor( +                CLASSES['array'], +                immediate_arguments=[0]), +    },      "scipy": {          "special": {              "binom": ConstFunctionIntr( @@ -4510,6 +4508,7 @@ MODULES = {      },      # conflicting method names must be listed here      "__dispatch__": { +        "append": MethodIntr(signature=Fun[[List[T0], T0], None]),          "clear": MethodIntr(signature=Fun[[T0], None]),          "conjugate": ConstMethodIntr(),          "copy": ConstMethodIntr(signature=Fun[[T0], T0]), @@ -4521,6 +4520,7 @@ MODULES = {              ],              return_range=interval.positive_values          ), +        "extend": MethodIntr(signature=Fun[[List[T0], Iterable[T0]], None]),          "index": ConstMethodIntr(              signature=Union[                  Fun[[Iterable[T0], T0], int], @@ -4529,13 +4529,19 @@ MODULES = {              ],              return_range=interval.positive_values          ), +        "insert": MethodIntr(signature=Fun[[List[T0], int, T0], None]),          "pop": MethodIntr(),          "remove": MethodIntr(), +        "reverse": MethodIntr(),          "sort": MethodIntr(), +        "tolist": ConstMethodIntr(),          "update": MethodIntr(update_effects),      },  } +# PyPy doesn't seem to provide this. +if sys.implementation.name == 'pypy': +    del MODULES['array']['typecodes']  if sys.version_info < (3, 5):      del MODULES['operator']['matmul'] diff --git a/contrib/python/pythran/pythran/toolchain.py b/contrib/python/pythran/pythran/toolchain.py index fde29026011..ba6a9aafe91 100644 --- a/contrib/python/pythran/pythran/toolchain.py +++ b/contrib/python/pythran/pythran/toolchain.py @@ -8,7 +8,6 @@ from pythran.config import cfg  from pythran.cxxgen import PythonModule, Include, Line, Statement  from pythran.cxxgen import FunctionBody, FunctionDeclaration, Value, Block  from pythran.cxxgen import ReturnStatement -from pythran.dist import PythranExtension, PythranBuildExt  from pythran.errors import PythranCompileError  from pythran.middlend import refine, mark_unexported_functions  from pythran.passmanager import PassManager @@ -24,12 +23,6 @@ import pythran.frontend as frontend  import sysconfig -try: -    # `numpy.distutils is deprecated, may not be present, or broken -    from numpy.distutils.core import setup -except Exception: -    from setuptools import setup -  from tempfile import mkdtemp, NamedTemporaryFile  import gast as ast  import importlib @@ -335,6 +328,14 @@ def compile_cxxfile(module_name, cxxfile, output_binary=None, **kwargs):      Raises PythranCompileError on failure      ''' +    # local import so that we don't depend on setuptools for the code generation +    # part +    from pythran.dist import PythranExtension, PythranBuildExt +    try: +        # `numpy.distutils is deprecated, may not be present, or broken +        from numpy.distutils.core import setup +    except Exception: +        from setuptools import setup      builddir = mkdtemp()      buildtmp = mkdtemp() diff --git a/contrib/python/pythran/pythran/transformations/expand_builtins.py b/contrib/python/pythran/pythran/transformations/expand_builtins.py index 648b16ab45c..8ce5c63c154 100644 --- a/contrib/python/pythran/pythran/transformations/expand_builtins.py +++ b/contrib/python/pythran/pythran/transformations/expand_builtins.py @@ -32,7 +32,6 @@ class ExpandBuiltins(Transformation):          if s in ('None', 'True', 'False'):              self.update = True              return ast.Constant(getattr(builtins, s), None) -          if(isinstance(node.ctx, ast.Load) and             s not in self.locals[node] and             s not in self.globals and diff --git a/contrib/python/pythran/pythran/transformations/expand_imports.py b/contrib/python/pythran/pythran/transformations/expand_imports.py index 62107b22bc5..718feadbff8 100644 --- a/contrib/python/pythran/pythran/transformations/expand_imports.py +++ b/contrib/python/pythran/pythran/transformations/expand_imports.py @@ -116,20 +116,23 @@ class ExpandImports(Transformation):          In this case, foo can't be used after assign.          """ +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,)          if isinstance(node.value, ast.Name) and node.value.id in self.symbols:              symbol = path_to_node(self.symbols[node.value.id])              if not getattr(symbol, 'isliteral', lambda: False)(): -                for target in node.targets: +                for target in targets:                      if not isinstance(target, ast.Name):                          err = "Unsupported module aliasing"                          raise PythranSyntaxError(err, target)                      self.symbols[target.id] = self.symbols[node.value.id]                  return None  # this assignment is no longer needed          new_node = self.generic_visit(node) +        ntargets = new_node.targets if isinstance(node, ast.Assign) else (new_node.target,)          # no problem if targets contains a subscript, it is not a new assign.          [self.symbols.pop(t.id, None) -         for t in new_node.targets if isinstance(t, ast.Name)] +         for t in ntargets if isinstance(t, ast.Name)]          return new_node +    visit_AnnAssign = visit_Assign      def visit_Name(self, node):          """ diff --git a/contrib/python/pythran/pythran/transformations/handle_import.py b/contrib/python/pythran/pythran/transformations/handle_import.py index 2e90d638740..13ace611303 100644 --- a/contrib/python/pythran/pythran/transformations/handle_import.py +++ b/contrib/python/pythran/pythran/transformations/handle_import.py @@ -136,8 +136,10 @@ class HandleImport(Transformation):          return node      def visit_assign(self, node): -        self.visit(node.value) -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        if node.value: +            self.visit(node.value) +        for target in targets:              self.visit(target)          return node @@ -152,10 +154,12 @@ class HandleImport(Transformation):          if not is_mangled_module(renaming):              return self.visit_assign(node) -        if any(not isinstance(target, ast.Name) for target in node.targets): +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        if any(not isinstance(target, ast.Name) for target in targets):              raise PythranSyntaxError("Invalid module assignment", node)          return node +    visit_AnnAssign = visit_Assign      def visit_Call(self, node):          if isinstance(node.func, ast.Name): diff --git a/contrib/python/pythran/pythran/transformations/normalize_method_calls.py b/contrib/python/pythran/pythran/transformations/normalize_method_calls.py index 4af1e47d104..9aea96e39f6 100644 --- a/contrib/python/pythran/pythran/transformations/normalize_method_calls.py +++ b/contrib/python/pythran/pythran/transformations/normalize_method_calls.py @@ -22,7 +22,8 @@ class NormalizeMethodCalls(Transformation):      >>> pm = passmanager.PassManager("test")      >>> _, node = pm.apply(NormalizeMethodCalls, node)      >>> print(pm.dump(backend.Python, node)) -    builtins.list.append([], 12) +    import __dispatch__ as __pythran_import___dispatch__ +    __pythran_import___dispatch__.append([], 12)      '''      def __init__(self): @@ -83,10 +84,12 @@ class NormalizeMethodCalls(Transformation):              return None          else:              n = self.generic_visit(node) -            for t in node.targets: +            targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +            for t in targets:                  if isinstance(t, ast.Name):                      self.imports.pop(t.id, None)              return n +    visit_AnnAssign = visit_Assign      def visit_For(self, node):          node.iter = self.visit(node.iter) @@ -198,7 +201,11 @@ class NormalizeMethodCalls(Transformation):                  # the only situation where this arises is for real/imag of                  # a ndarray. As a call is not valid for a store, add a slice                  # to ends up with a valid lhs -                assert node.attr in ('real', 'imag'), "only store to imag/real" +                if node.attr not in ('real', 'imag'): +                    raise PythranSyntaxError( +                            "Unsupported store to attribute {}".format(node.attr), +                            node) +                  return ast.Subscript(call,                                       ast.Slice(None, None, None),                                       node.ctx) diff --git a/contrib/python/pythran/pythran/transformations/normalize_tuples.py b/contrib/python/pythran/pythran/transformations/normalize_tuples.py index cb47ba91c0f..0cd5ba5c809 100644 --- a/contrib/python/pythran/pythran/transformations/normalize_tuples.py +++ b/contrib/python/pythran/pythran/transformations/normalize_tuples.py @@ -125,6 +125,37 @@ class NormalizeTuples(Transformation):                  node.body = ConvertToTuple(nname, renamings).visit(node.body)          return node +    def visit_assign_target(self, t, value, extra_assign, no_tmp): +        if isinstance(t, ast.Tuple) or isinstance(t, ast.List): +            renamings = OrderedDict() +            self.traverse_tuples(t, (), renamings) +            if renamings: +                if no_tmp: +                    gstore = deepcopy(value) +                else: +                    gstore = ast.Name(self.get_new_id(), +                                      ast.Store(), None, None) +                gload = deepcopy(gstore) +                gload.ctx = ast.Load() +                for rename, state in renamings.items(): +                    nnode = reduce( +                        lambda x, y: ast.Subscript( +                            x, +                            ast.Constant(y, None), +                            ast.Load()), +                        state, +                        gload) +                    if isinstance(rename, str): +                        extra_assign.append( +                            ast.Assign( +                                [ast.Name(rename, ast.Store(), +                                          None, None)], +                                nnode, None)) +                    else: +                        extra_assign.append(ast.Assign([rename], +                                                       nnode, None)) +                return gstore +      def visit_Assign(self, node):          self.generic_visit(node)          # if the rhs is an identifier, we don't need to duplicate it @@ -132,37 +163,27 @@ class NormalizeTuples(Transformation):          no_tmp = isinstance(node.value, (ast.Name, ast.Attribute))          extra_assign = [] if no_tmp else [node]          for i, t in enumerate(node.targets): -            if isinstance(t, ast.Tuple) or isinstance(t, ast.List): -                renamings = OrderedDict() -                self.traverse_tuples(t, (), renamings) -                if renamings: -                    if no_tmp: -                        gstore = deepcopy(node.value) -                    else: -                        gstore = ast.Name(self.get_new_id(), -                                          ast.Store(), None, None) -                    gload = deepcopy(gstore) -                    gload.ctx = ast.Load() -                    node.targets[i] = gstore -                    for rename, state in renamings.items(): -                        nnode = reduce( -                            lambda x, y: ast.Subscript( -                                x, -                                ast.Constant(y, None), -                                ast.Load()), -                            state, -                            gload) -                        if isinstance(rename, str): -                            extra_assign.append( -                                ast.Assign( -                                    [ast.Name(rename, ast.Store(), -                                              None, None)], -                                    nnode, None)) -                        else: -                            extra_assign.append(ast.Assign([rename], -                                                           nnode, None)) +            updated = self.visit_assign_target(t, node.value, extra_assign, +                                               no_tmp) +            if updated is not None: +                node.targets[i] = updated          return extra_assign or node +    def visit_AnnAssign(self, node): +        self.generic_visit(node) +        # if the rhs is an identifier, we don't need to duplicate it +        # otherwise, better duplicate it... +        if not node.value: +            return node +        no_tmp = isinstance(node.value, (ast.Name, ast.Attribute)) +        extra_assign = [] if no_tmp else [node] +        updated = self.visit_assign_target(node.target, node.value, +                                           extra_assign, no_tmp) +        if updated is not None: +            node.target = updated +        return extra_assign or node + +      def visit_For(self, node):          target = node.target          if isinstance(target, ast.Tuple) or isinstance(target, ast.List): diff --git a/contrib/python/pythran/pythran/transformations/unshadow_parameters.py b/contrib/python/pythran/pythran/transformations/unshadow_parameters.py index 2f29eebdae4..e61e90c695b 100644 --- a/contrib/python/pythran/pythran/transformations/unshadow_parameters.py +++ b/contrib/python/pythran/pythran/transformations/unshadow_parameters.py @@ -52,13 +52,15 @@ class UnshadowParameters(Transformation):                  self.renaming[node.id] = new_name      def visit_Assign(self, node): -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              self.update_name(target)          try:              self.generic_visit(node)          except AttributeError:              pass          return node +    visit_AnnAssign = visit_Assign      def visit_AugAssign(self, node):          self.update_name(node.target) diff --git a/contrib/python/pythran/pythran/types/type_dependencies.py b/contrib/python/pythran/pythran/types/type_dependencies.py index ba3b0a1b25c..a7fe47a9c8d 100644 --- a/contrib/python/pythran/pythran/types/type_dependencies.py +++ b/contrib/python/pythran/pythran/types/type_dependencies.py @@ -334,11 +334,15 @@ class TypeDependencies(ModuleAnalysis):          It is valid for subscript, `a[i] = foo()` means `a` type depend on          `foo` return type.          """ +        if not node.value: +            return          value_deps = self.visit(node.value) -        for target in node.targets: +        targets = node.targets if isinstance(node, ast.Assign) else (node.target,) +        for target in targets:              name = get_variable(target)              if isinstance(name, ast.Name):                  self.naming[name.id] = value_deps +    visit_AnnAssign = visit_Assign      def visit_AugAssign(self, node):          """ diff --git a/contrib/python/pythran/pythran/types/types.py b/contrib/python/pythran/pythran/types/types.py index e58664c04bd..e2774616e09 100644 --- a/contrib/python/pythran/pythran/types/types.py +++ b/contrib/python/pythran/pythran/types/types.py @@ -264,7 +264,7 @@ class Types(ModuleAnalysis):          self.result[node] = self.combined(curr_ty, ty)      def visit_FunctionDef(self, node): -        self.delayed_types = set() +        self.delayed_nodes = set()          self.curr_locals_declaration = self.gather(              LocalNodeDeclarations,              node) @@ -278,7 +278,7 @@ class Types(ModuleAnalysis):          self.generic_visit(node) -        for delayed_node in self.delayed_types: +        for delayed_node in self.delayed_nodes:              delayed_type = self.result[delayed_node]              all_types = ordered_set(self.result[ty] for ty in                                      self.name_to_nodes[delayed_node.id]) @@ -290,7 +290,7 @@ class Types(ModuleAnalysis):              all_types = ordered_set(self.result[ty] for ty in nodes)              final_type = self.combined(*all_types)              for n in nodes: -                if n not in self.delayed_types: +                if n not in self.delayed_nodes:                      self.result[n] = final_type          self.current_global_declarations[node.name] = node @@ -336,6 +336,23 @@ class Types(ModuleAnalysis):                          fake = ast.Subscript(alias, t.slice, ast.Store())                          self.combine(fake, None, node.value) +    def visit_AnnAssign(self, node): +        if not node.value: +            # FIXME: replace this by actually setting the node type from the +            # annotation +            self.curr_locals_declaration.remove(node.target) +            return +        self.visit(node.value) +        t = node.target +        self.combine(t, None, node.value) +        if t in self.curr_locals_declaration: +            self.result[t] = self.get_qualifier(t)(self.result[t]) +        if isinstance(t, ast.Subscript): +            if self.visit_AssignedSubscript(t): +                for alias in self.strict_aliases[t.value]: +                    fake = ast.Subscript(alias, t.slice, ast.Store()) +                    self.combine(fake, None, node.value) +      def visit_AugAssign(self, node):          self.visit(node.value) @@ -461,8 +478,11 @@ class Types(ModuleAnalysis):          else:              sty = pytype_to_ctype(ty)          if node in self.immediates: -            sty = "std::integral_constant<%s, %s>" % (sty, -                                                      str(node.value).lower()) +            if sty == 'pythonic::types::chr': +                sty = "std::integral_constant<char, '%s'>" % (node.value) +            else: +                sty = "std::integral_constant<%s, %s>" % (sty, +                                                          str(node.value).lower())          self.result[node] = self.builder.NamedType(sty)      def visit_Attribute(self, node): @@ -554,7 +574,7 @@ class Types(ModuleAnalysis):      def delayed(self, node):          fallback_type = self.combined(*[self.result[n] for n in                                          self.name_to_nodes[node.id]]) -        self.delayed_types.add(node) +        self.delayed_nodes.add(node)          return self.builder.LType(fallback_type, node)      def visit_Name(self, node): diff --git a/contrib/python/pythran/pythran/unparse.py b/contrib/python/pythran/pythran/unparse.py index 25f10d71975..058aa004ac7 100644 --- a/contrib/python/pythran/pythran/unparse.py +++ b/contrib/python/pythran/pythran/unparse.py @@ -142,6 +142,15 @@ class Unparser:              self.write(" = ")          self.dispatch(t.value) +    def _AnnAssign(self, t): +        self.fill() +        self.dispatch(t.target) +        self.write(": ") +        self.dispatch(t.annotation) +        if t.value: +            self.write(" = ") +            self.dispatch(t.value) +      def _AugAssign(self, t):          self.fill()          self.dispatch(t.target) diff --git a/contrib/python/pythran/pythran/utils.py b/contrib/python/pythran/pythran/utils.py index 2d7a6732740..55a7e8ad6f9 100644 --- a/contrib/python/pythran/pythran/utils.py +++ b/contrib/python/pythran/pythran/utils.py @@ -106,7 +106,7 @@ def get_variable(assignable):      ...     slice=ast.Name('j', ast.Load(), None, None),      ...     ctx=ast.Load())      >>> ast.dump(get_variable(ref)) -    "Name(id='a', ctx=Load(), annotation=None, type_comment=None)" +    "Name(id='a', ctx=Load())"      """      msg = "Only name and subscript can be assigned."      assert isinstance(assignable, (ast.Name, ast.Subscript)), msg diff --git a/contrib/python/pythran/pythran/version.py b/contrib/python/pythran/pythran/version.py index 14da714e456..7aca4f8ffed 100644 --- a/contrib/python/pythran/pythran/version.py +++ b/contrib/python/pythran/pythran/version.py @@ -1,2 +1,2 @@ -__version__ = '0.16.1' +__version__ = '0.17.0'  __descr__ = 'Ahead of Time compiler for numeric kernels' diff --git a/contrib/python/pythran/ya.make b/contrib/python/pythran/ya.make index 59e472063c8..96bb3996205 100644 --- a/contrib/python/pythran/ya.make +++ b/contrib/python/pythran/ya.make @@ -2,7 +2,7 @@  PY3_LIBRARY() -VERSION(0.16.1) +VERSION(0.17.0)  LICENSE(BSD-3-Clause) @@ -86,6 +86,7 @@ PY_SRCS(      pythran/optimizations/constant_folding.py      pythran/optimizations/copyto.py      pythran/optimizations/dead_code_elimination.py +    pythran/optimizations/fast_gexpr.py      pythran/optimizations/forward_substitution.py      pythran/optimizations/inline_builtins.py      pythran/optimizations/inlining.py  | 
