diff options
| author | nobody <nobody@localhost> | 2002-01-05 17:07:10 +0000 |
|---|---|---|
| committer | nobody <nobody@localhost> | 2002-01-05 17:07:10 +0000 |
| commit | e8c50dc6676e380e814c77927445ab3594382bc4 (patch) | |
| tree | 8b24a70994ccef281e051bd62a39a93234973c68 | |
| parent | f2e5fb8573178cb7a8924d57e70bf9c199034622 (diff) | |
| download | numpy-0.2.0.tar.gz | |
This commit was manufactured by cvs2svn to create tagv0.2.0
'release_0_2_0'.
164 files changed, 0 insertions, 75312 deletions
diff --git a/scipy_distutils/__init__.py b/scipy_distutils/__init__.py deleted file mode 100644 index b919cf75f..000000000 --- a/scipy_distutils/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""scipy_distutils - - Modified version of distutils to handle fortran source code, f2py, - and other issues in the scipy build process. -""" - -# Need to do something here to get distutils subsumed... diff --git a/scipy_distutils/__version__.py b/scipy_distutils/__version__.py deleted file mode 100644 index 6ea9991ca..000000000 --- a/scipy_distutils/__version__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file is automatically updated with get_version -# function from scipy_distutils.misc_utils.py -version = '0.1.19-alpha-47' -version_info = (0, 1, 19, 'alpha', 47) diff --git a/scipy_distutils/command/__init__.py b/scipy_distutils/command/__init__.py deleted file mode 100644 index 4aa39a8b6..000000000 --- a/scipy_distutils/command/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -"""distutils.command - -Package containing implementation of all the standard Distutils -commands.""" - -__revision__ = "$Id$" - -distutils_all = [ 'build_py', - 'build_scripts', - 'clean', - 'install_lib', - 'install_scripts', - 'bdist', - 'bdist_dumb', - 'bdist_rpm', - 'bdist_wininst', - ] - -__import__('distutils.command',globals(),locals(),distutils_all) - -__all__ = ['build', - 'build_ext', - 'build_clib', - 'build_flib', - 'install', - 'install_data', - 'install_headers', - 'sdist', - ] + distutils_all diff --git a/scipy_distutils/command/build.py b/scipy_distutils/command/build.py deleted file mode 100644 index 8d9835f2c..000000000 --- a/scipy_distutils/command/build.py +++ /dev/null @@ -1,17 +0,0 @@ -# Need to override the build command to include building of fortran libraries -# This class must be used as the entry for the build key in the cmdclass -# dictionary which is given to the setup command. - -from distutils.command.build import * -from distutils.command.build import build as old_build - -class build(old_build): - def has_f_libraries(self): - return self.distribution.has_f_libraries() - - sub_commands = [('build_py', old_build.has_pure_modules), - ('build_clib', old_build.has_c_libraries), - ('build_flib', has_f_libraries), # new feature - ('build_ext', old_build.has_ext_modules), - ('build_scripts', old_build.has_scripts), - ] diff --git a/scipy_distutils/command/build_clib.py b/scipy_distutils/command/build_clib.py deleted file mode 100644 index f3609e855..000000000 --- a/scipy_distutils/command/build_clib.py +++ /dev/null @@ -1,256 +0,0 @@ -"""distutils.command.build_clib - -Implements the Distutils 'build_clib' command, to build a C/C++ library -that is included in the module distribution and needed by an extension -module.""" - -# created (an empty husk) 1999/12/18, Greg Ward -# fleshed out 2000/02/03-04 - -__revision__ = "$Id$" - - -# XXX this module has *lots* of code ripped-off quite transparently from -# build_ext.py -- not surprisingly really, as the work required to build -# a static library from a collection of C source files is not really all -# that different from what's required to build a shared object file from -# a collection of C source files. Nevertheless, I haven't done the -# necessary refactoring to account for the overlap in code between the -# two modules, mainly because a number of subtle details changed in the -# cut 'n paste. Sigh. - -import os, string -from glob import glob -from types import * -from distutils.core import Command -from distutils.errors import * -from distutils.sysconfig import customize_compiler - - -def show_compilers (): - from distutils.ccompiler import show_compilers - show_compilers() - -def get_headers(directory_list): - # get *.h files from list of directories - headers = [] - for dir in directory_list: - head = glob(os.path.join(dir,"*.h")) - headers.extend(head) - - return headers - -def get_directories(list_of_sources): - # get unique directories from list of sources. - direcs = [] - for file in list_of_sources: - dir = os.path.split(file) - if dir[0] != '' and not dir[0] in direcs: - direcs.append(dir[0]) - - return direcs - - -class build_clib (Command): - - description = "build C/C++ libraries used by Python extensions" - - user_options = [ - ('build-clib', 'b', - "directory to build C/C++ libraries to"), - ('build-temp', 't', - "directory to put temporary build by-products"), - ('debug', 'g', - "compile with debugging information"), - ('force', 'f', - "forcibly build everything (ignore file timestamps)"), - ('compiler=', 'c', - "specify the compiler type"), - ] - - boolean_options = ['debug', 'force'] - - help_options = [ - ('help-compiler', None, - "list available compilers", show_compilers), - ] - - def initialize_options (self): - self.build_clib = None - self.build_temp = None - - # List of libraries to build - self.libraries = None - - # Compilation options for all libraries - self.include_dirs = None - self.define = None - self.undef = None - self.debug = None - self.force = 0 - self.compiler = None - - # initialize_options() - - - def finalize_options (self): - - # This might be confusing: both build-clib and build-temp default - # to build-temp as defined by the "build" command. This is because - # I think that C libraries are really just temporary build - # by-products, at least from the point of view of building Python - # extensions -- but I want to keep my options open. - self.set_undefined_options('build', - ('build_temp', 'build_clib'), - ('build_temp', 'build_temp'), - ('compiler', 'compiler'), - ('debug', 'debug'), - ('force', 'force')) - - self.libraries = self.distribution.libraries - if self.libraries: - self.check_library_list(self.libraries) - - if self.include_dirs is None: - self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: - self.include_dirs = string.split(self.include_dirs, - os.pathsep) - - # XXX same as for build_ext -- what about 'self.define' and - # 'self.undef' ? - - # finalize_options() - - - def run (self): - - if not self.libraries: - return - - # Yech -- this is cut 'n pasted from build_ext.py! - from distutils.ccompiler import new_compiler - self.compiler = new_compiler(compiler=self.compiler, - verbose=self.verbose, - dry_run=self.dry_run, - force=self.force) - customize_compiler(self.compiler) - - if self.include_dirs is not None: - self.compiler.set_include_dirs(self.include_dirs) - if self.define is not None: - # 'define' option is a list of (name,value) tuples - for (name,value) in self.define: - self.compiler.define_macro(name, value) - if self.undef is not None: - for macro in self.undef: - self.compiler.undefine_macro(macro) - - self.build_libraries(self.libraries) - - # run() - - - def check_library_list (self, libraries): - """Ensure that the list of libraries (presumably provided as a - command option 'libraries') is valid, i.e. it is a list of - 2-tuples, where the tuples are (library_name, build_info_dict). - Raise DistutilsSetupError if the structure is invalid anywhere; - just returns otherwise.""" - - # Yechh, blecch, ackk: this is ripped straight out of build_ext.py, - # with only names changed to protect the innocent! - - if type(libraries) is not ListType: - raise DistutilsSetupError, \ - "'libraries' option must be a list of tuples" - - for lib in libraries: - if type(lib) is not TupleType and len(lib) != 2: - raise DistutilsSetupError, \ - "each element of 'libraries' must a 2-tuple" - - if type(lib[0]) is not StringType: - raise DistutilsSetupError, \ - "first element of each tuple in 'libraries' " + \ - "must be a string (the library name)" - if '/' in lib[0] or (os.sep != '/' and os.sep in lib[0]): - raise DistutilsSetupError, \ - ("bad library name '%s': " + - "may not contain directory separators") % \ - lib[0] - - if type(lib[1]) is not DictionaryType: - raise DistutilsSetupError, \ - "second element of each tuple in 'libraries' " + \ - "must be a dictionary (build info)" - # for lib - - # check_library_list () - - - def get_library_names (self): - # Assume the library list is valid -- 'check_library_list()' is - # called from 'finalize_options()', so it should be! - - if not self.libraries: - return None - - lib_names = [] - for (lib_name, build_info) in self.libraries: - lib_names.append(lib_name) - return lib_names - - # get_library_names () - - - def get_source_files (self): - self.check_library_list(self.libraries) - filenames = [] - - # Gets source files specified and any "*.h" header files in - # those directories. - for ext in self.libraries: - filenames.extend(ext[1]['sources']) - filenames.extend(get_headers(get_directories(ext[1]['sources']))) - - return filenames - - def build_libraries (self, libraries): - - compiler = self.compiler - - for (lib_name, build_info) in libraries: - sources = build_info.get('sources') - if sources is None or type(sources) not in (ListType, TupleType): - raise DistutilsSetupError, \ - ("in 'libraries' option (library '%s'), " + - "'sources' must be present and must be " + - "a list of source filenames") % lib_name - sources = list(sources) - - self.announce("building '%s' library" % lib_name) - - # First, compile the source code to object files in the library - # directory. (This should probably change to putting object - # files in a temporary build directory.) - macros = build_info.get('macros') - include_dirs = build_info.get('include_dirs') - objects = self.compiler.compile(sources, - output_dir=self.build_temp, - macros=macros, - include_dirs=include_dirs, - debug=self.debug) - - # Now "link" the object files together into a static library. - # (On Unix at least, this isn't really linking -- it just - # builds an archive. Whatever.) - self.compiler.create_static_lib(objects, lib_name, - output_dir=self.build_clib, - debug=self.debug) - - # for libraries - - # build_libraries () - -# class build_lib diff --git a/scipy_distutils/command/build_ext.py b/scipy_distutils/command/build_ext.py deleted file mode 100644 index 343434659..000000000 --- a/scipy_distutils/command/build_ext.py +++ /dev/null @@ -1,60 +0,0 @@ -""" Modified version of build_ext that handles fortran source files and f2py - - build_extension() handles building any needed static fortran libraries - first and then calls our slightly_modified_..._extenstion() to do the - rest of the processing in the (mostly) standard way. -""" - -import os, string -from types import * - -from distutils.dep_util import newer_group, newer -from distutils.command.build_ext import * -from distutils.command.build_ext import build_ext as old_build_ext - -class build_ext (old_build_ext): - - def run (self): - - if self.distribution.has_f_libraries(): - build_flib = self.get_finalized_command('build_flib') - self.libraries.extend(build_flib.get_library_names() or []) - self.library_dirs.extend(build_flib.get_library_dirs() or []) - #self.library_dirs.extend(build_flib.get_library_dirs() or []) - #runtime_dirs = build_flib.get_runtime_library_dirs() - #self.runtime_library_dirs.extend(runtime_dirs or []) - - #?? what is this ?? - self.library_dirs.append(build_flib.build_flib) - - old_build_ext.run(self) - - def build_extension(self, ext): - # support for building static fortran libraries - if self.distribution.has_f_libraries(): - build_flib = self.get_finalized_command('build_flib') - moreargs = build_flib.fcompiler.get_extra_link_args() - if moreargs != []: - if ext.extra_link_args is None: - ext.extra_link_args = moreargs - else: - ext.extra_link_args += moreargs - # be sure to include fortran runtime library directory names - runtime_dirs = build_flib.get_runtime_library_dirs() - ext.runtime_library_dirs.extend(runtime_dirs or []) - linker_so = build_flib.fcompiler.get_linker_so() - if linker_so is not None: - self.compiler.linker_so = linker_so - # end of fortran source support - return old_build_ext.build_extension(self,ext) - - def get_source_files (self): - self.check_extensions_list(self.extensions) - filenames = [] - - # Get sources and any include files in the same directory. - for ext in self.extensions: - filenames.extend(ext.sources) - filenames.extend(get_headers(get_directories(ext.sources))) - - return filenames diff --git a/scipy_distutils/command/build_flib.py b/scipy_distutils/command/build_flib.py deleted file mode 100644 index 1fdf2056b..000000000 --- a/scipy_distutils/command/build_flib.py +++ /dev/null @@ -1,840 +0,0 @@ -""" Implements the build_flib command which should go into Distutils - at some point. - - Note: - Right now, we're dynamically linking to the Fortran libraries on - some platforms (Sun for sure). This is fine for local installations - but a bad thing for redistribution because these libraries won't - live on any machine that doesn't have a fortran compiler installed. - It is pretty hard (impossible?) to get gcc to pass the right compiler - flags on Sun to get the linker to use static libs for the fortran - stuff. Investigate further... - -Bugs: - *** Options -e and -x have no effect when used with --help-compiler - options. E.g. - ./setup.py build_flib --help-compiler -e g77-3.0 - finds g77-2.95. - How to extract these options inside the show_compilers function? - *** Option --force has no effect when switching a compiler. One must - manually remove .o files that were generated earlier by a - different compiler. - *** compiler.is_available() method may not work correctly on nt - because of lack of knowledge how to get exit status in - run_command function. However, it may give reasonable results - based on a version string. - *** Some vendors provide different compilers for F77 and F90 - compilations. Currently, checking the availability of these - compilers is based on only checking the availability of the - corresponding F77 compiler. If it exists, then F90 is assumed - to exist also. - -Open issues: - *** User-defined compiler flags. Do we need --fflags? - -Fortran compilers (as to be used with --fcompiler= option): - Absoft - Sun - SGI - Intel - Itanium - NAG - Compaq - Gnu - VAST -""" - -import distutils -import distutils.dep_util, distutils.dir_util -import os,sys,string -import commands,re -from types import * -from distutils.command.build_clib import build_clib -from distutils.errors import * - -if os.name == 'nt': - def run_command(command): - """ not sure how to get exit status on nt. """ - in_pipe,out_pipe = os.popen4(command) - in_pipe.close() - text = out_pipe.read() - return 0, text -else: - run_command = commands.getstatusoutput - -def show_compilers(): - for compiler_class in all_compilers: - compiler = compiler_class() - if compiler.is_available(): - print compiler - -class build_flib (build_clib): - - description = "build f77/f90 libraries used by Python extensions" - - user_options = [ - ('build-flib', 'b', - "directory to build f77/f90 libraries to"), - ('build-temp', 't', - "directory to put temporary build by-products"), - ('debug', 'g', - "compile with debugging information"), - ('force', 'f', - "forcibly build everything (ignore file timestamps)"), - ('fcompiler=', 'c', - "specify the compiler type"), - ('fcompiler-exec=', 'e', - "specify the path to F77 compiler"), - ('f90compiler-exec=', 'x', - "specify the path to F90 compiler"), - ] - - boolean_options = ['debug', 'force'] - - help_options = [ - ('help-compiler', None, - "list available compilers", show_compilers), - ] - - def initialize_options (self): - - self.build_flib = None - self.build_temp = None - - self.fortran_libraries = None - self.define = None - self.undef = None - self.debug = None - self.force = 0 - self.fcompiler = None - self.fcompiler_exec = None - self.f90compiler_exec = None - - # initialize_options() - - def finalize_options (self): - self.set_undefined_options('build', - ('build_temp', 'build_flib'), - ('build_temp', 'build_temp'), - ('debug', 'debug'), - ('force', 'force')) - fc = find_fortran_compiler(self.fcompiler, - self.fcompiler_exec, - self.f90compiler_exec) - if not fc: - raise DistutilsOptionError, 'Fortran compiler not available: %s'%(self.fcompiler) - else: - self.announce(' using %s Fortran compiler' % fc) - self.fcompiler = fc - if self.has_f_libraries(): - self.fortran_libraries = self.distribution.fortran_libraries - self.check_library_list(self.fortran_libraries) - - # finalize_options() - - def has_f_libraries(self): - return self.distribution.has_f_libraries() - - def run (self): - if not self.has_f_libraries(): - return - self.build_libraries(self.fortran_libraries) - - # run () - - def get_library_names(self): - if not self.has_f_libraries(): - return None - - lib_names = [] - - for (lib_name, build_info) in self.fortran_libraries: - lib_names.append(lib_name) - - if self.fcompiler is not None: - lib_names.extend(self.fcompiler.get_libraries()) - - return lib_names - - # get_library_names () - - def get_library_dirs(self): - if not self.has_f_libraries(): - return []#None - - lib_dirs = [] - - if self.fcompiler is not None: - lib_dirs.extend(self.fcompiler.get_library_dirs()) - - return lib_dirs - - # get_library_dirs () - - def get_runtime_library_dirs(self): - if not self.has_f_libraries(): - return []#None - - lib_dirs = [] - - if self.fcompiler is not None: - lib_dirs.extend(self.fcompiler.get_runtime_library_dirs()) - - return lib_dirs - - # get_library_dirs () - - def get_source_files (self): - self.check_library_list(self.fortran_libraries) - filenames = [] - - # Gets source files specified - for ext in self.fortran_libraries: - filenames.extend(ext[1]['sources']) - - return filenames - - def build_libraries (self, fortran_libraries): - - fcompiler = self.fcompiler - - for (lib_name, build_info) in fortran_libraries: - sources = build_info.get('sources') - if sources is None or type(sources) not in (ListType, TupleType): - raise DistutilsSetupError, \ - ("in 'fortran_libraries' option (library '%s'), " + - "'sources' must be present and must be " + - "a list of source filenames") % lib_name - sources = list(sources) - module_dirs = build_info.get('module_dirs') - module_files = build_info.get('module_files') - self.announce(" building '%s' library" % lib_name) - - if module_files: - fcompiler.build_library(lib_name, module_files, - temp_dir=self.build_temp) - - fcompiler.build_library(lib_name, sources, - module_dirs, temp_dir=self.build_temp) - - # for loop - - # build_libraries () - - -class fortran_compiler_base: - - vendor = None - ver_match = None - - def __init__(self): - # Default initialization. Constructors of derived classes MUST - # call this functions. - self.version = None - - self.f77_switches = '' - self.f77_opt = '' - self.f77_debug = '' - - self.f90_switches = '' - self.f90_opt = '' - self.f90_debug = '' - - self.libraries = [] - self.library_dirs = [] - - if self.vendor is None: - raise DistutilsInternalError,\ - '%s must define vendor attribute'%(self.__class__) - if self.ver_match is None: - raise DistutilsInternalError,\ - '%s must define ver_match attribute'%(self.__class__) - - def to_object(self,dirty_files,module_dirs=None, temp_dir=''): - files = string.join(dirty_files) - f90_files = get_f90_files(dirty_files) - f77_files = get_f77_files(dirty_files) - if f90_files != []: - obj1 = self.f90_compile(f90_files,module_dirs,temp_dir = temp_dir) - else: - obj1 = [] - if f77_files != []: - obj2 = self.f77_compile(f77_files, temp_dir = temp_dir) - else: - obj2 = [] - return obj1 + obj2 - - def source_to_object_names(self,source_files, temp_dir=''): - file_list = map(lambda x: os.path.basename(x),source_files) - file_base_ext = map(lambda x: os.path.splitext(x),file_list) - object_list = map(lambda x: x[0] +'.o',file_base_ext) - object_files = map(lambda x,td=temp_dir: os.path.join(td,x),object_list) - return object_files - - def source_and_object_pairs(self,source_files, temp_dir=''): - object_files = self.source_to_object_names(source_files,temp_dir) - file_pairs = zip(source_files,object_files) - return file_pairs - - def f_compile(self,compiler,switches, source_files, - module_dirs=None, temp_dir=''): - module_switch = self.build_module_switch(module_dirs) - file_pairs = self.source_and_object_pairs(source_files,temp_dir) - object_files = [] - for source,object in file_pairs: - if distutils.dep_util.newer(source,object): - cmd = compiler + ' ' + switches + \ - module_switch + ' -c ' + source + ' -o ' + object - print cmd - failure = os.system(cmd) - if failure: - raise ValueError, 'failure during compile' - object_files.append(object) - return object_files - #return all object files to make sure everything is archived - #return map(lambda x: x[1], file_pairs) - - def f90_compile(self,source_files,module_dirs=None, temp_dir=''): - switches = string.join((self.f90_switches, self.f90_opt)) - return self.f_compile(self.f90_compiler,switches, - source_files, module_dirs,temp_dir) - - def f77_compile(self,source_files,module_dirs=None, temp_dir=''): - switches = string.join((self.f77_switches, self.f77_opt)) - return self.f_compile(self.f77_compiler,switches, - source_files, module_dirs,temp_dir) - - - def build_module_switch(self, module_dirs): - return '' - - def create_static_lib(self, object_files, library_name, - output_dir='', debug=None): - lib_file = os.path.join(output_dir,'lib'+library_name+'.a') - newer = distutils.dep_util.newer - # This doesn't work -- no way to know if the file is in the archive - #object_files = filter(lambda o,lib=lib_file:\ - # distutils.dep_util.newer(o,lib),object_files) - objects = string.join(object_files) - if objects: - cmd = 'ar -cur %s %s' % (lib_file,objects) - print cmd - os.system(cmd) - - def build_library(self,library_name,source_list,module_dirs=None, - temp_dir = ''): - #make sure the temp directory exists before trying to build files - import distutils.dir_util - distutils.dir_util.mkpath(temp_dir) - #this compiles the files - object_list = self.to_object(source_list,module_dirs,temp_dir) - # actually we need to use all the object file names here to - # make sure the library is always built. It could occur that an - # object file exists but hasn't been put in the archive. (happens - # a lot when builds fail once and are restarted). - object_list = self.source_to_object_names(source_list, temp_dir) - #self.create_static_lib(object_list,library_name,temp_dir) - # This is pure bunk... - # Windows fails for long argument strings on the command line. - # if objects is real long (> 2048 chars or so on my machine), - # the command fails (cmd.exe /e:2048 on w2k) - # for now we'll split linking into to steps which should work for - objects = object_list[:] - while objects: - obj,objects = objects[:20],objects[20:] - self.create_static_lib(obj,library_name,temp_dir) - - def dummy_fortran_files(self): - import tempfile - d = tempfile.gettempdir() - dummy_name = os.path.join(d,'__dummy.f') - dummy = open(dummy_name,'w') - dummy.write(" subroutine dummy()\n end\n") - dummy.close() - return (os.path.join(d,'__dummy.f'),os.path.join(d,'__dummy.o')) - - def is_available(self): - return self.get_version() - - def get_version(self): - """Return the compiler version. If compiler is not available, - return empty string.""" - # XXX: Is there compilers that have no version? If yes, - # this test will fail even if the compiler is available. - if self.version is not None: - # Finding version is expensive, so return previously found - # version string. - return self.version - self.version = '' - # works I think only for unix... - #print 'command:', self.ver_cmd - exit_status, out_text = run_command(self.ver_cmd) - #print exit_status, out_text - if not exit_status: - m = re.match(self.ver_match,out_text) - if m: - self.version = m.group('version') - return self.version - - def get_libraries(self): - return self.libraries - def get_library_dirs(self): - return self.library_dirs - def get_extra_link_args(self): - return [] - def get_runtime_library_dirs(self): - return [] - def get_linker_so(self): - """ - If a compiler requires specific linker then return a list - containing a linker executable name and linker options. - Otherwise, return None. - """ - - def __str__(self): - return "%s %s" % (self.vendor, self.get_version()) - - -class absoft_fortran_compiler(fortran_compiler_base): - - vendor = 'Absoft' - ver_match = r'FORTRAN 77 Compiler (?P<version>[^\s*,]*).*?Absoft Corp' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - if fc is None: - fc = 'f77' - if f90c is None: - f90c = 'f90' - - self.f77_compiler = fc - self.f90_compiler = f90c - - # got rid of -B108 cause it was generating 2 underscores instead - # of one on the newest version. Now we use -YEXT_SFX=_ to - # specify the output format - if os.name == 'nt': - self.f90_switches = '-f fixed -YCFRL=1 -YCOM_NAMES=LCS' \ - ' -YCOM_PFX -YEXT_PFX -YEXT_NAMES=LCS' \ - ' -YCOM_SFX=_ -YEXT_SFX=_ -YEXT_NAMES=LCS' - self.f90_opt = '-O -Q100' - self.f77_switches = '-N22 -N90 -N110' - self.f77_opt = '-O -Q100' - self.libraries = ['fio', 'fmath', 'f90math', 'COMDLG32'] - else: - self.f90_switches = '-ffixed -YCFRL=1 -YCOM_NAMES=LCS' \ - ' -YCOM_PFX -YEXT_PFX -YEXT_NAMES=LCS' \ - ' -YCOM_SFX=_ -YEXT_SFX=_ -YEXT_NAMES=LCS' - self.f90_opt = '-O -B101' - self.f77_switches = '-N22 -N90 -N110 -B108' - self.f77_opt = '-O -B101' - - self.libraries = ['fio', 'f77math', 'f90math'] - - try: - dir = os.environ['ABSOFT'] - self.library_dirs = [os.path.join(dir,'lib')] - except KeyError: - self.library_dirs = [] - - self.ver_cmd = self.f77_compiler + ' -V -c %s -o %s' % \ - self.dummy_fortran_files() - - def build_module_switch(self,module_dirs): - res = '' - if module_dirs: - for mod in module_dirs: - res = res + ' -p' + mod - return res - - def get_extra_link_args(self): - return [] - # Couldn't get this to link for anything using gcc. - #dr = "c:\\Absoft62\\lib" - #libs = ['fio.lib', 'COMDLG32.lib','fmath.lib', 'f90math.lib','libcomdlg32.a' ] - #libs = map(lambda x,dr=dr:os.path.join(dr,x),libs) - #return libs - - -class sun_fortran_compiler(fortran_compiler_base): - - vendor = 'Sun' - ver_match = r'f77: (?P<version>[^\s*,]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - if fc is None: - fc = 'f77' - if f90c is None: - f90c = 'f90' - - self.f77_compiler = fc # not tested - self.f77_switches = ' -pic ' - self.f77_opt = ' -fast -dalign ' - - self.f90_compiler = f90c - self.f90_switches = ' -fixed ' # ??? why fixed? - self.f90_opt = ' -fast -dalign ' - - self.libraries = ['f90', 'F77', 'M77', 'sunmath', 'm'] - #threaded - #self.libraries = ['f90', 'F77_mt', 'sunmath_mt', 'm', 'thread'] - #self.libraries = [] - self.library_dirs = self.find_lib_dir() - #print 'sun:',self.library_dirs - - self.ver_cmd = self.f77_compiler + ' -V' - - def build_module_switch(self,module_dirs): - res = '' - if module_dirs: - for mod in module_dirs: - res = res + ' -M' + mod - return res - - def find_lib_dir(self): - library_dirs = [] - lib_match = r'### f90: Note: LD_RUN_PATH\s*= '\ - '(?P<lib_paths>[^\s.]*).*' - cmd = self.f90_compiler + ' -dryrun dummy.f' - exit_status, output = run_command(cmd) - if not exit_status: - libs = re.findall(lib_match,output) - if libs: - library_dirs = string.split(libs[0],':') - self.get_version() # force version calculation - compiler_home = os.path.dirname(library_dirs[0]) - library_dirs.append(os.path.join(compiler_home, - self.version,'lib')) - return library_dirs - def get_runtime_library_dirs(self): - return self.find_lib_dir() - def get_extra_link_args(self): - return ['-mimpure-text'] - - -class mips_fortran_compiler(fortran_compiler_base): - - vendor = 'SGI' - ver_match = r'MIPSpro Compilers: Version (?P<version>[^\s*,]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - if fc is None: - fc = 'f77' - if f90c is None: - f90c = 'f90' - - self.f77_compiler = fc # not tested - self.f77_switches = ' -n32 -KPIC ' - self.f77_opt = ' -O3 ' - - self.f90_compiler = f90c - self.f90_switches = ' -n32 -KPIC -fixedform ' # why fixed ??? - self.f90_opt = ' ' - - self.libraries = ['fortran', 'ftn', 'm'] - self.library_dirs = self.find_lib_dir() - - self.ver_cmd = self.f77_compiler + ' -version' - - def build_module_switch(self,module_dirs): - res = '' - return res - def find_lib_dir(self): - library_dirs = [] - return library_dirs - def get_runtime_library_dirs(self): - return self.find_lib_dir() - def get_extra_link_args(self): - return [] - - -class gnu_fortran_compiler(fortran_compiler_base): - - vendor = 'Gnu' - ver_match = r'g77 version (?P<version>[^\s*]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - if sys.platform == 'win32': - self.libraries = ['gcc','g2c'] - self.library_dirs = self.find_lib_directories() - - if fc is None: - fc = 'g77' - if f90c is None: - f90c = fc - - self.f77_compiler = fc - - switches = ' -Wall -fno-second-underscore ' - - if os.name != 'nt': - switches = switches + ' -fpic ' - - self.f77_switches = switches - - self.ver_cmd = self.f77_compiler + ' -v ' - self.f77_opt = self.get_opt() - - def get_opt(self): - import cpuinfo - cpu = cpuinfo.cpuinfo() - opt = ' -O3 -funroll-loops ' - - # only check for more optimization if g77 can handle - # it. - if self.get_version(): - if self.version[0]=='3': # is g77 3.x.x - if cpu.is_AthlonK6(): - opt = opt + ' -march=k6 ' - elif cpu.is_AthlonK7(): - opt = opt + ' -march=athlon ' - if cpu.is_i686(): - opt = opt + ' -march=i686 ' - elif cpu.is_i586(): - opt = opt + ' -march=i586 ' - elif cpu.is_i486(): - opt = opt + ' -march=i486 ' - elif cpu.is_i386(): - opt = opt + ' -march=i386 ' - if cpu.is_Intel(): - opt = opt + ' -malign-double ' - return opt - - def find_lib_directories(self): - lib_dir = [] - match = r'Reading specs from (.*)/specs' - - # works I think only for unix... - exit_status, out_text = run_command('g77 -v') - if not exit_status: - m = re.findall(match,out_text) - if m: - lib_dir= m #m[0] - return lib_dir - - def get_linker_so(self): - # win32 linking should be handled by standard linker - if sys.platform != 'win32': - return [self.f77_compiler,'-shared'] - - def f90_compile(self,source_files,module_files,temp_dir=''): - raise DistutilsExecError, 'f90 not supported by Gnu' - - -#http://developer.intel.com/software/products/compilers/f50/linux/ -class intel_ia32_fortran_compiler(fortran_compiler_base): - - vendor = 'Intel' # Intel(R) Corporation - ver_match = r'Intel\(R\) Fortran Compiler for 32-bit applications, Version (?P<version>[^\s*]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - - if fc is None: - fc = 'ifc' - if f90c is None: - f90c = fc - - self.f77_compiler = fc - self.f90_compiler = f90c - - switches = ' -KPIC ' - - import cpuinfo - cpu = cpuinfo.cpuinfo() - if cpu.has_fdiv_bug(): - switches = switches + ' -fdiv_check ' - if cpu.has_f00f_bug(): - switches = switches + ' -0f_check ' - self.f77_switches = self.f90_switches = switches - self.f77_switches = self.f77_switches + ' -FI ' - - self.f77_opt = self.f90_opt = self.get_opt() - - debug = ' -g -C ' - self.f77_debug = self.f90_debug = debug - - self.ver_cmd = self.f77_compiler+' -FI -V -c %s -o %s' %\ - self.dummy_fortran_files() - - def get_opt(self): - import cpuinfo - cpu = cpuinfo.cpuinfo() - opt = ' -O3 ' - if cpu.is_PentiumPro() or cpu.is_PentiumII(): - opt = opt + ' -tpp6 -xi ' - elif cpu.is_PentiumIII(): - opt = opt + ' -tpp6 ' - elif cpu.is_Pentium(): - opt = opt + ' -tpp5 ' - elif cpu.is_PentiumIV(): - opt = opt + ' -tpp7 -xW ' - elif cpu.has_mmx(): - opt = opt + ' -xM ' - return opt - - - def get_linker_so(self): - return [self.f77_compiler,'-shared'] - - -class intel_itanium_fortran_compiler(intel_ia32_fortran_compiler): - - vendor = 'Itanium' - ver_match = r'Intel\(R\) Fortran 90 Compiler Itanium\(TM\) Compiler for the Itanium\(TM\)-based applications, Version (?P<version>[^\s*]*)' - - def __init__(self, fc = None, f90c = None): - if fc is None: - fc = 'efc' - intel_ia32_fortran_compiler.__init__(self, fc, f90c) - - -class nag_fortran_compiler(fortran_compiler_base): - - vendor = 'NAG' - ver_match = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - - if fc is None: - fc = 'f95' - if f90c is None: - f90c = fc - - self.f77_compiler = fc - self.f90_compiler = f90c - - switches = '' - debug = ' -g -gline -g90 -nan -C ' - - self.f77_switches = self.f90_switches = switches - self.f77_switches = self.f77_switches + ' -fixed ' - self.f77_debug = self.f90_debug = debug - self.f77_opt = self.f90_opt = self.get_opt() - - self.ver_cmd = self.f77_compiler+' -V ' - - def get_opt(self): - opt = ' -O4 -target=native ' - return opt - - def get_linker_so(self): - return [self.f77_compiler,'-Wl,-shared'] - - -class vast_fortran_compiler(fortran_compiler_base): - - vendor = 'VAST' - ver_match = r'\s*Pacific-Sierra Research vf90 (Personal|Professional)\s+(?P<version>[^\s]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - - if fc is None: - fc = 'g77' - if f90c is None: - f90c = 'f90' - - self.f77_compiler = fc - self.f90_compiler = f90c - - d,b = os.path.split(f90c) - vf90 = os.path.join(d,'v'+b) - self.ver_cmd = vf90+' -v ' - - gnu = gnu_fortran_compiler(fc) - if not gnu.is_available(): # VAST compiler requires g77. - self.version = '' - return - if not self.is_available(): - return - - self.f77_switches = gnu.f77_switches - self.f77_debug = gnu.f77_debug - self.f77_opt = gnu.f77_opt - - # XXX: need f90 switches, debug, opt - - def get_linker_so(self): - return [self.f90_compiler,'-shared'] - -class compaq_fortran_compiler(fortran_compiler_base): - - vendor = 'Compaq' - ver_match = r'Compaq Fortran (?P<version>[^\s]*)' - - def __init__(self, fc = None, f90c = None): - fortran_compiler_base.__init__(self) - - if fc is None: - fc = 'fort' - if f90c is None: - f90c = fc - - self.f77_compiler = fc - self.f90_compiler = f90c - - switches = ' -assume no2underscore -nomixed_str_len_arg ' - debug = ' -g -check_bounds ' - - self.f77_switches = self.f90_switches = switches - self.f77_debug = self.f90_debug = debug - self.f77_opt = self.f90_opt = self.get_opt() - - # XXX: uncomment if required - #self.libraries = ' -lUfor -lfor -lFutil -lcpml -lots -lc ' - - # XXX: fix the version showing flag - self.ver_cmd = self.f77_compiler+' -V ' - - def get_opt(self): - opt = ' -O4 -align dcommons -arch host -assume bigarrays -assume nozsize -math_library fast -tune host ' - return opt - - def get_linker_so(self): - # XXX: is -shared needed? - return [self.f77_compiler,'-shared'] - - -def match_extension(files,ext): - match = re.compile(r'.*[.]('+ext+r')\Z',re.I).match - return filter(lambda x,match = match: match(x),files) - -def get_f77_files(files): - return match_extension(files,'for|f77|ftn|f') - -def get_f90_files(files): - return match_extension(files,'f90|f95') - -def get_fortran_files(files): - return match_extension(files,'f90|f95|for|f77|ftn|f') - -def find_fortran_compiler(vendor = None, fc = None, f90c = None): - fcompiler = None - for compiler_class in all_compilers: - if vendor is not None and vendor != compiler_class.vendor: - continue - print compiler_class - compiler = compiler_class(fc,f90c) - if compiler.is_available(): - fcompiler = compiler - break - return fcompiler - -all_compilers = [absoft_fortran_compiler, - mips_fortran_compiler, - sun_fortran_compiler, - intel_ia32_fortran_compiler, - intel_itanium_fortran_compiler, - nag_fortran_compiler, - compaq_fortran_compiler, - vast_fortran_compiler, - gnu_fortran_compiler, - ] - -if __name__ == "__main__": - show_compilers() diff --git a/scipy_distutils/command/build_py.py b/scipy_distutils/command/build_py.py deleted file mode 100644 index 6f5e5df51..000000000 --- a/scipy_distutils/command/build_py.py +++ /dev/null @@ -1,25 +0,0 @@ -from distutils.command.build_py import * -from distutils.command.build_py import build_py as old_build_py -from fnmatch import fnmatch - -def is_setup_script(file): - file = os.path.basename(file) - return (fnmatch(file,"setup.py") or fnmatch(file,"setup_*.py")) - -class build_py(old_build_py): - def find_package_modules (self, package, package_dir): - # we filter all files that are setup.py or setup_xxx.py - self.check_package(package, package_dir) - module_files = glob(os.path.join(package_dir, "*.py")) - modules = [] - setup_script = os.path.abspath(self.distribution.script_name) - - for f in module_files: - abs_f = os.path.abspath(f) - if abs_f != setup_script and not is_setup_script(f): - module = os.path.splitext(os.path.basename(f))[0] - modules.append((package, module, f)) - else: - self.debug_print("excluding %s" % setup_script) - return modules - diff --git a/scipy_distutils/command/cpuinfo.py b/scipy_distutils/command/cpuinfo.py deleted file mode 100644 index 3e1796ddd..000000000 --- a/scipy_distutils/command/cpuinfo.py +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env python -""" -cpuinfo - -Copyright 2001 Pearu Peterson all rights reserved, -Pearu Peterson <pearu@cens.ioc.ee> -Permission to use, modify, and distribute this software is given under the -terms of the LGPL. See http://www.fsf.org - -Note: This should be merged into proc at some point. Perhaps proc should -be returning classes like this instead of using dictionaries. - -NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. -$Revision$ -$Date$ -Pearu Peterson -""" - -__version__ = "$Id$" - -__all__ = ['cpuinfo'] - -import sys,string,re,types - -class cpuinfo_base: - """Holds CPU information and provides methods for requiring - the availability of various CPU features. - """ - - def _try_call(self,func): - try: - return func() - except: - pass - - def __getattr__(self,name): - if name[0]!='_': - if hasattr(self,'_'+name): - attr = getattr(self,'_'+name) - if type(attr) is types.MethodType: - return lambda func=self._try_call,attr=attr : func(attr) - else: - return lambda : None - raise AttributeError,name - - -class linux_cpuinfo(cpuinfo_base): - - info = None - - def __init__(self): - if self.info is not None: - return - info = [] - try: - for line in open('/proc/cpuinfo').readlines(): - name_value = map(string.strip,string.split(line,':',1)) - if len(name_value)!=2: - continue - name,value = name_value - if not info or info[-1].has_key(name): # next processor - info.append({}) - info[-1][name] = value - except: - print sys.exc_value,'(ignoring)' - self.__class__.info = info - - def _not_impl(self): pass - - # Athlon - - def _is_AMD(self): - return self.info[0]['vendor_id']=='AuthenticAMD' - - def _is_AthlonK6(self): - return re.match(r'.*?AMD-K6',self.info[0]['model name']) is not None - - def _is_AthlonK7(self): - return re.match(r'.*?AMD-K7',self.info[0]['model name']) is not None - - # Alpha - - def _is_Alpha(self): - return self.info[0]['cpu']=='Alpha' - - def _is_EV4(self): - return self.is_Alpha() and self.info[0]['cpu model'] == 'EV4' - - def _is_EV5(self): - return self.is_Alpha() and self.info[0]['cpu model'] == 'EV5' - - def _is_EV56(self): - return self.is_Alpha() and self.info[0]['cpu model'] == 'EV56' - - def _is_PCA56(self): - return self.is_Alpha() and self.info[0]['cpu model'] == 'PCA56' - - # Intel - - #XXX - _is_i386 = _not_impl - - def _is_Intel(self): - return self.info[0]['vendor_id']=='GenuineIntel' - - def _is_i486(self): - return self.info[0]['cpu']=='i486' - - def _is_i586(self): - return self.is_Intel() and self.info[0]['model'] == '5' - - def _is_i686(self): - return self.is_Intel() and self.info[0]['model'] == '6' - - def _is_Celeron(self): - return re.match(r'.*?Celeron', - self.info[0]['model name']) is not None - - #XXX - _is_Pentium = _is_PentiumPro = _is_PentiumIII = _is_PentiumIV = _not_impl - - def _is_PentiumII(self): - return re.match(r'.*?Pentium II\b', - self.info[0]['model name']) is not None - - # Varia - - def _is_singleCPU(self): - return len(self.info) == 1 - - def _has_fdiv_bug(self): - return self.info[0]['fdiv_bug']=='yes' - - def _has_f00f_bug(self): - return self.info[0]['f00f_bug']=='yes' - - def _has_mmx(self): - return re.match(r'.*?\bmmx',self.info[0]['flags']) is not None - -if sys.platform[:5] == 'linux': # variations: linux2,linux-i386 (any others?) - cpuinfo = linux_cpuinfo -#XXX: other OS's. Eg. use _winreg on Win32. Or os.uname on unices. -else: - cpuinfo = cpuinfo_base - - -""" -laptop: -[{'cache size': '256 KB', 'cpu MHz': '399.129', 'processor': '0', 'fdiv_bug': 'no', 'coma_bug': 'no', 'model': '6', 'cpuid level': '2', 'model name': 'Mobile Pentium II', 'fpu_exception': 'yes', 'hlt_bug': 'no', 'bogomips': '796.26', 'vendor_id': 'GenuineIntel', 'fpu': 'yes', 'wp': 'yes', 'cpu family': '6', 'f00f_bug': 'no', 'stepping': '13', 'flags': 'fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr'}] - -kev: -[{'cache size': '512 KB', 'cpu MHz': '350.799', 'processor': '0', 'fdiv_bug': 'no', 'coma_bug': 'no', 'model': '5', 'cpuid level': '2', 'model name': 'Pentium II (Deschutes)', 'fpu_exception': 'yes', 'hlt_bug': 'no', 'bogomips': '699.59', 'vendor_id': 'GenuineIntel', 'fpu': 'yes', 'wp': 'yes', 'cpu family': '6', 'f00f_bug': 'no', 'stepping': '3', 'flags': 'fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr'}, {'cache size': '512 KB', 'cpu MHz': '350.799', 'processor': '1', 'fdiv_bug': 'no', 'coma_bug': 'no', 'model': '5', 'cpuid level': '2', 'model name': 'Pentium II (Deschutes)', 'fpu_exception': 'yes', 'hlt_bug': 'no', 'bogomips': '701.23', 'vendor_id': 'GenuineIntel', 'fpu': 'yes', 'wp': 'yes', 'cpu family': '6', 'f00f_bug': 'no', 'stepping': '3', 'flags': 'fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr'}] - -ath: -[{'cache size': '512 KB', 'cpu MHz': '503.542', 'processor': '0', 'fdiv_bug': 'no', 'coma_bug': 'no', 'model': '1', 'cpuid level': '1', 'model name': 'AMD-K7(tm) Processor', 'fpu_exception': 'yes', 'hlt_bug': 'no', 'bogomips': '1002.70', 'vendor_id': 'AuthenticAMD', 'fpu': 'yes', 'wp': 'yes', 'cpu family': '6', 'f00f_bug': 'no', 'stepping': '2', 'flags': 'fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat mmx syscall mmxext 3dnowext 3dnow'}] - -fiasco: -[{'max. addr. space #': '127', 'cpu': 'Alpha', 'cpu serial number': 'Linux_is_Great!', 'kernel unaligned acc': '0 (pc=0,va=0)', 'system revision': '0', 'system variation': 'LX164', 'cycle frequency [Hz]': '533185472', 'system serial number': 'MILO-2.0.35-c5.', 'timer frequency [Hz]': '1024.00', 'cpu model': 'EV56', 'platform string': 'N/A', 'cpu revision': '0', 'BogoMIPS': '530.57', 'cpus detected': '0', 'phys. address bits': '40', 'user unaligned acc': '1340 (pc=2000000ec90,va=20001156da4)', 'page size [bytes]': '8192', 'system type': 'EB164', 'cpu variation': '0'}] -""" - -if __name__ == "__main__": - cpu = cpuinfo() - - cpu.is_blaa() - cpu.is_Intel() - cpu.is_Alpha() - - print 'CPU information:', - for name in dir(cpuinfo): - if name[0]=='_' and name[1]!='_' and getattr(cpu,name[1:])(): - print name[1:], - print diff --git a/scipy_distutils/command/install.py b/scipy_distutils/command/install.py deleted file mode 100644 index 43be36c8a..000000000 --- a/scipy_distutils/command/install.py +++ /dev/null @@ -1,54 +0,0 @@ -from types import StringType -from distutils.command.install import * -from distutils.command.install import install as old_install -from distutils.util import convert_path -from distutils.file_util import write_file -from distutils.errors import DistutilsOptionError - -#install support for Numeric.pth setup -class install(old_install): - def finalize_options (self): - old_install.finalize_options(self) - self.install_lib = self.install_libbase - - def handle_extra_path (self): - if self.extra_path is None: - self.extra_path = self.distribution.extra_path - - if self.extra_path is not None: - if type(self.extra_path) is StringType: - self.extra_path = string.split(self.extra_path, ',') - if len(self.extra_path) == 1: - path_file = extra_dirs = self.extra_path[0] - elif len(self.extra_path) == 2: - (path_file, extra_dirs) = self.extra_path - else: - raise DistutilsOptionError, \ - "'extra_path' option must be a list, tuple, or " + \ - "comma-separated string with 1 or 2 elements" - - # convert to local form in case Unix notation used (as it - # should be in setup scripts) - extra_dirs = convert_path(extra_dirs) - - else: - path_file = None - extra_dirs = '' - - # XXX should we warn if path_file and not extra_dirs? (in which - # case the path file would be harmless but pointless) - self.path_file = path_file - self.extra_dirs = '' - self.pth_file = extra_dirs - - # handle_extra_path () - - def create_path_file (self): - filename = os.path.join(self.install_libbase, - self.path_file + ".pth") - if self.install_path_file: - self.execute(write_file, - (filename, [self.pth_file]), - "creating %s" % filename) - else: - self.warn("path file '%s' not created" % filename)
\ No newline at end of file diff --git a/scipy_distutils/command/install_data.py b/scipy_distutils/command/install_data.py deleted file mode 100644 index 15926329c..000000000 --- a/scipy_distutils/command/install_data.py +++ /dev/null @@ -1,14 +0,0 @@ -from distutils.command.install_data import * -from distutils.command.install_data import install_data as old_install_data - -#data installer with improved intelligence over distutils -#data files are copied into the project directory instead -#of willy-nilly -class install_data (old_install_data): - def finalize_options (self): - print 'hhhhhhhhhhhheeeeeeeeeeerrrrrrrrrrrreeeeeeeeeeeee' - self.set_undefined_options('install', - ('install_lib', 'install_dir'), - ('root', 'root'), - ('force', 'force'), - ) diff --git a/scipy_distutils/command/install_headers.py b/scipy_distutils/command/install_headers.py deleted file mode 100644 index b8dc21920..000000000 --- a/scipy_distutils/command/install_headers.py +++ /dev/null @@ -1,20 +0,0 @@ -""" - I don't know much about this one, so I'm not going to mess with - it much. (eric) -""" -from distutils.command.install import * -from distutils.command.install_headers import install_headers as old_install_headers - -class install_headers (old_install_headers): - def run (self): - headers = self.distribution.headers - if not headers: - return - # hack to force headers into Numeric instead of SciPy - import os - d,f = os.path.split(self.install_dir) - self.install_dir = os.path.join(d,'Numeric') - self.mkpath(self.install_dir) - for header in headers: - (out, _) = self.copy_file(header, self.install_dir) - self.outfiles.append(out) diff --git a/scipy_distutils/command/sdist.py b/scipy_distutils/command/sdist.py deleted file mode 100644 index 0b8e4227a..000000000 --- a/scipy_distutils/command/sdist.py +++ /dev/null @@ -1,105 +0,0 @@ -from distutils.command.sdist import * -from distutils.command.sdist import sdist as old_sdist - -class sdist(old_sdist): - def add_defaults (self): - old_sdist.add_defaults(self) - if self.distribution.has_f_libraries(): - build_flib = self.get_finalized_command('build_flib') - self.filelist.extend(build_flib.get_source_files()) - - if self.distribution.has_data_files(): - self.filelist.extend(self.distribution.get_data_files()) - - def make_release_tree (self, base_dir, files): - """Create the directory tree that will become the source - distribution archive. All directories implied by the filenames in - 'files' are created under 'base_dir', and then we hard link or copy - (if hard linking is unavailable) those files into place. - Essentially, this duplicates the developer's source tree, but in a - directory named after the distribution, containing only the files - to be distributed. - """ - # Create all the directories under 'base_dir' necessary to - # put 'files' there; the 'mkpath()' is just so we don't die - # if the manifest happens to be empty. - dest_files = remove_common_base(files) - self.mkpath(base_dir) - dir_util.create_tree(base_dir, dest_files, - verbose=self.verbose, dry_run=self.dry_run) - - # And walk over the list of files, either making a hard link (if - # os.link exists) to each one that doesn't already exist in its - # corresponding location under 'base_dir', or copying each file - # that's out-of-date in 'base_dir'. (Usually, all files will be - # out-of-date, because by default we blow away 'base_dir' when - # we're done making the distribution archives.) - - if hasattr(os, 'link'): # can make hard links on this system - link = 'hard' - msg = "making hard links in %s..." % base_dir - else: # nope, have to copy - link = None - msg = "copying files to %s..." % base_dir - - if not files: - self.warn("no files to distribute -- empty manifest?") - else: - self.announce(msg) - - dest_files = [os.path.join(base_dir,file) for file in dest_files] - file_pairs = zip(files,dest_files) - for file,dest in file_pairs: - if not os.path.isfile(file): - self.warn("'%s' not a regular file -- skipping" % file) - else: - #ej: here is the only change -- made to handle - # absolute paths to files as well as relative - #par,file_name = os.path.split(file) - #dest = os.path.join(base_dir, file_name) - # end of changes - - # old code - #dest = os.path.join(base_dir, file) - #end old code - self.copy_file(file, dest, link=link) - - self.distribution.metadata.write_pkg_info(base_dir) - #raise ValueError - # make_release_tree () - -def remove_common_base(files): - """ Remove the greatest common base directory from all the - absolute file paths in the list of files. files in the - list without a parent directory are not affected. - """ - rel_files = filter(lambda x: not os.path.dirname(x),files) - abs_files = filter(os.path.dirname,files) - base = find_common_base(abs_files) - # will leave files with local path unaffected - # and maintains original file order - results = [string.replace(file,base,'') for file in files] - return results - -def find_common_base(files): - """ Find the "greatest common base directory" of a list of files - """ - if not files: - return files - result = '' - d,f = os.path.split(files[0]) - keep_looking = 1 - while(keep_looking and d): - keep_looking = 0 - for file in files: - if string.find('start'+file,'start'+d) == -1: - keep_looking = 1 - break - if keep_looking: - d,f = os.path.split(d) - else: - result = d - - if d: - d = os.path.join(d,'') - return d
\ No newline at end of file diff --git a/scipy_distutils/core.py b/scipy_distutils/core.py deleted file mode 100644 index faf8a8d9e..000000000 --- a/scipy_distutils/core.py +++ /dev/null @@ -1,41 +0,0 @@ -from distutils.core import * -from distutils.core import setup as old_setup - -from distutils.cmd import Command -from distutils.extension import Extension - -# Our dist is different than the standard one. -from scipy_distutils.dist import Distribution - -from scipy_distutils.command import build -from scipy_distutils.command import build_py -from scipy_distutils.command import build_ext -from scipy_distutils.command import build_clib -from scipy_distutils.command import build_flib -from scipy_distutils.command import sdist -from scipy_distutils.command import install_data -from scipy_distutils.command import install -from scipy_distutils.command import install_headers - -def setup(**attr): - distclass = Distribution - cmdclass = {'build': build.build, - 'build_flib': build_flib.build_flib, - 'build_ext': build_ext.build_ext, - 'build_py': build_py.build_py, - 'build_clib': build_clib.build_clib, - 'sdist': sdist.sdist, - 'install_data': install_data.install_data, - 'install': install.install, - 'install_headers': install_headers.install_headers - } - - new_attr = attr.copy() - if new_attr.has_key('cmdclass'): - cmdclass.update(new_attr['cmdclass']) - new_attr['cmdclass'] = cmdclass - - if not new_attr.has_key('distclass'): - new_attr['distclass'] = distclass - - return old_setup(**new_attr) diff --git a/scipy_distutils/dist.py b/scipy_distutils/dist.py deleted file mode 100644 index e54b35f6f..000000000 --- a/scipy_distutils/dist.py +++ /dev/null @@ -1,96 +0,0 @@ -from distutils.dist import * -from distutils.dist import Distribution as OldDistribution -from distutils.errors import DistutilsSetupError - -from types import * - -class Distribution (OldDistribution): - def __init__ (self, attrs=None): - self.fortran_libraries = None - OldDistribution.__init__(self, attrs) - - def has_f_libraries(self): - if self.fortran_libraries and len(self.fortran_libraries) > 0: - return 1 - if hasattr(self,'_been_here_has_f_libraries'): - return 0 - if self.has_ext_modules(): - # extension module sources may contain fortran files, - # extract them to fortran_libraries. - for ext in self.ext_modules: - self.fortran_sources_to_flib(ext) - self._been_here_has_f_libraries = None - return self.fortran_libraries and len(self.fortran_libraries) > 0 - - def fortran_sources_to_flib(self, ext): - """ - Extract fortran files from ext.sources and append them to - fortran_libraries item having the same name as ext. - """ - sources = [] - f_files = [] - match = re.compile(r'.*[.](f90|f95|f77|for|ftn|f)\Z',re.I).match - for file in ext.sources: - if match(file): - f_files.append(file) - else: - sources.append(file) - if not f_files: - return - - ext.sources = sources - - if self.fortran_libraries is None: - self.fortran_libraries = [] - - name = ext.name - flib = None - for n,d in self.fortran_libraries: - if n == name: - flib = d - break - if flib is None: - flib = {'sources':[]} - self.fortran_libraries.append((name,flib)) - - flib['sources'].extend(f_files) - - def check_data_file_list(self): - """Ensure that the list of data_files (presumably provided as a - command option 'data_files') is valid, i.e. it is a list of - 2-tuples, where the tuples are (name, list_of_libraries). - Raise DistutilsSetupError if the structure is invalid anywhere; - just returns otherwise.""" - print 'check_data_file_list' - if type(self.data_files) is not ListType: - raise DistutilsSetupError, \ - "'data_files' option must be a list of tuples" - - for lib in self.data_files: - if type(lib) is not TupleType and len(lib) != 2: - raise DistutilsSetupError, \ - "each element of 'data_files' must a 2-tuple" - - if type(lib[0]) is not StringType: - raise DistutilsSetupError, \ - "first element of each tuple in 'data_files' " + \ - "must be a string (the package with the data_file)" - - if type(lib[1]) is not ListType: - raise DistutilsSetupError, \ - "second element of each tuple in 'data_files' " + \ - "must be a list of files." - # for lib - - # check_data_file_list () - - def get_data_files (self): - print 'get_data_files' - self.check_data_file_list() - filenames = [] - - # Gets data files specified - for ext in self.data_files: - filenames.extend(ext[1]) - - return filenames diff --git a/scipy_distutils/fftw_info.py b/scipy_distutils/fftw_info.py deleted file mode 100755 index 0b64d6de4..000000000 --- a/scipy_distutils/fftw_info.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -def get_fftw_info(): - # FFTW (requires FFTW libraries to be previously installed) - double_libraries = ['fftw_threads','rfftw_threads','fftw','rfftw'] - float_libraries = map(lambda x: 's'+x,double_libraries) - - if os.name == 'nt': - fftw_dirs = ['c:\\fftw'] - else: - base_dir = os.environ.get('FFTW') - if base_dir is None: - base_dir = os.environ['HOME'] - fftw_dirs = [os.path.join(base_dir,'lib')] - double_libraries += ['pthread'] - float_libraries += ['pthread'] - - return float_libraries, double_libraries, fftw_dirs diff --git a/scipy_distutils/mingw32_support.py b/scipy_distutils/mingw32_support.py deleted file mode 100644 index c42e4c546..000000000 --- a/scipy_distutils/mingw32_support.py +++ /dev/null @@ -1,103 +0,0 @@ -""" -Support code for building Python extensions on Windows. - - # NT stuff - # 1. Make sure libpython<version>.a exists for gcc. If not, build it. - # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) - # 3. Force windows to use g77 - -""" - -import os, sys -import distutils.ccompiler - -# I'd really like to pull this out of scipy and make it part of distutils... -import scipy_distutils.command.build_flib as build_flib - - -if sys.platform == 'win32': - # NT stuff - # 1. Make sure libpython<version>.a exists for gcc. If not, build it. - # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) - # 3. Force windows to use g77 - - # 1. Build libpython<version> from .lib and .dll if they don't exist. - def import_library_exists(): - """ on windows platforms, make sure a gcc import library exists - """ - if sys.platform == 'win32': - lib_name = "libpython%d%d.a" % tuple(sys.version_info[:2]) - full_path = os.path.join(sys.prefix,'libs',lib_name) - #print full_path - if not os.path.exists(full_path): - return 0 - return 1 - - def build_import_library(): - """ Build the import libraries for Mingw32-gcc on Windows - """ - # lib2def lives in compiler - sys.path.append(os.path.join('.','compiler')) - - import lib2def - #libfile, deffile = parse_cmd() - #if deffile == None: - # deffile = sys.stdout - #else: - # deffile = open(deffile, 'w') - lib_name = "python%d%d.lib" % tuple(sys.version_info[:2]) - lib_file = os.path.join(sys.prefix,'libs',lib_name) - def_name = "python%d%d.def" % tuple(sys.version_info[:2]) - def_file = os.path.join(sys.prefix,'libs',def_name) - nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file) - nm_output = lib2def.getnm(nm_cmd) - dlist, flist = lib2def.parse_nm(nm_output) - lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w')) - - out_name = "libpython%d%d.a" % tuple(sys.version_info[:2]) - out_file = os.path.join(sys.prefix,'libs',out_name) - dll_name = "python%d%d.dll" % tuple(sys.version_info[:2]) - args = (dll_name,def_file,out_file) - cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args - print cmd - success = not os.system(cmd) - # for now, fail silently - if not success: - print "WARNING: failed to build import library for gcc. "\ - "Linking will fail." - #if not success: - # msg = "Couldn't find import library, and failed to build it." - # raise DistutilsPlatformError, msg - - def set_windows_compiler(compiler): - distutils.ccompiler._default_compilers = ( - - # Platform string mappings - - # on a cygwin built python we can use gcc like an ordinary UNIXish - # compiler - ('cygwin.*', 'unix'), - - # OS name mappings - ('posix', 'unix'), - ('nt', compiler), - ('mac', 'mwerks'), - - ) - def use_msvc(): - set_windows_compiler('msvc') - - def use_gcc(): - set_windows_compiler('mingw32') - - def use_g77(): - build_flib.all_compilers = [build_flib.gnu_fortran_compiler] - - # 2. force the use of gcc on windows platform - use_gcc() - # 3. force the use of g77 on windows platform - use_g77() - if not import_library_exists(): - build_import_library() - - diff --git a/scipy_distutils/misc_util.py b/scipy_distutils/misc_util.py deleted file mode 100644 index f9633323a..000000000 --- a/scipy_distutils/misc_util.py +++ /dev/null @@ -1,197 +0,0 @@ -import os,sys,string - -def get_version(release_level='alpha', path='.', major=None): - """ - Return version string calculated from CVS tree or found in - <path>/__version__.py. Automatically update <path>/__version__.py - if the version is changed. - An attempt is made to guarantee that version is increasing in - time. This function always succeeds. None is returned if no - version information is available. - - Version string is in the form - - <major>.<minor>.<micro>-<release_level>-<serial> - - and its items have the following meanings: - serial - shows cumulative changes in all files in the CVS - repository - micro - a number that is equivalent to the number of files - minor - indicates the changes in micro value (files are added - or removed) - release_level - is alpha, beta, canditate, or final - major - indicates changes in release_level. - """ - - release_level_map = {'alpha':0, - 'beta':1, - 'canditate':2, - 'final':3} - release_level_value = release_level_map.get(release_level) - if release_level_value is None: - print 'Warning: release_level=%s is not %s'\ - % (release_level, - string.join(release_level_map.keys(),',')) - - cwd = os.getcwd() - os.chdir(path) - try: - version_module = __import__('__version__') - reload(version_module) - old_version_info = version_module.version_info - old_version = version_module.version - except: - print sys.exc_value - old_version_info = None - old_version = None - os.chdir(cwd) - - cvs_revs = get_cvs_version(path) - if cvs_revs is None: - return old_version - - minor = 1 - micro,serial = cvs_revs - if old_version_info is not None: - minor = old_version_info[1] - old_release_level_value = release_level_map.get(old_version_info[3]) - if micro != old_version_info[2]: # files have beed added or removed - minor = minor + 1 - if major is None: - major = old_version_info[0] - if old_release_level_value is not None: - if old_release_level_value > release_level_value: - major = major + 1 - if major is None: - major = 0 - - version_info = (major,minor,micro,release_level,serial) - version = '%s.%s.%s-%s-%s' % version_info - - if version != old_version: - print 'updating version: %s -> %s'%(old_version,version) - version_file = os.path.abspath(os.path.join(path,'__version__.py')) - f = open(version_file,'w') - f.write('# This file is automatically updated with get_version\n'\ - '# function from scipy_distutils.misc_utils.py\n'\ - 'version = %s\n'\ - 'version_info = %s\n'%(repr(version),version_info)) - f.close() - return version - -def get_cvs_version(path): - """ - Return two last cumulative revision numbers of a CVS tree starting - at <path>. The first number shows the number of files in the CVS - tree (this is often true, but not always) and the second number - characterizes the changes in these files. - If <path>/CVS/Entries is not existing then return None. - """ - entries_file = os.path.join(path,'CVS','Entries') - if os.path.exists(entries_file): - rev1,rev2 = 0,0 - for line in open(entries_file).readlines(): - items = string.split(line,'/') - if items[0]=='D' and len(items)>1: - try: - d1,d2 = get_cvs_version(os.path.join(path,items[1])) - except: - d1,d2 = 0,0 - elif items[0]=='' and len(items)>3 and items[1]!='__version__.py': - d1,d2 = map(eval,string.split(items[2],'.')[-2:]) - else: - continue - rev1,rev2 = rev1+d1,rev2+d2 - return rev1,rev2 - -def get_path(mod_name): - """ This function makes sure installation is done from the - correct directory no matter if it is installed from the - command line or from another package or run_setup function. - - """ - if mod_name == '__main__': - d = os.path.abspath('.') - elif mod_name == '__builtin__': - #builtin if/then added by Pearu for use in core.run_setup. - d = os.path.dirname(os.path.abspath(sys.argv[0])) - else: - #import scipy_distutils.setup - mod = __import__(mod_name) - file = mod.__file__ - d = os.path.dirname(os.path.abspath(file)) - return d - -def add_local_to_path(mod_name): - local_path = get_path(mod_name) - sys.path.insert(0,local_path) - -def add_grandparent_to_path(mod_name): - local_path = get_path(mod_name) - gp_dir = os.path.split(local_path)[0] - sys.path.insert(0,gp_dir) - -def restore_path(): - del sys.path[0] - -def append_package_dir_to_path(package_name): - """ Search for a directory with package_name and append it to PYTHONPATH - - The local directory is searched first and then the parent directory. - """ - # first see if it is in the current path - # then try parent. If it isn't found, fail silently - # and let the import error occur. - - # not an easy way to clean up after this... - import os,sys - if os.path.exists(package_name): - sys.path.append(package_name) - elif os.path.exists(os.path.join('..',package_name)): - sys.path.append(os.path.join('..',package_name)) - -def get_package_config(package_name): - """ grab the configuration info from the setup_xxx.py file - in a package directory. The package directory is searched - from the current directory, so setting the path to the - setup.py file directory of the file calling this is usually - needed to get search the path correct. - """ - append_package_dir_to_path(package_name) - mod = __import__('setup_'+package_name) - config = mod.configuration() - return config - -def package_config(primary,dependencies=[]): - """ Create a configuration dictionary ready for setup.py from - a list of primary and dependent package names. Each - package listed must have a directory with the same name - in the current or parent working directory. Further, it - should have a setup_xxx.py module within that directory that - has a configuration() file in it. - """ - config = [] - config.extend([get_package_config(x) for x in primary]) - config.extend([get_package_config(x) for x in dependencies]) - config_dict = merge_config_dicts(config) - return config_dict - -list_keys = ['packages', 'ext_modules', 'data_files', - 'include_dirs', 'libraries', 'fortran_libraries', - 'headers'] -dict_keys = ['package_dir'] - -def default_config_dict(): - d={} - for key in list_keys: d[key] = [] - for key in dict_keys: d[key] = {} - return d - -def merge_config_dicts(config_list): - result = default_config_dict() - for d in config_list: - for key in list_keys: - result[key].extend(d.get(key,[])) - for key in dict_keys: - result[key].update(d.get(key,{})) - return result diff --git a/scipy_distutils/setup.py b/scipy_distutils/setup.py deleted file mode 100755 index 0457dfa1f..000000000 --- a/scipy_distutils/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -import os - -from distutils.core import setup -from misc_util import get_path, get_version - -def install_package(): - """ Install the scipy_distutils. The dance with the current directory is done - to fool distutils into thinking it is run from the scipy_distutils directory - even if it was invoked from another script located in a different location. - """ - path = get_path(__name__) - old_path = os.getcwd() - os.chdir(path) - try: - - version = get_version('alpha') - print 'scipy_distutils',version - - setup (name = "scipy_distutils", - version = version, - description = "Changes to distutils needed for SciPy -- mostly Fortran support", - author = "Travis Oliphant, Eric Jones, and Pearu Peterson", - author_email = "scipy-devel@scipy.org", - licence = "BSD Style", - url = 'http://www.scipy.org', - packages = ['scipy_distutils','scipy_distutils.command'], - package_dir = {'scipy_distutils':path} - ) - finally: - os.chdir(old_path) - -if __name__ == '__main__': - install_package() diff --git a/scipy_distutils/setup_scipy_distutils.py b/scipy_distutils/setup_scipy_distutils.py deleted file mode 100755 index 5baef987f..000000000 --- a/scipy_distutils/setup_scipy_distutils.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from scipy_distutils.misc_util import get_path, default_config_dict - -def configuration(parent_package=''): - parent_path = parent_package - if parent_package: - parent_package += '.' - local_path = get_path(__name__) - - config = default_config_dict() - package = 'scipy_distutils' - config['packages'].append(parent_package+package) - config['package_dir'][package] = local_path - package = 'scipy_distutils.command' - config['packages'].append(parent_package+package), - config['package_dir'][package] = os.path.join(local_path,'command') - return config diff --git a/scipy_test/__init__.py b/scipy_test/__init__.py deleted file mode 100644 index 8d503eb95..000000000 --- a/scipy_test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from scipy_test import * diff --git a/scipy_test/scipy_test.py b/scipy_test/scipy_test.py deleted file mode 100755 index 74e2a7ccb..000000000 --- a/scipy_test/scipy_test.py +++ /dev/null @@ -1,273 +0,0 @@ -import os - -def remove_ignored_patterns(files,pattern): - from fnmatch import fnmatch - good_files = [] - for file in files: - if not fnmatch(file,pattern): - good_files.append(file) - return good_files - -def remove_ignored_files(original,ignored_files,cur_dir): - """ This is actually expanded to do pattern matching. - - """ - if not ignored_files: ignored_files = [] - ignored_modules = map(lambda x: x+'.py',ignored_files) - ignored_packages = ignored_files[:] - # always ignore setup.py and __init__.py files - ignored_files = ['setup.py','setup_*.py','__init__.py'] - ignored_files += ignored_modules + ignored_packages - ignored_files = map(lambda x,cur_dir=cur_dir: os.path.join(cur_dir,x), - ignored_files) - #print 'ignored:', ignored_files - #good_files = filter(lambda x,ignored = ignored_files: x not in ignored, - # original) - good_files = original - for pattern in ignored_files: - good_files = remove_ignored_patterns(good_files,pattern) - - return good_files - -def harvest_modules(package,ignore=None): - """* Retreive a list of all modules that live within a package. - - Only retreive files that are immediate children of the - package -- do not recurse through child packages or - directories. The returned list contains actual modules, not - just their names. - *""" - import os,sys - - d,f = os.path.split(package.__file__) - - # go through the directory and import every py file there. - import glob - common_dir = os.path.join(d,'*.py') - py_files = glob.glob(common_dir) - #py_files.remove(os.path.join(d,'__init__.py')) - #py_files.remove(os.path.join(d,'setup.py')) - - py_files = remove_ignored_files(py_files,ignore,d) - #print 'py_files:', py_files - try: - prefix = package.__name__ - except: - prefix = '' - - all_modules = [] - for file in py_files: - d,f = os.path.split(file) - base,ext = os.path.splitext(f) - mod = prefix + '.' + base - #print 'module: import ' + mod - try: - exec ('import ' + mod) - all_modules.append(eval(mod)) - except: - print 'FAILURE to import ' + mod - output_exception() - - return all_modules - -def harvest_packages(package,ignore = None): - """ Retreive a list of all sub-packages that live within a package. - - Only retreive packages that are immediate children of this - package -- do not recurse through child packages or - directories. The returned list contains actual package objects, not - just their names. - """ - import os,sys - join = os.path.join - - d,f = os.path.split(package.__file__) - - common_dir = os.path.abspath(d) - all_files = os.listdir(d) - - all_files = remove_ignored_files(all_files,ignore,'') - #print 'all_files:', all_files - try: - prefix = package.__name__ - except: - prefix = '' - all_packages = [] - for directory in all_files: - path = join(common_dir,directory) - if os.path.isdir(path) and \ - os.path.exists(join(path,'__init__.py')): - sub_package = prefix + '.' + directory - #print 'sub-package import ' + sub_package - try: - exec ('import ' + sub_package) - all_packages.append(eval(sub_package)) - except: - print 'FAILURE to import ' + sub_package - output_exception() - return all_packages - -def harvest_modules_and_packages(package,ignore=None): - """ Retreive list of all packages and modules that live within a package. - - See harvest_packages() and harvest_modules() - """ - all = harvest_modules(package,ignore) + harvest_packages(package,ignore) - return all - -def harvest_test_suites(package,ignore = None): - import unittest - suites=[] - test_modules = harvest_modules_and_packages(package,ignore) - #for i in test_modules: - # print i.__name__ - for module in test_modules: - if hasattr(module,'test_suite'): - try: - suite = module.test_suite() - if suite: - suites.append(suite) - else: - msg = " !! FAILURE without error - shouldn't happen" + \ - module.__name__ - print msg - except: - print ' !! FAILURE building test for ', module.__name__ - print ' ', - output_exception() - else: - print 'No test suite found for ', module.__name__ - total_suite = unittest.TestSuite(suites) - return total_suite - -def module_test(mod_name,mod_file): - """* - - *""" - import os,sys,string - #print 'testing', mod_name - d,f = os.path.split(mod_file) - - # add the tests directory to the python path - test_dir = os.path.join(d,'tests') - sys.path.append(test_dir) - - # call the "test_xxx.test()" function for the appropriate - # module. - - # This should deal with package naming issues correctly - short_mod_name = string.split(mod_name,'.')[-1] - test_module = 'test_' + short_mod_name - test_string = 'import %s;reload(%s);%s.test()' % \ - ((test_module,)*3) - - # This would be better cause it forces a reload of the orginal - # module. It doesn't behave with packages however. - #test_string = 'reload(%s);import %s;reload(%s);%s.test()' % \ - # ((mod_name,) + (test_module,)*3) - exec(test_string) - - # remove test directory from python path. - sys.path = sys.path[:-1] - -def module_test_suite(mod_name,mod_file): - #try: - import os,sys,string - print ' creating test suite for:', mod_name - d,f = os.path.split(mod_file) - - # add the tests directory to the python path - test_dir = os.path.join(d,'tests') - sys.path.append(test_dir) - - # call the "test_xxx.test()" function for the appropriate - # module. - - # This should deal with package naming issues correctly - short_mod_name = string.split(mod_name,'.')[-1] - test_module = 'test_' + short_mod_name - test_string = 'import %s;reload(%s);suite = %s.test_suite()' % ((test_module,)*3) - #print test_string - exec(test_string) - - # remove test directory from python path. - sys.path = sys.path[:-1] - return suite - #except: - # print ' !! FAILURE loading test suite from', test_module, ':' - # print ' ', - # output_exception() - - -# Utility function to facilitate testing. - -def assert_equal(actual,desired,err_msg='',verbose=1): - """ Raise an assertion if two items are not - equal. I think this should be part of unittest.py - """ - msg = '\nItems are not equal:\n' + err_msg - try: - if ( verbose and len(str(desired)) < 100 and len(str(actual)) ): - msg = msg \ - + 'DESIRED: ' + str(desired) \ - + '\nACTUAL: ' + str(actual) - except: - msg = msg \ - + 'DESIRED: ' + str(desired) \ - + '\nACTUAL: ' + str(actual) - assert desired == actual, msg - -def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1): - """ Raise an assertion if two items are not - equal. I think this should be part of unittest.py - """ - msg = '\nItems are not equal:\n' + err_msg - try: - if ( verbose and len(str(desired)) < 100 and len(str(actual)) ): - msg = msg \ - + 'DESIRED: ' + str(desired) \ - + '\nACTUAL: ' + str(actual) - except: - msg = msg \ - + 'DESIRED: ' + str(desired) \ - + '\nACTUAL: ' + str(actual) - assert round(abs(desired - actual),decimal) == 0, msg - -try: - # Numeric specific tests - from Numeric import * - from fastumath import * - - def assert_array_equal(x,y): - try: - assert(alltrue(equal(shape(x),shape(y)))) - reduced = equal(x,y) - assert(alltrue(ravel(reduced))) - except ValueError: - print shape(x),shape(y) - raise ValueError, 'arrays are not equal' - - def assert_array_almost_equal(x,y,decimal=6): - try: - assert(alltrue(equal(shape(x),shape(y)))) - reduced = equal(around(abs(x-y),decimal)) - assert(alltrue(ravel(reduced))) - except ValueError: - print shape(x),shape(y) - print x, y - raise ValueError, 'arrays are not almost equal' -except: - pass # Numeric not installed - -import traceback,sys -def output_exception(): - try: - type, value, tb = sys.exc_info() - info = traceback.extract_tb(tb) - #this is more verbose - #traceback.print_exc() - filename, lineno, function, text = info[-1] # last line only - print "%s:%d: %s: %s (in %s)" %\ - (filename, lineno, type.__name__, str(value), function) - finally: - type = value = tb = None # clean up diff --git a/scipy_test/setup.py b/scipy_test/setup.py deleted file mode 100755 index 31c37e734..000000000 --- a/scipy_test/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python -from setup_scipy_test import install_package - -if __name__ == '__main__': - install_package() diff --git a/scipy_test/setup_scipy_test.py b/scipy_test/setup_scipy_test.py deleted file mode 100755 index 9de504622..000000000 --- a/scipy_test/setup_scipy_test.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -import os -from distutils.core import setup -from scipy_distutils.misc_util import get_path, default_config_dict - -def configuration(parent_package=''): - parent_path = parent_package - if parent_package: - parent_package += '.' - local_path = get_path(__name__) - - config = default_config_dict() - config['packages'].append(parent_package+'scipy_test') - config['package_dir'][parent_package+'scipy_test'] = local_path - return config - -def install_package(): - """ Install the scipy_test module. The dance with the current directory - is done to fool distutils into thinking it is run from the - scipy_distutils directory even if it was invoked from another script - located in a different location. - """ - path = get_path(__name__) - old_path = os.getcwd() - os.chdir(path) - try: - setup (name = "scipy_test", - version = "0.1", - description = "Supports testing of SciPy and other heirarchical packages", - author = "Eric Jones", - licence = "BSD Style", - url = 'http://www.scipy.org', - py_modules = ['scipy_test'] - ) - finally: - os.chdir(old_path) - -if __name__ == '__main__': - install_package() diff --git a/weave/blitz-20001213/blitz/applics.h b/weave/blitz-20001213/blitz/applics.h deleted file mode 100644 index 4c6b25993..000000000 --- a/weave/blitz-20001213/blitz/applics.h +++ /dev/null @@ -1,403 +0,0 @@ -/*************************************************************************** - * blitz/applics.h Applicative template classes - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_APPLICS_H -#define BZ_APPLICS_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_PROMOTE_H - #include <blitz/promote.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -BZ_NAMESPACE(blitz) - -// These base classes are included for no other reason than to keep -// the applicative templates clustered together in a graphical -// class browser. -class ApplicativeTemplatesBase { }; -class TwoOperandApplicativeTemplatesBase : public ApplicativeTemplatesBase { }; -class OneOperandApplicativeTemplatesBase : public ApplicativeTemplatesBase { }; - -template<class P_numtype1, class P_numtype2> -class _bz_Add : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x + y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Subtract : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x - y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Multiply : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x * y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Divide : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x / y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Mod : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x % y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_BitwiseXOR : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x ^ y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_BitwiseAnd : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x & y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_BitwiseOr : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x | y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_ShiftRight : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x >> y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_ShiftLeft : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef BZ_PROMOTE(T_numtype1,T_numtype2) T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x << y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Greater : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x > y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Less : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x < y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_GreaterOrEqual : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x >= y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_LessOrEqual : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x <= y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_Equal : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x == y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_NotEqual : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x != y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_LogicalAnd : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x && y; } -}; - -template<class P_numtype1, class P_numtype2> -class _bz_LogicalOr : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline T_promote apply(P_numtype1 x, P_numtype2 y) - { return x || y; } -}; - -template<class P_numtype_in, class P_numtype_out> -class _bz_Cast : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype_in T_numtype1; - typedef P_numtype_out T_promote; - typedef T_promote T_numtype; - - static inline P_numtype_out apply(P_numtype_in x) - { return P_numtype_out(x); } -}; - -template<class P_numtype> -class _bz_LogicalNot : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype T_numtype1; - typedef _bz_bool T_promote; - typedef T_promote T_numtype; - - static inline P_numtype apply(P_numtype x) - { return !x; } -}; - -template<class P_numtype> -class _bz_BitwiseNot : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype T_numtype1; - typedef T_numtype1 T_promote; - typedef T_promote T_numtype; - - static inline P_numtype apply(P_numtype x) - { return ~x; } -}; - -/***************************************************************************** - * Math Functions - *****************************************************************************/ - -// Applicative templates for these functions are defined in -// <blitz/mathfunc.h>, which is included below: -// -// abs(i), labs(l) Absolute value -// acos(d), acols(ld) Inverse cosine -// acosh(d) Inverse hyperbolic cosine -// asin(d), asinl(ld) Inverse sine -// asinh(d) Inverse hyperbolic sine -// atan(d), atanl(ld) Inverse tangent -// atan2(d,d), atan2l(ld,ld) Inverse tangent -// atanh(d) Inverse hyperbolic tangent -// cbrt(x) Cube root -// ceil(d), ceill(ld) Smallest f-int not less than x -// int class(d) Classification of x (FP_XXXXX) -// cos(d), cosl(ld) Cosine -// cosh(d), coshl(ld) Hyperbolic cosine -// copysign(d,d) Return 1st arg with same sign as 2nd -// drem(x,x) IEEE remainder -// exp(d), expl(ld) Exponential -// expm1(d) Exp(x)-1 -// erf(d), erfl(ld) Error function -// erfc(d), erfcl(ld) Complementary error function -// fabs(d), fabsl(ld) Floating point absolute value -// int finite(d) Nonzero if finite -// floor(d), floor(ld) Largest f-int not greater than x -// fmod(d,d), fmodl(ld,ld) Floating point remainder -// frexp(d, int* e) Break into mantissa/exponent (*) -// frexpl(ld, int* e) Break into mantissa/exponent (*) -// gammaFunc(d) Gamma function (** needs special -// implementation using lgamma) -// hypot(d,d) Hypotenuse: sqrt(x*x+y*y) -// int ilogb(d) Integer unbiased exponent -// int isnan(d) Nonzero if NaNS or NaNQ -// int itrunc(d) Truncate and convert to integer -// j0(d) Bessel function first kind, order 0 -// j1(d) Bessel function first kind, order 1 -// jn(int, double) Bessel function first kind, order i -// ldexp(d,i), ldexpl(ld,i) Compute d * 2^i -// lgamma(d), lgammald(ld) Log absolute gamma -// log(d), logl(ld) Natural logarithm -// logb(d) Unbiased exponent (IEEE) -// log1p(d) Compute log(1 + x) -// log10(d), log10l(ld) Logarithm base 10 -// modf(d, int* i), modfl(ld, int* i) Break into integral/fractional part -// double nearest(double) Nearest floating point integer -// nextafter(d, d) Next representable neighbor of 1st -// in direction of 2nd -// pow(d,d), pow(ld,ld) Computes x ^ y -// d remainder(d,d) IEEE remainder -// d rint(d) Round to f-integer (depends on mode) -// d rsqrt(d) Reciprocal square root -// d scalb(d,d) Return x * (2^y) -// sin(d), sinl(ld) Sine -// sinh(d), sinhl(ld) Hyperbolic sine -// sqr(x) Return x * x -// sqrt(d), sqrtl(ld) Square root -// tan(d), tanl(ld) Tangent -// tanh(d), tanhl(ld) Hyperbolic tangent -// trunc(d) Nearest f-int in the direction of 0 -// unsigned uitrunc(d) Truncate and convert to unsigned -// int unordered(d,d) Nonzero if comparison is unordered -// y0(d) Bessel function 2nd kind, order 0 -// y1(d) Bessel function 2nd kind, order 1 -// yn(i,d) Bessel function 2nd kind, order d - - -BZ_NAMESPACE_END - -#ifndef BZ_MATHFUNC_H - #include <blitz/mathfunc.h> -#endif - -#ifndef BZ_MATHF2_H - #include <blitz/mathf2.h> -#endif - -#endif // BZ_APPLICS_H diff --git a/weave/blitz-20001213/blitz/array.h b/weave/blitz-20001213/blitz/array.h deleted file mode 100644 index 7410117d3..000000000 --- a/weave/blitz-20001213/blitz/array.h +++ /dev/null @@ -1,2495 +0,0 @@ -/*************************************************************************** - * blitz/array.h Declaration of the Array<P_numtype, N_rank> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -/* - * Wish list for array classes. - * - Arrays whose dimensions are unknown at compile time. - * - where()/elsewhere()/elsewhere() as in Dan Quinlan's implementation - * - block reduction operations - * - conversion to/from matrix & vector - * - apply(T func(T)) - * - apply(T func(const T&)) - * - apply<T func(T)> - */ - -#ifndef BZ_ARRAY_H -#define BZ_ARRAY_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_MEMBLOCK_H - #include <blitz/memblock.h> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_TRAVERSAL_H - #include <blitz/traversal.h> -#endif - -#ifndef BZ_INDEXEXPR_H - #include <blitz/indexexpr.h> -#endif - -#ifndef BZ_PRETTYPRINT_H - #include <blitz/prettyprint.h> -#endif - -#include <blitz/array/slice.h> // Subarrays and slicing -#include <blitz/array/map.h> // Tensor index notation -#include <blitz/array/multi.h> // Multicomponent arrays -#include <blitz/array/domain.h> // RectDomain class -#include <blitz/array/storage.h> // GeneralArrayStorage - - -BZ_NAMESPACE(blitz) - -/* - * Forward declarations - */ - -template<class T_numtype, int N_rank> -class ArrayIterator; - -template<class T_numtype, int N_rank> -class ConstArrayIterator; - -template<class T_numtype, int N_rank> -class FastArrayIterator; - -template<class P_expr> -class _bz_ArrayExpr; - -template<class T_array, class T_index> -class IndirectArray; - -class _bz_endTag; - - - -/* - * Declaration of class Array - */ - -// NEEDS_WORK: Array should inherit protected from MemoryBlockReference. -// To make this work, need to expose MemoryBlockReference::numReferences() -// and make Array<P,N2> a friend of Array<P,N> for slicing. - -template<class P_numtype, int N_rank> -class Array : public MemoryBlockReference<P_numtype> -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - , public ETBase<Array<P_numtype,N_rank> > -#endif -{ - -public: - ////////////////////////////////////////////// - // Public Types - ////////////////////////////////////////////// - - /* - * T_numtype is the numeric type stored in the array. - * T_index is a vector type which can be used to access elements - * of many-dimensional arrays. - * T_array is the array type itself -- Array<T_numtype, N_rank> - * T_iterator is a a fast iterator for the array, used for expression - * templates - * iterator is a STL-style iterator - * const_iterator is an STL-style const iterator - */ - - typedef P_numtype T_numtype; - typedef TinyVector<int, N_rank> T_index; - typedef Array<T_numtype, N_rank> T_array; - typedef FastArrayIterator<T_numtype, N_rank> T_iterator; - - typedef ArrayIterator<T_numtype,N_rank> iterator; - typedef ConstArrayIterator<T_numtype,N_rank> const_iterator; - - enum { _bz_rank = N_rank }; - - ////////////////////////////////////////////// - // Constructors // - ////////////////////////////////////////////// - - - /* - * Construct an array from an array expression. - */ - - template<class T_expr> - _bz_explicit Array(_bz_ArrayExpr<T_expr> expr); - - /* - * Any missing length arguments will have their value taken from the - * last argument. For example, - * Array<int,3> A(32,64); - * will create a 32x64x64 array. This is handled by setupStorage(). - */ - - Array(GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - length_ = 0; - stride_ = 0; - zeroOffset_ = 0; - } - - _bz_explicit Array(int length0, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - length_[0] = length0; - setupStorage(0); - } - - Array(int length0, int length1, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 2); - TAU_TYPE_STRING(p1, "Array<T,N>::Array() [T=" - + CT(T_numtype) + ",N=" + CT(N_rank) + "]"); - TAU_PROFILE(p1, "void (int,int)", TAU_BLITZ); - - length_[0] = length0; - length_[1] = length1; - setupStorage(1); - } - - Array(int length0, int length1, int length2, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 3); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - setupStorage(2); - } - - Array(int length0, int length1, int length2, int length3, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 4); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - setupStorage(3); - } - - Array(int length0, int length1, int length2, int length3, int length4, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 5); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - setupStorage(4); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 6); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - setupStorage(5); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, int length6, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 7); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - length_[6] = length6; - setupStorage(6); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, int length6, int length7, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 8); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - length_[6] = length6; - length_[7] = length7; - setupStorage(7); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, int length6, int length7, int length8, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 9); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - length_[6] = length6; - length_[7] = length7; - length_[8] = length8; - setupStorage(8); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, int length6, int length7, int length8, int length9, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 10); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - length_[6] = length6; - length_[7] = length7; - length_[8] = length8; - length_[9] = length9; - setupStorage(9); - } - - Array(int length0, int length1, int length2, int length3, int length4, - int length5, int length6, int length7, int length8, int length9, - int length10, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(N_rank >= 11); - length_[0] = length0; - length_[1] = length1; - length_[2] = length2; - length_[3] = length3; - length_[4] = length4; - length_[5] = length5; - length_[6] = length6; - length_[7] = length7; - length_[8] = length8; - length_[9] = length9; - length_[10] = length10; - setupStorage(10); - } - - /* - * Construct an array from an existing block of memory. Ownership - * is not acquired (this is provided for backwards compatibility). - */ - Array(T_numtype* _bz_restrict dataFirst, TinyVector<int, N_rank> shape, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : MemoryBlockReference<T_numtype>(product(shape), dataFirst, - neverDeleteData), - storage_(storage) - { - BZPRECONDITION(dataFirst != 0); - - length_ = shape; - computeStrides(); - data_ += zeroOffset_; - } - - /* - * Construct an array from an existing block of memory, with a - * given set of strides. Ownership is not acquired (i.e. the memory - * block will not be freed by Blitz++). - */ - Array(T_numtype* _bz_restrict dataFirst, TinyVector<int, N_rank> shape, - TinyVector<int, N_rank> stride, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : MemoryBlockReference<T_numtype>(product(shape), dataFirst, - neverDeleteData), - storage_(storage) - { - BZPRECONDITION(dataFirst != 0); - - length_ = shape; - stride_ = stride; - calculateZeroOffset(); - data_ += zeroOffset_; - } - - /* - * Construct an array from an existing block of memory. - */ - Array(T_numtype* _bz_restrict dataFirst, TinyVector<int, N_rank> shape, - preexistingMemoryPolicy deletionPolicy, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : MemoryBlockReference<T_numtype>(product(shape), dataFirst, - deletionPolicy), - storage_(storage) - { - BZPRECONDITION(dataFirst != 0); - - length_ = shape; - computeStrides(); - data_ += zeroOffset_; - - if (deletionPolicy == duplicateData) - reference(copy()); - } - - /* - * Construct an array from an existing block of memory, with a - * given set of strides. - */ - Array(T_numtype* _bz_restrict dataFirst, TinyVector<int, N_rank> shape, - TinyVector<int, N_rank> stride, - preexistingMemoryPolicy deletionPolicy, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : MemoryBlockReference<T_numtype>(product(shape), dataFirst, - deletionPolicy), - storage_(storage) - { - BZPRECONDITION(dataFirst != 0); - - length_ = shape; - stride_ = stride; - calculateZeroOffset(); - data_ += zeroOffset_; - - if (deletionPolicy == duplicateData) - reference(copy()); - } - - /* - * This constructor takes an extent (length) vector and storage format. - */ - - Array(const TinyVector<int, N_rank>& extent, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - length_ = extent; - setupStorage(N_rank - 1); - } - - /* - * This construct takes a vector of bases (lbounds) and a vector of - * extents. - */ - - Array(const TinyVector<int, N_rank>& lbounds, - const TinyVector<int, N_rank>& extent, - const GeneralArrayStorage<N_rank>& storage - = GeneralArrayStorage<N_rank>()); - - /* - * These constructors allow arbitrary bases (starting indices) to be set. - * e.g. Array<int,2> A(Range(10,20), Range(20,30)) - * will create an 11x11 array whose indices are 10..20 and 20..30 - */ - Array(Range r0, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - setupStorage(0); - } - - Array(Range r0, Range r1, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - - setupStorage(1); - } - - Array(Range r0, Range r1, Range r2, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - - setupStorage(2); - } - - Array(Range r0, Range r1, Range r2, Range r3, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - - setupStorage(3); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - - setupStorage(4); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - - setupStorage(5); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - Range r6, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous() && r6.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - length_[6] = r6.length(); - storage_.setBase(6, r6.first()); - - setupStorage(6); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - Range r6, Range r7, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous() && r6.isAscendingContiguous() - && r7.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - length_[6] = r6.length(); - storage_.setBase(6, r6.first()); - length_[7] = r7.length(); - storage_.setBase(7, r7.first()); - - setupStorage(7); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - Range r6, Range r7, Range r8, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous() && r6.isAscendingContiguous() - && r7.isAscendingContiguous() && r8.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - length_[6] = r6.length(); - storage_.setBase(6, r6.first()); - length_[7] = r7.length(); - storage_.setBase(7, r7.first()); - length_[8] = r8.length(); - storage_.setBase(8, r8.first()); - - setupStorage(8); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - Range r6, Range r7, Range r8, Range r9, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous() && r6.isAscendingContiguous() - && r7.isAscendingContiguous() && r8.isAscendingContiguous() - && r9.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - length_[6] = r6.length(); - storage_.setBase(6, r6.first()); - length_[7] = r7.length(); - storage_.setBase(7, r7.first()); - length_[8] = r8.length(); - storage_.setBase(8, r8.first()); - length_[9] = r9.length(); - storage_.setBase(9, r9.first()); - - setupStorage(9); - } - - Array(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, - Range r6, Range r7, Range r8, Range r9, Range r10, - GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>()) - : storage_(storage) - { - BZPRECONDITION(r0.isAscendingContiguous() && - r1.isAscendingContiguous() && r2.isAscendingContiguous() - && r3.isAscendingContiguous() && r4.isAscendingContiguous() - && r5.isAscendingContiguous() && r6.isAscendingContiguous() - && r7.isAscendingContiguous() && r8.isAscendingContiguous() - && r9.isAscendingContiguous() && r10.isAscendingContiguous()); - - length_[0] = r0.length(); - storage_.setBase(0, r0.first()); - length_[1] = r1.length(); - storage_.setBase(1, r1.first()); - length_[2] = r2.length(); - storage_.setBase(2, r2.first()); - length_[3] = r3.length(); - storage_.setBase(3, r3.first()); - length_[4] = r4.length(); - storage_.setBase(4, r4.first()); - length_[5] = r5.length(); - storage_.setBase(5, r5.first()); - length_[6] = r6.length(); - storage_.setBase(6, r6.first()); - length_[7] = r7.length(); - storage_.setBase(7, r7.first()); - length_[8] = r8.length(); - storage_.setBase(8, r8.first()); - length_[9] = r9.length(); - storage_.setBase(9, r9.first()); - length_[10] = r10.length(); - storage_.setBase(10, r10.first()); - - setupStorage(10); - } - - /* - * Create a reference of another array - */ - Array(const Array<T_numtype, N_rank>& array) - { - // NEEDS_WORK: this const_cast is a tad ugly. - reference(const_cast<T_array&>(array)); - } - - /* - * These constructors are used for creating interlaced arrays (see - * <blitz/arrayshape.h> - */ - Array(const TinyVector<int,N_rank-1>& shape, - int lastExtent, const GeneralArrayStorage<N_rank>& storage); - //Array(const TinyVector<Range,N_rank-1>& shape, - // int lastExtent, const GeneralArrayStorage<N_rank>& storage); - - /* - * These constructors make the array a view of a subportion of another - * array. If there fewer than N_rank Range arguments provided, no - * slicing is performed in the unspecified ranks. - * e.g. Array<int,3> A(20,20,20); - * Array<int,3> B(A, Range(5,15)); - * is equivalent to: - * Array<int,3> B(A, Range(5,15), Range::all(), Range::all()); - */ - Array(Array<T_numtype, N_rank>& array, Range r0) - { - constructSubarray(array, r0); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1) - { - constructSubarray(array, r0, r1); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2) - { - constructSubarray(array, r0, r1, r2); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3) - { - constructSubarray(array, r0, r1, r2, r3); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4) - { - constructSubarray(array, r0, r1, r2, r3, r4); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5, Range r6) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5, r6); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5, Range r6, Range r7) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5, r6, r7); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5, Range r6, Range r7, Range r8) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5, r6, r7, r8); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5, Range r6, Range r7, Range r8, Range r9) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9); - } - - Array(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, - Range r3, Range r4, Range r5, Range r6, Range r7, Range r8, Range r9, - Range r10) - { - constructSubarray(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10); - } - - Array(Array<T_numtype, N_rank>& array, - const RectDomain<N_rank>& subdomain) - { - constructSubarray(array, subdomain); - } - - /* - * This constructor is invoked by the operator()'s which take - * a combination of integer and Range arguments. It's not intended - * for end-user use. - */ - template<int N_rank2, class R0, class R1, class R2, class R3, class R4, - class R5, class R6, class R7, class R8, class R9, class R10> - Array(Array<T_numtype,N_rank2>& array, R0 r0, R1 r1, R2 r2, - R3 r3, R4 r4, R5 r5, R6 r6, R7 r7, R8 r8, R9 r9, R10 r10) - { - constructSlice(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10); - } - - ////////////////////////////////////////////// - // Member functions - ////////////////////////////////////////////// - - const TinyVector<int, N_rank>& base() const - { return storage_.base(); } - - int base(int rank) const - { return storage_.base(rank); } - - iterator begin() - { return iterator(*this); } - - const_iterator begin() const - { return const_iterator(*this); } - - T_iterator beginFast() const - { return T_iterator(*this); } - - // Deprecated: now extractComponent(...) - template<class T_numtype2> - Array<T_numtype2,N_rank> chopComponent(T_numtype2 a, int compNum, - int numComponents) const - { return extractComponent(a, compNum, numComponents); } - - int cols() const - { return length_[1]; } - - int columns() const - { return length_[1]; } - - T_array copy() const; - - // data_ always refers to the point (0,0,...,0) which may - // not be in the array if the base is not zero in each rank. - // These data() routines return a pointer to the first - // element in the array (but note that it may not be - // stored first in memory if some ranks are stored descending). - - const T_numtype* _bz_restrict data() const - { return data_ + dot(storage_.base(), stride_); } - - T_numtype* _bz_restrict data() - { return data_ + dot(storage_.base(), stride_); } - - // These dataZero() routines refer to the point (0,0,...,0) - // which may not be in the array if the bases are nonzero. - - const T_numtype* _bz_restrict dataZero() const - { return data_; } - - T_numtype* _bz_restrict dataZero() - { return data_; } - - // These dataFirst() routines refer to the element in the - // array which falls first in memory. - - const T_numtype* _bz_restrict dataFirst() const - { - return data_ + dot(storage_.base() - + (1 - storage_.ascendingFlag()) * (length_ - 1), stride_); - } - - T_numtype* _bz_restrict dataFirst() - { - return data_ + dot(storage_.base() - + (1 - storage_.ascendingFlag()) * (length_ - 1), stride_); - } - - int depth() const - { return length_[2]; } - - int dimensions() const - { return N_rank; } - - RectDomain<N_rank> domain() const - { - return RectDomain<N_rank>(lbound(), ubound()); - } - - void dumpStructureInformation(ostream& os = cout) const; - - iterator end() - { - return iterator(*this, _bz_endTag()); - } - - const_iterator end() const - { - return const_iterator(*this, _bz_endTag()); - } - - int extent(int rank) const - { return length_[rank]; } - - const TinyVector<int,N_rank>& extent() const - { return length_; } - - template<class T_numtype2> - Array<T_numtype2,N_rank> extractComponent(T_numtype2, int compNum, - int numComponents) const; - - void free() - { - changeToNullBlock(); - length_ = 0; - } - - _bz_bool isMajorRank(int rank) const - { return storage_.ordering(rank) == 0; } - - _bz_bool isMinorRank(int rank) const - { return storage_.ordering(rank) != 0; } - - _bz_bool isRankStoredAscending(int rank) const - { return storage_.isRankStoredAscending(rank); } - - _bz_bool isStorageContiguous() const; - - int lbound(int rank) const - { return base(rank); } - - TinyVector<int,N_rank> lbound() const - { - return base(); - } - - int length(int rank) const - { return length_[rank]; } - - const TinyVector<int, N_rank>& length() const - { return length_; } - - void makeUnique(); - - int numElements() const - { return product(length_); } - - // NEEDS_WORK -- Expose the numReferences() method - // MemoryBlockReference<T_numtype>::numReferences; - - // The storage_.ordering_ array is a list of dimensions from - // the most minor (stride 1) to major dimension. Generally, - // ordering(0) will return the dimension which has the smallest - // stride, and ordering(N_rank-1) will return the dimension with - // the largest stride. - int ordering(int storageRankIndex) const - { return storage_.ordering(storageRankIndex); } - - const TinyVector<int, N_rank>& ordering() const - { return storage_.ordering(); } - - void transposeSelf(int r0, int r1, int r2=0, - int r3=0, int r4=0, int r5=0, int r6=0, int r7=0, int r8=0, int - r9=0, int r10=0); - T_array transpose(int r0, int r1, int r2=0, - int r3=0, int r4=0, int r5=0, int r6=0, int r7=0, int r8=0, int - r9=0, int r10=0); - - int rank() const - { return N_rank; } - - void reference(const T_array&); - - // Added by Derrick Bass - T_array reindex(const TinyVector<int,N_rank>&); - void reindexSelf(const - TinyVector<int,N_rank>&); - - void resize(int extent); - void resize(int extent1, int extent2); - void resize(int extent1, int extent2, - int extent3); - void resize(int extent1, int extent2, - int extent3, int extent4); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6, int extent7); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8, - int extent9); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8, - int extent9, int extent10); - void resize(int extent1, int extent2, - int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8, - int extent9, int extent10, - int extent11); - - - void resize(Range r1); - void resize(Range r1, Range r2); - void resize(Range r1, Range r2, Range r3); - void resize(Range r1, Range r2, Range r3, - Range r4); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, - Range r7); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, - Range r7, Range r8); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, - Range r7, Range r8, Range r9); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, - Range r7, Range r8, Range r9, - Range r10); - void resize(Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, - Range r7, Range r8, Range r9, - Range r10, Range r11); - - void resize(const TinyVector<int,N_rank>&); - - - void resizeAndPreserve(int extent); - void resizeAndPreserve(int extent1, - int extent2); - void resizeAndPreserve(int extent1, - int extent2, int extent3); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6, int extent7); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6, int extent7, - int extent8); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6, int extent7, - int extent8, int extent9); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6, int extent7, - int extent8, int extent9, - int extent10); - void resizeAndPreserve(int extent1, - int extent2, int extent3, int extent4, - int extent5, int extent6, int extent7, - int extent8, int extent9, int extent10, - int extent11); - - // NEEDS_WORK -- resizeAndPreserve(Range,...) - // NEEDS_WORK -- resizeAndPreserve(const TinyVector<int,N_rank>&); - // NEEDS_WORK -- resizeAndPreserve(const Domain<N_rank>&); - - T_array reverse(int rank); - void reverseSelf(int rank); - - int rows() const - { return length_[0]; } - - void slice(int rank, Range r); - - const TinyVector<int, N_rank>& shape() const - { return length_; } - - int size() const - { return numElements(); } - - const TinyVector<int, N_rank>& stride() const - { return stride_; } - - int stride(int rank) const - { return stride_[rank]; } - - int ubound(int rank) const - { return base(rank) + length_(rank) - 1; } - - TinyVector<int, N_rank> ubound() const - { - TinyVector<int, N_rank> ub; - ub = base() + extent() - 1; - return ub; - } - - int zeroOffset() const - { return zeroOffset_; } - - ////////////////////////////////////////////// - // Debugging routines - ////////////////////////////////////////////// - - _bz_bool isInRangeForDim(int i, int d) const - { - return unsigned(i - base(d)) < length_[d]; - } - - _bz_bool isInRange(int i0) const - { - return unsigned(i0 - base(0)) < length_[0]; - } - - _bz_bool isInRange(int i0, int i1) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1]; - } - - _bz_bool isInRange(int i0, int i1, int i2) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5] - && unsigned(i6 - base(6)) < length_[6]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5] - && unsigned(i6 - base(6)) < length_[6] - && unsigned(i7 - base(7)) < length_[7]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5] - && unsigned(i6 - base(6)) < length_[6] - && unsigned(i7 - base(7)) < length_[7] - && unsigned(i8 - base(8)) < length_[8]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8, int i9) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5] - && unsigned(i6 - base(6)) < length_[6] - && unsigned(i7 - base(7)) < length_[7] - && unsigned(i8 - base(8)) < length_[8] - && unsigned(i9 - base(9)) < length_[9]; - } - - _bz_bool isInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8, int i9, int i10) const - { - return unsigned(i0 - base(0)) < length_[0] - && unsigned(i1 - base(1)) < length_[1] - && unsigned(i2 - base(2)) < length_[2] - && unsigned(i3 - base(3)) < length_[3] - && unsigned(i4 - base(4)) < length_[4] - && unsigned(i5 - base(5)) < length_[5] - && unsigned(i6 - base(6)) < length_[6] - && unsigned(i7 - base(7)) < length_[7] - && unsigned(i8 - base(8)) < length_[8] - && unsigned(i9 - base(9)) < length_[9] - && unsigned(i10 - base(10)) < length_[10]; - } - - _bz_bool isInRange(const T_index& index) const - { - for (int i=0; i < N_rank; ++i) - if (unsigned(index[i] - base(i)) >= length_[i]) - return _bz_false; - - return _bz_true; - } - - _bz_bool assertInRange(const T_index& index) const - { - BZPRECHECK(isInRange(index), "Array index out of range: " << index - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0) const - { - BZPRECHECK(isInRange(i0), "Array index out of range: " << i0 - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1) const - { - BZPRECHECK(isInRange(i0,i1), "Array index out of range: (" - << i0 << ", " << i1 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2) const - { - BZPRECHECK(isInRange(i0,i1,i2), "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3), "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4), "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5), "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5,i6), - "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ", " << i6 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5,i6,i7), - "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ", " << i6 << ", " << i7 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5,i6,i7,i8), - "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ", " << i6 << ", " << i7 - << ", " << i8 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8, int i9) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9), - "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ", " << i6 << ", " << i7 - << ", " << i8 << ", " << i9 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - _bz_bool assertInRange(int i0, int i1, int i2, int i3, int i4, - int i5, int i6, int i7, int i8, int i9, int i10) const - { - BZPRECHECK(isInRange(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10), - "Array index out of range: (" - << i0 << ", " << i1 << ", " << i2 << ", " << i3 - << ", " << i4 << ", " << i5 << ", " << i6 << ", " << i7 - << ", " << i8 << ", " << i9 << ", " << i10 << ")" - << endl << "Lower bounds: " << storage_.base() << endl - << "Upper bounds: " << (storage_.base() + length_ - 1) << endl); - return _bz_true; - } - - ////////////////////////////////////////////// - // Subscripting operators - ////////////////////////////////////////////// - - template<int N_rank2> - T_numtype operator()(const TinyVector<int,N_rank2>& index) const - { - assertInRange(index); - return data_[dot(index, stride_)]; - } - - template<int N_rank2> - T_numtype& _bz_restrict operator()(const TinyVector<int,N_rank2>& index) - { - assertInRange(index); - return data_[dot(index, stride_)]; - } - - T_numtype operator()(TinyVector<int,1> index) const - { - assertInRange(index[0]); - return data_[index[0] * stride_[0]]; - } - - T_numtype& operator()(TinyVector<int,1> index) - { - assertInRange(index[0]); - return data_[index[0] * stride_[0]]; - } - - T_numtype operator()(TinyVector<int,2> index) const - { - assertInRange(index[0], index[1]); - return data_[index[0] * stride_[0] + index[1] * stride_[1]]; - } - - T_numtype& operator()(TinyVector<int,2> index) - { - assertInRange(index[0], index[1]); - return data_[index[0] * stride_[0] + index[1] * stride_[1]]; - } - - T_numtype operator()(TinyVector<int,3> index) const - { - assertInRange(index[0], index[1], index[2]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2]]; - } - - T_numtype& operator()(TinyVector<int,3> index) - { - assertInRange(index[0], index[1], index[2]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2]]; - } - - T_numtype operator()(const TinyVector<int,4>& index) const - { - assertInRange(index[0], index[1], index[2], index[3]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3]]; - } - - T_numtype& operator()(const TinyVector<int,4>& index) - { - assertInRange(index[0], index[1], index[2], index[3]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3]]; - } - - T_numtype operator()(const TinyVector<int,5>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4]]; - } - - T_numtype& operator()(const TinyVector<int,5>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4]]; - } - - T_numtype operator()(const TinyVector<int,6>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5]]; - } - - T_numtype& operator()(const TinyVector<int,6>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5]]; - } - - T_numtype operator()(const TinyVector<int,7>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6]]; - } - - T_numtype& operator()(const TinyVector<int,7>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6]]; - } - - T_numtype operator()(const TinyVector<int,8>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7]]; - } - - T_numtype& operator()(const TinyVector<int,8>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7]]; - } - - T_numtype operator()(const TinyVector<int,9>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8]]; - } - - T_numtype& operator()(const TinyVector<int,9>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8]]; - } - - T_numtype operator()(const TinyVector<int,10>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8], index[9]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8] + index[9] * stride_[9]]; - } - - T_numtype& operator()(const TinyVector<int,10>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8], index[9]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8] + index[9] * stride_[9]]; - } - - T_numtype operator()(const TinyVector<int,11>& index) const - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8], index[9], - index[10]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8] + index[9] * stride_[9] - + index[10] * stride_[10]]; - } - - T_numtype& operator()(const TinyVector<int,11>& index) - { - assertInRange(index[0], index[1], index[2], index[3], - index[4], index[5], index[6], index[7], index[8], index[9], - index[10]); - return data_[index[0] * stride_[0] + index[1] * stride_[1] - + index[2] * stride_[2] + index[3] * stride_[3] - + index[4] * stride_[4] + index[5] * stride_[5] - + index[6] * stride_[6] + index[7] * stride_[7] - + index[8] * stride_[8] + index[9] * stride_[9] - + index[10] * stride_[10]]; - } - - T_numtype operator()(int i0) const - { - assertInRange(i0); - return data_[i0 * stride_[0]]; - } - - T_numtype& _bz_restrict operator()(int i0) - { - assertInRange(i0); - return data_[i0 * stride_[0]]; - } - - T_numtype operator()(int i0, int i1) const - { - assertInRange(i0, i1); - return data_[i0 * stride_[0] + i1 * stride_[1]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1) - { - assertInRange(i0, i1); - return data_[i0 * stride_[0] + i1 * stride_[1]]; - } - - T_numtype operator()(int i0, int i1, int i2) const - { - assertInRange(i0, i1, i2); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2) - { - assertInRange(i0, i1, i2); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3) const - { - assertInRange(i0, i1, i2, i3); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3) - { - assertInRange(i0, i1, i2, i3); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4) const - { - assertInRange(i0, i1, i2, i3, i4); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4) - { - assertInRange(i0, i1, i2, i3, i4); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5) const - { - assertInRange(i0, i1, i2, i3, i4, i5); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5) - { - assertInRange(i0, i1, i2, i3, i4, i5); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6) const - { - assertInRange(i0, i1, i2, i3, i4, i5, i6); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6) - { - assertInRange(i0, i1, i2, i3, i4, i5, i6); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7) const - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7) - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8) const - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8) - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8, int i9) const - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8] + i9 * stride_[9]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8, int i9) - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8] + i9 * stride_[9]]; - } - - T_numtype operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8, int i9, int i10) const - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8, - i9, i10); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8] + i9 * stride_[9] + i10 * stride_[10]]; - } - - T_numtype& _bz_restrict operator()(int i0, int i1, int i2, int i3, - int i4, int i5, int i6, int i7, int i8, int i9, int i10) - { - assertInRange(i0, i1, i2, i3, i4, i5, i6, i7, i8, - i9, i10); - return data_[i0 * stride_[0] + i1 * stride_[1] - + i2 * stride_[2] + i3 * stride_[3] + i4 * stride_[4] - + i5 * stride_[5] + i6 * stride_[6] + i7 * stride_[7] - + i8 * stride_[8] + i9 * stride_[9] + i10 * stride_[10]]; - } - - /* - * Slicing to produce subarrays. If the number of Range arguments is - * fewer than N_rank, then missing arguments are treated like Range::all(). - */ - - T_array& noConst() const - { return const_cast<T_array&>(*this); } - - T_array operator()(const RectDomain<N_rank>& subdomain) const - { - return T_array(noConst(), subdomain); - } - - T_array operator()(Range r0) const - { - return T_array(noConst(), r0); - } - - T_array operator()(Range r0, Range r1) const - { - return T_array(noConst(), r0, r1); - } - - T_array operator()(Range r0, Range r1, Range r2) const - { - return T_array(noConst(), r0, r1, r2); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3) const - { - return T_array(noConst(), r0, r1, r2, r3); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4) const - { - return T_array(noConst(), r0, r1, r2, r3, r4); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5, Range r6) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5, r6); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5, Range r6, Range r7) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5, r6, r7); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5, Range r6, Range r7, Range r8) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5, r6, r7, r8); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5, Range r6, Range r7, Range r8, Range r9) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5, r6, r7, r8, r9); - } - - T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4, - Range r5, Range r6, Range r7, Range r8, Range r9, Range r10) const - { - return T_array(noConst(), r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10); - } - - // Allow any mixture of Range, int and Vector<int> objects as - // operands for operator(): A(Range(3,7), 5, Range(2,4)) - - /* - * These versions of operator() allow any combination of int - * and Range operands to be used. Each int operand reduces - * the rank of the resulting array by one. - * - * e.g. Array<int,4> A(20,20,20,20); - * Array<int,2> B = A(Range(5,15), 3, 5, Range(8,9)); - * - * SliceInfo is a helper class defined in <blitz/arrayslice.h>. - * It counts the number of Range vs. int arguments and does some - * other helpful things. - * - * Once partial specialization becomes widely implemented, these - * operators may be expanded to accept Vector<int> arguments - * and produce ArrayPick<T,N> objects. - * - * This operator() is not provided with a single argument because - * the appropriate cases exist above. - */ - -#ifdef BZ_PARTIAL_ORDERING - - template<class T1, class T2> - _bz_typename SliceInfo<T_numtype,T1,T2>::T_slice - operator()(T1 r1, T2 r2) const - { - return SliceInfo<T_numtype,T1,T2>::T_slice(noConst(), r1, r2, - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3> - _bz_typename SliceInfo<T_numtype,T1,T2,T3>::T_slice - operator()(T1 r1, T2 r2, T3 r3) const - { - return SliceInfo<T_numtype,T1,T2,T3>::T_slice(noConst(), r1, r2, r3, - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4>::T_slice(noConst(), r1, r2, r3, - r4, nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5>::T_slice(noConst(), r1, r2, - r3, r4, r5, nilArraySection(), - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6>::T_slice(noConst(), r1, - r2, r3, r4, r5, r6, - nilArraySection(), nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6, - class T7> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6, T7 r7) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7>::T_slice(noConst(), - r1, r2, r3, r4, r5, r6, r7, - nilArraySection(), nilArraySection(), - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6, T7 r7, T8 r8) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8>::T_slice(noConst(), - r1, r2, r3, r4, r5, r6, r7, r8, - nilArraySection(), nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6, T7 r7, T8 r8, - T9 r9) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9> - ::T_slice(noConst(), - r1, r2, r3, r4, r5, r6, r7, r8, r9, - nilArraySection(), nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6, T7 r7, T8 r8, - T9 r9, T10 r10) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9, - T10>::T_slice(noConst(), r1, r2, r3, r4, r5, r6, r7, r8, - r9, r10, nilArraySection()); - } - - template<class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10, class T11> - _bz_typename SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10, - T11>::T_slice - operator()(T1 r1, T2 r2, T3 r3, T4 r4, T5 r5, T6 r6, T7 r7, T8 r8, - T9 r9, T10 r10, T11 r11) const - { - return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10, - T11>::T_slice(noConst(), r1, r2, r3, r4, r5, r6, r7, r8, r9, - r10, r11); - } - -#endif // BZ_PARTIAL_ORDERING - - /* - * These versions of operator() are provided to support tensor-style - * array notation, e.g. - * - * Array<float, 2> A, B; - * firstIndex i; - * secondIndex j; - * thirdIndex k; - * Array<float, 3> C = A(i,j) * B(j,k); - */ - - template<int N0> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0> > - operator()(IndexPlaceholder<N0>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0> > - (noConst()); - } - - template<int N0, int N1> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1> >(noConst()); - } - - template<int N0, int N1, int N2> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2> >(noConst()); - } - - template<int N0, int N1, int N2, int N3> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, N4> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, - IndexPlaceholder<N4>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5, int N6> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5, N6> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>, IndexPlaceholder<N6>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5, N6> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5, int N6, - int N7> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5, N6, N7> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>, IndexPlaceholder<N6>, - IndexPlaceholder<N7>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5, N6, N7> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5, int N6, - int N7, int N8> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5, N6, N7, N8> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>, IndexPlaceholder<N6>, IndexPlaceholder<N7>, - IndexPlaceholder<N8>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5, N6, N7, N8> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5, int N6, - int N7, int N8, int N9> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5, N6, N7, N8, N9> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>, IndexPlaceholder<N6>, IndexPlaceholder<N7>, - IndexPlaceholder<N8>, IndexPlaceholder<N9>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5, N6, N7, N8, N9> >(noConst()); - } - - template<int N0, int N1, int N2, int N3, int N4, int N5, int N6, - int N7, int N8, int N9, int N10> - _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2, N3, - N4, N5, N6, N7, N8, N9, N10> > - operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>, - IndexPlaceholder<N2>, IndexPlaceholder<N3>, IndexPlaceholder<N4>, - IndexPlaceholder<N5>, IndexPlaceholder<N6>, IndexPlaceholder<N7>, - IndexPlaceholder<N8>, IndexPlaceholder<N9>, - IndexPlaceholder<N10>) const - { - return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, - N1, N2, N3, N4, N5, N6, N7, N8, N9, N10> >(noConst()); - } - - ////////////////////////////////////////////// - // Support for multicomponent arrays - ////////////////////////////////////////////// - - /* - * See <blitz/array/multi.h> for an explanation of the traits class - * multicomponent_traits. - */ - - // NEEDS_WORK: const version - Array<_bz_typename multicomponent_traits<T_numtype>::T_element,N_rank> - operator[](int component) - { - typedef _bz_typename multicomponent_traits<T_numtype>::T_element - T_compType; - - return extractComponent(T_compType(), - component, multicomponent_traits<T_numtype>::numComponents); - } - - ////////////////////////////////////////////// - // Indirection - ////////////////////////////////////////////// - - template<class T_indexContainer> - IndirectArray<T_array, T_indexContainer> - operator[](const T_indexContainer& index) - { - return IndirectArray<T_array, T_indexContainer>(*this, - const_cast<T_indexContainer&>(index)); - } - - ////////////////////////////////////////////// - // Assignment Operators - ////////////////////////////////////////////// - - // Scalar operand - // NEEDS_WORK : need a precondition check on - // isStorageContiguous when operator, is used. - ListInitializationSwitch<T_array> operator=(T_numtype x) - { - return ListInitializationSwitch<T_array>(*this, x); - } - - T_array& initialize(T_numtype); - - // Was: - // T_array& operator=(T_numtype); - -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - template<class T_expr> - T_array& operator=(const ETBase<T_expr>&); - T_array& operator=(const Array<T_numtype,N_rank>&); - - template<class T> T_array& operator+=(const T&); - template<class T> T_array& operator-=(const T&); - template<class T> T_array& operator*=(const T&); - template<class T> T_array& operator/=(const T&); - template<class T> T_array& operator%=(const T&); - template<class T> T_array& operator^=(const T&); - template<class T> T_array& operator&=(const T&); - template<class T> T_array& operator|=(const T&); - template<class T> T_array& operator>>=(const T&); - template<class T> T_array& operator<<=(const T&); - -#else - T_array& operator+=(T_numtype); - T_array& operator-=(T_numtype); - T_array& operator*=(T_numtype); - T_array& operator/=(T_numtype); - T_array& operator%=(T_numtype); - T_array& operator^=(T_numtype); - T_array& operator&=(T_numtype); - T_array& operator|=(T_numtype); - T_array& operator>>=(T_numtype); - T_array& operator<<=(T_numtype); - - // Array operands - T_array& operator=(const Array<T_numtype,N_rank>&); - - template<class T_numtype2> - T_array& operator=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator+=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator-=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator*=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator/=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator%=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator^=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator&=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator|=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator>>=(const Array<T_numtype2,N_rank>&); - template<class T_numtype2> - T_array& operator<<=(const Array<T_numtype2,N_rank>&); - - // Array expression operands - template<class T_expr> - inline T_array& operator=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator+=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator-=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator*=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator/=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator%=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator^=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator&=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator|=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator>>=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - template<class T_expr> - inline T_array& operator<<=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr); - - // NEEDS_WORK -- Index placeholder operand - - // NEEDS_WORK -- Random operand -#endif - -public: - // Undocumented implementation routines - - template<class T_expr, class T_update> - inline T_array& evaluate(T_expr expr, T_update); - -#ifdef BZ_HAVE_STD - template<class T_expr, class T_update> - inline T_array& evaluateWithFastTraversal( - const TraversalOrder<N_rank - 1>& order, - T_expr expr, T_update); -#endif - -#ifdef BZ_ARRAY_2D_STENCIL_TILING - template<class T_expr, class T_update> - inline T_array& evaluateWithTiled2DTraversal( - T_expr expr, T_update); -#endif - - template<class T_expr, class T_update> - inline T_array& evaluateWithIndexTraversal1( - T_expr expr, T_update); - - template<class T_expr, class T_update> - inline T_array& evaluateWithIndexTraversalN( - T_expr expr, T_update); - - template<class T_expr, class T_update> - inline T_array& evaluateWithStackTraversal1( - T_expr expr, T_update); - - template<class T_expr, class T_update> - inline T_array& evaluateWithStackTraversalN( - T_expr expr, T_update); - - - T_numtype* _bz_restrict getInitializationIterator() - { return dataFirst(); } - - _bz_bool canCollapse(int outerRank, int innerRank) const - { -#ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("stride(" << innerRank << ")=" << stride(innerRank) - << ", extent()=" << extent(innerRank) << ", stride(outerRank)=" - << stride(outerRank)); -#endif - return (stride(innerRank) * extent(innerRank) == stride(outerRank)); - } - -protected: - ////////////////////////////////////////////// - // Implementation routines - ////////////////////////////////////////////// - - _bz_inline2 void computeStrides(); - _bz_inline2 void setupStorage(int rank); - void constructSubarray(Array<T_numtype, N_rank>& array, - const RectDomain<N_rank>&); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, Range r1); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5, Range r6); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, - Range r7); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, - Range r7, Range r8); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, - Range r7, Range r8, Range r9); - void constructSubarray(Array<T_numtype, N_rank>& array, Range r0, - Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, - Range r7, Range r8, Range r9, Range r10); - - void calculateZeroOffset(); - - template<int N_rank2, class R0, class R1, class R2, class R3, class R4, - class R5, class R6, class R7, class R8, class R9, class R10> - void constructSlice(Array<T_numtype, N_rank2>& array, R0 r0, R1 r1, R2 r2, - R3 r3, R4 r4, R5 r5, R6 r6, R7 r7, R8 r8, R9 r9, R10 r10); - - template<int N_rank2> - void slice(int& setRank, Range r, Array<T_numtype,N_rank2>& array, - TinyVector<int,N_rank2>& rankMap, int sourceRank); - - template<int N_rank2> - void slice(int& setRank, int i, Array<T_numtype,N_rank2>& array, - TinyVector<int,N_rank2>& rankMap, int sourceRank); - - template<int N_rank2> - void slice(int& setRank, nilArraySection, Array<T_numtype,N_rank2>& array, - TinyVector<int,N_rank2>& rankMap, int sourceRank) - { } - - void doTranspose(int destRank, int sourceRank, T_array& array); - -protected: - ////////////////////////////////////////////// - // Data members - ////////////////////////////////////////////// - - // NB: adding new data members may require changes to ctors, reference() - - /* - * For a description of the storage_ members, see the comments for class - * GeneralArrayStorage<N_rank> above. - * - * length_[] contains the extent of each rank. E.g. a 10x20x30 array - * would have length_ = { 10, 20, 30}. - * stride_[] contains the stride to move to the next element along each - * rank. - * zeroOffset_ is the distance from the first element in the array - * to the point (0,0,...,0). If base_ is zero and all ranks are - * stored ascending, then zeroOffset_ is zero. This value - * is needed because to speed up indexing, the data_ member - * (inherited from MemoryBlockReference) always refers to - * (0,0,...,0). - */ - GeneralArrayStorage<N_rank> storage_; - TinyVector<int, N_rank> length_; - TinyVector<int, N_rank> stride_; - int zeroOffset_; -}; - -/* - * Rank numbers start with zero, which may be confusing to users coming - * from Fortran. To make code more readable, the following constants - * may help. Example: instead of - * - * int firstRankExtent = A.extent(0); - * - * One can write: - * - * int firstRankExtent = A.extent(firstRank); - */ - -const int firstRank = 0; -const int secondRank = 1; -const int thirdRank = 2; -const int fourthRank = 3; -const int fifthRank = 4; -const int sixthRank = 5; -const int seventhRank = 6; -const int eighthRank = 7; -const int ninthRank = 8; -const int tenthRank = 9; -const int eleventhRank = 10; - -const int firstDim = 0; -const int secondDim = 1; -const int thirdDim = 2; -const int fourthDim = 3; -const int fifthDim = 4; -const int sixthDim = 5; -const int seventhDim = 6; -const int eighthDim = 7; -const int ninthDim = 8; -const int tenthDim = 9; -const int eleventhDim = 10; - -/* - * Global Functions - */ - -template<class T_numtype> -ostream& operator<<(ostream&, const Array<T_numtype,1>&); - -template<class T_numtype> -ostream& operator<<(ostream&, const Array<T_numtype,2>&); - -template<class T_numtype, int N_rank> -ostream& operator<<(ostream&, const Array<T_numtype,N_rank>&); - -template<class T_numtype, int N_rank> -istream& operator>>(istream& is, Array<T_numtype,N_rank>& x); - -BZ_NAMESPACE_END - -/* - * Include implementations of the member functions and some additional - * global functions. - */ - -#include <blitz/array/iter.h> // Array iterators -#include <blitz/array/fastiter.h> // Fast Array iterators (for et) -#include <blitz/array/expr.h> // Array expression objects -#include <blitz/array/methods.cc> // Member functions -#include <blitz/array/eval.cc> // Array expression evaluation -#include <blitz/array/ops.cc> // Assignment operators -#include <blitz/array/io.cc> // Output formatting - -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - #include <blitz/array/et.h> // Expression templates -#else - #include <blitz/array/bops.cc> // Expression templates, two operands - #include <blitz/array/uops.cc> // Expression templates, math functions -#endif - -#include <blitz/array/misc.cc> // Expression templates, miscellaneous -#include <blitz/array/reduce.h> // Array reduction expression templates -#include <blitz/array/interlace.cc> // Allocation of interlaced arrays -#include <blitz/array/resize.cc> // Array resize, resizeAndPreserve -#include <blitz/array/slicing.cc> // Slicing and subarrays -#include <blitz/array/cycle.cc> // Cycling arrays -#include <blitz/array/complex.cc> // Special support for complex arrays -#include <blitz/array/zip.h> // Zipping multicomponent types -#include <blitz/array/where.h> // where(X,Y,Z) -#include <blitz/array/stencil.h> // Stencil objects -#include <blitz/array/indirect.h> // Indirection - -#endif // BZ_ARRAY_H - diff --git a/weave/blitz-20001213/blitz/array/asexpr.h b/weave/blitz-20001213/blitz/array/asexpr.h deleted file mode 100644 index 56bd96eb3..000000000 --- a/weave/blitz-20001213/blitz/array/asexpr.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef BZ_ARRAYASEXPR_H -#define BZ_ARRAYASEXPR_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/asexpr.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -// The traits class asExpr converts arbitrary things to -// expression templatable operands. - -// Default to scalar. -template<class T> -struct asExpr { - typedef _bz_ArrayExprConstant<T> T_expr; -}; - -// Already an expression template term -template<class T> -struct asExpr<_bz_ArrayExpr<T> > { - typedef _bz_ArrayExpr<T> T_expr; -}; - -// An array operand -template<class T, int N> -struct asExpr<Array<T,N> > { - typedef FastArrayIterator<T,N> T_expr; -}; - -// Index placeholder -template<int N> -struct asExpr<IndexPlaceholder<N> > { - typedef IndexPlaceholder<N> T_expr; -}; - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/array/cartesian.h b/weave/blitz-20001213/blitz/array/cartesian.h deleted file mode 100644 index 9bcce6a47..000000000 --- a/weave/blitz-20001213/blitz/array/cartesian.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef BZ_ARRAY_CARTESIAN_H -#define BZ_ARRAY_CARTESIAN_H - -BZ_NAMESPACE(blitz) - -/* - * CartesianProduct<T_tuple,T_container> is an adaptor which represents - * the cartesian product of several containers. - */ - -// forward declaration of iterator -template<class T_tuple, class T_container, int N_containers> -class CartesianProductIterator; - -struct _cp_end_tag { }; - -template<class T_tuple, class T_container, int N_containers> -class CartesianProduct { -public: - typedef T_tuple value_type; - typedef T_tuple& reference; - typedef const T_tuple& const_reference; - typedef CartesianProductIterator<T_tuple,T_container,N_containers> iterator; - typedef int difference_type; - typedef int size_type; - - iterator begin() - { return iterator(*this); } - - iterator end() - { return iterator(_cp_end_tag()); } - - CartesianProduct(const T_container& container0, - const T_container& container1) - { - BZPRECONDITION(N_containers == 2); - containers_[0] = &container0; - containers_[1] = &container1; - } - - CartesianProduct(const T_container& container0, - const T_container& container1, - const T_container& container2) - { - BZPRECONDITION(N_containers == 3); - containers_[0] = &container0; - containers_[1] = &container1; - containers_[2] = &container2; - } - - const T_container& operator[](int i) - { return *(containers_[i]); } - - void debugDump(); - -protected: - const T_container* containers_[N_containers]; -}; - -template<class T_tuple, class T_container, int N_containers> -void CartesianProduct<T_tuple,T_container,N_containers>::debugDump() -{ - cout << "Dump of CartesianProduct<..,..," << N_containers << ">" << endl; - for (int i=0; i < N_containers; ++i) - { - cout << "Container " << (i+1) << ": "; - _bz_typename T_container::const_iterator iter = containers_[i]->begin(), - end = containers_[i]->end(); - for (; iter != end; ++iter) - cout << (*iter) << '\t'; - } -} - -template<class T_tuple, class T_container, int N_containers> -class CartesianProductIterator { -public: - typedef _bz_typename T_container::const_iterator citerator; - typedef CartesianProductIterator<T_tuple,T_container,N_containers> iterator; - typedef CartesianProduct<T_tuple,T_container,N_containers> T_cp; - - CartesianProductIterator(T_cp& container) - { - for (int i=0; i < N_containers; ++i) - { - firstiters_[i] = container[i].begin(); - iters_[i] = firstiters_[i]; - enditers_[i] = container[i].end(); - tuple_[i] = *iters_[i]; - } - - endflag_ = _bz_false; - } - - void operator++(); - - CartesianProductIterator(_cp_end_tag) - { - endflag_ = _bz_true; - } - - _bz_bool operator==(const iterator& x) const - { - return (endflag_ == x.endflag_); - } - - _bz_bool operator!=(const iterator& x) const - { - return endflag_ != x.endflag_; - } - - const T_tuple& operator*() const - { return tuple_; } - -protected: - citerator iters_[N_containers]; - citerator firstiters_[N_containers]; - citerator enditers_[N_containers]; - T_tuple tuple_; - _bz_bool endflag_; -}; - -template<class T_tuple, class T_container, int N_containers> -void CartesianProductIterator<T_tuple, T_container, - N_containers>::operator++() -{ - // NEEDS_WORK: put in short-circuit for most common case - // (just increment the last iterator) - - // Usual stack-style increment - const int Nminus1 = N_containers - 1; - - int i = Nminus1; - - for (; i >= 0; --i) - { - ++iters_[i]; - if (iters_[i] != enditers_[i]) - break; - } - - if (i == -1) - { - endflag_ = _bz_true; - return; - } - - tuple_[i] = *iters_[i]; - - for (++i; i < N_containers; ++i) - { - iters_[i] = firstiters_[i]; - tuple_[i] = *iters_[i]; - } -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_CARTESIAN_H - diff --git a/weave/blitz-20001213/blitz/array/cgsolve.h b/weave/blitz-20001213/blitz/array/cgsolve.h deleted file mode 100644 index 68e9d0578..000000000 --- a/weave/blitz-20001213/blitz/array/cgsolve.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef BZ_CGSOLVE_H -#define BZ_CGSOLVE_H - -BZ_NAMESPACE(blitz) - -template<class T_numtype> -void dump(const char* name, Array<T_numtype,3>& A) -{ - T_numtype normA = 0; - - for (int i=A.lbound(0); i <= A.ubound(0); ++i) - { - for (int j=A.lbound(1); j <= A.ubound(1); ++j) - { - for (int k=A.lbound(2); k <= A.ubound(2); ++k) - { - T_numtype tmp = A(i,j,k); - normA += ::fabs(tmp); - } - } - } - - normA /= A.numElements(); - cout << "Average magnitude of " << name << " is " << normA << endl; -} - -template<class T_stencil, class T_numtype, int N_rank, class T_BCs> -int conjugateGradientSolver(T_stencil stencil, - Array<T_numtype,N_rank>& x, - Array<T_numtype,N_rank>& rhs, double haltrho, - const T_BCs& boundaryConditions) -{ - // NEEDS_WORK: only apply CG updates over interior; need to handle - // BCs separately. - - // x = unknowns being solved for (initial guess assumed) - // r = residual - // p = descent direction for x - // q = descent direction for r - - RectDomain<N_rank> interior = interiorDomain(stencil, x, rhs); - -cout << "Interior: " << interior.lbound() << ", " << interior.ubound() - << endl; - - // Calculate initial residual - Array<T_numtype,N_rank> r = rhs.copy(); - r *= -1.0; - - boundaryConditions.applyBCs(x); - - applyStencil(stencil, r, x); - - dump("r after stencil", r); - cout << "Slice through r: " << endl << r(23,17,Range::all()) << endl; - cout << "Slice through x: " << endl << x(23,17,Range::all()) << endl; - cout << "Slice through rhs: " << endl << rhs(23,17,Range::all()) << endl; - - r *= -1.0; - - dump("r", r); - - // Allocate the descent direction arrays - Array<T_numtype,N_rank> p, q; - allocateArrays(x.shape(), p, q); - - int iteration = 0; - int converged = 0; - T_numtype rho = 0.; - T_numtype oldrho = 0.; - - const int maxIterations = 1000; - - // Get views of interior of arrays (without boundaries) - Array<T_numtype,N_rank> rint = r(interior); - Array<T_numtype,N_rank> pint = p(interior); - Array<T_numtype,N_rank> qint = q(interior); - Array<T_numtype,N_rank> xint = x(interior); - - while (iteration < maxIterations) - { - rho = sum(r * r); - - if ((iteration % 20) == 0) - cout << "CG: Iter " << iteration << "\t rho = " << rho << endl; - - // Check halting condition - if (rho < haltrho) - { - converged = 1; - break; - } - - if (iteration == 0) - { - p = r; - } - else { - T_numtype beta = rho / oldrho; - p = beta * p + r; - } - - q = 0.; -// boundaryConditions.applyBCs(p); - applyStencil(stencil, q, p); - - T_numtype pq = sum(p*q); - - T_numtype alpha = rho / pq; - - x += alpha * p; - r -= alpha * q; - - oldrho = rho; - ++iteration; - } - - if (!converged) - cout << "Warning: CG solver did not converge" << endl; - - return iteration; -} - -BZ_NAMESPACE_END - -#endif // BZ_CGSOLVE_H diff --git a/weave/blitz-20001213/blitz/array/complex.cc b/weave/blitz-20001213/blitz/array/complex.cc deleted file mode 100644 index d03e097f0..000000000 --- a/weave/blitz-20001213/blitz/array/complex.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Special functions for complex arrays - -#ifndef BZ_ARRAYCOMPLEX_CC -#define BZ_ARRAYCOMPLEX_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/complex.cc> must be included via <blitz/array/array.h> -#endif - -BZ_NAMESPACE(blitz) - -#ifdef BZ_HAVE_COMPLEX - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank> real(const Array<complex<T_numtype>,N_rank>& A) -{ - return A.extractComponent(T_numtype(), 0, 2); -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank> imag(const Array<complex<T_numtype>,N_rank>& A) -{ - return A.extractComponent(T_numtype(), 1, 2); -} - - -#endif - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYCOMPLEX_CC - diff --git a/weave/blitz-20001213/blitz/array/convolve.cc b/weave/blitz-20001213/blitz/array/convolve.cc deleted file mode 100644 index 514238915..000000000 --- a/weave/blitz-20001213/blitz/array/convolve.cc +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef BZ_ARRAY_CONVOLVE_CC -#define BZ_ARRAY_CONVOLVE_CC - -BZ_NAMESPACE(blitz) - -template<class T> -Array<T,1> convolve(const Array<T,1>& B, const Array<T,1>& C) -{ - int Bl = B.lbound(0), Bh = B.ubound(0); - int Cl = C.lbound(0), Ch = C.ubound(0); - - int lbound = Bl + Cl; - int ubound = Bh + Ch; - - Array<T,1> A(Range(lbound,ubound)); - - for (int i=lbound; i <= ubound; ++i) - { - int jl = i - Ch; - if (jl < Bl) - jl = Bl; - - int jh = i - Cl; - if (jh > Bh) - jh = Bh; - - T result = 0; - for (int j=jl; j <= jh; ++j) - result += B(j) * C(i-j); - - A(i) = result; - } - - return A; -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_CONVOLVE_CC - diff --git a/weave/blitz-20001213/blitz/array/convolve.h b/weave/blitz-20001213/blitz/array/convolve.h deleted file mode 100644 index 93ecc769a..000000000 --- a/weave/blitz-20001213/blitz/array/convolve.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef BZ_ARRAY_CONVOLVE_H -#define BZ_ARRAY_CONVOLVE_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/convolve.h> must be included after <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class T> -Array<T,1> convolve(const Array<T,1>& B, const Array<T,1>& C); - -BZ_NAMESPACE_END - -#include <blitz/array/convolve.cc> - -#endif // BZ_ARRAY_CONVOLVE_H diff --git a/weave/blitz-20001213/blitz/array/cycle.cc b/weave/blitz-20001213/blitz/array/cycle.cc deleted file mode 100644 index baa7aaf30..000000000 --- a/weave/blitz-20001213/blitz/array/cycle.cc +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef BZ_ARRAYCYCLE_CC -#define BZ_ARRAYCYCLE_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/cycle.cc> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class T_numtype, int N_rank> -void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b) -{ - Array<T_numtype, N_rank> tmp(a); - a.reference(b); - b.reference(tmp); -} - -template<class T_numtype, int N_rank> -void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, - Array<T_numtype, N_rank>& c) -{ - Array<T_numtype, N_rank> tmp(a); - a.reference(b); - b.reference(c); - c.reference(tmp); -} - -template<class T_numtype, int N_rank> -void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, - Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d) -{ - Array<T_numtype, N_rank> tmp(a); - a.reference(b); - b.reference(c); - c.reference(d); - d.reference(tmp); -} - -template<class T_numtype, int N_rank> -void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, - Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d, - Array<T_numtype, N_rank>& e) -{ - Array<T_numtype, N_rank> tmp(a); - a.reference(b); - b.reference(c); - c.reference(d); - d.reference(e); - e.reference(tmp); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYCYCLE_CC diff --git a/weave/blitz-20001213/blitz/array/domain.h b/weave/blitz-20001213/blitz/array/domain.h deleted file mode 100644 index 650b553b6..000000000 --- a/weave/blitz-20001213/blitz/array/domain.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef BZ_DOMAIN_H -#define BZ_DOMAIN_H - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -/* - * Portions of this class were inspired by the "RectDomain" class - * provided by the Titanium language (UC Berkeley). - */ - -BZ_NAMESPACE(blitz) - -template<int N_rank> -class RectDomain { - -public: - RectDomain(const TinyVector<int,N_rank>& lbound, - const TinyVector<int,N_rank>& ubound) - : lbound_(lbound), ubound_(ubound) - { } - - // NEEDS_WORK: better constructors - // RectDomain(Range, Range, ...) - // RectDomain with any combination of Range and int - - const TinyVector<int,N_rank>& lbound() const - { return lbound_; } - - int lbound(int i) const - { return lbound_(i); } - - const TinyVector<int,N_rank>& ubound() const - { return ubound_; } - - int ubound(int i) const - { return ubound_(i); } - - Range operator[](int rank) const - { return Range(lbound_(rank), ubound_(rank)); } - - void shrink(int amount) - { - lbound_ += amount; - ubound_ -= amount; - } - - void shrink(int dim, int amount) - { - lbound_(dim) += amount; - ubound_(dim) -= amount; - } - - void expand(int amount) - { - lbound_ -= amount; - ubound_ += amount; - } - - void expand(int dim, int amount) - { - lbound_(dim) -= amount; - ubound_(dim) += amount; - } - -private: - TinyVector<int,N_rank> lbound_, ubound_; -}; - -template<int N_rank> -inline RectDomain<N_rank> strip(const TinyVector<int,N_rank>& startPosition, - int stripDimension, int ubound) -{ - BZPRECONDITION((stripDimension >= 0) && (stripDimension < N_rank)); - BZPRECONDITION(ubound >= startPosition(stripDimension)); - - TinyVector<int,N_rank> endPosition = startPosition; - endPosition(stripDimension) = ubound; - return RectDomain<N_rank>(startPosition, endPosition); -} - -BZ_NAMESPACE_END - -#endif // BZ_DOMAIN_H diff --git a/weave/blitz-20001213/blitz/array/et.h b/weave/blitz-20001213/blitz/array/et.h deleted file mode 100644 index c71fb656c..000000000 --- a/weave/blitz-20001213/blitz/array/et.h +++ /dev/null @@ -1,334 +0,0 @@ -#ifndef BZ_ARRAY_ET_H -#define BZ_ARRAY_ET_H - -#ifndef BZ_ARRAYEXPR_H - #error <blitz/array/et.h> must be included after <blitz/arrayexpr.h> -#endif - -#include <blitz/array/asexpr.h> - -#ifndef BZ_OPS_H - #include <blitz/ops.h> -#endif - -#ifndef BZ_MATHFUNC_H - #include <blitz/mathfunc.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * Array expression templates: the macro BZ_DECLARE_ARRAY_ET(X,Y) - * declares a function or operator which takes two operands. - * X is the function name (or operator), and Y is the functor object - * which implements the operation. - */ - -#define BZ_DECLARE_ARRAY_ET(name, applic) \ - \ -template<class T_numtype1, int N_rank1, class T_other> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprOp<FastArrayIterator<T_numtype1, N_rank1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<T_numtype1, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ -name (const Array<T_numtype1,N_rank1>& d1, \ - const T_other& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<FastArrayIterator<T_numtype1, \ - N_rank1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<T_numtype1, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ - (d1.beginFast(),d2); \ -} \ - \ -template<class T_expr1, class T_other> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<T_expr1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<_bz_typename T_expr1::T_numtype, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ -name(const _bz_ArrayExpr<T_expr1>& d1, \ - const T_other& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<T_expr1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<_bz_typename T_expr1::T_numtype, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > >(d1,d2); \ -} \ - \ -template<class T1, class T2> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, \ - _bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ -name(const ETBase<T1>& d1, const T2& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, \ - _bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ - (static_cast<const T1&>(d1), d2); \ -} \ - \ -template<class T1, class T2> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, \ -_bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ -name(const T1& d1, \ - const ETBase<T2>& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename \ - asExpr<T1>::T_expr, \ - _bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ - (d1, static_cast<const T2&>(d2)); \ -} \ - \ -template<int N1, class T_other> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<int, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ -name(IndexPlaceholder<N1> d1, \ - const T_other& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<int, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > >(d1,d2); \ -} \ - - -// operator<< has been commented out because it causes ambiguity -// with statements like "cout << A". NEEDS_WORK -// ditto operator<< - -BZ_DECLARE_ARRAY_ET(operator+, Add) -BZ_DECLARE_ARRAY_ET(operator-, Subtract) -BZ_DECLARE_ARRAY_ET(operator*, Multiply) -BZ_DECLARE_ARRAY_ET(operator/, Divide) -BZ_DECLARE_ARRAY_ET(operator%, Modulo) -BZ_DECLARE_ARRAY_ET(operator^, BitwiseXor) -BZ_DECLARE_ARRAY_ET(operator&, BitwiseAnd) -BZ_DECLARE_ARRAY_ET(operator|, BitwiseOr) -// BZ_DECLARE_ARRAY_ET(operator>>, ShiftRight) -// BZ_DECLARE_ARRAY_ET(operator<<, ShiftLeft) -BZ_DECLARE_ARRAY_ET(operator>, Greater) -BZ_DECLARE_ARRAY_ET(operator<, Less) -BZ_DECLARE_ARRAY_ET(operator>=, GreaterOrEqual) -BZ_DECLARE_ARRAY_ET(operator<=, LessOrEqual) -BZ_DECLARE_ARRAY_ET(operator==, Equal) -BZ_DECLARE_ARRAY_ET(operator!=, NotEqual) -BZ_DECLARE_ARRAY_ET(operator&&, LogicalAnd) -BZ_DECLARE_ARRAY_ET(operator||, LogicalOr) - -BZ_DECLARE_ARRAY_ET(atan2, _bz_atan2) -BZ_DECLARE_ARRAY_ET(pow, _bz_pow) - -#ifdef BZ_HAVE_COMPLEX_MATH -BZ_DECLARE_ARRAY_ET(polar, _bz_polar) -#endif - -#ifdef BZ_HAVE_SYSTEM_V_MATH -BZ_DECLARE_ARRAY_ET(copysign, _bz_copysign) -BZ_DECLARE_ARRAY_ET(drem, _bz_drem) -BZ_DECLARE_ARRAY_ET(fmod, _bz_fmod) -BZ_DECLARE_ARRAY_ET(hypot, _bz_hypot) -BZ_DECLARE_ARRAY_ET(nextafter, _bz_nextafter) -BZ_DECLARE_ARRAY_ET(remainder, _bz_remainder) -BZ_DECLARE_ARRAY_ET(scalb, _bz_scalb) -BZ_DECLARE_ARRAY_ET(unordered, _bz_unordered) -#endif - -/* - * Unary functions and operators - */ - -#define BZ_DECLARE_ARRAY_ET_UOP(name, functor) \ -template<class T1> \ -_bz_inline_et \ -_bz_ArrayExpr<_bz_ArrayExprUnaryOp< \ - _bz_typename asExpr<T1>::T_expr, \ - functor<_bz_typename asExpr<T1>::T_expr::T_numtype> > > \ -name(const ETBase<T1>& d1) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprUnaryOp< \ - _bz_typename asExpr<T1>::T_expr, \ - functor<_bz_typename asExpr<T1>::T_expr::T_numtype> > > \ - (static_cast<const T1&>(d1)); \ -} - -BZ_DECLARE_ARRAY_ET_UOP(operator-, _bz_negate) - -// NEEDS_WORK: operator!, operator~ - -BZ_DECLARE_ARRAY_ET_UOP(abs, _bz_abs) -BZ_DECLARE_ARRAY_ET_UOP(acos, _bz_acos) -BZ_DECLARE_ARRAY_ET_UOP(asin, _bz_asin) -BZ_DECLARE_ARRAY_ET_UOP(atan, _bz_atan) -BZ_DECLARE_ARRAY_ET_UOP(ceil, _bz_ceil) -BZ_DECLARE_ARRAY_ET_UOP(cexp, _bz_cexp) -BZ_DECLARE_ARRAY_ET_UOP(cos, _bz_cos) -BZ_DECLARE_ARRAY_ET_UOP(cosh, _bz_cosh) -BZ_DECLARE_ARRAY_ET_UOP(csqrt, _bz_csqrt) -BZ_DECLARE_ARRAY_ET_UOP(exp, _bz_exp) -BZ_DECLARE_ARRAY_ET_UOP(fabs, _bz_abs) -BZ_DECLARE_ARRAY_ET_UOP(floor, _bz_floor) -BZ_DECLARE_ARRAY_ET_UOP(log, _bz_log) -BZ_DECLARE_ARRAY_ET_UOP(log10, _bz_log10) -BZ_DECLARE_ARRAY_ET_UOP(pow2, _bz_pow2) -BZ_DECLARE_ARRAY_ET_UOP(pow3, _bz_pow3) -BZ_DECLARE_ARRAY_ET_UOP(pow4, _bz_pow4) -BZ_DECLARE_ARRAY_ET_UOP(pow5, _bz_pow5) -BZ_DECLARE_ARRAY_ET_UOP(pow6, _bz_pow6) -BZ_DECLARE_ARRAY_ET_UOP(pow7, _bz_pow7) -BZ_DECLARE_ARRAY_ET_UOP(pow8, _bz_pow8) -BZ_DECLARE_ARRAY_ET_UOP(sin, _bz_sin) -BZ_DECLARE_ARRAY_ET_UOP(sinh, _bz_sinh) -BZ_DECLARE_ARRAY_ET_UOP(sqr, _bz_sqr) -BZ_DECLARE_ARRAY_ET_UOP(sqrt, _bz_sqrt) -BZ_DECLARE_ARRAY_ET_UOP(tan, _bz_tan) -BZ_DECLARE_ARRAY_ET_UOP(tanh, _bz_tanh) - -#ifdef BZ_HAVE_COMPLEX_MATH -BZ_DECLARE_ARRAY_ET_UOP(arg, _bz_arg) -BZ_DECLARE_ARRAY_ET_UOP(conj, _bz_conj) -#endif - -#ifdef BZ_HAVE_SYSTEM_V_MATH -BZ_DECLARE_ARRAY_ET_UOP(_class, _bz__class) -BZ_DECLARE_ARRAY_ET_UOP(ilogb, _bz_ilogb) -BZ_DECLARE_ARRAY_ET_UOP(itrunc, _bz_itrunc) -BZ_DECLARE_ARRAY_ET_UOP(nearest, _bz_nearest) -BZ_DECLARE_ARRAY_ET_UOP(rsqrt, _bz_rsqrt) -BZ_DECLARE_ARRAY_ET_UOP(uitrunc, _bz_uitrunc) -#endif - -#ifdef BZ_HAVE_IEEE_MATH - -// finite and trunc omitted: blitz-bugs/archive/0189.html -BZ_DECLARE_ARRAY_ET_UOP(acosh, _bz_acosh) -BZ_DECLARE_ARRAY_ET_UOP(asinh, _bz_asinh) -BZ_DECLARE_ARRAY_ET_UOP(atanh, _bz_atanh) -BZ_DECLARE_ARRAY_ET_UOP(cbrt, _bz_cbrt) -BZ_DECLARE_ARRAY_ET_UOP(expm1, _bz_expm1) -BZ_DECLARE_ARRAY_ET_UOP(erf, _bz_erf) -BZ_DECLARE_ARRAY_ET_UOP(erfc, _bz_erfc) -// BZ_DECLARE_ARRAY_ET_UOP(finite, _bz_finite) -BZ_DECLARE_ARRAY_ET_UOP(isnan, _bz_isnan) -BZ_DECLARE_ARRAY_ET_UOP(j0, _bz_j0) -BZ_DECLARE_ARRAY_ET_UOP(j1, _bz_j1) -BZ_DECLARE_ARRAY_ET_UOP(lgamma, _bz_lgamma) -BZ_DECLARE_ARRAY_ET_UOP(logb, _bz_logb) -BZ_DECLARE_ARRAY_ET_UOP(log1p, _bz_log1p) -BZ_DECLARE_ARRAY_ET_UOP(rint, _bz_rint) -// BZ_DECLARE_ARRAY_ET_UOP(trunc, _bz_trunc) -BZ_DECLARE_ARRAY_ET_UOP(y0, _bz_y0) -BZ_DECLARE_ARRAY_ET_UOP(y1, _bz_y1) -#endif - - -/* - * User-defined expression template routines - */ - -#define BZ_DECLARE_FUNCTION(name) \ - template<class P_numtype> \ - struct name ## _impl { \ - typedef P_numtype T_numtype; \ - template<class T> \ - static inline T apply(T x) \ - { return name(x); } \ - \ - template<class T1> \ - static void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& a) \ - { \ - str += #name; \ - str += "("; \ - a.prettyPrint(str,format); \ - str += ")"; \ - } \ - }; \ - \ - BZ_DECLARE_ARRAY_ET_UOP(name, name ## _impl) - -#define BZ_DECLARE_FUNCTION_RET(name, return_type) \ - template<class P_numtype> \ - struct name ## _impl { \ - typedef return_type T_numtype; \ - template<class T> \ - static inline return_type apply(T x) \ - { return name(x); } \ - \ - template<class T1> \ - static void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& a) \ - { \ - str += #name; \ - str += "("; \ - a.prettyPrint(str,format); \ - str += ")"; \ - } \ - }; \ - \ - BZ_DECLARE_ARRAY_ET_UOP(name, name ## _impl) - - -#define BZ_DECLARE_FUNCTION2(name) \ - template<class P_numtype1, class P_numtype2> \ - struct name ## _impl { \ - typedef _bz_typename promote_trait<P_numtype1, \ - P_numtype2>::T_promote T_numtype; \ - template<class T1, class T2> \ - static inline T_numtype apply(T1 x, T2 y) \ - { return name(x,y); } \ - \ - template<class T1, class T2> \ - static void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& a, const T2& b) \ - { \ - str += #name; \ - str += "("; \ - a.prettyPrint(str,format); \ - str += ","; \ - b.prettyPrint(str,format); \ - str += ")"; \ - } \ - }; \ - \ - BZ_DECLARE_ARRAY_ET(name, name ## _impl) - -#define BZ_DECLARE_FUNCTION2_RET(name, return_type) \ - template<class P_numtype1, class P_numtype2> \ - struct name ## _impl { \ - typedef return_type T_numtype; \ - template<class T1, class T2> \ - static inline T_numtype apply(T1 x, T2 y) \ - { return name(x,y); } \ - \ - template<class T1, class T2> \ - static void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& a, const T2& b) \ - { \ - str += #name; \ - str += "("; \ - a.prettyPrint(str,format); \ - str += ","; \ - b.prettyPrint(str,format); \ - str += ")"; \ - } \ - }; \ - \ - BZ_DECLARE_ARRAY_ET(name, name ## _impl) - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/array/eval.cc b/weave/blitz-20001213/blitz/array/eval.cc deleted file mode 100644 index de4d4e8a7..000000000 --- a/weave/blitz-20001213/blitz/array/eval.cc +++ /dev/null @@ -1,1237 +0,0 @@ -/* - * $Id$ - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1998/02/25 20:04:01 tveldhui - * Initial revision - * - */ - -#ifndef BZ_ARRAYEVAL_CC -#define BZ_ARRAYEVAL_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/eval.cc> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * Assign an expression to an array. For performance reasons, there are - * several traversal mechanisms: - * - * - Index traversal scans through the destination array in storage order. - * The expression is evaluated using a TinyVector<int,N> operand. This - * version is used only when there are index placeholders in the expression - * (see <blitz/indexexpr.h>) - * - Stack traversal also scans through the destination array in storage - * order. However, push/pop stack iterators are used. - * - Fast traversal follows a Hilbert (or other) space-filling curve to - * improve cache reuse for stencilling operations. Currently, the - * space filling curves must be generated by calling - * generateFastTraversalOrder(TinyVector<int,N_dimensions>). - * - 2D tiled traversal follows a tiled traversal, to improve cache reuse - * for 2D stencils. Space filling curves have too much overhead to use - * in two-dimensions. - * - * _bz_tryFastTraversal is a helper class. Fast traversals are only - * attempted if the expression looks like a stencil -- it's at least - * three-dimensional, has at least six array operands, and there are - * no index placeholders in the expression. These are all things which - * can be checked at compile time, so the if()/else() syntax has been - * replaced with this class template. - */ - -// Fast traversals require <set> from the ISO/ANSI C++ standard library -#ifdef BZ_HAVE_STD - -template<_bz_bool canTryFastTraversal> -struct _bz_tryFastTraversal { - template<class T_numtype, int N_rank, class T_expr, class T_update> - static _bz_bool tryFast(Array<T_numtype,N_rank>& array, - BZ_ETPARM(T_expr) expr, T_update) - { - return _bz_false; - } -}; - -template<> -struct _bz_tryFastTraversal<_bz_true> { - template<class T_numtype, int N_rank, class T_expr, class T_update> - static _bz_bool tryFast(Array<T_numtype,N_rank>& array, - BZ_ETPARM(T_expr) expr, T_update) - { - // See if there's an appropriate space filling curve available. - // Currently fast traversals use an N-1 dimensional curve. The - // Nth dimension column corresponding to each point on the curve - // is traversed in the normal fashion. - TraversalOrderCollection<N_rank-1> traversals; - TinyVector<int, N_rank - 1> traversalGridSize; - - for (int i=0; i < N_rank - 1; ++i) - traversalGridSize[i] = array.length(array.ordering(i+1)); - -#ifdef BZ_DEBUG_TRAVERSE -cout << "traversalGridSize = " << traversalGridSize << endl; -cout.flush(); -#endif - - const TraversalOrder<N_rank-1>* order = - traversals.find(traversalGridSize); - - if (order) - { -#ifdef BZ_DEBUG_TRAVERSE - cerr << "Array<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype) - << ", " << N_rank << ">: Using stack traversal" << endl; -#endif - // A curve was available -- use fast traversal. - array.evaluateWithFastTraversal(*order, expr, T_update()); - return _bz_true; - } - - return _bz_false; - } -}; - -#endif // BZ_HAVE_STD - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluate(T_expr expr, - T_update) -{ - // Check that all arrays have the same shape -#ifdef BZ_DEBUG - if (!expr.shapeCheck(shape())) - { - if (assertFailMode == _bz_false) - { - cerr << "[Blitz++] Shape check failed: Module " << __FILE__ - << " line " << __LINE__ << endl - << " Expression: "; - prettyPrintFormat format(_bz_true); // Use terse formatting - string str; - expr.prettyPrint(str, format); - cerr << str << endl ; - } - -#if 0 -// Shape dumping is broken by change to using string for prettyPrint - << " Shapes: " << shape() << " = "; - prettyPrintFormat format2; - format2.setDumpArrayShapesMode(); - expr.prettyPrint(cerr, format2); - cerr << endl; -#endif - BZ_PRE_FAIL; - } -#endif - - BZPRECHECK(expr.shapeCheck(shape()), - "Shape check failed." << endl << "Expression:"); - - BZPRECHECK((T_expr::rank == N_rank) || (T_expr::numArrayOperands == 0), - "Assigned rank " << T_expr::rank << " expression to rank " - << N_rank << " array."); - - /* - * Check that the arrays are not empty (e.g. length 0 arrays) - * This fixes a bug found by Peter Bienstman, 6/16/99, where - * Array<double,2> A(0,0),B(0,0); B=A(tensor::j,tensor::i); - * went into an infinite loop. - */ - - if (numElements() == 0) - return *this; - -#ifdef BZ_DEBUG_TRAVERSE -cout << "T_expr::numIndexPlaceholders = " << T_expr::numIndexPlaceholders - << endl; cout.flush(); -#endif - - // Tau profiling code. Provide Tau with a pretty-printed version of - // the expression. - // NEEDS_WORK-- use a static initializer somehow. - -#ifdef BZ_TAU_PROFILING - static string exprDescription; - if (!exprDescription.length()) // faked static initializer - { - exprDescription = "A"; - prettyPrintFormat format(_bz_true); // Terse mode on - format.nextArrayOperandSymbol(); - T_update::prettyPrint(exprDescription); - expr.prettyPrint(exprDescription, format); - } - TAU_PROFILE(" ", exprDescription, TAU_BLITZ); -#endif - - // Determine which evaluation mechanism to use - if (T_expr::numIndexPlaceholders > 0) - { - // The expression involves index placeholders, so have to - // use index traversal rather than stack traversal. - - if (N_rank == 1) - return evaluateWithIndexTraversal1(expr, T_update()); - else - return evaluateWithIndexTraversalN(expr, T_update()); - } - else { - - // If this expression looks like an array stencil, then attempt to - // use a fast traversal order. - // Fast traversals require <set> from the ISO/ANSI C++ standard - // library. - -#ifdef BZ_HAVE_STD - - enum { isStencil = (N_rank >= 3) && (T_expr::numArrayOperands > 6) - && (T_expr::numIndexPlaceholders == 0) }; - - if (_bz_tryFastTraversal<isStencil>::tryFast(*this, expr, T_update())) - return *this; - -#endif - -#ifdef BZ_ARRAY_2D_STENCIL_TILING - // Does this look like a 2-dimensional stencil on a largeish - // array? - - if ((N_rank == 2) && (T_expr::numArrayOperands >= 5)) - { - // Use a heuristic to determine whether a tiled traversal - // is desirable. First, estimate how much L1 cache is needed - // to achieve a high hit rate using the stack traversal. - // Try to err on the side of using tiled traversal even when - // it isn't strictly needed. - - // Assumptions: - // Stencil width 3 - // 3 arrays involved in stencil - // Uniform data type in arrays (all T_numtype) - - int cacheNeeded = 3 * 3 * sizeof(T_numtype) * length(ordering(0)); - if (cacheNeeded > BZ_L1_CACHE_ESTIMATED_SIZE) - return evaluateWithTiled2DTraversal(expr, T_update()); - } - -#endif - - // If fast traversal isn't available or appropriate, then just - // do a stack traversal. - if (N_rank == 1) - return evaluateWithStackTraversal1(expr, T_update()); - else - return evaluateWithStackTraversalN(expr, T_update()); - } -} - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithStackTraversal1( - T_expr expr, T_update) -{ -#ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("Array<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype) - << ", " << N_rank << ">: Using stack traversal"); -#endif - FastArrayIterator<T_numtype, N_rank> iter(*this); - iter.loadStride(firstRank); - expr.loadStride(firstRank); - - _bz_bool useUnitStride = iter.isUnitStride(firstRank) - && expr.isUnitStride(firstRank); - -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - int commonStride = expr.suggestStride(firstRank); - if (iter.suggestStride(firstRank) > commonStride) - commonStride = iter.suggestStride(firstRank); - bool useCommonStride = iter.isStride(firstRank,commonStride) - && expr.isStride(firstRank,commonStride); - - #ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("BZ_ARRAY_EXPR_USE_COMMON_STRIDE:" << endl - << " commonStride = " << commonStride << " useCommonStride = " - << useCommonStride); - #endif -#else - int commonStride = 1; - bool useCommonStride = _bz_false; -#endif - - const T_numtype * last = iter.data() + length(firstRank) - * stride(firstRank); - - if (useUnitStride || useCommonStride) - { -#ifdef BZ_USE_FAST_READ_ARRAY_EXPR - -#ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("BZ_USE_FAST_READ_ARRAY_EXPR with commonStride"); -#endif - int ubound = length(firstRank) * commonStride; - T_numtype* _bz_restrict data = const_cast<T_numtype*>(iter.data()); - - if (commonStride == 1) - { - #ifndef BZ_ARRAY_STACK_TRAVERSAL_UNROLL - for (int i=0; i < ubound; ++i) - T_update::update(data[i], expr.fastRead(i)); - #else - int n1 = ubound & 3; - int i = 0; - for (; i < n1; ++i) - T_update::update(data[i], expr.fastRead(i)); - - for (; i < ubound; i += 4) - { -#ifndef BZ_ARRAY_STACK_TRAVERSAL_CSE_AND_ANTIALIAS - T_update::update(data[i], expr.fastRead(i)); - T_update::update(data[i+1], expr.fastRead(i+1)); - T_update::update(data[i+2], expr.fastRead(i+2)); - T_update::update(data[i+3], expr.fastRead(i+3)); -#else - int t1 = i+1; - int t2 = i+2; - int t3 = i+3; - - _bz_typename T_expr::T_numtype tmp1, tmp2, tmp3, tmp4; - - tmp1 = expr.fastRead(i); - tmp2 = expr.fastRead(BZ_NO_PROPAGATE(t1)); - tmp3 = expr.fastRead(BZ_NO_PROPAGATE(t2)); - tmp4 = expr.fastRead(BZ_NO_PROPAGATE(t3)); - - T_update::update(data[i], BZ_NO_PROPAGATE(tmp1)); - T_update::update(data[BZ_NO_PROPAGATE(t1)], tmp2); - T_update::update(data[BZ_NO_PROPAGATE(t2)], tmp3); - T_update::update(data[BZ_NO_PROPAGATE(t3)], tmp4); -#endif - } - #endif // BZ_ARRAY_STACK_TRAVERSAL_UNROLL - - } - #ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - else { - - #ifndef BZ_ARRAY_STACK_TRAVERSAL_UNROLL - for (int i=0; i < ubound; i += commonStride) - T_update::update(data[i], expr.fastRead(i)); - #else - int n1 = (length(firstRank) & 3) * commonStride; - - int i = 0; - for (; i < n1; i += commonStride) - T_update::update(data[i], expr.fastRead(i)); - - int strideInc = 4 * commonStride; - for (; i < ubound; i += strideInc) - { - T_update::update(data[i], expr.fastRead(i)); - int i2 = i + commonStride; - T_update::update(data[i2], expr.fastRead(i2)); - int i3 = i + 2 * commonStride; - T_update::update(data[i3], expr.fastRead(i3)); - int i4 = i + 3 * commonStride; - T_update::update(data[i4], expr.fastRead(i4)); - } - #endif // BZ_ARRAY_STACK_TRAVERSAL_UNROLL - } - #endif // BZ_ARRAY_EXPR_USE_COMMON_STRIDE - -#else // ! BZ_USE_FAST_READ_ARRAY_EXPR - -#ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("Common stride, no fast read"); -#endif - while (iter.data() != last) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(commonStride); - expr.advance(commonStride); - } -#endif - } - else { - while (iter.data() != last) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(); - expr.advance(); - } - } - - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithStackTraversalN( - T_expr expr, T_update) -{ - /* - * A stack traversal replaces the usual nested loops: - * - * for (int i=A.lbound(firstDim); i <= A.ubound(firstDim); ++i) - * for (int j=A.lbound(secondDim); j <= A.ubound(secondDim); ++j) - * for (int k=A.lbound(thirdDim); k <= A.ubound(thirdDim); ++k) - * A(i,j,k) = 0; - * - * with a stack data structure. The stack allows this single - * routine to replace any number of nested loops. - * - * For each dimension (loop), these quantities are needed: - * - a pointer to the first element encountered in the loop - * - the stride associated with the dimension/loop - * - a pointer to the last element encountered in the loop - * - * The basic idea is that entering each loop is a "push" onto the - * stack, and exiting each loop is a "pop". In practice, this - * routine treats accesses the stack in a random-access way, - * which confuses the picture a bit. But conceptually, that's - * what is going on. - */ - - /* - * ordering(0) gives the dimension associated with the smallest - * stride (usually; the exceptions have to do with subarrays and - * are uninteresting). We call this dimension maxRank; it will - * become the innermost "loop". - * - * Ordering the loops from ordering(N_rank-1) down to - * ordering(0) ensures that the largest stride is associated - * with the outermost loop, and the smallest stride with the - * innermost. This is critical for good performance on - * cached machines. - */ - - const int maxRank = ordering(0); - // const int secondLastRank = ordering(1); - - // Create an iterator for the array receiving the result - FastArrayIterator<T_numtype, N_rank> iter(*this); - - // Set the initial stack configuration by pushing the pointer - // to the first element of the array onto the stack N times. - - int i; - for (i=1; i < N_rank; ++i) - { - iter.push(i); - expr.push(i); - } - - // Load the strides associated with the innermost loop. - iter.loadStride(maxRank); - expr.loadStride(maxRank); - - /* - * Is the stride in the innermost loop equal to 1? If so, - * we might take advantage of this and generate more - * efficient code. - */ - _bz_bool useUnitStride = iter.isUnitStride(maxRank) - && expr.isUnitStride(maxRank); - - /* - * Do all array operands share a common stride in the innermost - * loop? If so, we can generate more efficient code (but only - * if this optimization has been enabled). - */ -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - int commonStride = expr.suggestStride(maxRank); - if (iter.suggestStride(maxRank) > commonStride) - commonStride = iter.suggestStride(maxRank); - bool useCommonStride = iter.isStride(maxRank,commonStride) - && expr.isStride(maxRank,commonStride); - -#ifdef BZ_DEBUG_TRAVERSE - BZ_DEBUG_MESSAGE("BZ_ARRAY_EXPR_USE_COMMON_STRIDE" << endl - << "commonStride = " << commonStride << " useCommonStride = " - << useCommonStride); -#endif - -#else - int commonStride = 1; - bool useCommonStride = _bz_false; -#endif - - /* - * The "last" array contains a pointer to the last element - * encountered in each "loop". - */ - const T_numtype* last[N_rank]; - - // Set up the initial state of the "last" array - for (i=1; i < N_rank; ++i) - last[i] = iter.data() + length(ordering(i)) * stride(ordering(i)); - - int lastLength = length(maxRank); - int firstNoncollapsedLoop = 1; - -#ifdef BZ_COLLAPSE_LOOPS - - /* - * This bit of code handles collapsing loops. When possible, - * the N nested loops are converted into a single loop (basically, - * the N-dimensional array is treated as a long vector). - * This is important for cases where the length of the innermost - * loop is very small, for example a 100x100x3 array. - * If this code can't collapse all the loops into a single loop, - * it will collapse as many loops as possible starting from the - * innermost and working out. - */ - - // Collapse loops when possible - for (i=1; i < N_rank; ++i) - { - // Figure out which pair of loops we are considering combining. - int outerLoopRank = ordering(i); - int innerLoopRank = ordering(i-1); - - /* - * The canCollapse() routines look at the strides and extents - * of the loops, and determine if they can be combined into - * one loop. - */ - - if (canCollapse(outerLoopRank,innerLoopRank) - && expr.canCollapse(outerLoopRank,innerLoopRank)) - { -#ifdef BZ_DEBUG_TRAVERSE - cout << "Collapsing " << outerLoopRank << " and " - << innerLoopRank << endl; -#endif - lastLength *= length(outerLoopRank); - firstNoncollapsedLoop = i+1; - } - else - break; - } - -#endif // BZ_COLLAPSE_LOOPS - - /* - * Now we actually perform the loops. This while loop contains - * two parts: first, the innermost loop is performed. Then we - * exit the loop, and pop our way down the stack until we find - * a loop that isn't completed. We then restart the inner loops - * and push them onto the stack. - */ - - while (true) { - - /* - * This bit of code handles the innermost loop. It would look - * a lot simpler if it weren't for unit stride and common stride - * optimizations; these clutter up the code with multiple versions. - */ - - if ((useUnitStride) || (useCommonStride)) - { -#ifdef BZ_USE_FAST_READ_ARRAY_EXPR - - /* - * The check for BZ_USE_FAST_READ_ARRAY_EXPR can probably - * be taken out. This was put in place while the unit stride/ - * common stride optimizations were being implemented and - * tested. - */ - - // Calculate the end of the innermost loop - int ubound = lastLength * commonStride; - - /* - * This is a real kludge. I didn't want to have to write - * a const and non-const version of FastArrayIterator, so I use a - * const iterator and cast away const. This could - * probably be avoided with some trick, but the whole routine - * is ugly, so why bother. - */ - - T_numtype* _bz_restrict data = const_cast<T_numtype*>(iter.data()); - - /* - * BZ_NEEDS_WORK-- need to implement optional unrolling. - */ - if (commonStride == 1) - { - for (int i=0; i < ubound; ++i) - T_update::update(data[i], expr.fastRead(i)); - } -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - else { - for (int i=0; i < ubound; i += commonStride) - T_update::update(data[i], expr.fastRead(i)); - } -#endif - /* - * Tidy up for the fact that we haven't actually been - * incrementing the iterators in the innermost loop, by - * faking it afterward. - */ - iter.advance(lastLength * commonStride); - expr.advance(lastLength * commonStride); -#else - // !BZ_USE_FAST_READ_ARRAY_EXPR - // This bit of code not really needed; should remove at some - // point, along with the test for BZ_USE_FAST_READ_ARRAY_EXPR - - T_numtype * _bz_restrict end = const_cast<T_numtype*>(iter.data()) - + lastLength; - - while (iter.data() != end) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(commonStride); - expr.advance(commonStride); - } -#endif - } - else { - /* - * We don't have a unit stride or common stride in the innermost - * loop. This is going to hurt performance. Luckily 95% of - * the time, we hit the cases above. - */ - T_numtype * _bz_restrict end = const_cast<T_numtype*>(iter.data()) - + lastLength * stride(maxRank); - - while (iter.data() != end) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(); - expr.advance(); - } - } - - - /* - * We just finished the innermost loop. Now we pop our way down - * the stack, until we hit a loop that hasn't completed yet. - */ - int j = firstNoncollapsedLoop; - for (; j < N_rank; ++j) - { - // Get the next loop - int r = ordering(j); - - // Pop-- this restores the data pointers to the first element - // encountered in the loop. - iter.pop(j); - expr.pop(j); - - // Load the stride associated with this loop, and increment - // once. - iter.loadStride(r); - expr.loadStride(r); - iter.advance(); - expr.advance(); - - // If we aren't at the end of this loop, then stop popping. - if (iter.data() != last[j]) - break; - } - - // Are we completely done? - if (j == N_rank) - break; - - // No, so push all the inner loops back onto the stack. - for (; j >= firstNoncollapsedLoop; --j) - { - int r2 = ordering(j-1); - iter.push(j); - expr.push(j); - last[j-1] = iter.data() + length(r2) * stride(r2); - } - - // Load the stride for the innermost loop again. - iter.loadStride(maxRank); - expr.loadStride(maxRank); - } - - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithIndexTraversal1( - T_expr expr, T_update) -{ - TinyVector<int,N_rank> index; - - if (stride(firstRank) == 1) - { - T_numtype * _bz_restrict iter = data_; - int last = ubound(firstRank); - - for (index[0] = lbound(firstRank); index[0] <= last; - ++index[0]) - { - T_update::update(iter[index[0]], T_numtype(expr(index))); - } - } - else { - FastArrayIterator<T_numtype, N_rank> iter(*this); - iter.loadStride(0); - int last = ubound(firstRank); - - for (index[0] = lbound(firstRank); index[0] <= last; - ++index[0]) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), - expr(index)); - iter.advance(); - } - } - - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithIndexTraversalN( - T_expr expr, T_update) -{ - // Do a stack-type traversal for the destination array and use - // index traversal for the source expression - - const int maxRank = ordering(0); - -#ifdef BZ_DEBUG_TRAVERSE - const int secondLastRank = ordering(1); - -cout << "Index traversal: N_rank = " << N_rank << endl; -cout << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank - << endl; -cout.flush(); -#endif - - FastArrayIterator<T_numtype, N_rank> iter(*this); - for (int i=1; i < N_rank; ++i) - iter.push(ordering(i)); - - iter.loadStride(maxRank); - - TinyVector<int,N_rank> index, last; - - index = storage_.base(); - last = storage_.base() + length_; - - // int lastLength = length(maxRank); - - while (true) { - - for (index[maxRank] = base(maxRank); - index[maxRank] < last[maxRank]; - ++index[maxRank]) - { -#ifdef BZ_DEBUG_TRAVERSE -#if 0 - cout << "(" << index[0] << "," << index[1] << ") " << endl; - cout.flush(); -#endif -#endif - - T_update::update(*const_cast<T_numtype*>(iter.data()), expr(index)); - iter.advance(); - } - - int j = 1; - for (; j < N_rank; ++j) - { - iter.pop(ordering(j)); - iter.loadStride(ordering(j)); - iter.advance(); - - index[ordering(j-1)] = base(ordering(j-1)); - ++index[ordering(j)]; - if (index[ordering(j)] != last[ordering(j)]) - break; - } - - if (j == N_rank) - break; - - for (; j > 0; --j) - { - iter.push(ordering(j)); - } - iter.loadStride(maxRank); - } - - return *this; -} - -// Fast traversals require <set> from the ISO/ANSI C++ standard library - -#ifdef BZ_HAVE_STD - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithFastTraversal( - const TraversalOrder<N_rank - 1>& order, - T_expr expr, - T_update) -{ - const int maxRank = ordering(0); - -#ifdef BZ_DEBUG_TRAVERSE - const int secondLastRank = ordering(1); - -cerr << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank - << endl; -#endif - - FastArrayIterator<T_numtype, N_rank> iter(*this); - iter.push(0); - expr.push(0); - - _bz_bool useUnitStride = iter.isUnitStride(maxRank) - && expr.isUnitStride(maxRank); - -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - int commonStride = expr.suggestStride(maxRank); - if (iter.suggestStride(maxRank) > commonStride) - commonStride = iter.suggestStride(maxRank); - bool useCommonStride = iter.isStride(maxRank,commonStride) - && expr.isStride(maxRank,commonStride); -#else - int commonStride = 1; - bool useCommonStride = _bz_false; -#endif - - int lastLength = length(maxRank); - - for (int i=0; i < order.length(); ++i) - { - iter.pop(0); - expr.pop(0); - -#ifdef BZ_DEBUG_TRAVERSE - cerr << "Traversing: " << order[i] << endl; -#endif - // Position the iterator at the start of the next column - for (int j=1; j < N_rank; ++j) - { - iter.loadStride(ordering(j)); - expr.loadStride(ordering(j)); - - int offset = order[i][j-1]; - iter.advance(offset); - expr.advance(offset); - } - - iter.loadStride(maxRank); - expr.loadStride(maxRank); - - // Evaluate the expression along the column - - if ((useUnitStride) || (useCommonStride)) - { - T_numtype* _bz_restrict last = const_cast<T_numtype*>(iter.data()) - + lastLength * commonStride; - -#ifdef BZ_USE_FAST_READ_ARRAY_EXPR - int ubound = lastLength * commonStride; - T_numtype* _bz_restrict data = const_cast<T_numtype*>(iter.data()); - - if (commonStride == 1) - { - #ifndef BZ_ARRAY_FAST_TRAVERSAL_UNROLL - for (int i=0; i < ubound; ++i) - T_update::update(data[i], expr.fastRead(i)); - #else - int n1 = ubound & 3; - int i=0; - for (; i < n1; ++i) - T_update::update(data[i], expr.fastRead(i)); - - for (; i < ubound; i += 4) - { - T_update::update(data[i], expr.fastRead(i)); - T_update::update(data[i+1], expr.fastRead(i+1)); - T_update::update(data[i+2], expr.fastRead(i+2)); - T_update::update(data[i+3], expr.fastRead(i+3)); - } - #endif // BZ_ARRAY_FAST_TRAVERSAL_UNROLL - } - #ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - else { - for (int i=0; i < ubound; i += commonStride) - T_update::update(data[i], expr.fastRead(i)); - } - #endif // BZ_ARRAY_EXPR_USE_COMMON_STRIDE - - iter.advance(lastLength * commonStride); - expr.advance(lastLength * commonStride); -#else // ! BZ_USE_FAST_READ_ARRAY_EXPR - while (iter.data() != last) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(commonStride); - expr.advance(commonStride); - } -#endif // BZ_USE_FAST_READ_ARRAY_EXPR - - } - else { - // No common stride - - T_numtype* _bz_restrict last = const_cast<T_numtype*>(iter.data()) - + lastLength * stride(maxRank); - - while (iter.data() != last) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), *expr); - iter.advance(); - expr.advance(); - } - } - } - - return *this; -} -#endif // BZ_HAVE_STD - -#ifdef BZ_ARRAY_2D_NEW_STENCIL_TILING - -#ifdef BZ_ARRAY_2D_STENCIL_TILING - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithTiled2DTraversal( - T_expr expr, T_update) -{ - const int minorRank = ordering(0); - const int majorRank = ordering(1); - - FastArrayIterator<T_numtype, N_rank> iter(*this); - iter.push(0); - expr.push(0); - -#ifdef BZ_2D_STENCIL_DEBUG - int count = 0; -#endif - - _bz_bool useUnitStride = iter.isUnitStride(minorRank) - && expr.isUnitStride(minorRank); - -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - int commonStride = expr.suggestStride(minorRank); - if (iter.suggestStride(minorRank) > commonStride) - commonStride = iter.suggestStride(minorRank); - bool useCommonStride = iter.isStride(minorRank,commonStride) - && expr.isStride(minorRank,commonStride); -#else - int commonStride = 1; - bool useCommonStride = _bz_false; -#endif - - // Determine if a common major stride exists - int commonMajorStride = expr.suggestStride(majorRank); - if (iter.suggestStride(majorRank) > commonMajorStride) - commonMajorStride = iter.suggestStride(majorRank); - bool haveCommonMajorStride = iter.isStride(majorRank,commonMajorStride) - && expr.isStride(majorRank,commonMajorStride); - - - int maxi = length(majorRank); - int maxj = length(minorRank); - - const int tileHeight = 16, tileWidth = 3; - - int bi, bj; - for (bi=0; bi < maxi; bi += tileHeight) - { - int ni = bi + tileHeight; - if (ni > maxi) - ni = maxi; - - // Move back to the beginning of the array - iter.pop(0); - expr.pop(0); - - // Move to the start of this tile row - iter.loadStride(majorRank); - iter.advance(bi); - expr.loadStride(majorRank); - expr.advance(bi); - - // Save this position - iter.push(1); - expr.push(1); - - for (bj=0; bj < maxj; bj += tileWidth) - { - // Move to the beginning of the tile row - iter.pop(1); - expr.pop(1); - - // Move to the top of the current tile (bi,bj) - iter.loadStride(minorRank); - iter.advance(bj); - expr.loadStride(minorRank); - expr.advance(bj); - - if (bj + tileWidth <= maxj) - { - // Strip mining - - if ((useUnitStride) && (haveCommonMajorStride)) - { - int offset = 0; - T_numtype* _bz_restrict data = const_cast<T_numtype*> - (iter.data()); - - for (int i=bi; i < ni; ++i) - { - _bz_typename T_expr::T_numtype tmp1, tmp2, tmp3; - - // Common subexpression elimination -- compilers - // won't necessarily do this on their own. - int t1 = offset+1; - int t2 = offset+2; - - tmp1 = expr.fastRead(offset); - tmp2 = expr.fastRead(t1); - tmp3 = expr.fastRead(t2); - - T_update::update(data[0], tmp1); - T_update::update(data[1], tmp2); - T_update::update(data[2], tmp3); - - offset += commonMajorStride; - data += commonMajorStride; - -#ifdef BZ_2D_STENCIL_DEBUG - count += 3; -#endif - } - } - else { - - for (int i=bi; i < ni; ++i) - { - iter.loadStride(minorRank); - expr.loadStride(minorRank); - - // Loop through current row elements - T_update::update(*const_cast<T_numtype*>(iter.data()), - *expr); - iter.advance(); - expr.advance(); - - T_update::update(*const_cast<T_numtype*>(iter.data()), - *expr); - iter.advance(); - expr.advance(); - - T_update::update(*const_cast<T_numtype*>(iter.data()), - *expr); - iter.advance(-2); - expr.advance(-2); - - iter.loadStride(majorRank); - expr.loadStride(majorRank); - iter.advance(); - expr.advance(); - -#ifdef BZ_2D_STENCIL_DEBUG - count += 3; -#endif - - } - } - } - else { - - // This code handles partial tiles at the bottom of the - // array. - - for (int j=bj; j < maxj; ++j) - { - iter.loadStride(majorRank); - expr.loadStride(majorRank); - - for (int i=bi; i < ni; ++i) - { - T_update::update(*const_cast<T_numtype*>(iter.data()), - *expr); - iter.advance(); - expr.advance(); -#ifdef BZ_2D_STENCIL_DEBUG - ++count; -#endif - - } - - // Move back to the top of this column - iter.advance(bi-ni); - expr.advance(bi-ni); - - // Move over to the next column - iter.loadStride(minorRank); - expr.loadStride(minorRank); - - iter.advance(); - expr.advance(); - } - } - } - } - -#ifdef BZ_2D_STENCIL_DEBUG - cout << "BZ_2D_STENCIL_DEBUG: count = " << count << endl; -#endif - - return *this; -} - -#endif // BZ_ARRAY_2D_STENCIL_TILING -#endif // BZ_ARRAY_2D_NEW_STENCIL_TILING - - - -#ifndef BZ_ARRAY_2D_NEW_STENCIL_TILING - -#ifdef BZ_ARRAY_2D_STENCIL_TILING - -template<class T_numtype, int N_rank> template<class T_expr, class T_update> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::evaluateWithTiled2DTraversal( - T_expr expr, T_update) -{ - const int minorRank = ordering(0); - const int majorRank = ordering(1); - - const int blockSize = 16; - - FastArrayIterator<T_numtype, N_rank> iter(*this); - iter.push(0); - expr.push(0); - - _bz_bool useUnitStride = iter.isUnitStride(minorRank) - && expr.isUnitStride(minorRank); - -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - int commonStride = expr.suggestStride(minorRank); - if (iter.suggestStride(minorRank) > commonStride) - commonStride = iter.suggestStride(minorRank); - bool useCommonStride = iter.isStride(minorRank,commonStride) - && expr.isStride(minorRank,commonStride); -#else - int commonStride = 1; - bool useCommonStride = _bz_false; -#endif - - int maxi = length(majorRank); - int maxj = length(minorRank); - - int bi, bj; - for (bi=0; bi < maxi; bi += blockSize) - { - int ni = bi + blockSize; - if (ni > maxi) - ni = maxi; - - for (bj=0; bj < maxj; bj += blockSize) - { - int nj = bj + blockSize; - if (nj > maxj) - nj = maxj; - - // Move to the beginning of the array - iter.pop(0); - expr.pop(0); - - // Move to the beginning of the tile (bi,bj) - iter.loadStride(majorRank); - iter.advance(bi); - iter.loadStride(minorRank); - iter.advance(bj); - - expr.loadStride(majorRank); - expr.advance(bi); - expr.loadStride(minorRank); - expr.advance(bj); - - // Loop through tile rows - for (int i=bi; i < ni; ++i) - { - // Save the beginning of this tile row - iter.push(1); - expr.push(1); - - // Load the minor stride - iter.loadStride(minorRank); - expr.loadStride(minorRank); - - if (useUnitStride) - { - T_numtype* _bz_restrict data = const_cast<T_numtype*> - (iter.data()); - - int ubound = (nj-bj); - for (int j=0; j < ubound; ++j) - T_update::update(data[j], expr.fastRead(j)); - } -#ifdef BZ_ARRAY_EXPR_USE_COMMON_STRIDE - else if (useCommonStride) - { - int ubound = (nj-bj) * commonStride; - T_numtype* _bz_restrict data = const_cast<T_numtype*> - (iter.data()); - - for (int j=0; j < ubound; j += commonStride) - T_update::update(data[j], expr.fastRead(j)); - } -#endif - else { - for (int j=bj; j < nj; ++j) - { - // Loop through current row elements - T_update::update(*const_cast<T_numtype*>(iter.data()), - *expr); - iter.advance(); - expr.advance(); - } - } - - // Move back to the beginning of the tile row, then - // move to the next row - iter.pop(1); - iter.loadStride(majorRank); - iter.advance(1); - - expr.pop(1); - expr.loadStride(majorRank); - expr.advance(1); - } - } - } - - return *this; -} -#endif // BZ_ARRAY_2D_STENCIL_TILING -#endif // BZ_ARRAY_2D_NEW_STENCIL_TILING - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYEVAL_CC - diff --git a/weave/blitz-20001213/blitz/array/expr.h b/weave/blitz-20001213/blitz/array/expr.h deleted file mode 100644 index 8e169f16c..000000000 --- a/weave/blitz-20001213/blitz/array/expr.h +++ /dev/null @@ -1,725 +0,0 @@ -/*************************************************************************** - * blitz/arrayexpr.h Array<T,N> expression templates - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_ARRAYEXPR_H -#define BZ_ARRAYEXPR_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/expr.h> must be included via <blitz/array.h> -#endif - -#ifndef BZ_OPS_H - #include <blitz/ops.h> -#endif - -#ifndef BZ_PRETTYPRINT_H - #include <blitz/prettyprint.h> -#endif - -#ifndef BZ_SHAPECHECK_H - #include <blitz/shapecheck.h> -#endif - -#ifndef BZ_NUMINQUIRE_H - #include <blitz/numinquire.h> -#endif - -/* - * The array expression templates iterator interface is followed by - * these classes: - * - * FastArrayIterator <blitz/array/fastiter.h> - * _bz_ArrayExpr <blitz/array/expr.h> - * _bz_ArrayExprOp " - * _bz_ArrayExprUnaryOp " - * _bz_ArrayExprConstant " - * _bz_ArrayMap <blitz/array/map.h> - * _bz_ArrayExprReduce <blitz/array/reduce.h> - * IndexPlaceholder <blitz/indexexpr.h> - */ - -BZ_NAMESPACE(blitz) - -template<class T1, class T2> -class _bz_ExprPair { -public: - _bz_ExprPair(const T1& a, const T2& b) - : first_(a), second_(b) - { } - - const T1& first() const - { return first_; } - - const T2& second() const - { return second_; } - -protected: - T1 first_; - T2 second_; -}; - -template<class T1, class T2> -inline _bz_ExprPair<T1,T2> makeExprPair(const T1& a, const T2& b) -{ - return _bz_ExprPair<T1,T2>(a,b); -} - -template<class P_expr> -class _bz_ArrayExpr -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - : public ETBase<_bz_ArrayExpr<P_expr> > -#endif -{ - -public: - typedef P_expr T_expr; - typedef _bz_typename T_expr::T_numtype T_numtype; - typedef T_expr T_ctorArg1; - typedef int T_ctorArg2; // dummy - - enum { numArrayOperands = BZ_ENUM_CAST(P_expr::numArrayOperands), - numIndexPlaceholders = BZ_ENUM_CAST(P_expr::numIndexPlaceholders), - rank = BZ_ENUM_CAST(P_expr::rank) }; - - _bz_ArrayExpr(const _bz_ArrayExpr<P_expr>& a) - : iter_(a.iter_) - { } - -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - template<class T> - _bz_ArrayExpr(const T& a) - : iter_(a) - { } -#else - - _bz_ArrayExpr(BZ_ETPARM(T_expr) a) - : iter_(a) - { } - - _bz_ArrayExpr(BZ_ETPARM(_bz_typename T_expr::T_ctorArg1) a) - : iter_(a) - { } -#endif - - template<class T1, class T2> - _bz_ArrayExpr(BZ_ETPARM(T1) a, BZ_ETPARM(T2) b) - : iter_(a, b) - { } - - template<class T1, class T2, class T3> - _bz_ArrayExpr(BZ_ETPARM(T1) a, BZ_ETPARM(T2) b, BZ_ETPARM(T3) c) - : iter_(a, b, c) - { } - - template<class T1, class T2> - _bz_ArrayExpr(const _bz_ExprPair<T1,T2>& pair) - : iter_(pair.first(), pair.second()) - { } - - T_numtype operator*() - { return *iter_; } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_rank> - T_numtype operator()(TinyVector<int, N_rank> i) - { return iter_(i); } -#else - template<int N_rank> - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return iter_(i); } -#endif - - int ascending(int rank) - { return iter_.ascending(rank); } - - int ordering(int rank) - { return iter_.ordering(rank); } - - int lbound(int rank) - { return iter_.lbound(rank); } - - int ubound(int rank) - { return iter_.ubound(rank); } - - void push(int position) - { iter_.push(position); } - - void pop(int position) - { iter_.pop(position); } - - void advance() - { iter_.advance(); } - - void advance(int n) - { iter_.advance(n); } - - void loadStride(int rank) - { iter_.loadStride(rank); } - - _bz_bool isUnitStride(int rank) const - { return iter_.isUnitStride(rank); } - - void advanceUnitStride() - { iter_.advanceUnitStride(); } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { - // BZ_DEBUG_MESSAGE("_bz_ArrayExpr<>::canCollapse()"); - return iter_.canCollapse(outerLoopRank, innerLoopRank); - } - - T_numtype operator[](int i) - { return iter_[i]; } - - T_numtype fastRead(int i) - { return iter_.fastRead(i); } - - int suggestStride(int rank) const - { return iter_.suggestStride(rank); } - - _bz_bool isStride(int rank, int stride) const - { return iter_.isStride(rank,stride); } - - void prettyPrint(string& str) const - { - prettyPrintFormat format(_bz_true); // Terse formatting by default - iter_.prettyPrint(str, format); - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { iter_.prettyPrint(str, format); } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { return iter_.shapeCheck(shape); } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - iter_.moveTo(i); - } - -protected: - _bz_ArrayExpr() { } - - T_expr iter_; -}; - -struct bounds { - static int compute_ascending(int rank, int ascending1, int ascending2) - { - // The value INT_MIN indicates that there are no arrays - // in a subtree of the expression. This logic returns - // whichever ascending is available. If there are two - // conflicting ascending values, this is an error. - - if (ascending1 == ascending2) - return ascending1; - else if (ascending1 == INT_MIN) - return ascending2; - else if (ascending2 == INT_MIN) - return ascending1; - - BZ_DEBUG_MESSAGE("Two array operands have different" - << endl << "ascending flags: for rank " << rank - << ", the flags are " << ascending1 << " and " - << ascending2 << endl); - BZ_PRE_FAIL; - return 0; - } - - static int compute_ordering(int rank, int order1, int order2) - { - // The value INT_MIN indicates that there are no arrays - // in a subtree of the expression. This logic returns - // whichever ordering is available. If there are two - // conflicting ordering values, this is an error. - - if (order1 == order2) - return order1; - else if (order1 == INT_MIN) - return order2; - else if (order2 == INT_MIN) - return order1; - - BZ_DEBUG_MESSAGE("Two array operands have different" - << endl << "orders: for rank " << rank << ", the orders are " - << order1 << " and " << order2 << endl); - BZ_PRE_FAIL; - return 0; - } - - static int compute_lbound(int rank, int lbound1, int lbound2) - { - // The value INT_MIN indicates that there are no arrays - // in a subtree of the expression. This logic returns - // whichever lbound is available. If there are two - // conflicting lbound values, this is an error. - - if (lbound1 == lbound2) - return lbound1; - else if (lbound1 == INT_MIN) - return lbound2; - else if (lbound2 == INT_MIN) - return lbound1; - - BZ_DEBUG_MESSAGE("Two array operands have different" - << endl << "lower bounds: in rank " << rank << ", the bounds are " - << lbound1 << " and " << lbound2 << endl); - BZ_PRE_FAIL; - return 0; - } - - static int compute_ubound(int rank, int ubound1, int ubound2) - { - // The value INT_MAX indicates that there are no arrays - // in a subtree of the expression. This logic returns - // whichever ubound is available. If there are two - // conflicting ubound values, this is an error. - - if (ubound1 == ubound2) - return ubound1; - else if (ubound1 == INT_MAX) - return ubound2; - else if (ubound2 == INT_MAX) - return ubound1; - - BZ_DEBUG_MESSAGE("Two array operands have different" - << endl << "upper bounds: in rank " << rank << ", the bounds are " - << ubound1 << " and " << ubound2 << endl); - BZ_PRE_FAIL; - return 0; - } - -}; - -template<class P_expr1, class P_expr2, class P_op> -class _bz_ArrayExprOp { -public: - typedef P_expr1 T_expr1; - typedef P_expr2 T_expr2; - typedef _bz_typename T_expr1::T_numtype T_numtype1; - typedef _bz_typename T_expr2::T_numtype T_numtype2; - typedef _bz_typename P_op::T_numtype T_numtype; - typedef P_op T_op; - typedef T_expr1 T_ctorArg1; - typedef T_expr2 T_ctorArg2; - - enum { numArrayOperands = BZ_ENUM_CAST(P_expr1::numArrayOperands) - + BZ_ENUM_CAST(P_expr2::numArrayOperands), - numIndexPlaceholders = BZ_ENUM_CAST(P_expr1::numIndexPlaceholders) - + BZ_ENUM_CAST(P_expr2::numIndexPlaceholders), - rank = (BZ_ENUM_CAST(P_expr1::rank) > BZ_ENUM_CAST(P_expr2::rank)) - ? BZ_ENUM_CAST(P_expr1::rank) : BZ_ENUM_CAST(P_expr2::rank) - }; - - _bz_ArrayExprOp(const _bz_ArrayExprOp<P_expr1, P_expr2, P_op>& a) - : iter1_(a.iter1_), iter2_(a.iter2_) - { } - - template<class T1, class T2> - _bz_ArrayExprOp(BZ_ETPARM(T1) a, BZ_ETPARM(T2) b) - : iter1_(a), iter2_(b) - { } - -// _bz_ArrayExprOp(T_expr1 a, T_expr2 b) -// : iter1_(a), iter2_(b) -// { } - - T_numtype operator*() - { return T_op::apply(*iter1_, *iter2_); } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_rank> - T_numtype operator()(TinyVector<int, N_rank> i) - { return T_op::apply(iter1_(i), iter2_(i)); } -#else - template<int N_rank> - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return T_op::apply(iter1_(i), iter2_(i)); } -#endif - - int ascending(int rank) - { - return bounds::compute_ascending(rank, iter1_.ascending(rank), - iter2_.ascending(rank)); - } - - int ordering(int rank) - { - return bounds::compute_ordering(rank, iter1_.ordering(rank), - iter2_.ordering(rank)); - } - - int lbound(int rank) - { - return bounds::compute_lbound(rank, iter1_.lbound(rank), - iter2_.lbound(rank)); - } - - int ubound(int rank) - { - return bounds::compute_ubound(rank, iter1_.ubound(rank), - iter2_.ubound(rank)); - } - - void push(int position) - { - iter1_.push(position); - iter2_.push(position); - } - - void pop(int position) - { - iter1_.pop(position); - iter2_.pop(position); - } - - void advance() - { - iter1_.advance(); - iter2_.advance(); - } - - void advance(int n) - { - iter1_.advance(n); - iter2_.advance(n); - } - - void loadStride(int rank) - { - iter1_.loadStride(rank); - iter2_.loadStride(rank); - } - - _bz_bool isUnitStride(int rank) const - { return iter1_.isUnitStride(rank) && iter2_.isUnitStride(rank); } - - void advanceUnitStride() - { - iter1_.advanceUnitStride(); - iter2_.advanceUnitStride(); - } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { - // BZ_DEBUG_MESSAGE("_bz_ArrayExprOp<>::canCollapse"); - return iter1_.canCollapse(outerLoopRank, innerLoopRank) - && iter2_.canCollapse(outerLoopRank, innerLoopRank); - } - - T_numtype operator[](int i) - { return T_op::apply(iter1_[i], iter2_[i]); } - - T_numtype fastRead(int i) - { return T_op::apply(iter1_.fastRead(i), iter2_.fastRead(i)); } - - int suggestStride(int rank) const - { - int stride1 = iter1_.suggestStride(rank); - int stride2 = iter2_.suggestStride(rank); - return (stride1 > stride2) ? stride1 : stride2; - } - - _bz_bool isStride(int rank, int stride) const - { - return iter1_.isStride(rank,stride) && iter2_.isStride(rank,stride); - } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - iter1_.moveTo(i); - iter2_.moveTo(i); - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - T_op::prettyPrint(str, format, iter1_, iter2_); - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { return iter1_.shapeCheck(shape) && iter2_.shapeCheck(shape); } - -protected: - _bz_ArrayExprOp() { } - - T_expr1 iter1_; - T_expr2 iter2_; -}; - -template<class P_expr, class P_op> -class _bz_ArrayExprUnaryOp { -public: - typedef P_expr T_expr; - typedef _bz_typename P_expr::T_numtype T_numtype1; - typedef _bz_typename P_op::T_numtype T_numtype; - typedef P_op T_op; - typedef T_expr T_ctorArg1; - typedef int T_ctorArg2; // dummy - - enum { numArrayOperands = BZ_ENUM_CAST(T_expr::numArrayOperands), - numIndexPlaceholders = BZ_ENUM_CAST(T_expr::numIndexPlaceholders), - rank = BZ_ENUM_CAST(T_expr::rank) }; - - _bz_ArrayExprUnaryOp(const _bz_ArrayExprUnaryOp<T_expr, P_op>& a) - : iter_(a.iter_) - { } - - _bz_ArrayExprUnaryOp(BZ_ETPARM(T_expr) a) - : iter_(a) - { } - - _bz_ArrayExprUnaryOp(_bz_typename T_expr::T_ctorArg1 a) - : iter_(a) - { } - -#if BZ_TEMPLATE_CTOR_DOESNT_CAUSE_HAVOC - template<class T1> - _bz_explicit _bz_ArrayExprUnaryOp(BZ_ETPARM(T1) a) - : iter_(a) - { } -#endif - - int ascending(int rank) - { return iter_.ascending(rank); } - - int ordering(int rank) - { return iter_.ordering(rank); } - - int lbound(int rank) - { return iter_.lbound(rank); } - - int ubound(int rank) - { return iter_.ubound(rank); } - - T_numtype operator*() - { return T_op::apply(*iter_); } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_rank> - T_numtype operator()(TinyVector<int, N_rank> i) - { return T_op::apply(iter_(i)); } -#else - template<int N_rank> - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return T_op::apply(iter_(i)); } -#endif - - void push(int position) - { - iter_.push(position); - } - - void pop(int position) - { - iter_.pop(position); - } - - void advance() - { - iter_.advance(); - } - - void advance(int n) - { - iter_.advance(n); - } - - void loadStride(int rank) - { - iter_.loadStride(rank); - } - - _bz_bool isUnitStride(int rank) const - { return iter_.isUnitStride(rank); } - - void advanceUnitStride() - { - iter_.advanceUnitStride(); - } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - iter_.moveTo(i); - } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { - // BZ_DEBUG_MESSAGE("_bz_ArrayExprUnaryOp<>::canCollapse"); - return iter_.canCollapse(outerLoopRank, innerLoopRank); - } - - T_numtype operator[](int i) - { return T_op::apply(iter_[i]); } - - T_numtype fastRead(int i) - { return T_op::apply(iter_.fastRead(i)); } - - int suggestStride(int rank) const - { return iter_.suggestStride(rank); } - - _bz_bool isStride(int rank, int stride) const - { return iter_.isStride(rank,stride); } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { T_op::prettyPrint(str, format, iter_); } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { return iter_.shapeCheck(shape); } - -protected: - _bz_ArrayExprUnaryOp() { } - - T_expr iter_; -}; - -template<class P_numtype> -class _bz_ArrayExprConstant { -public: - typedef P_numtype T_numtype; - typedef T_numtype T_ctorArg1; - typedef int T_ctorArg2; // dummy - - enum { numArrayOperands = 0, numIndexPlaceholders = 0, rank = 0 }; - - _bz_ArrayExprConstant(const _bz_ArrayExprConstant<T_numtype>& a) - : value_(a.value_) - { } - - _bz_ArrayExprConstant(T_numtype value) - : value_(BZ_NO_PROPAGATE(value)) - { - } - - // tiny() and huge() return the smallest and largest representable - // integer values. See <blitz/numinquire.h> - // NEEDS_WORK: use tiny(int()) once numeric_limits<T> available on - // all platforms - - int ascending(int) - { return INT_MIN; } - - int ordering(int) - { return INT_MIN; } - - int lbound(int) - { return INT_MIN; } - - int ubound(int) - { return INT_MAX; } - // NEEDS_WORK: use huge(int()) once numeric_limits<T> available on - // all platforms - - T_numtype operator*() - { return value_; } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_rank> - T_numtype operator()(TinyVector<int,N_rank>) - { return value_; } -#else - template<int N_rank> - T_numtype operator()(const TinyVector<int,N_rank>&) - { return value_; } -#endif - - void push(int) { } - void pop(int) { } - void advance() { } - void advance(int) { } - void loadStride(int) { } - - _bz_bool isUnitStride(int rank) const - { return _bz_true; } - - void advanceUnitStride() - { } - - _bz_bool canCollapse(int,int) const - { return _bz_true; } - - T_numtype operator[](int) - { return value_; } - - T_numtype fastRead(int) - { return value_; } - - int suggestStride(int) const - { return 1; } - - _bz_bool isStride(int,int) const - { return _bz_true; } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - if (format.tersePrintingSelected()) - str += format.nextScalarOperandSymbol(); - else - str += BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype); - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape&) - { return _bz_true; } - -protected: - _bz_ArrayExprConstant() { } - - T_numtype value_; -}; - -BZ_NAMESPACE_END - -#include <blitz/array/asexpr.h> - -#endif // BZ_ARRAYEXPR_H - diff --git a/weave/blitz-20001213/blitz/array/fastiter.h b/weave/blitz-20001213/blitz/array/fastiter.h deleted file mode 100644 index b5eb338ae..000000000 --- a/weave/blitz-20001213/blitz/array/fastiter.h +++ /dev/null @@ -1,297 +0,0 @@ -/*************************************************************************** - * blitz/array/iter.h Declaration of FastArrayIterator<P_numtype,N_rank> - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:15 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_ARRAY_FASTITER_H -#define BZ_ARRAY_FASTITER_H - -#ifdef BZ_HAVE_STD - #include <strstream> -#else - #include <strstream.h> -#endif - -BZ_NAMESPACE(blitz) - -#ifndef BZ_ARRAY_H - #error <blitz/array/iter.h> must be included via <blitz/array.h> -#endif - -template<class P_numtype, int N_rank> -class FastArrayIterator { -public: - typedef P_numtype T_numtype; - typedef Array<T_numtype, N_rank> T_array; - typedef FastArrayIterator<P_numtype, N_rank> T_iterator; - typedef const T_array& T_ctorArg1; - typedef int T_ctorArg2; // dummy - - enum { numArrayOperands = 1, numIndexPlaceholders = 0, - rank = N_rank }; - - // NB: this ctor does NOT preserve stack and stride - // parameters. This is for speed purposes. - FastArrayIterator(const FastArrayIterator<P_numtype, N_rank>& x) - : data_(x.data_), array_(x.array_) - { } - - void operator=(const FastArrayIterator<P_numtype, N_rank>& x) - { - array_ = x.array_; - data_ = x.data_; - stack_ = x.stack_; - stride_ = x.stride_; - } - - FastArrayIterator(const T_array& array) - : array_(array) - { - data_ = array.data(); - } - - ~FastArrayIterator() - { } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - T_numtype operator()(TinyVector<int, N_rank> i) - { return array_(i); } -#else - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return array_(i); } -#endif - - int ascending(int rank) - { - if (rank < N_rank) - return array_.isRankStoredAscending(rank); - else - return INT_MIN; // tiny(int()); - } - - int ordering(int rank) - { - if (rank < N_rank) - return array_.ordering(rank); - else - return INT_MIN; // tiny(int()); - } - - int lbound(int rank) - { - if (rank < N_rank) - return array_.lbound(rank); - else - return INT_MIN; // tiny(int()); - } - - int ubound(int rank) - { - if (rank < N_rank) - return array_.ubound(rank); - else - return INT_MAX; // huge(int()); - } - - T_numtype operator*() - { return *data_; } - - T_numtype operator[](int i) - { return data_[i * stride_]; } - - T_numtype fastRead(int i) - { return data_[i]; } - - int suggestStride(int rank) const - { return array_.stride(rank); } - - _bz_bool isStride(int rank, int stride) const - { return array_.stride(rank) == stride; } - - void push(int position) - { - stack_[position] = data_; - } - - void pop(int position) - { - data_ = stack_[position]; - } - - void advance() - { - data_ += stride_; - } - - void advance(int n) - { - data_ += n * stride_; - } - - void loadStride(int rank) - { - stride_ = array_.stride(rank); - } - - const T_numtype * _bz_restrict data() const - { return data_; } - - void _bz_setData(const T_numtype* ptr) - { data_ = ptr; } - - int stride() const - { return stride_; } - - _bz_bool isUnitStride(int rank) const - { return array_.stride(rank) == 1; } - - void advanceUnitStride() - { ++data_; } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { return array_.canCollapse(outerLoopRank, innerLoopRank); } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - if (format.tersePrintingSelected()) - str += format.nextArrayOperandSymbol(); - else if (format.dumpArrayShapesMode()) - { - ostrstream ostr; - ostr << array_.shape(); - str += ostr.str(); - } - else { - str += "Array<"; - str += BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype); - str += ","; - - char tmpBuf[10]; - sprintf(tmpBuf, "%d", N_rank); - - str += tmpBuf; - str += ">"; - } - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { return areShapesConformable(shape, array_.length()); } - - - // Experimental - T_numtype& operator()(int i) - { - return (T_numtype&)data_[i*array_.stride(0)]; - } - - // Experimental - T_numtype& operator()(int i, int j) - { - return (T_numtype&)data_[i*array_.stride(0) + j*array_.stride(1)]; - } - - // Experimental - T_numtype& operator()(int i, int j, int k) - { - return (T_numtype&)data_[i*array_.stride(0) + j*array_.stride(1) - + k*array_.stride(2)]; - } - - // Experimental - - void moveTo(int i, int j) - { - data_ = &const_cast<T_array&>(array_)(i,j); - } - - void moveTo(int i, int j, int k) - { - data_ = &const_cast<T_array&>(array_)(i,j,k); - } - - void moveTo(const TinyVector<int,N_rank>& i) - { - data_ = &const_cast<T_array&>(array_)(i); - } - - // Experimental - void operator=(T_numtype x) - { *const_cast<T_numtype* _bz_restrict>(data_) = x; } - - // Experimental - template<class T_value> - void operator=(T_value x) - { *const_cast<T_numtype* _bz_restrict>(data_) = x; } - - // Experimental - template<class T_value> - void operator+=(T_value x) - { *const_cast<T_numtype* _bz_restrict>(data_) += x; } - - // NEEDS_WORK: other operators - - // Experimental - operator T_numtype() const - { return *data_; } - - // Experimental - T_numtype shift(int offset, int dim) - { - return data_[offset*array_.stride(dim)]; - } - - // Experimental - T_numtype shift(int offset1, int dim1, int offset2, int dim2) - { - return data_[offset1*array_.stride(dim1) - + offset2*array_.stride(dim2)]; - } - -private: - const T_numtype * _bz_restrict data_; - const T_array& array_; - const T_numtype * stack_[N_rank]; - int stride_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_FASTITER_H diff --git a/weave/blitz-20001213/blitz/array/geometry.h b/weave/blitz-20001213/blitz/array/geometry.h deleted file mode 100644 index 7ec405fe3..000000000 --- a/weave/blitz-20001213/blitz/array/geometry.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef BZ_GEOMETRY_H -#define BZ_GEOMETRY_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/geometry.h> must be included after <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -typedef double T_defaultSpatialCoordinate; - -template<int N_dim, class T = T_defaultSpatialCoordinate> -class UniformOrthoGeometry { -public: -}; - -template<int N_dim, class T = T_defaultSpatialCoordinate> -class UniformCubicGeometry { - T h_; - T recip_h_; - T recip2_h_; - T recip3_h_; - TinyVector<T,N_dim> zero_; - -public: - typedef T T_coord; - - UniformCubicGeometry() - { - h_ = 0.0; - recip_h_ = 0.0; - recip2_h_ = 0.0; - recip3_h_ = 0.0; - zero_ = 0.0; - } - - UniformCubicGeometry(T spatialStep) - { - h_ = spatialStep; - zero_ = T(0); - setup(); - } - - UniformCubicGeometry(T spatialStep, TinyVector<T,N_dim> zeroCoordinates) - { - h_ = spatialStep; - zero_ = zeroCoordinates; - setup(); - } - - TinyVector<T,N_dim> toSpatial(TinyVector<int,N_dim> logicalCoord) const - { - return zero_ + h_ * logicalCoord; - } - - T spatialStep() const - { return h_; } - - T recipSpatialStep() const - { return recip_h_; } - - T recipSpatialStepPow2() const - { return recip2_h_; } - -private: - void setup() - { - recip_h_ = 1.0 / h_; - recip2_h_ = 1.0 / pow2(h_); - recip3_h_ = 1.0 / pow3(h_); - } -}; - -template<int N_dim, class T = T_defaultSpatialCoordinate> -class TensorProductGeometry { -public: -}; - -BZ_NAMESPACE_END - -#endif // BZ_GEOMETRY_H diff --git a/weave/blitz-20001213/blitz/array/indirect.h b/weave/blitz-20001213/blitz/array/indirect.h deleted file mode 100644 index eb1ce6707..000000000 --- a/weave/blitz-20001213/blitz/array/indirect.h +++ /dev/null @@ -1,270 +0,0 @@ -#ifndef BZ_ARRAY_INDIRECT_H -#define BZ_ARRAY_INDIRECT_H - -#include <blitz/array/asexpr.h> -#include <blitz/array/cartesian.h> - -BZ_NAMESPACE(blitz) - -template<class T_array, class T_index> -class IndirectArray { - -public: - IndirectArray(T_array& array, T_index& index) - : array_(array), index_(index) - { } - - template<class T_expr> - void operator=(T_expr expr); - -protected: - T_array& array_; - T_index& index_; -}; - -// Forward declarations -template<class T_array, class T_arrayiter, class T_subdomain, class T_expr> -inline void applyOverSubdomain(const T_array& array, T_arrayiter& arrayIter, - T_subdomain subdomain, T_expr expr); -template<class T_array, class T_arrayiter, int N_rank, class T_expr> -inline void applyOverSubdomain(const T_array& array, T_arrayiter& arrayIter, - RectDomain<N_rank> subdomain, - T_expr expr); - -template<class T_array, class T_index> template<class T_rhs> -void IndirectArray<T_array, T_index>::operator=(T_rhs rhs) -{ - typedef _bz_typename asExpr<T_rhs>::T_expr T_expr; - T_expr expr(rhs); - - _bz_typename T_array::T_iterator arrayIter(array_); - - _bz_typename T_index::iterator iter = index_.begin(), - end = index_.end(); - - for (; iter != end; ++iter) - { - _bz_typename T_index::value_type subdomain = *iter; - applyOverSubdomain(array_, arrayIter, subdomain, expr); - } -} - -template<class T_array, class T_arrayiter, class T_subdomain, class T_expr> -inline void applyOverSubdomain(const T_array& array, T_arrayiter& arrayIter, - T_subdomain subdomain, T_expr expr) -{ - BZPRECHECK(array.isInRange(subdomain), - "In indirection using an STL container of TinyVector<int," - << array.rank() << ">, one of the" << endl << "positions is out of" - " range: " << endl << subdomain << endl - << "Array lower bounds: " << array.lbound() << endl - << "Array upper bounds: " << array.ubound() << endl) - - arrayIter.moveTo(subdomain); - expr.moveTo(subdomain); - - *const_cast<_bz_typename T_arrayiter::T_numtype*>(arrayIter.data()) = *expr; -} - -// Specialization for RectDomain<N> -template<class T_array, class T_arrayiter, int N_rank, class T_expr> -inline void applyOverSubdomain(const T_array& array, T_arrayiter& arrayIter, - RectDomain<N_rank> subdomain, - T_expr expr) -{ - typedef _bz_typename T_array::T_numtype T_numtype; - - // Assume that the RectDomain<N_rank> is a 1-D strip. - // Find the dimension in which the strip is oriented. This - // variable is static so that we cache the value; likely to be - // the same for all strips within a container. - - static int stripDim = 0; - - if (subdomain.lbound(stripDim) == subdomain.ubound(stripDim)) - { - // Cached value was wrong, find the correct value of stripDim - for (stripDim=0; stripDim < N_rank; ++stripDim) - if (subdomain.lbound(stripDim) != subdomain.ubound(stripDim)) - break; - - // Handle case where the strip is just a single point - if (stripDim == N_rank) - stripDim = 0; - } - -#ifdef BZ_DEBUG - // Check that this is in fact a 1D strip - for (int i=0; i < N_rank; ++i) - if ((i != stripDim) && (subdomain.lbound(i) != subdomain.ubound(i))) - BZPRECHECK(0, "In indirection using an STL container of RectDomain<" - << N_rank << ">, one of" << endl << "the RectDomain objects was not" - " a one-dimensional strip:" << endl << "RectDomain<" << N_rank - << ">::lbound() = " << subdomain.lbound() << endl - << "RectDomain<" << N_rank << ">::ubound() = " << subdomain.ubound()) -#endif - - // Check that the start and end position are in range - BZPRECHECK(array.isInRange(subdomain.lbound()), - "In indirection using an STL container of RectDomain<" - << N_rank << ">, one of" << endl << "the RectDomain objects has a" - " lbound which is out of range:" << endl - << subdomain.lbound() << endl - << "Array lower bounds: " << array.lbound() << endl - << "Array upper bounds: " << array.ubound() << endl) - - BZPRECHECK(array.isInRange(subdomain.ubound()), - "In indirection using an STL container of RectDomain<" - << N_rank << ">, one of" << endl << "the RectDomain objects has a" - " ubound which is out of range:" << endl - << subdomain.lbound() << endl - << "Array lower bounds: " << array.lbound() << endl - << "Array upper bounds: " << array.ubound() << endl) - - // Position at the beginning of the strip - arrayIter.moveTo(subdomain.lbound()); - expr.moveTo(subdomain.lbound()); - - // Loop through the strip - -#ifdef BZ_USE_FAST_READ_ARRAY_EXPR - - _bz_bool useUnitStride = arrayIter.isUnitStride(stripDim) - && expr.isUnitStride(stripDim); - - int lbound = subdomain.lbound(stripDim); - int ubound = subdomain.ubound(stripDim); - - if (useUnitStride) - { - T_numtype* _bz_restrict data = const_cast<T_numtype*>(arrayIter.data()); - - int length = ubound - lbound + 1; - for (int i=0; i < length; ++i) - data[i] = expr.fastRead(i); - } - else { -#endif - - arrayIter.loadStride(stripDim); - expr.loadStride(stripDim); - - for (int i=lbound; i <= ubound; ++i) - { - *const_cast<_bz_typename T_arrayiter::T_numtype*>(arrayIter.data()) - = *expr; - expr.advance(); - arrayIter.advance(); - } - -#ifdef BZ_USE_FAST_READ_ARRAY_EXPR - } -#endif -} - -// Global functions for cartesian product of index sets -template<class T_container> -CartesianProduct<TinyVector<int,2>,T_container,2> -indexSet(const T_container& container0, const T_container& container1) -{ - return CartesianProduct<TinyVector<int,2>,T_container,2>( - const_cast<T_container&>(container0), - const_cast<T_container&>(container1)); -} - -template<class T_container> -CartesianProduct<TinyVector<int,3>,T_container,3> -indexSet(const T_container& container0, const T_container& container1, - const T_container& container2) -{ - return CartesianProduct<TinyVector<int,3>,T_container,3>( - const_cast<T_container&>(container0), - const_cast<T_container&>(container1), - const_cast<T_container&>(container2)); -} - -// Mixture of singletons and containers, e.g. A[indexSet(I,3,K)] - -// cp_findContainerType<T1,T2,T3,...,Tn>::T_container -// The set of parameters T1, T2, T3, ... Tn is a mixture of -// int and T_container. This traits class finds the container -// type, and sets T_container. -// -// e.g. cp_findContainerType<int,int,list<int>,int>::T_container is list<int> -// cp_findContainerType<int,deque<int>,deque<int>>::T_container -// is deque<int> - -template<class T1, class T2, class T3=int, class T4=int> -struct cp_findContainerType { - typedef T1 T_container; -}; - -template<class T2, class T3, class T4> -struct cp_findContainerType<int,T2,T3,T4> { - typedef _bz_typename cp_findContainerType<T2,T3,T4>::T_container T_container; -}; - - -// The cp_traits class handles promotion of singleton integers to -// containers. It takes two template parameters: -// T = argument type -// T2 = container type -// If T is an integer, then a container of type T2 is created and the -// integer is inserted. This container is returned. -// Otherwise, T is assumed to be the same type as T2, and the original -// container is returned. - -template<class T, class T2> -struct cp_traits { - typedef T T_container; - - static const T_container& make(const T& x) - { return x; } -}; - -template<class T2> -struct cp_traits<int,T2> { - typedef T2 T_container; - - static T2 make(int x) - { - T2 singleton; - singleton.push_back(x); - return singleton; - } -}; - -// These versions of indexSet() allow mixtures of integer -// and container arguments. At least one integer must be -// specified. - -template<class T1, class T2> -CartesianProduct<TinyVector<int,2>, _bz_typename - cp_findContainerType<T1,T2>::T_container,2> -indexSet(const T1& c1, const T2& c2) -{ - typedef _bz_typename cp_findContainerType<T1,T2>::T_container - T_container; - - return CartesianProduct<TinyVector<int,2>, T_container, 2>( - cp_traits<T1,T_container>::make(c1), - cp_traits<T2,T_container>::make(c2)); -} - -template<class T1, class T2, class T3> -CartesianProduct<TinyVector<int,3>, _bz_typename - cp_findContainerType<T1,T2,T3>::T_container, 3> -indexSet(const T1& c1, const T2& c2, const T3& c3) -{ - typedef _bz_typename cp_findContainerType<T1,T2,T3>::T_container - T_container; - - return CartesianProduct<TinyVector<int,3>, T_container, 3>( - cp_traits<T1,T_container>::make(c1), - cp_traits<T2,T_container>::make(c2), - cp_traits<T3,T_container>::make(c3)); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_INDIRECT_H diff --git a/weave/blitz-20001213/blitz/array/interlace.cc b/weave/blitz-20001213/blitz/array/interlace.cc deleted file mode 100644 index c0623c322..000000000 --- a/weave/blitz-20001213/blitz/array/interlace.cc +++ /dev/null @@ -1,558 +0,0 @@ -/*************************************************************************** - * blitz/array/interlace.cc - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * - */ - -#ifndef BZ_ARRAYINTERLACE_CC -#define BZ_ARRAYINTERLACE_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/interlace.cc> must be included via <blitz/array.h> -#endif - -#ifndef BZ_ARRAYSHAPE_H - #include <blitz/array/shape.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * This header provides two collections of routines: - * - * interlaceArrays(shape, A1, A2, ...); - * allocateArrays(shape, A1, A2, ...); - * - * interlaceArrays allocates a set of arrays so that their data is - * interlaced. For example, - * - * Array<int,2> A, B; - * interlaceArrays(shape(10,10), A, B); - * - * sets up the array storage so that A(0,0) is followed by B(0,0) in - * memory; then A(0,1) and B(0,1), and so on. - * - * The allocateArrays() routines may or may not interlace the data, - * depending on whether interlacing is advantageous for the architecture. - * This is controlled by the setting of BZ_INTERLACE_ARRAYS in - * <blitz/tuning.h>. - */ - -// Warning: Can't instantiate TinyVector<Range,N> because causes -// conflict between TinyVector<T,N>::operator=(T) and -// TinyVector<T,N>::operator=(Range) - -// NEEDS_WORK -- also shape for up to N=11 -// NEEDS_WORK -- shape(Range r1, Range r2, ...) (return TinyVector<Range,n>) -// maybe use Domain objects -// NEEDS_WORK -- doesn't make a lot of sense for user to provide a -// GeneralArrayStorage<N_rank+1> - -template<class T_numtype> -void makeInterlacedArray(Array<T_numtype,2>& mainArray, - Array<T_numtype,1>& subarray, int slice) -{ - Array<T_numtype,1> tmp = mainArray(Range::all(), slice); - subarray.reference(tmp); -} - -template<class T_numtype> -void makeInterlacedArray(Array<T_numtype,3>& mainArray, - Array<T_numtype,2>& subarray, int slice) -{ - Array<T_numtype,2> tmp = mainArray(Range::all(), Range::all(), - slice); - subarray.reference(tmp); -} - -template<class T_numtype> -void makeInterlacedArray(Array<T_numtype,4>& mainArray, - Array<T_numtype,3>& subarray, int slice) -{ - Array<T_numtype,3> tmp = mainArray(Range::all(), Range::all(), - Range::all(), slice); - subarray.reference(tmp); -} - -// These routines always allocate interlaced arrays -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 2, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 3, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 4, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 5, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 6, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 7, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); - makeInterlacedArray(array, a7, 6); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 8, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); - makeInterlacedArray(array, a7, 6); - makeInterlacedArray(array, a8, 7); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 9, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); - makeInterlacedArray(array, a7, 6); - makeInterlacedArray(array, a8, 7); - makeInterlacedArray(array, a9, 8); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9, Array<T_numtype,N_rank>& a10) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 10, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); - makeInterlacedArray(array, a7, 6); - makeInterlacedArray(array, a8, 7); - makeInterlacedArray(array, a9, 8); - makeInterlacedArray(array, a10, 9); -} - -template<class T_numtype, int N_rank> -void interlaceArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9, Array<T_numtype,N_rank>& a10, - Array<T_numtype,N_rank>& a11) -{ - GeneralArrayStorage<N_rank+1> storage; - Array<T_numtype, N_rank+1> array(shape, 11, storage); - makeInterlacedArray(array, a1, 0); - makeInterlacedArray(array, a2, 1); - makeInterlacedArray(array, a3, 2); - makeInterlacedArray(array, a4, 3); - makeInterlacedArray(array, a5, 4); - makeInterlacedArray(array, a6, 5); - makeInterlacedArray(array, a7, 6); - makeInterlacedArray(array, a8, 7); - makeInterlacedArray(array, a9, 8); - makeInterlacedArray(array, a10, 9); - makeInterlacedArray(array, a11, 10); -} - -// NEEDS_WORK -- make `storage' a parameter in these routines -// Will be tricky: have to convert GeneralArrayStorage<N_rank> to -// GeneralArrayStorage<N_rank+1> - -// These routines may or may not interlace arrays, depending on -// whether it is advantageous for this platform. - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2); -#else - a1.resize(shape); - a2.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6, a7); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); - a7.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6, a7, a8); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); - a7.resize(shape); - a8.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6, a7, a8, a9); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); - a7.resize(shape); - a8.resize(shape); - a9.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9, Array<T_numtype,N_rank>& a10) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); - a7.resize(shape); - a8.resize(shape); - a9.resize(shape); - a10.resize(shape); -#endif -} - -template<class T_numtype, int N_rank> -void allocateArrays(const TinyVector<int,N_rank>& shape, - Array<T_numtype,N_rank>& a1, Array<T_numtype,N_rank>& a2, - Array<T_numtype,N_rank>& a3, Array<T_numtype,N_rank>& a4, - Array<T_numtype,N_rank>& a5, Array<T_numtype,N_rank>& a6, - Array<T_numtype,N_rank>& a7, Array<T_numtype,N_rank>& a8, - Array<T_numtype,N_rank>& a9, Array<T_numtype,N_rank>& a10, - Array<T_numtype,N_rank>& a11) -{ -#ifdef BZ_INTERLACE_ARRAYS - interlaceArrays(shape, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); -#else - a1.resize(shape); - a2.resize(shape); - a3.resize(shape); - a4.resize(shape); - a5.resize(shape); - a6.resize(shape); - a7.resize(shape); - a8.resize(shape); - a9.resize(shape); - a10.resize(shape); - a11.resize(shape); -#endif -} - -// NEEDS_WORK -- allocateArrays for TinyVector<Range,N_rank> - -// This constructor is used to create interlaced arrays. -template<class T_numtype, int N_rank> -Array<T_numtype,N_rank>::Array(const TinyVector<int,N_rank-1>& shape, - int lastExtent, const GeneralArrayStorage<N_rank>& storage) - : storage_(storage) -{ - // Create an array with the given shape, plus an extra dimension - // for the number of arrays being allocated. This extra dimension - // must have minor storage order. - - if (ordering(0) == 0) - { - // Column major storage order (or something like it) - length_[0] = lastExtent; - storage_.setBase(0,0); - for (int i=1; i < N_rank; ++i) - length_[i] = shape[i-1]; - } - else if (ordering(0) == N_rank-1) - { - // Row major storage order (or something like it) - for (int i=0; i < N_rank-1; ++i) - length_[i] = shape[i]; - length_[N_rank-1] = lastExtent; - storage_.setBase(N_rank-1, 0); - } - else { - BZPRECHECK(0, "Used allocateArrays() with a peculiar storage format"); - } - - setupStorage(N_rank-1); -} - -// NEEDS_WORK -- see note about TinyVector<Range,N> in <blitz/arrayshape.h> -#if 0 -template<class T_numtype, int N_rank> -Array<T_numtype,N_rank>::Array(const TinyVector<Range,N_rank-1>& shape, - int lastExtent, const GeneralArrayStorage<N_rank>& storage) - : storage_(storage) -{ -#ifdef BZ_DEBUG - for (int i=0; i < N_rank; ++i) - BZPRECHECK(shape[i].isAscendingContiguous(), - "In call to allocateArrays(), a Range object is not ascending" << endl - << "contiguous: " << shape[i] << endl); -#endif - - if (ordering(0) == 0) - { - // Column major storage order (or something like it) - length_[0] = lastExtent; - storage_.setBase(0,0); - for (int i=1; i < N_rank; ++i) - { - length_[i] = shape[i-1].length(); - storage_.setBase(i, shape[i-1].first()); - } - } - else if (ordering(0) == N_rank-1) - { - // Row major storage order (or something like it) - for (int i=0; i < N_rank-1; ++i) - { - length_[i] = shape[i]; - storage_.setBase(i, shape[i].first()); - } - length_[N_rank-1] = lastExtent; - storage_.setBase(N_rank-1, 0); - } - else { - BZPRECHECK(0, "Used allocateArrays() with a peculiar storage format"); - } - - setupStorage(N_rank-1); -} -#endif - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYINTER_CC - diff --git a/weave/blitz-20001213/blitz/array/io.cc b/weave/blitz-20001213/blitz/array/io.cc deleted file mode 100644 index 087114f83..000000000 --- a/weave/blitz-20001213/blitz/array/io.cc +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef BZ_ARRAY_H - #error <blitz/array/io.cc> must be included via <blitz/array.h> -#endif - -#ifndef BZ_ARRAYIO_CC -#define BZ_ARRAYIO_CC - -BZ_NAMESPACE(blitz) - -template<class T_numtype> -ostream& operator<<(ostream& os, const Array<T_numtype,1>& x) -{ - os << x.extent(firstRank) << endl; - os << " [ "; - for (int i=x.lbound(firstRank); i <= x.ubound(firstRank); ++i) - { - os << setw(9) << x(i) << " "; - if (!((i+1-x.lbound(firstRank))%7)) - os << endl << " "; - } - os << " ]"; - return os; -} - -template<class T_numtype> -ostream& operator<<(ostream& os, const Array<T_numtype,2>& x) -{ - os << x.rows() << " x " << x.columns() << endl; - os << "[ "; - for (int i=x.lbound(firstRank); i <= x.ubound(firstRank); ++i) - { - for (int j=x.lbound(secondRank); j <= x.ubound(secondRank); ++j) - { - os << setw(9) << x(i,j) << " "; - if (!((j+1-x.lbound(secondRank)) % 7)) - os << endl << " "; - } - - if (i != x.ubound(firstRank)) - os << endl << " "; - } - - os << "]" << endl; - - return os; -} - -template<class T_numtype, int N_rank> -ostream& operator<<(ostream& os, const Array<T_numtype,N_rank>& x) -{ - for (int i=0; i < N_rank; ++i) - { - os << x.extent(i); - if (i != N_rank - 1) - os << " x "; - } - - os << endl << "[ "; - - typedef _bz_typename Array<T_numtype, N_rank>::const_iterator - ArrayConstIterator; - ArrayConstIterator iter = x.begin(), end = x.end(); - int p = 0; - - while (iter != end) { - os << setw(9) << (*iter) << " "; - ++iter; - - // See if we need a linefeed - ++p; - if (!(p % 7)) - os << endl << " "; - } - - os << "]" << endl; - return os; -} - -/* - * Input - */ - -template<class T_numtype, int N_rank> -istream& operator>>(istream& is, Array<T_numtype,N_rank>& x) -{ - TinyVector<int,N_rank> extent; - char sep; - - // Read the extent vector: this is separated by 'x's, e.g. - // 3 x 4 x 5 - - for (int i=0; i < N_rank; ++i) - { - is >> extent(i); - - BZPRECHECK(!is.bad(), "Premature end of input while scanning array"); - - if (i != N_rank - 1) - { - is >> sep; - BZPRECHECK(sep == 'x', "Format error while scanning input array" - << endl << " (expected 'x' between array extents)"); - } - } - - is >> sep; - BZPRECHECK(sep == '[', "Format error while scanning input array" - << endl << " (expected '[' before beginning of array data)"); - - x.resize(extent); - - typedef _bz_typename Array<T_numtype,N_rank>::iterator - ArrayIterator; - ArrayIterator iter = x.begin(), end = x.end(); - - while (iter != end) { - BZPRECHECK(!is.bad(), "Premature end of input while scanning array"); - - is >> (*iter); - ++iter; - } - - is >> sep; - BZPRECHECK(sep == ']', "Format error while scanning input array" - << endl << " (expected ']' after end of array data)"); - - return is; -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYIO_CC diff --git a/weave/blitz-20001213/blitz/array/iter.h b/weave/blitz-20001213/blitz/array/iter.h deleted file mode 100644 index dc6c10cc9..000000000 --- a/weave/blitz-20001213/blitz/array/iter.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef BZ_ARRAY_H - #error <blitz/array/iter.h> must be included via <blitz/array.h> -#endif - -#ifndef BZ_ARRAY_ITER_H -#define BZ_ARRAY_ITER_H - -BZ_NAMESPACE(blitz) - -struct _bz_endTag { }; - - -template<class T, int N> -class ConstArrayIterator { - -public: - ConstArrayIterator(const Array<T,N>& array) - { - // Making internal copies of these avoids keeping - // a pointer to the array and doing indirection. - strides_ = array.stride(); - lbound_ = array.lbound(); - extent_ = array.extent(); - order_ = array.ordering(); - first_ = const_cast<T*>(array.dataFirst()); - data_ = first_; - - maxRank_ = order_(0); - stride_ = strides_(maxRank_); - - for (int i=0; i < N; ++i) - { - stack_[i] = data_; - last_[i] = data_ + array.extent(order_(i)) - * strides_(order_(i)); - } - - pos_ = lbound_; - } - - ConstArrayIterator(const Array<T,N>& array, _bz_endTag) - { - // The _bz_endTag type is provided by the end() method - // in Array<T,N>, and indicates that an end iterator - // is to be constructed. - - // Use 0 pointer to mark end of array. - // This also handles the case of empty arrays, which - // have their data pointer set to 0. - data_ = 0; - } - - T operator*() const - { - BZPRECHECK(data_ != 0, "Attempted to dereference invalid iterator " - << "(empty array or past end of array)"); - return *data_; - } - - const T* _bz_restrict operator->() const - { - BZPRECHECK(data_ != 0, "Attempted to dereference invalid iterator " - << "(empty array or past end of array)"); - return data_; - } - - ConstArrayIterator<T,N>& operator++(); - - // This operator returns void, which breaks the STL forward - // iterator requirements. Unfortunately many people have - // gotten into the habit of writing iter++ when they really - // mean ++iter. iter++ implemented the proper way requires - // returning a copy of the original state of the iterator, - // before increment. This would be very inefficient, since - // the iterator contains a lot of data. Hence the void - // return: it will be efficient even if you write iter++. - // Maybe this is a bad idea, let me know if this causes - // you problems. - void operator++(int) - { ++(*this); } - - const TinyVector<int,N>& position() const - { - BZPRECHECK(data_ != 0, "Array<T,N>::iterator::position() called on" - << " invalid iterator"); - return pos_; - } - - bool operator==(const ConstArrayIterator<T,N>& x) const - { - return data_ == x.data_; - } - - bool operator!=(const ConstArrayIterator<T,N>& x) const - { - return data_ != x.data_; - } - -private: - ConstArrayIterator() { } - -private: - TinyVector<int,N> strides_, lbound_, extent_, order_; - T * stack_[N]; - T * last_[N]; - int stride_; - int maxRank_; - -protected: - TinyVector<int,N> pos_; - T * _bz_restrict data_; - T * _bz_restrict first_; -}; - - - -template<class T, int N> -class ArrayIterator : public ConstArrayIterator<T,N> { - public: - ArrayIterator(Array<T,N>& x) - : ConstArrayIterator<T,N>(x) - { } - - ArrayIterator(Array<T,N>& x, _bz_endTag y) - : ConstArrayIterator<T,N>(x,y) - { } - - ArrayIterator<T,N>& operator++() - { - ConstArrayIterator<T,N>::operator++(); - return *this; - } - - T& operator*() - { - return *data_; - } - - T* _bz_restrict operator->() - { - return data_; - } -}; - - - -template<class T, int N> -ConstArrayIterator<T,N>& ConstArrayIterator<T,N>::operator++() -{ - BZPRECHECK(data_ != 0, "Attempted to iterate past the end of an array."); - - data_ += stride_; - - if (data_ != last_[0]) - { - // We hit this case almost all the time. - ++pos_[maxRank_]; - return *this; - } - - // We've hit the end of a row/column/whatever. Need to - // increment one of the loops over another dimension. - - int j = 1; - for (; j < N; ++j) - { - int r = order_(j); - data_ = stack_[j]; - data_ += strides_[r]; - ++pos_(r); - - if (data_ != last_[j]) - break; - } - - // All done? - if (j == N) - { - // Setting data_ to 0 indicates the end of the array has - // been reached, and will match the end iterator. - data_ = 0; - return *this; - } - - stack_[j] = data_; - - // Now reset all the last pointers - for (--j; j >= 0; --j) - { - int r2 = order_(j); - stack_[j] = data_; - last_[j] = data_ + extent_(r2) * strides_(r2); - pos_(r2) = lbound_(r2); - } - - return *this; -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_ITER_H - diff --git a/weave/blitz-20001213/blitz/array/map.h b/weave/blitz-20001213/blitz/array/map.h deleted file mode 100644 index 8348447ab..000000000 --- a/weave/blitz-20001213/blitz/array/map.h +++ /dev/null @@ -1,495 +0,0 @@ -/*************************************************************************** - * blitz/array/map.h Declaration of the ArrayIndexMapping class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -/* - * ArrayIndexMapping is used to implement tensor array notation. For - * example: - * - * Array<float, 2> A, B; - * firstIndex i; - * secondIndex j; - * thirdIndex k; - * Array<float, 3> C = A(i,j) * B(j,k); - * - * For expression templates purposes, something like B(j,k) is represented - * by an instance of class ArrayIndexMapping. This class maps an array onto - * the destination array coordinate system, e.g. B(j,k) -> C(i,j,k) - */ - -#ifndef BZ_ARRAYMAP_H -#define BZ_ARRAYMAP_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/map.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * _bz_doArrayIndexMapping is a helper class. It is specialized for - * ranks 1, 2, 3, ..., 11. - */ - -template<int N_rank> -struct _bz_doArrayIndexMapping { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, N_rank>&, - const TinyVector<int,N_destRank>&, int, int, int, int, int, int, - int, int, int, int, int) - { - // If you try to use an array index mapping on an array with - // rank greater than 11, then you'll get a precondition failure - // here. - BZPRECONDITION(0); - } -}; - -template<> -struct _bz_doArrayIndexMapping<1> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 1>& array, - const TinyVector<int,N_destRank>& index, int i0, int, int, int, int, - int, int, int, int, int, int) - { - return array(index[i0]); - } -}; - - -template<> -struct _bz_doArrayIndexMapping<2> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 2>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int, - int, int, int, int, int, int, int, int) - { - return array(index[i0], index[i1]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<3> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 3>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int, int, int, int, int, int, int, int) - { - return array(index[i0], index[i1], index[i2]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<4> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 4>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int, int, int, int, int, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<5> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 5>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int, int, int, int, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<6> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 6>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int, int, int, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<7> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 7>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int i6, int, int, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5], index[i6]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<8> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 8>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int i6, int i7, int, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5], index[i6], index[i7]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<9> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 9>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int i6, int i7, int i8, int, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5], index[i6], index[i7], index[i8]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<10> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 10>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int i6, int i7, int i8, int i9, int) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5], index[i6], index[i7], index[i8], index[i9]); - } -}; - -template<> -struct _bz_doArrayIndexMapping<11> { - template<class T_numtype, int N_destRank> - static T_numtype map(const Array<T_numtype, 11>& array, - const TinyVector<int,N_destRank>& index, int i0, int i1, int i2, - int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10) - { - return array(index[i0], index[i1], index[i2], index[i3], index[i4], - index[i5], index[i6], index[i7], index[i8], index[i9], - index[i10]); - } -}; - -template<class P_numtype, int N_rank, int N_map0, int N_map1=0, int N_map2=0, - int N_map3=0, int N_map4=0, int N_map5=0, int N_map6=0, int N_map7=0, - int N_map8=0, int N_map9=0, int N_map10=0> -class ArrayIndexMapping { -public: - typedef P_numtype T_numtype; - typedef const Array<T_numtype,N_rank>& T_ctorArg1; - typedef int T_ctorArg2; // dummy - - /* - * This enum block finds the maximum of the N_map0, N_map1, ..., N_map10 - * parameters and stores it in maxRank10. The rank of the expression is - * then maxRank10 + 1, since the IndexPlaceholders start at 0 rather than - * 1. - */ - enum { - maxRank1 = (N_map0 > N_map1) ? N_map0 : N_map1, - maxRank2 = (N_map2 > maxRank1) ? N_map2 : maxRank1, - maxRank3 = (N_map3 > maxRank2) ? N_map3 : maxRank2, - maxRank4 = (N_map4 > maxRank3) ? N_map4 : maxRank3, - maxRank5 = (N_map5 > maxRank4) ? N_map5 : maxRank4, - maxRank6 = (N_map6 > maxRank5) ? N_map6 : maxRank5, - maxRank7 = (N_map7 > maxRank6) ? N_map7 : maxRank6, - maxRank8 = (N_map8 > maxRank7) ? N_map8 : maxRank7, - maxRank9 = (N_map9 > maxRank8) ? N_map9 : maxRank8, - maxRank10 = (N_map10 > maxRank9) ? N_map10 : maxRank9 - }; - - enum { numArrayOperands = 1, numIndexPlaceholders = 1, - rank = maxRank10 + 1 }; - - ArrayIndexMapping(const Array<T_numtype, N_rank>& array) - : array_(array) - { - } - - ArrayIndexMapping(const ArrayIndexMapping<T_numtype,N_rank,N_map0, - N_map1,N_map2,N_map3,N_map4,N_map5,N_map6,N_map7,N_map8,N_map9, - N_map10>& z) - : array_(z.array_) - { - } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_destRank> - T_numtype operator()(TinyVector<int, N_destRank> i) - { - return _bz_doArrayIndexMapping<N_rank>::map(array_, i, - N_map0, N_map1, N_map2, N_map3, N_map4, N_map5, N_map6, - N_map7, N_map8, N_map9, N_map10); - } -#else - template<int N_destRank> - T_numtype operator()(const TinyVector<int, N_destRank>& i) - { - return _bz_doArrayIndexMapping<N_rank>::map(array_, i, - N_map0, N_map1, N_map2, N_map3, N_map4, N_map5, N_map6, - N_map7, N_map8, N_map9, N_map10); - } -#endif - - int ascending(int rank) - { - if (N_map0 == rank) - return array_.ascending(0); - else if ((N_map1 == rank) && (N_rank > 1)) - return array_.ascending(1); - else if ((N_map2 == rank) && (N_rank > 2)) - return array_.ascending(2); - else if ((N_map3 == rank) && (N_rank > 3)) - return array_.ascending(3); - else if ((N_map4 == rank) && (N_rank > 4)) - return array_.ascending(4); - else if ((N_map5 == rank) && (N_rank > 5)) - return array_.ascending(5); - else if ((N_map6 == rank) && (N_rank > 6)) - return array_.ascending(6); - else if ((N_map7 == rank) && (N_rank > 7)) - return array_.ascending(7); - else if ((N_map8 == rank) && (N_rank > 8)) - return array_.ascending(8); - else if ((N_map9 == rank) && (N_rank > 9)) - return array_.ascending(9); - else if ((N_map10 == rank) && (N_rank > 10)) - return array_.ascending(10); - else - return INT_MIN; // tiny(int()); - } - - int ordering(int rank) - { - if (N_map0 == rank) - return array_.ordering(0); - else if ((N_map1 == rank) && (N_rank > 1)) - return array_.ordering(1); - else if ((N_map2 == rank) && (N_rank > 2)) - return array_.ordering(2); - else if ((N_map3 == rank) && (N_rank > 3)) - return array_.ordering(3); - else if ((N_map4 == rank) && (N_rank > 4)) - return array_.ordering(4); - else if ((N_map5 == rank) && (N_rank > 5)) - return array_.ordering(5); - else if ((N_map6 == rank) && (N_rank > 6)) - return array_.ordering(6); - else if ((N_map7 == rank) && (N_rank > 7)) - return array_.ordering(7); - else if ((N_map8 == rank) && (N_rank > 8)) - return array_.ordering(8); - else if ((N_map9 == rank) && (N_rank > 9)) - return array_.ordering(9); - else if ((N_map10 == rank) && (N_rank > 10)) - return array_.ordering(10); - else - return INT_MIN; // tiny(int()); - } - - int lbound(int rank) - { - if (N_map0 == rank) - return array_.lbound(0); - else if ((N_map1 == rank) && (N_rank > 1)) - return array_.lbound(1); - else if ((N_map2 == rank) && (N_rank > 2)) - return array_.lbound(2); - else if ((N_map3 == rank) && (N_rank > 3)) - return array_.lbound(3); - else if ((N_map4 == rank) && (N_rank > 4)) - return array_.lbound(4); - else if ((N_map5 == rank) && (N_rank > 5)) - return array_.lbound(5); - else if ((N_map6 == rank) && (N_rank > 6)) - return array_.lbound(6); - else if ((N_map7 == rank) && (N_rank > 7)) - return array_.lbound(7); - else if ((N_map8 == rank) && (N_rank > 8)) - return array_.lbound(8); - else if ((N_map9 == rank) && (N_rank > 9)) - return array_.lbound(9); - else if ((N_map10 == rank) && (N_rank > 10)) - return array_.lbound(10); - else - return INT_MIN; // tiny(int()); - } - - int ubound(int rank) - { - if (N_map0 == rank) - return array_.ubound(0); - else if ((N_map1 == rank) && (N_rank > 1)) - return array_.ubound(1); - else if ((N_map2 == rank) && (N_rank > 2)) - return array_.ubound(2); - else if ((N_map3 == rank) && (N_rank > 3)) - return array_.ubound(3); - else if ((N_map4 == rank) && (N_rank > 4)) - return array_.ubound(4); - else if ((N_map5 == rank) && (N_rank > 5)) - return array_.ubound(5); - else if ((N_map6 == rank) && (N_rank > 6)) - return array_.ubound(6); - else if ((N_map7 == rank) && (N_rank > 7)) - return array_.ubound(7); - else if ((N_map8 == rank) && (N_rank > 8)) - return array_.ubound(8); - else if ((N_map9 == rank) && (N_rank > 9)) - return array_.ubound(9); - else if ((N_map10 == rank) && (N_rank > 10)) - return array_.ubound(10); - else - return INT_MAX; // huge(int()); - } - - // If you have a precondition failure on this routine, it means - // you are trying to use stack iteration mode on an expression - // which contains an index placeholder. You must use index - // iteration mode instead. - int operator*() - { - BZPRECONDITION(0); - return 0; - } - - // See operator*() note - void push(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void pop(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance() - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void loadStride(int) - { - BZPRECONDITION(0); - } - - _bz_bool isUnitStride(int rank) const - { - BZPRECONDITION(0); - return false; - } - - void advanceUnitStride() - { - BZPRECONDITION(0); - } - - _bz_bool canCollapse(int,int) const - { BZPRECONDITION(0); return _bz_false; } - - T_numtype operator[](int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - T_numtype fastRead(int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - int suggestStride(int) const - { - BZPRECONDITION(0); - return 0; - } - - _bz_bool isStride(int,int) const - { - BZPRECONDITION(0); - return _bz_true; - } - - template<int N_rank2> - void moveTo(const TinyVector<int,N_rank2>& i) - { - BZPRECONDITION(0); - return ; - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - // NEEDS_WORK-- do real formatting for reductions - str += "map[NEEDS_WORK]"; - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) const - { - // NEEDS_WORK-- do a real shape check (tricky) - return _bz_true; - } - -private: - ArrayIndexMapping() { } - - const Array<T_numtype, N_rank>& array_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYMAP_H - diff --git a/weave/blitz-20001213/blitz/array/methods.cc b/weave/blitz-20001213/blitz/array/methods.cc deleted file mode 100644 index 13b5256e3..000000000 --- a/weave/blitz-20001213/blitz/array/methods.cc +++ /dev/null @@ -1,407 +0,0 @@ -/* - * $Id$ - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/08/18 19:13:08 tveldhui - * Just prior to implementing fastRead() optimization for array - * expression evaluation. - * - * Revision 1.2 1997/08/15 21:14:10 tveldhui - * Just prior to loop-collapse change - * - */ - -#ifndef BZ_ARRAYMETHODS_CC -#define BZ_ARRAYMETHODS_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/methods.cc> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_numtype, int N_rank> template<class T_expr> -Array<P_numtype,N_rank>::Array(_bz_ArrayExpr<T_expr> expr) -{ - // Determine extent of the array expression - - TinyVector<int,N_rank> lbound, extent, ordering; - TinyVector<bool,N_rank> ascendingFlag; - - for (int i=0; i < N_rank; ++i) - { - lbound(i) = expr.lbound(i); - int ubound = expr.ubound(i); - extent(i) = ubound - lbound(i) + 1; - ordering(i) = expr.ordering(i); - int ascending = expr.ascending(i); - ascendingFlag(i) = (ascending == 1); - -#ifdef BZ_DEBUG - if ((lbound(i) == INT_MIN) || (ubound == INT_MAX) - || (ordering(i) == INT_MAX) || (ascending == INT_MAX)) - { - BZPRECHECK(0, - "Attempted to construct an array from an expression " << endl - << "which does not have a shape. To use this constructor, " - << endl - << "the expression must contain at least one array operand."); - return; - } -#endif - } - - Array<P_numtype,N_rank> A(lbound,extent, - GeneralArrayStorage<N_rank>(ordering,ascendingFlag)); - A = expr; - reference(A); -} - -template<class T_numtype, int N_rank> -Array<T_numtype,N_rank>::Array(const TinyVector<int, N_rank>& lbounds, - const TinyVector<int, N_rank>& extent, - const GeneralArrayStorage<N_rank>& storage) - : storage_(storage) -{ - length_ = extent; - storage_.setBase(lbounds); - setupStorage(N_rank - 1); -} - - -/* - * This routine takes the storage information for the array - * (ascendingFlag_[], base_[], and ordering_[]) and the size - * of the array (length_[]) and computes the stride vector - * (stride_[]) and the zero offset (see explanation in array.h). - */ -template<class P_numtype, int N_rank> -_bz_inline2 void Array<P_numtype, N_rank>::computeStrides() -{ - if (N_rank > 1) - { - int stride = 1; - - // This flag simplifies the code in the loop, encouraging - // compile-time computation of strides through constant folding. - _bz_bool allAscending = storage_.allRanksStoredAscending(); - - // BZ_OLD_FOR_SCOPING - int n; - for (n=0; n < N_rank; ++n) - { - int strideSign = +1; - - // If this rank is stored in descending order, then the stride - // will be negative. - if (!allAscending) - { - if (!isRankStoredAscending(ordering(n))) - strideSign = -1; - } - - // The stride for this rank is the product of the lengths of - // the ranks minor to it. - stride_[ordering(n)] = stride * strideSign; - - stride *= length_[ordering(n)]; - } - } - else { - // Specialization for N_rank == 1 - // This simpler calculation makes it easier for the compiler - // to propagate stride values. - - if (isRankStoredAscending(0)) - stride_[0] = 1; - else - stride_[0] = -1; - } - - calculateZeroOffset(); -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::calculateZeroOffset() -{ - // Calculate the offset of (0,0,...,0) - zeroOffset_ = 0; - - // zeroOffset_ = - sum(where(ascendingFlag_, stride_ * base_, - // (length_ - 1 + base_) * stride_)) - for (int n=0; n < N_rank; ++n) - { - if (!isRankStoredAscending(n)) - zeroOffset_ -= (length_[n] - 1 + base(n)) * stride_[n]; - else - zeroOffset_ -= stride_[n] * base(n); - } -} - -template<class T_numtype, int N_rank> -_bz_bool Array<T_numtype, N_rank>::isStorageContiguous() const -{ - // The storage is contiguous if for the set - // { | stride[i] * extent[i] | }, i = 0..N_rank-1, - // there is only one value which is not in the set - // of strides; and if there is one stride which is 1. - - // This algorithm is quadratic in the rank. It is hard - // to imagine this being a serious problem. - - int numStridesMissing = 0; - bool haveUnitStride = _bz_false; - - for (int i=0; i < N_rank; ++i) - { - int stride = BZ_MATHFN_SCOPE(abs)(stride_[i]); - if (stride == 1) - haveUnitStride = _bz_true; - - int vi = stride * length_[i]; - - int j = 0; - for (j=0; j < N_rank; ++j) - if (BZ_MATHFN_SCOPE(abs)(stride_[j]) == vi) - break; - - if (j == N_rank) - { - ++numStridesMissing; - if (numStridesMissing == 2) - return _bz_false; - } - } - - return haveUnitStride; -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::dumpStructureInformation(ostream& os) const -{ - os << "Dump of Array<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(P_numtype) - << ", " << N_rank << ">:" << endl - << "ordering_ = " << storage_.ordering() << endl - << "ascendingFlag_ = " << storage_.ascendingFlag() << endl - << "base_ = " << storage_.base() << endl - << "length_ = " << length_ << endl - << "stride_ = " << stride_ << endl - << "zeroOffset_ = " << zeroOffset_ << endl - << "numElements() = " << numElements() << endl - << "isStorageContiguous() = " << isStorageContiguous() << endl; -} - -/* - * Make this array a view of another array's data. - */ -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::reference(const Array<P_numtype, N_rank>& array) -{ - storage_ = array.storage_; - length_ = array.length_; - stride_ = array.stride_; - zeroOffset_ = array.zeroOffset_; - - MemoryBlockReference<P_numtype>::changeBlock(array.noConst(), - array.zeroOffset_); - - data_ = const_cast<P_numtype*>(array.data_); -} - -/* - * This method is called to allocate memory for a new array. - */ -template<class P_numtype, int N_rank> -_bz_inline2 void Array<P_numtype, N_rank>::setupStorage(int lastRankInitialized) -{ - TAU_TYPE_STRING(p1, "Array<T,N>::setupStorage() [T=" - + CT(P_numtype) + ",N=" + CT(N_rank) + "]"); - TAU_PROFILE(" ", p1, TAU_BLITZ); - - /* - * If the length of some of the ranks was unspecified, fill these - * in using the last specified value. - * - * e.g. Array<int,3> A(40) results in a 40x40x40 array. - */ - for (int i=lastRankInitialized + 1; i < N_rank; ++i) - { - storage_.setBase(i, storage_.base(lastRankInitialized)); - length_[i] = length_[lastRankInitialized]; - } - - // Compute strides - computeStrides(); - - // Allocate a block of memory - MemoryBlockReference<P_numtype>::newBlock(numElements()); - - // Adjust the base of the array to account for non-zero base - // indices and reversals - data_ += zeroOffset_; -} - -template<class T_numtype, int N_rank> -Array<T_numtype, N_rank> Array<T_numtype, N_rank>::copy() const -{ - if (numElements()) - { - Array<T_numtype, N_rank> z(length_, storage_); - z = *this; - return z; - } - else { - // Null array-- don't bother allocating an empty block. - return *this; - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::makeUnique() -{ - if (numReferences() > 1) - { - T_array tmp = copy(); - reference(tmp); - } -} - -template<class T_numtype, int N_rank> -Array<T_numtype, N_rank> Array<T_numtype, N_rank>::transpose(int r0, int r1, - int r2, int r3, int r4, int r5, int r6, int r7, int r8, int r9, int r10) -{ - T_array B(*this); - B.transposeSelf(r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10); - return B; -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::transposeSelf(int r0, int r1, int r2, int r3, - int r4, int r5, int r6, int r7, int r8, int r9, int r10) -{ - BZPRECHECK(r0+r1+r2+r3+r4+r5+r6+r7+r8+r9+r10 == N_rank * (N_rank-1) / 2, - "Invalid array transpose() arguments." << endl - << "Arguments must be a permutation of the numerals (0,...," - << (N_rank - 1) << ")"); - - // Create a temporary reference copy of this array - Array<T_numtype, N_rank> x(*this); - - // Now reorder the dimensions using the supplied permutation - doTranspose(0, r0, x); - doTranspose(1, r1, x); - doTranspose(2, r2, x); - doTranspose(3, r3, x); - doTranspose(4, r4, x); - doTranspose(5, r5, x); - doTranspose(6, r6, x); - doTranspose(7, r7, x); - doTranspose(8, r8, x); - doTranspose(9, r9, x); - doTranspose(10, r10, x); -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::doTranspose(int destRank, int sourceRank, - Array<T_numtype, N_rank>& array) -{ - // BZ_NEEDS_WORK: precondition check - - if (destRank >= N_rank) - return; - - length_[destRank] = array.length_[sourceRank]; - stride_[destRank] = array.stride_[sourceRank]; - storage_.setAscendingFlag(destRank, - array.isRankStoredAscending(sourceRank)); - storage_.setBase(destRank, array.base(sourceRank)); - - // BZ_NEEDS_WORK: Handling the storage ordering is currently O(N^2) - // but it can be done fairly easily in linear time by constructing - // the appropriate permutation. - - // Find sourceRank in array.storage_.ordering_ - int i=0; - for (; i < N_rank; ++i) - if (array.storage_.ordering(i) == sourceRank) - break; - - storage_.setOrdering(i, destRank); -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::reverseSelf(int rank) -{ - BZPRECONDITION(rank < N_rank); - - storage_.setAscendingFlag(rank, !isRankStoredAscending(rank)); - - int adjustment = stride_[rank] * (lbound(rank) + ubound(rank)); - zeroOffset_ += adjustment; - data_ += adjustment; - stride_[rank] *= -1; -} - -template<class T_numtype, int N_rank> -Array<T_numtype, N_rank> Array<T_numtype,N_rank>::reverse(int rank) -{ - T_array B(*this); - B.reverseSelf(rank); - return B; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -Array<T_numtype2,N_rank> Array<T_numtype,N_rank>::extractComponent(T_numtype2, - int componentNumber, int numComponents) const -{ - BZPRECONDITION((componentNumber >= 0) - && (componentNumber < numComponents)); - - TinyVector<int,N_rank> stride2; - stride2 = stride_ * numComponents; - const T_numtype2* dataFirst2 = - ((const T_numtype2*)dataFirst()) + componentNumber; - return Array<T_numtype2,N_rank>(const_cast<T_numtype2*>(dataFirst2), - length_, stride2, storage_); -} - -/* - * These routines reindex the current array to use a new base vector. - * The first reindexes the array, the second just returns a reindex view - * of the current array, leaving the current array unmodified. - * (Contributed by Derrick Bass) - */ -template<class P_numtype, int N_rank> -_bz_inline2 void Array<P_numtype, N_rank>::reindexSelf(const - TinyVector<int, N_rank>& newBase) -{ - data_ += dot(base() - newBase, stride_); - storage_.setBase(newBase); - calculateZeroOffset(); -} - -template<class P_numtype, int N_rank> -_bz_inline2 Array<P_numtype, N_rank> -Array<P_numtype, N_rank>::reindex(const TinyVector<int, N_rank>& newBase) -{ - T_array B(*this); - B.reindexSelf(newBase); - return B; -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_CC - diff --git a/weave/blitz-20001213/blitz/array/misc.cc b/weave/blitz-20001213/blitz/array/misc.cc deleted file mode 100644 index f4a046be5..000000000 --- a/weave/blitz-20001213/blitz/array/misc.cc +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef BZ_ARRAYMISC_CC -#define BZ_ARRAYMISC_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/misc.cc> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -#define BZ_ARRAY_DECLARE_UOP(fn, fnobj) \ -template<class T_numtype, int N_rank> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<FastArrayIterator<T_numtype,N_rank>, \ - fnobj<T_numtype> > > \ -fn(const Array<T_numtype,N_rank>& array) \ -{ \ - return _bz_ArrayExprUnaryOp<FastArrayIterator<T_numtype,N_rank>, \ - fnobj<T_numtype> >(array.beginFast()); \ -} \ - \ -template<class T_expr> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>, \ - fnobj<_bz_typename T_expr::T_numtype> > > \ -fn(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) \ -{ \ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>, \ - fnobj<_bz_typename T_expr::T_numtype> >(expr); \ -} - -BZ_ARRAY_DECLARE_UOP(operator!, LogicalNot) -BZ_ARRAY_DECLARE_UOP(operator~, BitwiseNot) -BZ_ARRAY_DECLARE_UOP(operator-, Negate) - -/* - * cast() functions, for explicit type casting - */ - -template<class T_numtype, int N_rank, class T_cast> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<FastArrayIterator<T_numtype,N_rank>, - Cast<T_numtype, T_cast> > > -cast(const Array<T_numtype,N_rank>& array, T_cast) -{ - return _bz_ArrayExprUnaryOp<FastArrayIterator<T_numtype,N_rank>, - Cast<T_numtype,T_cast> >(array.beginFast()); -} - -template<class T_expr, class T_cast> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>, - Cast<_bz_typename T_expr::T_numtype,T_cast> > > -cast(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr, T_cast) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>, - Cast<_bz_typename T_expr::T_numtype,T_cast> >(expr); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYMISC_CC - diff --git a/weave/blitz-20001213/blitz/array/multi.h b/weave/blitz-20001213/blitz/array/multi.h deleted file mode 100644 index d0e3647ef..000000000 --- a/weave/blitz-20001213/blitz/array/multi.h +++ /dev/null @@ -1,60 +0,0 @@ -// Support for multicomponent arrays - -#ifndef BZ_ARRAYMULTI_H -#define BZ_ARRAYMULTI_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/multi.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * The multicomponent_traits class provides a mapping from multicomponent - * tuples to the element type they contain. For example: - * - * multicomponent_traits<complex<float> >::T_numtype is float, - * multicomponent_traits<TinyVector<int,3> >::T_numtype is int. - * - * This is used to support Array<T,N>::operator[], which extracts components - * from a multicomponent array. - */ - -// By default, produce a harmless component type, and zero components. -template<class T_component> -struct multicomponent_traits { - typedef T_component T_element; - enum { numComponents = 0 }; -}; - -// TinyVector -template<class T_numtype, int N_rank> -struct multicomponent_traits<TinyVector<T_numtype,N_rank> > { - typedef T_numtype T_element; - enum { numComponents = N_rank }; -}; - -#ifdef BZ_HAVE_COMPLEX_MATH -// complex<T> -template<class T> -struct multicomponent_traits<complex<T> > { - typedef T T_element; - enum { numComponents = 2 }; -}; -#endif - -// This macro is provided so that users can register their own -// multicomponent types. - -#define BZ_DECLARE_MULTICOMPONENT_TYPE(T_tuple,T,N) \ - BZ_NAMESPACE(blitz) \ - template<> \ - struct multicomponent_traits<T_tuple > { \ - typedef T T_element; \ - enum { numComponents = N }; \ - }; \ - BZ_NAMESPACE_END - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYMULTI_H diff --git a/weave/blitz-20001213/blitz/array/newbops.cc b/weave/blitz-20001213/blitz/array/newbops.cc deleted file mode 100644 index 1332527ba..000000000 --- a/weave/blitz-20001213/blitz/array/newbops.cc +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef BZ_ARRAYBOPS_CC -#define BZ_ARRAYBOPS_CC - -#ifndef BZ_ARRAYEXPR_H - #error <blitz/arraybops.cc> must be included after <blitz/arrayexpr.h> -#endif - -#include <blitz/array/asexpr.h> - -BZ_NAMESPACE(blitz) - -#define BZ_DECLARE_ARRAY_ET(name, applic) \ - \ -template<class T_numtype1, int N_rank1, class T_other> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<T_numtype1, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ -name (const Array<T_numtype1,N_rank1>& d1, \ - const T_other& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, \ - N_rank1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<T_numtype1, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ - (d1.begin(),d2); \ -} \ - \ -template<class T_expr1, class T_other> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<T_expr1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<_bz_typename T_expr1::T_numtype, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > > \ -name(const _bz_ArrayExpr<T_expr1>& d1, \ - const T_other& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<T_expr1>, \ - _bz_typename asExpr<T_other>::T_expr, \ - applic<_bz_typename T_expr1::T_numtype, \ - _bz_typename asExpr<T_other>::T_expr::T_numtype> > >(d1,d2); \ -} \ - \ -template<class T1, class T2> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, \ - _bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ -name(const T1& d1, \ - const ETBase<T2>& d2) \ -{ \ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename \ - asExpr<T1>::T_expr, \ - _bz_typename asExpr<T2>::T_expr, \ - applic<_bz_typename asExpr<T1>::T_expr::T_numtype, \ - _bz_typename asExpr<T2>::T_expr::T_numtype> > > \ - (d1, static_cast<const T2&>(d2)); \ -} - -BZ_DECLARE_ARRAY_ET(operator+, Add) -BZ_DECLARE_ARRAY_ET(operator-, Subtract) -BZ_DECLARE_ARRAY_ET(operator*, Multiply) -BZ_DECLARE_ARRAY_ET(operator/, Divide) -BZ_DECLARE_ARRAY_ET(operator%, Modulo) -BZ_DECLARE_ARRAY_ET(operator^, BitwiseXor) -BZ_DECLARE_ARRAY_ET(operator&, BitwiseAnd) -BZ_DECLARE_ARRAY_ET(operator|, BitwiseOr) -BZ_DECLARE_ARRAY_ET(operator>>,ShiftRight) -BZ_DECLARE_ARRAY_ET(operator<<,ShiftLeft) -BZ_DECLARE_ARRAY_ET(operator>, Greater) -BZ_DECLARE_ARRAY_ET(operator<, Less) -BZ_DECLARE_ARRAY_ET(operator>=, GreaterOrEqual) -BZ_DECLARE_ARRAY_ET(operator<=, LessOrEqual) -BZ_DECLARE_ARRAY_ET(operator==, Equal) -BZ_DECLARE_ARRAY_ET(operator!=, NotEqual) -BZ_DECLARE_ARRAY_ET(operator&&, LogicalAnd) -BZ_DECLARE_ARRAY_ET(operator||, LogicalOr) - -BZ_DECLARE_ARRAY_ET(atan2, _bz_atan2) - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYBOPS_CC diff --git a/weave/blitz-20001213/blitz/array/ops.cc b/weave/blitz-20001213/blitz/array/ops.cc deleted file mode 100644 index 831f2c851..000000000 --- a/weave/blitz-20001213/blitz/array/ops.cc +++ /dev/null @@ -1,355 +0,0 @@ -#ifndef BZ_ARRAYOPS_CC -#define BZ_ARRAYOPS_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/ops.cc> must be included via <blitz/array.h> -#endif - -#ifndef BZ_UPDATE_H - #include <blitz/update.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * Constant operands - */ - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& Array<T_numtype,N_rank>::initialize( - T_numtype x) -{ - (*this) = _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype,N_rank>& -Array<T_numtype,N_rank>::operator=(const ETBase<T_expr>& expr) -{ - evaluate(static_cast<const T_expr&>(expr), - _bz_update<T_numtype, _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator=(const Array<T_numtype,N_rank>& x) -{ - (*this) = _bz_ArrayExpr<FastArrayIterator<T_numtype, N_rank> > - (x.beginFast()); - return *this; -} - -#define BZ_ARRAY_UPDATE(op,name) \ -template<class T_numtype, int N_rank> \ -template<class T> \ -inline Array<T_numtype,N_rank>& \ -Array<T_numtype,N_rank>::operator op(const T& expr) \ -{ \ - evaluate(_bz_typename asExpr<T>::T_expr(expr), \ - name<T_numtype, _bz_typename asExpr<T>::T_expr::T_numtype>()); \ - return *this; \ -} - -BZ_ARRAY_UPDATE(+=, _bz_plus_update) -BZ_ARRAY_UPDATE(-=, _bz_minus_update) -BZ_ARRAY_UPDATE(*=, _bz_multiply_update) -BZ_ARRAY_UPDATE(/=, _bz_divide_update) -BZ_ARRAY_UPDATE(%=, _bz_mod_update) -BZ_ARRAY_UPDATE(^=, _bz_xor_update) -BZ_ARRAY_UPDATE(&=, _bz_bitand_update) -BZ_ARRAY_UPDATE(|=, _bz_bitor_update) -BZ_ARRAY_UPDATE(<<=, _bz_shiftl_update) -BZ_ARRAY_UPDATE(>>=, _bz_shiftr_update) - -#else - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator+=(T_numtype x) -{ - (*this) += _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator-=(T_numtype x) -{ - (*this) -= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator*=(T_numtype x) -{ - (*this) *= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator/=(T_numtype x) -{ - (*this) /= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator%=(T_numtype x) -{ - (*this) %= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator^=(T_numtype x) -{ - (*this) ^= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator&=(T_numtype x) -{ - (*this) &= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator|=(T_numtype x) -{ - (*this) |= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator>>=(T_numtype x) -{ - (*this) <<= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype,N_rank>::operator<<=(T_numtype x) -{ - (*this) <<= _bz_ArrayExpr<_bz_ArrayExprConstant<T_numtype> >(x); - return *this; -} - -/* - * Array operands - */ - -template<class T_numtype, int N_rank> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator=(const Array<T_numtype,N_rank>& x) -{ - (*this) = _bz_ArrayExpr<FastArrayIterator<T_numtype, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator=(const Array<T_numtype2,N_rank>& x) -{ - (*this) = _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator+=(const Array<T_numtype2,N_rank>& x) -{ - (*this) += _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator-=(const Array<T_numtype2,N_rank>& x) -{ - (*this) -= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator*=(const Array<T_numtype2,N_rank>& x) -{ - (*this) *= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator/=(const Array<T_numtype2,N_rank>& x) -{ - (*this) /= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator%=(const Array<T_numtype2,N_rank>& x) -{ - (*this) %= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator^=(const Array<T_numtype2,N_rank>& x) -{ - (*this) ^= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator&=(const Array<T_numtype2,N_rank>& x) -{ - (*this) &= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator|=(const Array<T_numtype2,N_rank>& x) -{ - (*this) |= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator>>=(const Array<T_numtype2,N_rank>& x) -{ - (*this) >>= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_numtype2> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator<<=(const Array<T_numtype2,N_rank>& x) -{ - (*this) <<= _bz_ArrayExpr<FastArrayIterator<T_numtype2, N_rank> >(x.beginFast()); - return *this; -} - -/* - * Array expression operands - */ - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_update<T_numtype, _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator+=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_plus_update<T_numtype, _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator-=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_minus_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator*=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_multiply_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator/=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_divide_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator%=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_mod_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator^=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_xor_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator&=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_bitand_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator|=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_bitor_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator>>=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_shiftr_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -template<class T_numtype, int N_rank> template<class T_expr> -inline Array<T_numtype, N_rank>& -Array<T_numtype, N_rank>::operator<<=(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) -{ - evaluate(expr, _bz_shiftl_update<T_numtype, - _bz_typename T_expr::T_numtype>()); - return *this; -} - -#endif // BZ_NEW_EXPRESSION_TEMPLATES - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYOPS_CC diff --git a/weave/blitz-20001213/blitz/array/reduce.cc b/weave/blitz-20001213/blitz/array/reduce.cc deleted file mode 100644 index 36c13e564..000000000 --- a/weave/blitz-20001213/blitz/array/reduce.cc +++ /dev/null @@ -1,167 +0,0 @@ -#ifndef BZ_ARRAYREDUCE_H - #error <blitz/array/reduce.cc> must be included via <blitz/array/reduce.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_reduceWithIndexTraversal(T_expr expr, T_reduction reduction); - -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_reduceWithStackTraversal(T_expr expr, T_reduction reduction); - -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_ArrayExprFullReduce(T_expr expr, T_reduction reduction) -{ -#ifdef BZ_TAU_PROFILING - // Tau profiling code. Provide Tau with a pretty-printed version of - // the expression. - static string exprDescription; - if (!exprDescription.length()) // faked static initializer - { - exprDescription = T_reduction::name(); - exprDescription += "("; - prettyPrintFormat format(_bz_true); // Terse mode on - expr.prettyPrint(exprDescription, format); - exprDescription += ")"; - } - TAU_PROFILE(" ", exprDescription, TAU_BLITZ); -#endif // BZ_TAU_PROFILING - - return _bz_reduceWithIndexTraversal(expr, reduction); - -#ifdef BZ_NOT_IMPLEMENTED_FLAG - if ((T_expr::numIndexPlaceholders > 0) || (T_reduction::needIndex)) - { - // The expression involves index placeholders, so have to - // use index traversal rather than stack traversal. - return reduceWithIndexTraversal(expr, reduction); - } - else { - // Use a stack traversal - return reduceWithStackTraversal(expr, reduction); - } -#endif -} - -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_reduceWithIndexTraversal(T_expr expr, T_reduction reduction) -{ - // This is optimized assuming C-style arrays. - - reduction.reset(); - - const int rank = T_expr::rank; - - TinyVector<int,rank> index, first, last; - - unsigned long count = 1; - - for (int i=0; i < rank; ++i) - { - index(i) = expr.lbound(i); - first(i) = index(i); - last(i) = expr.ubound(i) + 1; - count *= last(i) - first(i); - } - - const int maxRank = rank - 1; - int lastlbound = expr.lbound(maxRank); - int lastubound = expr.ubound(maxRank); - - int lastIndex = lastubound + 1; - - _bz_bool loopFlag = _bz_true; - - while(loopFlag) { - for (index[maxRank] = lastlbound; index[maxRank] < lastIndex; - ++index[maxRank]) - { - if (!reduction(expr(index), index[maxRank])) - { - loopFlag = _bz_false; - break; - } - } - - int j = rank-2; - for (; j >= 0; --j) - { - index(j+1) = first(j+1); - ++index(j); - if (index(j) != last(j)) - break; - } - - if (j < 0) - break; - } - - return reduction.result(count); -} - - -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_reduceWithIndexVectorTraversal(T_expr expr, T_reduction reduction) -{ - // This version is for reductions that require a vector - // of index positions. - - reduction.reset(); - - const int rank = T_expr::rank; - - TinyVector<int,rank> index, first, last; - - unsigned long count = 1; - - for (int i=0; i < rank; ++i) - { - index(i) = expr.lbound(i); - first(i) = index(i); - last(i) = expr.ubound(i) + 1; - count *= last(i) - first(i); - } - - const int maxRank = rank - 1; - int lastlbound = expr.lbound(maxRank); - int lastubound = expr.ubound(maxRank); - - int lastIndex = lastubound + 1; - - _bz_bool loopFlag = _bz_true; - - while(loopFlag) { - for (index[maxRank] = lastlbound; index[maxRank] < lastIndex; - ++index[maxRank]) - { - if (!reduction(expr(index), index)) - { - loopFlag = _bz_false; - break; - } - } - - int j = rank-2; - for (; j >= 0; --j) - { - index(j+1) = first(j+1); - ++index(j); - if (index(j) != last(j)) - break; - } - - if (j < 0) - break; - } - - return reduction.result(count); -} - -BZ_NAMESPACE_END - diff --git a/weave/blitz-20001213/blitz/array/reduce.h b/weave/blitz-20001213/blitz/array/reduce.h deleted file mode 100644 index 803ea17b5..000000000 --- a/weave/blitz-20001213/blitz/array/reduce.h +++ /dev/null @@ -1,344 +0,0 @@ -/*************************************************************************** - * blitz/array/reduce.h Reductions of an array (or array expression) in a - * single rank: sum, mean, min, minIndex, max, maxIndex, - * product, count, any, all - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:14 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_ARRAYREDUCE_H -#define BZ_ARRAYREDUCE_H - -#ifndef BZ_ARRAYEXPR_H - #error <blitz/array/reduce.h> must be included after <blitz/array/expr.h> -#endif - -#ifndef BZ_REDUCE_H - #include <blitz/reduce.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class T_expr, int N_index, class T_reduction> -class _bz_ArrayExprReduce { - -public: - typedef _bz_typename T_reduction::T_numtype T_numtype; - typedef T_expr T_ctorArg1; - typedef T_reduction T_ctorArg2; - - enum { numArrayOperands = BZ_ENUM_CAST(T_expr::numArrayOperands), - numIndexPlaceholders = BZ_ENUM_CAST(T_expr::numIndexPlaceholders) + 1, - rank = BZ_ENUM_CAST(T_expr::rank) - 1 }; - - _bz_ArrayExprReduce(const _bz_ArrayExprReduce<T_expr,N_index,T_reduction>& - reduce) - : reduce_(reduce.reduce_), iter_(reduce.iter_) - { - } - - _bz_ArrayExprReduce(T_expr expr) - : iter_(expr) - { } - - _bz_ArrayExprReduce(T_expr expr, T_reduction reduce) - : iter_(expr), reduce_(reduce) - { } - - int ascending(int rank) - { return iter_.ascending(rank); } - - int ordering(int rank) - { return iter_.ordering(rank); } - - int lbound(int rank) - { return iter_.lbound(rank); } - - int ubound(int rank) - { return iter_.ubound(rank); } - - template<int N_destRank> - T_numtype operator()(const TinyVector<int, N_destRank>& destIndex) - { - BZPRECHECK(N_destRank == N_index, - "Array reduction performed over rank " << N_index - << " to produce a rank " << N_destRank << " expression." << endl - << "You must reduce over rank " << N_destRank << " instead."); - - TinyVector<int, N_destRank + 1> index; - - // This metaprogram copies elements 0..N-1 of destIndex into index - _bz_meta_vecAssign<N_index, 0>::assign(index, destIndex, - _bz_update<int,int>()); - - int lbound = iter_.lbound(N_index); - int ubound = iter_.ubound(N_index); - - // NEEDS_WORK: replace with tiny(int()) and huge(int()) once - // <limits> widely available - BZPRECHECK((lbound != INT_MIN) && (ubound != INT_MAX), - "Array reduction performed over rank " << N_index - << " is unbounded." << endl - << "There must be an array object in the expression being reduced" - << endl << "which provides a bound in rank " << N_index << "."); - - reduce_.reset(); - - for (index[N_index] = iter_.lbound(N_index); - index[N_index] <= ubound; ++index[N_index]) - { - if (!reduce_(iter_(index), index[N_index])) - break; - } - - return reduce_.result(ubound-lbound+1); - } - - // If you have a precondition failure on this routine, it means - // you are trying to use stack iteration mode on an expression - // which contains an index placeholder. You must use index - // iteration mode instead. - int operator*() - { - BZPRECONDITION(0); - return 0; - } - - // See operator*() note - void push(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void pop(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance() - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void loadStride(int) - { - BZPRECONDITION(0); - } - - _bz_bool isUnitStride(int rank) const - { - BZPRECONDITION(0); - return false; - } - - void advanceUnitStride() - { - BZPRECONDITION(0); - } - - _bz_bool canCollapse(int,int) const - { BZPRECONDITION(0); return _bz_false; } - - T_numtype operator[](int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - T_numtype fastRead(int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - int suggestStride(int) const - { - BZPRECONDITION(0); - return 0; - } - - _bz_bool isStride(int,int) const - { - BZPRECONDITION(0); - return _bz_true; - } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - BZPRECONDITION(0); - return; - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - // NEEDS_WORK-- do real formatting for reductions - str += "reduce[NEEDS_WORK]("; - iter_.prettyPrint(str,format); - str += ")"; - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) const - { - // NEEDS_WORK-- do a real shape check (tricky) - return _bz_true; - } - -private: - _bz_ArrayExprReduce() { } - - T_reduction reduce_; - T_expr iter_; -}; - -#define BZ_DECL_ARRAY_PARTIAL_REDUCE(fn,reduction) \ -template<class T_expr, int N_index> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprReduce<_bz_ArrayExpr<T_expr>, N_index, \ - reduction<_bz_typename T_expr::T_numtype> > > \ -fn(_bz_ArrayExpr<T_expr> expr, const IndexPlaceholder<N_index>&) \ -{ \ - return _bz_ArrayExprReduce<_bz_ArrayExpr<T_expr>, N_index, \ - reduction<_bz_typename T_expr::T_numtype> >(expr); \ -} \ - \ -template<class T_numtype, int N_rank, int N_index> \ -inline \ -_bz_ArrayExpr<_bz_ArrayExprReduce<FastArrayIterator<T_numtype,N_rank>, \ - N_index, reduction<T_numtype> > > \ -fn(const Array<T_numtype, N_rank>& array, \ - const IndexPlaceholder<N_index>&) \ -{ \ - return _bz_ArrayExprReduce<FastArrayIterator<T_numtype,N_rank>, \ - N_index, reduction<T_numtype> > (array.beginFast()); \ -} - -BZ_DECL_ARRAY_PARTIAL_REDUCE(sum, ReduceSum) -BZ_DECL_ARRAY_PARTIAL_REDUCE(mean, ReduceMean) -BZ_DECL_ARRAY_PARTIAL_REDUCE(min, ReduceMin) -BZ_DECL_ARRAY_PARTIAL_REDUCE(minIndex, ReduceMinIndex) -BZ_DECL_ARRAY_PARTIAL_REDUCE(max, ReduceMax) -BZ_DECL_ARRAY_PARTIAL_REDUCE(maxIndex, ReduceMaxIndex) -BZ_DECL_ARRAY_PARTIAL_REDUCE(product, ReduceProduct) -BZ_DECL_ARRAY_PARTIAL_REDUCE(count, ReduceCount) -BZ_DECL_ARRAY_PARTIAL_REDUCE(any, ReduceAny) -BZ_DECL_ARRAY_PARTIAL_REDUCE(all, ReduceAll) -BZ_DECL_ARRAY_PARTIAL_REDUCE(first, ReduceFirst) -BZ_DECL_ARRAY_PARTIAL_REDUCE(last, ReduceLast) - -/* - * Complete reductions - */ - -// Prototype of reduction function -template<class T_expr, class T_reduction> -_bz_typename T_reduction::T_resulttype -_bz_ArrayExprFullReduce(T_expr expr, T_reduction reduction); - -#define BZ_DECL_ARRAY_FULL_REDUCE(fn,reduction) \ -template<class T_expr> \ -inline \ -_bz_typename reduction<_bz_typename T_expr::T_numtype>::T_resulttype \ -fn(_bz_ArrayExpr<T_expr> expr) \ -{ \ - return _bz_ArrayExprFullReduce(expr, \ - reduction<_bz_typename T_expr::T_numtype>()); \ -} \ - \ -template<class T_numtype, int N_rank> \ -inline \ -_bz_typename reduction<T_numtype>::T_resulttype \ -fn(const Array<T_numtype, N_rank>& array) \ -{ \ - return _bz_ArrayExprFullReduce(array.beginFast(), \ - reduction<T_numtype>()); \ -} - -BZ_DECL_ARRAY_FULL_REDUCE(sum, ReduceSum) -BZ_DECL_ARRAY_FULL_REDUCE(mean, ReduceMean) -BZ_DECL_ARRAY_FULL_REDUCE(min, ReduceMin) -BZ_DECL_ARRAY_FULL_REDUCE(max, ReduceMax) -BZ_DECL_ARRAY_FULL_REDUCE(product, ReduceProduct) -BZ_DECL_ARRAY_FULL_REDUCE(count, ReduceCount) -BZ_DECL_ARRAY_FULL_REDUCE(any, ReduceAny) -BZ_DECL_ARRAY_FULL_REDUCE(all, ReduceAll) -BZ_DECL_ARRAY_FULL_REDUCE(first, ReduceFirst) -BZ_DECL_ARRAY_FULL_REDUCE(last, ReduceLast) - -// Special versions of complete reductions: minIndex and -// maxIndex - -#define BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(fn,reduction) \ -template<class T_expr> \ -inline \ -_bz_typename reduction<_bz_typename T_expr::T_numtype, \ - T_expr::rank>::T_resulttype \ -fn(_bz_ArrayExpr<T_expr> expr) \ -{ \ - return _bz_reduceWithIndexVectorTraversal(expr, \ - reduction<_bz_typename T_expr::T_numtype, T_expr::rank>()); \ -} \ - \ -template<class T_numtype, int N_rank> \ -inline \ -_bz_typename reduction<T_numtype,N_rank>::T_resulttype \ -fn(const Array<T_numtype, N_rank>& array) \ -{ \ - return _bz_reduceWithIndexVectorTraversal( array.beginFast(), \ - reduction<T_numtype,N_rank>()); \ -} - -BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(minIndex, ReduceMinIndexVector) -BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(maxIndex, ReduceMaxIndexVector) - -BZ_NAMESPACE_END - -#include <blitz/array/reduce.cc> - -#endif // BZ_ARRAYREDUCE_H diff --git a/weave/blitz-20001213/blitz/array/resize.cc b/weave/blitz-20001213/blitz/array/resize.cc deleted file mode 100644 index 2d3ef336d..000000000 --- a/weave/blitz-20001213/blitz/array/resize.cc +++ /dev/null @@ -1,457 +0,0 @@ -#ifndef BZ_ARRAYRESIZE_CC -#define BZ_ARRAYRESIZE_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/resize.cc> must be included via <blitz/array.h> -#endif - -#include <blitz/minmax.h> - -BZ_NAMESPACE(blitz) - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int length0) -{ - BZPRECONDITION(length0 > 0); - BZPRECONDITION(N_rank == 1); - - if (length0 != length_[firstRank]) - { - length_[firstRank] = length0; - setupStorage(0); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0)); - BZPRECONDITION(N_rank == 2); - - if ((extent0 != length_[0]) || (extent1 != length_[1])) - { - length_[0] = extent0; - length_[1] = extent1; - setupStorage(1); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0)); - BZPRECONDITION(N_rank == 3); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - setupStorage(2); - } -} - - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0)); - BZPRECONDITION(N_rank == 4); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - setupStorage(3); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0)); - BZPRECONDITION(N_rank == 5); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - setupStorage(4); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0)); - BZPRECONDITION(N_rank == 6); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - setupStorage(5); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5, - int extent6) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0) - && (extent6 > 0)); - BZPRECONDITION(N_rank == 7); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5]) - || (extent6 != length_[6])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - length_[6] = extent6; - setupStorage(6); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5, - int extent6, int extent7) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0) - && (extent6 > 0) && (extent7 > 0)); - BZPRECONDITION(N_rank == 8); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5]) - || (extent6 != length_[6]) || (extent7 != length_[7])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - length_[6] = extent6; - length_[7] = extent7; - setupStorage(7); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0) - && (extent6 > 0) && (extent7 > 0) && (extent8 > 0)); - BZPRECONDITION(N_rank == 9); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5]) - || (extent6 != length_[6]) || (extent7 != length_[7]) - || (extent8 != length_[8])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - length_[6] = extent6; - length_[7] = extent7; - length_[8] = extent8; - setupStorage(8); - } -} - - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8, int extent9) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0) - && (extent6 > 0) && (extent7 > 0) && (extent8 > 0) - && (extent9 > 0)); - BZPRECONDITION(N_rank == 10); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5]) - || (extent6 != length_[6]) || (extent7 != length_[7]) - || (extent8 != length_[8]) || (extent9 != length_[9])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - length_[6] = extent6; - length_[7] = extent7; - length_[8] = extent8; - length_[9] = extent9; - setupStorage(9); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(int extent0, int extent1, - int extent2, int extent3, int extent4, int extent5, - int extent6, int extent7, int extent8, int extent9, - int extent10) -{ - BZPRECONDITION((extent0 > 0) && (extent1 > 0) && (extent2 > 0) - && (extent3 > 0) && (extent4 > 0) && (extent5 > 0) - && (extent6 > 0) && (extent7 > 0) && (extent8 > 0) - && (extent9 > 0) && (extent10 > 0)); - BZPRECONDITION(N_rank == 11); - - if ((extent0 != length_[0]) || (extent1 != length_[1]) - || (extent2 != length_[2]) || (extent3 != length_[3]) - || (extent4 != length_[4]) || (extent5 != length_[5]) - || (extent6 != length_[6]) || (extent7 != length_[7]) - || (extent8 != length_[8]) || (extent9 != length_[9]) - || (extent10 != length_[10])) - { - length_[0] = extent0; - length_[1] = extent1; - length_[2] = extent2; - length_[3] = extent3; - length_[4] = extent4; - length_[5] = extent5; - length_[6] = extent6; - length_[7] = extent7; - length_[8] = extent8; - length_[9] = extent9; - length_[10] = extent10; - setupStorage(10); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0) -{ - BZPRECONDITION(length0 > 0); - BZPRECONDITION(N_rank == 1); - - if (length0 != length_[firstRank]) - { -#if defined(__KCC) || defined(__DECCXX) - // NEEDS_WORK: have to discard the base() parameter for EDG, - // because it gives the following bizarre error: - -/* - * "blitz/tinyvec.h", line 421: error: the size of an array must be greater - * than zero - * T_numtype data_[N_length]; - * ^ - * detected during: - * instantiation of class "blitz::TinyVector<int, 0>" at line 273 of - * "./../blitz/array/resize.cc" - * instantiation of - * "void blitz::Array<int, 1>::resizeAndPreserve(int)" - */ - T_array B(length0, storage_); -#else - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0), storage_); // line 273 -#endif - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), - ubound(0))); - B(overlap0) = (*this)(overlap0); - } - reference(B); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0, int length1) -{ - BZPRECONDITION((length0 > 0) && (length1 > 0)); - BZPRECONDITION(N_rank == 2); - - if ((length0 != length_[0]) || (length1 != length_[1])) - { - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1), storage_); - - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), - ubound(0))); - Range overlap1 = Range(fromStart, minmax::min(B.ubound(1), - ubound(1))); - B(overlap0, overlap1) = (*this)(overlap0, overlap1); - } - reference(B); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0, int length1, - int length2) -{ - BZPRECONDITION((length0 > 0) && (length1 > 0) && (length2 > 0)); - BZPRECONDITION(N_rank == 3); - - if ((length0 != length_[0]) || (length1 != length_[1]) - || (length2 != length_[2])) - { - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1, length2), - storage_); - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), - ubound(0))); - Range overlap1 = Range(fromStart, minmax::min(B.ubound(1), - ubound(1))); - Range overlap2 = Range(fromStart, minmax::min(B.ubound(2), - ubound(2))); - B(overlap0, overlap1, overlap2) = (*this)(overlap0, overlap1, - overlap2); - } - reference(B); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0, int length1, - int length2, int length3) -{ - BZPRECONDITION((length0 > 0) && (length1 > 0) && (length2 > 0) - && (length3 > 0)); - BZPRECONDITION(N_rank == 4); - - if ((length0 != length_[0]) || (length1 != length_[1]) - || (length2 != length_[2]) || (length3 != length_[3])) - { - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1, - length2, length3), storage_); - - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), ubound(0))); - Range overlap1 = Range(fromStart, minmax::min(B.ubound(1), ubound(1))); - Range overlap2 = Range(fromStart, minmax::min(B.ubound(2), ubound(2))); - Range overlap3 = Range(fromStart, minmax::min(B.ubound(3), ubound(3))); - B(overlap0, overlap1, overlap2, overlap3) = (*this)(overlap0, - overlap1, overlap2, overlap3); - } - reference(B); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0, int length1, - int length2, int length3, int length4) -{ - BZPRECONDITION((length0 > 0) && (length1 > 0) && (length2 > 0) - && (length3 > 0) && (length4 > 0)); - BZPRECONDITION(N_rank == 5); - - if ((length0 != length_[0]) || (length1 != length_[1]) - || (length2 != length_[2]) || (length3 != length_[3]) - || (length4 != length_[4])) - { - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1, - length2, length3, length4), storage_); - - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), ubound(0))); - Range overlap1 = Range(fromStart, minmax::min(B.ubound(1), ubound(1))); - Range overlap2 = Range(fromStart, minmax::min(B.ubound(2), ubound(2))); - Range overlap3 = Range(fromStart, minmax::min(B.ubound(3), ubound(3))); - Range overlap4 = Range(fromStart, minmax::min(B.ubound(4), ubound(4))); - B(overlap0, overlap1, overlap2, overlap3, overlap4) = (*this) - (overlap0, overlap1, overlap2, overlap3, overlap4); - } - reference(B); - } -} - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resizeAndPreserve(int length0, int length1, - int length2, int length3, int length4, int length5) -{ - BZPRECONDITION((length0 > 0) && (length1 > 0) && (length2 > 0) - && (length3 > 0) && (length4 > 0) && (length5 > 0)); - BZPRECONDITION(N_rank == 6); - - if ((length0 != length_[0]) || (length1 != length_[1]) - || (length2 != length_[2]) || (length3 != length_[3]) - || (length4 != length_[4]) || (length5 != length_[5])) - { - T_array B(base(), BZ_BLITZ_SCOPE(shape)(length0, length1, length2, - length3, length4, length5), storage_); - - if (numElements()) - { - Range overlap0 = Range(fromStart, minmax::min(B.ubound(0), ubound(0))); - Range overlap1 = Range(fromStart, minmax::min(B.ubound(1), ubound(1))); - Range overlap2 = Range(fromStart, minmax::min(B.ubound(2), ubound(2))); - Range overlap3 = Range(fromStart, minmax::min(B.ubound(3), ubound(3))); - Range overlap4 = Range(fromStart, minmax::min(B.ubound(4), ubound(4))); - Range overlap5 = Range(fromStart, minmax::min(B.ubound(5), ubound(5))); - B(overlap0, overlap1, overlap2, overlap3, overlap4, overlap5) - = (*this)(overlap0, overlap1, overlap2, overlap3, overlap4, - overlap5); - } - reference(B); - } -} - - -// NEEDS_WORK: resizeAndPreserve for N_rank = 7..11 - -template<class T_numtype, int N_rank> -void Array<T_numtype, N_rank>::resize(const TinyVector<int,N_rank>& extent) -{ -// NEEDS_WORK -// BZPRECONDITION(all(extent > 0)); -// if (any(extent != length_)) -// { - length_ = extent; - setupStorage(N_rank); -// } -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYRESIZE_CC diff --git a/weave/blitz-20001213/blitz/array/shape.h b/weave/blitz-20001213/blitz/array/shape.h deleted file mode 100644 index 96b49ae5f..000000000 --- a/weave/blitz-20001213/blitz/array/shape.h +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************** - * blitz/array/shape.h - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:14 tveldhui - * Imported sources - * - * Revision 1.1 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -#ifndef BZ_ARRAYSHAPE_H -#define BZ_ARRAYSHAPE_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/shape.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * These routines make it easier to create shape parameters on - * the fly: instead of having to write - * - * A.resize(TinyVector<int,4>(8,8,8,12)); - * - * you can just say - * - * A.resize(shape(8,8,8,12)); - * - */ -inline TinyVector<int,1> shape(int n1) -{ return TinyVector<int,1>(n1); } - -inline TinyVector<int,2> shape(int n1, int n2) -{ return TinyVector<int,2>(n1,n2); } - -inline TinyVector<int,3> shape(int n1, int n2, int n3) -{ return TinyVector<int,3>(n1,n2,n3); } - -inline TinyVector<int,4> shape(int n1, int n2, int n3, int n4) -{ return TinyVector<int,4>(n1,n2,n3,n4); } - -inline TinyVector<int,5> shape(int n1, int n2, int n3, int n4, - int n5) -{ return TinyVector<int,5>(n1,n2,n3,n4,n5); } - -inline TinyVector<int,6> shape(int n1, int n2, int n3, int n4, - int n5, int n6) -{ return TinyVector<int,6>(n1,n2,n3,n4,n5,n6); } - -inline TinyVector<int,7> shape(int n1, int n2, int n3, int n4, - int n5, int n6, int n7) -{ return TinyVector<int,7>(n1,n2,n3,n4,n5,n6,n7); } - -inline TinyVector<int,8> shape(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8) -{ return TinyVector<int,8>(n1,n2,n3,n4,n5,n6,n7,n8); } - -inline TinyVector<int,9> shape(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, int n9) -{ return TinyVector<int,9>(n1,n2,n3,n4,n5,n6,n7,n8,n9); } - -inline TinyVector<int,10> shape(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, int n9, int n10) -{ return TinyVector<int,10>(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10); } - -inline TinyVector<int,11> shape(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, int n9, int n10, int n11) -{ return TinyVector<int,11>(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11); } - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYSHAPE_H - diff --git a/weave/blitz-20001213/blitz/array/slice.h b/weave/blitz-20001213/blitz/array/slice.h deleted file mode 100644 index 28bb246d0..000000000 --- a/weave/blitz-20001213/blitz/array/slice.h +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * blitz/array/slice.h Helper classes for slicing arrays - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:14 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_ARRAYSLICE_H -#define BZ_ARRAYSLICE_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/slice.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -// Forward declaration -template<class T, int N> -class Array; - - - -class nilArraySection { }; - -template<class T> -class ArraySectionInfo { -public: - enum { isValidType = 0, rank = 0, isPick = 0 }; -}; - -template<> -class ArraySectionInfo<Range> { -public: - enum { isValidType = 1, rank = 1, isPick = 0 }; -}; - -template<> -class ArraySectionInfo<int> { -public: - enum { isValidType = 1, rank = 0, isPick = 0 }; -}; - -template<> -class ArraySectionInfo<nilArraySection> { -public: - enum { isValidType = 1, rank = 0, isPick = 0 }; -}; - -template<class T_numtype, class T1, class T2 = nilArraySection, - class T3 = nilArraySection, class T4 = nilArraySection, - class T5 = nilArraySection, class T6 = nilArraySection, - class T7 = nilArraySection, class T8 = nilArraySection, - class T9 = nilArraySection, class T10 = nilArraySection, - class T11 = nilArraySection> -class SliceInfo { -public: - enum { - numValidTypes = ArraySectionInfo<T1>::isValidType - + ArraySectionInfo<T2>::isValidType - + ArraySectionInfo<T3>::isValidType - + ArraySectionInfo<T4>::isValidType - + ArraySectionInfo<T5>::isValidType - + ArraySectionInfo<T6>::isValidType - + ArraySectionInfo<T7>::isValidType - + ArraySectionInfo<T8>::isValidType - + ArraySectionInfo<T9>::isValidType - + ArraySectionInfo<T10>::isValidType - + ArraySectionInfo<T11>::isValidType, - - rank = ArraySectionInfo<T1>::rank - + ArraySectionInfo<T2>::rank - + ArraySectionInfo<T3>::rank - + ArraySectionInfo<T4>::rank - + ArraySectionInfo<T5>::rank - + ArraySectionInfo<T6>::rank - + ArraySectionInfo<T7>::rank - + ArraySectionInfo<T8>::rank - + ArraySectionInfo<T9>::rank - + ArraySectionInfo<T10>::rank - + ArraySectionInfo<T11>::rank, - - isPick = ArraySectionInfo<T1>::isPick - + ArraySectionInfo<T2>::isPick - + ArraySectionInfo<T3>::isPick - + ArraySectionInfo<T4>::isPick - + ArraySectionInfo<T5>::isPick - + ArraySectionInfo<T6>::isPick - + ArraySectionInfo<T7>::isPick - + ArraySectionInfo<T8>::isPick - + ArraySectionInfo<T9>::isPick - + ArraySectionInfo<T10>::isPick - + ArraySectionInfo<T11>::isPick - }; - - typedef Array<T_numtype,numValidTypes> T_array; - typedef Array<T_numtype,rank> T_slice; -}; - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYSLICE_H diff --git a/weave/blitz-20001213/blitz/array/slicing.cc b/weave/blitz-20001213/blitz/array/slicing.cc deleted file mode 100644 index e5c3ae629..000000000 --- a/weave/blitz-20001213/blitz/array/slicing.cc +++ /dev/null @@ -1,325 +0,0 @@ -#ifndef BZ_ARRAYSLICING_CC -#define BZ_ARRAYSLICING_CC - -#ifndef BZ_ARRAY_H - #error <blitz/array/slicing.cc> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * These routines make the array a view of a portion of another array. - * They all work by first referencing the other array, and then slicing. - */ - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, const RectDomain<N_rank>& subdomain) -{ - reference(array); - for (int i=0; i < N_rank; ++i) - slice(i, subdomain[i]); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0) -{ - reference(array); - slice(0, r0); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1) -{ - reference(array); - slice(0, r0); - slice(1, r1); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); - slice(6, r6); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, Range r7) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); - slice(6, r6); - slice(7, r7); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, Range r7, Range r8) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); - slice(6, r6); - slice(7, r7); - slice(8, r8); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, Range r7, Range r8, Range r9) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); - slice(6, r6); - slice(7, r7); - slice(8, r8); - slice(9, r9); -} - -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::constructSubarray( - Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, - Range r4, Range r5, Range r6, Range r7, Range r8, Range r9, Range r10) -{ - reference(array); - slice(0, r0); - slice(1, r1); - slice(2, r2); - slice(3, r3); - slice(4, r4); - slice(5, r5); - slice(6, r6); - slice(7, r7); - slice(8, r8); - slice(9, r9); - slice(10, r10); -} - -/* - * This member template is used to implement operator() with any - * combination of int and Range parameters. There's room for up - * to 11 parameters, but any unused parameters have no effect. - */ -template<class P_numtype, int N_rank> template<int N_rank2, class R0, - class R1, class R2, class R3, class R4, class R5, class R6, class R7, - class R8, class R9, class R10> -void Array<P_numtype, N_rank>::constructSlice(Array<T_numtype, N_rank2>& array, - R0 r0, R1 r1, R2 r2, R3 r3, R4 r4, R5 r5, R6 r6, R7 r7, R8 r8, R9 r9, - R10 r10) -{ - MemoryBlockReference<P_numtype>::changeBlock(array, array.zeroOffset()); - data_ = array.dataZero(); - - int setRank = 0; - - TinyVector<int, N_rank2> rankMap; - - slice(setRank, r0, array, rankMap, 0); - slice(setRank, r1, array, rankMap, 1); - slice(setRank, r2, array, rankMap, 2); - slice(setRank, r3, array, rankMap, 3); - slice(setRank, r4, array, rankMap, 4); - slice(setRank, r5, array, rankMap, 5); - slice(setRank, r6, array, rankMap, 6); - slice(setRank, r7, array, rankMap, 7); - slice(setRank, r8, array, rankMap, 8); - slice(setRank, r9, array, rankMap, 9); - slice(setRank, r10, array, rankMap, 10); - - // Redo the ordering_ array to account for dimensions which - // have been sliced away. - int j = 0; - for (int i=0; i < N_rank2; ++i) - { - if (rankMap[array.ordering(i)] != -1) - storage_.setOrdering(j++, rankMap[array.ordering(i)]); - } - - calculateZeroOffset(); -} - -/* - * This member template is also used in the implementation of - * operator() with any combination of int and Rank parameters. - * It's called by constructSlice(), above. This version handles - * Range parameters. - */ -template<class T_numtype, int N_rank> template<int N_rank2> -void Array<T_numtype, N_rank>::slice(int& setRank, Range r, - Array<T_numtype,N_rank2>& array, TinyVector<int,N_rank2>& rankMap, - int sourceRank) -{ - // NEEDS WORK: ordering will change completely when some ranks - // are deleted. - -#ifdef BZ_DEBUG_SLICE -cout << "slice(" << setRank << ", [" << r.first(array.lbound(sourceRank)) - << ", " << r.last(array.ubound(sourceRank)) << "], Array<T," - << N_rank2 << ">, " << sourceRank << ")" << endl; -#endif - - rankMap[sourceRank] = setRank; - length_[setRank] = array.length(sourceRank); - stride_[setRank] = array.stride(sourceRank); - storage_.setAscendingFlag(setRank, array.isRankStoredAscending(sourceRank)); - storage_.setBase(setRank, array.base(sourceRank)); - slice(setRank, r); - ++setRank; -} - -/* - * This member template is also used in the implementation of - * operator() with any combination of int and Rank parameters. - * It's called by constructSlice(), above. This version handles - * int parameters, which reduce the dimensionality by one. - */ -template<class T_numtype, int N_rank> template<int N_rank2> -void Array<T_numtype, N_rank>::slice(int& setRank, int i, - Array<T_numtype,N_rank2>& array, TinyVector<int,N_rank2>& rankMap, - int sourceRank) -{ -#ifdef BZ_DEBUG_SLICE - cout << "slice(" << setRank << ", " << i - << ", Array<T," << N_rank2 << ">, " << sourceRank << ")" << endl; - cout << "Offset by " << (i * array.stride(sourceRank)) - << endl; -#endif - BZPRECHECK(array.isInRangeForDim(i, sourceRank), - "Slice is out of range for array: index=" << i << " rank=" << sourceRank - << endl << "Possible range for index: [" << array.lbound(sourceRank) - << ", " << array.ubound(sourceRank) << "]"); - - rankMap[sourceRank] = -1; - data_ += i * array.stride(sourceRank); -#ifdef BZ_DEBUG_SLICE - cout << "data_ = " << data_ << endl; -#endif -} - -/* - * After calling slice(int rank, Range r), the array refers only to the - * Range r of the original array. - * e.g. Array<int,1> x(100); - * x.slice(firstRank, Range(25,50)); - * x = 0; // Sets elements 25..50 of the original array to 0 - */ -template<class P_numtype, int N_rank> -void Array<P_numtype, N_rank>::slice(int rank, Range r) -{ - BZPRECONDITION((rank >= 0) && (rank < N_rank)); - - int first = r.first(lbound(rank)); - int last = r.last(ubound(rank)); - int stride = r.stride(); - -#ifdef BZ_DEBUG_SLICE -cout << "slice(" << rank << ", Range):" << endl - << "first = " << first << " last = " << last << "stride = " << stride - << endl << "length_[rank] = " << length_[rank] << endl; -#endif - - BZPRECHECK( - ((first <= last) && (stride > 0) - || (first >= last) && (stride < 0)) - && (unsigned(first - base(rank)) < length_[rank]) - && (unsigned(last - base(rank)) < length_[rank]), - "Bad array slice: Range(" << first << ", " << last << ", " - << stride << "). Array is Range(" << lbound(rank) << ", " - << ubound(rank) << ")"); - - // Will the storage be non-contiguous? - // (1) Slice in the minor dimension and the range does not span - // the entire index interval (NB: non-unit strides are possible) - // (2) Slice in a middle dimension and the range is not Range::all() - - length_[rank] = (last - first) / stride + 1; - - // TV 20000312: added second term here, for testsuite/Josef-Wagenhuber - int offset = -base(rank) * stride_[rank] * stride - + first * stride_[rank]; - // (first - base(rank)) * stride_[rank] - data_ += offset; - zeroOffset_ -= offset; - - stride_[rank] *= stride; -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYSLICING_CC diff --git a/weave/blitz-20001213/blitz/array/stencil-et.h b/weave/blitz-20001213/blitz/array/stencil-et.h deleted file mode 100644 index a16055d1f..000000000 --- a/weave/blitz-20001213/blitz/array/stencil-et.h +++ /dev/null @@ -1,272 +0,0 @@ -#ifndef BZ_ARRAY_STENCIL_ET_H -#define BZ_ARRAY_STENCIL_ET_H - -BZ_NAMESPACE(blitz) - -template<typename T_ArrayNumtype, int N_rank, typename T_result> -class StencilExpr -{ -public: - typedef T_result T_numtype; - typedef Array<T_ArrayNumtype,N_rank> T_array; - typedef const T_array& T_ctorArg1; - typedef int T_ctorArg2; - - enum { numArrayOperands = 1, numIndexPlaceholders = 0, - rank = N_rank }; - - StencilExpr(const T_array& array) - : iter_(array) - { } - - ~StencilExpr() - { } - - // operator* must be declared by subclass - - int ascending(int rank) - { return iter_.ascending(rank); } - - int ordering(int rank) - { return iter_.ordering(rank); } - - int lbound(int rank) - { return iter_.lbound(rank); } - - int ubound(int rank) - { return iter_.ubound(rank); } - - void push(int position) - { iter_.push(position); } - - void pop(int position) - { iter_.pop(position); } - - void advance() - { iter_.advance(); } - - void advance(int n) - { iter_.advance(n); } - - void loadStride(int rank) - { iter_.loadStride(rank); } - - _bz_bool isUnitStride(int rank) const - { return iter_.isUnitStride(rank); } - - void advanceUnitStride() - { iter_.advanceUnitStride(); } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { - // BZ_DEBUG_MESSAGE("_bz_ArrayExpr<>::canCollapse()"); - return iter_.canCollapse(outerLoopRank, innerLoopRank); - } - - // T_numtype operator[](int i) -- don't know how to do that. - - // T_numtype fastRead(int i) -- ditto - - int suggestStride(int rank) const - { return iter_.suggestStride(rank); } - - _bz_bool isStride(int rank, int stride) const - { return iter_.isStride(rank,stride); } - - void prettyPrint(string& str) const - { - str += "(stencil)"; // lame, needs work - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { str += "(stencil)"; } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { return iter_.shapeCheck(shape); } - - void moveTo(const TinyVector<int,N_rank>& i) - { - iter_.moveTo(i); - } - -protected: - FastArrayIterator<T_ArrayNumtype,N_rank> iter_; -}; - -#define BZ_ET_STENCIL(name,result) \ -template<class P_numtype, int N_rank> \ -class name ## _et : public StencilExpr<P_numtype,N_rank,result>, \ - public ETBase<name ## _et<P_numtype,N_rank> > \ - { \ -public: \ - name ## _et(const Array<T_numtype,N_rank>& A) \ - : StencilExpr<T_numtype,N_rank,result>(A) \ - { } \ - result operator*() \ - { return name(iter_); } \ - result operator()(const TinyVector<int,N_rank>& a) \ - { iter_.moveTo(a); return name(iter_); } \ - result fastRead(int i) \ - { \ - const T_numtype* tmp = iter_.data(); \ - iter_._bz_setData(tmp + i); \ - T_numtype r = name(iter_); \ - iter_._bz_setData(tmp); \ - return r; \ - } \ -}; \ -template<class T_numtype, int N_rank> \ -inline _bz_ArrayExpr<name ## _et<T_numtype, N_rank> > \ -name(Array<T_numtype,N_rank>& A) \ -{ \ - return _bz_ArrayExpr<name ## _et<T_numtype, N_rank> >(A); \ -} - -#define BZ_ET_STENCILV(name,rank) \ -template<class P_numtype, int N_rank> \ -class name ## _et : public StencilExpr<P_numtype,N_rank, \ - TinyVector<P_numtype,rank> >, \ - public ETBase<name ## _et<P_numtype,N_rank> > \ - { \ -public: \ - typedef TinyVector<T_numtype,rank> result; \ - name ## _et(const Array<T_numtype,N_rank>& A) \ - : StencilExpr<T_numtype,N_rank,result>(A) \ - { } \ - result operator*() \ - { return name(iter_); } \ - result operator()(const TinyVector<int,N_rank>& a) \ - { iter_.moveTo(a); return name(iter_); } \ - result fastRead(int i) \ - { \ - const T_numtype* tmp = iter_.data(); \ - iter_._bz_setData(tmp + i); \ - T_numtype r = name(iter_); \ - iter_._bz_setData(tmp); \ - return r; \ - } \ -}; \ -template<class T_numtype, int N_rank> \ -inline _bz_ArrayExpr<name ## _et<T_numtype, N_rank> > \ -name(Array<T_numtype,N_rank>& A) \ -{ \ - return _bz_ArrayExpr< name ## _et<T_numtype, N_rank> >(A); \ -} - -#define BZ_ET_STENCIL_DIFF(name) \ -template<class P_numtype, int N_rank> \ -class name ## _et : public StencilExpr<P_numtype,N_rank,P_numtype>, \ - public ETBase<name ## _et<P_numtype,N_rank> > \ - { \ -public: \ - name ## _et(const Array<T_numtype,N_rank>& A, int dim) \ - : StencilExpr<T_numtype,N_rank,P_numtype>(A), dim_(dim) \ - { } \ - T_numtype operator*() \ - { return name(iter_); } \ - T_numtype operator()(const TinyVector<int,N_rank>& a) \ - { iter_.moveTo(a); return name(iter_,dim_); } \ - T_numtype fastRead(int i) \ - { \ - const T_numtype* tmp = iter_.data(); \ - iter_._bz_setData(tmp + i); \ - T_numtype r = name(iter_,dim_); \ - iter_._bz_setData(tmp); \ - return r; \ - } \ -private: \ - int dim_; \ -}; \ -template<class T_numtype, int N_rank> \ -inline _bz_ArrayExpr<name ## _et<T_numtype, N_rank> > \ -name(Array<T_numtype,N_rank>& A, int dim) \ -{ \ - return _bz_ArrayExpr<name ## _et<T_numtype, N_rank> >(A,dim); \ -} - - -BZ_ET_STENCIL(Laplacian2D, P_numtype) -BZ_ET_STENCIL(Laplacian3D, P_numtype) -BZ_ET_STENCIL(Laplacian2D4, P_numtype) -BZ_ET_STENCIL(Laplacian2D4n, P_numtype) -BZ_ET_STENCIL(Laplacian3D4, P_numtype) -BZ_ET_STENCIL(Laplacian3D4n, P_numtype) -BZ_ET_STENCILV(grad2D, 2) -BZ_ET_STENCILV(grad2D4, 2) -BZ_ET_STENCILV(grad3D, 3) -BZ_ET_STENCILV(grad3D4, 3) -BZ_ET_STENCILV(grad2Dn, 2) -BZ_ET_STENCILV(grad2D4n, 2) -BZ_ET_STENCILV(grad3Dn, 3) -BZ_ET_STENCILV(grad3D4n, 3) -BZ_ET_STENCILV(gradSqr2D, 2) -BZ_ET_STENCILV(gradSqr2D4, 2) -BZ_ET_STENCILV(gradSqr3D, 3) -BZ_ET_STENCILV(gradSqr3D4, 3) -BZ_ET_STENCILV(gradSqr2Dn, 2) -BZ_ET_STENCILV(gradSqr2D4n, 2) -BZ_ET_STENCILV(gradSqr3Dn, 3) -BZ_ET_STENCILV(gradSqr3D4n, 3) - -// NEEDS_WORK: -// Jacobian -// Curl -// Div -// mixed - -BZ_ET_STENCIL_DIFF(central12) -BZ_ET_STENCIL_DIFF(central22) -BZ_ET_STENCIL_DIFF(central32) -BZ_ET_STENCIL_DIFF(central42) -BZ_ET_STENCIL_DIFF(central14) -BZ_ET_STENCIL_DIFF(central24) -BZ_ET_STENCIL_DIFF(central34) -BZ_ET_STENCIL_DIFF(central44) -BZ_ET_STENCIL_DIFF(central12n) -BZ_ET_STENCIL_DIFF(central22n) -BZ_ET_STENCIL_DIFF(central32n) -BZ_ET_STENCIL_DIFF(central42n) -BZ_ET_STENCIL_DIFF(central14n) -BZ_ET_STENCIL_DIFF(central24n) -BZ_ET_STENCIL_DIFF(central34n) -BZ_ET_STENCIL_DIFF(central44n) - -BZ_ET_STENCIL_DIFF(backward11) -BZ_ET_STENCIL_DIFF(backward21) -BZ_ET_STENCIL_DIFF(backward31) -BZ_ET_STENCIL_DIFF(backward41) -BZ_ET_STENCIL_DIFF(backward12) -BZ_ET_STENCIL_DIFF(backward22) -BZ_ET_STENCIL_DIFF(backward32) -BZ_ET_STENCIL_DIFF(backward42) -BZ_ET_STENCIL_DIFF(backward11n) -BZ_ET_STENCIL_DIFF(backward21n) -BZ_ET_STENCIL_DIFF(backward31n) -BZ_ET_STENCIL_DIFF(backward41n) -BZ_ET_STENCIL_DIFF(backward12n) -BZ_ET_STENCIL_DIFF(backward22n) -BZ_ET_STENCIL_DIFF(backward32n) -BZ_ET_STENCIL_DIFF(backward42n) - -BZ_ET_STENCIL_DIFF(forward11) -BZ_ET_STENCIL_DIFF(forward21) -BZ_ET_STENCIL_DIFF(forward31) -BZ_ET_STENCIL_DIFF(forward41) -BZ_ET_STENCIL_DIFF(forward12) -BZ_ET_STENCIL_DIFF(forward22) -BZ_ET_STENCIL_DIFF(forward32) -BZ_ET_STENCIL_DIFF(forward42) -BZ_ET_STENCIL_DIFF(forward11n) -BZ_ET_STENCIL_DIFF(forward21n) -BZ_ET_STENCIL_DIFF(forward31n) -BZ_ET_STENCIL_DIFF(forward41n) -BZ_ET_STENCIL_DIFF(forward12n) -BZ_ET_STENCIL_DIFF(forward22n) -BZ_ET_STENCIL_DIFF(forward32n) -BZ_ET_STENCIL_DIFF(forward42n) - - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_STENCIL_ET_H diff --git a/weave/blitz-20001213/blitz/array/stencil.cc b/weave/blitz-20001213/blitz/array/stencil.cc deleted file mode 100644 index 1fc27d54c..000000000 --- a/weave/blitz-20001213/blitz/array/stencil.cc +++ /dev/null @@ -1,583 +0,0 @@ -#ifndef BZ_ARRAYSTENCIL_CC -#define BZ_ARRAYSTENCIL_CC - -#ifndef BZ_ARRAYSTENCIL_H - #error <blitz/array/stencil.cc> must be included via <blitz/array/stencil.h> -#endif - -BZ_NAMESPACE(blitz) - -// NEEDS_WORK: -// o Need to allow scalar arguments as well as arrays -// o Unit stride optimization -// o Tiling -// o Pass coordinate vector to stencil, so that where-like constructs -// can depend on location -// o Maybe allow expression templates to be passed as -// array parameters? - -/* - * There are a lot of kludges in this code to work around the fact that - * you can't have default template parameters with function templates. - * Ideally, one would implement applyStencil(..) as: - * - * template<class T_stencil, class T_numtype1, class T_array2, - * class T_array3, class T_array4, class T_array5, class T_array6, - * class T_array7, class T_array8, class T_array9, class T_array10, - * class T_array11> - * void applyStencil(const T_stencil& stencil, Array<T_numtype1,3>& A, - * T_array2& B = _dummyArray, T_array3& C = _dummyArray, ......) - * - * and allow for up to (say) 11 arrays to be passed. But this doesn't - * appear to be legal C++. Instead, 11 versions of applyStencil are - * provided, each one with a different number of array parameters, - * and these stubs fill in the _dummyArray parameters and invoke - * applyStencil_imp(). - */ - -template<int N_rank, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -void checkShapes(const Array<T_numtype1,N_rank>& A, - const T_array2& B, const T_array3& C, const T_array4& D, - const T_array5& E, const T_array6& F, const T_array7& G, - const T_array8& H, const T_array9& I, const T_array10& J, - const T_array11& K) -{ - BZPRECONDITION(areShapesConformable(A.shape(),B.shape()) - && areShapesConformable(A.shape(),C.shape()) - && areShapesConformable(A.shape(),D.shape()) - && areShapesConformable(A.shape(),E.shape()) - && areShapesConformable(A.shape(),F.shape()) - && areShapesConformable(A.shape(),G.shape()) - && areShapesConformable(A.shape(),H.shape()) - && areShapesConformable(A.shape(),I.shape()) - && areShapesConformable(A.shape(),J.shape()) - && areShapesConformable(A.shape(),K.shape())); -} - -template<class T_extent, int N_rank, - class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -void calcStencilExtent(T_extent& At, const T_stencil& stencil, - const Array<T_numtype1,N_rank>& A, - const T_array2& B, const T_array3& C, const T_array4& D, const T_array5& E, - const T_array6& F, const T_array7& G, const T_array8& H, const T_array9& I, - const T_array10& J, const T_array11& K) -{ - // Interrogate the stencil to find out its extent - _bz_typename stencilExtent_traits<T_array2>::T_stencilExtent Bt; - _bz_typename stencilExtent_traits<T_array3>::T_stencilExtent Ct; - _bz_typename stencilExtent_traits<T_array4>::T_stencilExtent Dt; - _bz_typename stencilExtent_traits<T_array5>::T_stencilExtent Et; - _bz_typename stencilExtent_traits<T_array6>::T_stencilExtent Ft; - _bz_typename stencilExtent_traits<T_array7>::T_stencilExtent Gt; - _bz_typename stencilExtent_traits<T_array8>::T_stencilExtent Ht; - _bz_typename stencilExtent_traits<T_array9>::T_stencilExtent It; - _bz_typename stencilExtent_traits<T_array10>::T_stencilExtent Jt; - _bz_typename stencilExtent_traits<T_array11>::T_stencilExtent Kt; - - stencil.apply(At, Bt, Ct, Dt, Et, Ft, Gt, Ht, It, Jt, Kt); - At.combine(Bt); - At.combine(Ct); - At.combine(Dt); - At.combine(Et); - At.combine(Ft); - At.combine(Gt); - At.combine(Ht); - At.combine(It); - At.combine(Jt); - At.combine(Kt); -} - -template<int N_rank, class T_stencil, class T_numtype1, class T_array2> -RectDomain<N_rank> interiorDomain(const T_stencil& stencil, - const Array<T_numtype1,N_rank>& A, - const T_array2& B) -{ - RectDomain<N_rank> domain = A.domain(); - - // Interrogate the stencil to find out its extent - stencilExtent<3, T_numtype1> At; - calcStencilExtent(At, stencil, A, B, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, _dummyArray, - _dummyArray, _dummyArray); - - // Shrink the domain according to the stencil size - TinyVector<int,N_rank> lbound, ubound; - lbound = domain.lbound() - At.min(); - ubound = domain.ubound() - At.max(); - return RectDomain<N_rank>(lbound,ubound); -} - -template<int hasExtents> -struct _getStencilExtent { -template<int N_rank, - class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -static void getStencilExtent(TinyVector<int,N_rank>& minb, - TinyVector<int,N_rank>& maxb, - const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - // Interrogate the stencil to find out its extent - stencilExtent<N_rank, T_numtype1> At; - calcStencilExtent(At, stencil, A, B, C, D, E, F, G, H, I, J, K); - minb = At.min(); - maxb = At.max(); -} -}; - -template<> -struct _getStencilExtent<1> { -template<int N_rank, - class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -static inline void getStencilExtent(TinyVector<int,N_rank>& minb, - TinyVector<int,N_rank>& maxb, - const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - stencil.getExtent(minb, maxb); -} -}; - -template<int N_rank, - class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -inline void getStencilExtent(TinyVector<int,N_rank>& minb, - TinyVector<int,N_rank>& maxb, - const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - _getStencilExtent<T_stencil::hasExtent>::getStencilExtent( - minb, maxb, stencil, A, B, C, D, E, F, G, H, I, J, K); -} - -/* - * This version applies a stencil to a set of 3D arrays. Up to 11 arrays - * may be used. Any unused arrays are turned into dummyArray objects. - * Operations on dummyArray objects are translated into no-ops. - */ -template<class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -void applyStencil_imp(const T_stencil& stencil, Array<T_numtype1,3>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - checkShapes(A,B,C,D,E,F,G,H,I,J,K); - - // Determine stencil extent - TinyVector<int,3> minb, maxb; - getStencilExtent(minb, maxb, stencil, A, B, C, D, E, F, G, H, I, J, K); - - // Now determine the subdomain over which the stencil - // can be applied without worrying about overrunning the - // boundaries of the array - int stencil_lbound0 = minb(0); - int stencil_lbound1 = minb(1); - int stencil_lbound2 = minb(2); - - int stencil_ubound0 = maxb(0); - int stencil_ubound1 = maxb(1); - int stencil_ubound2 = maxb(2); - - int lbound0 = minmax::max(A.lbound(0), A.lbound(0) - stencil_lbound0); - int lbound1 = minmax::max(A.lbound(1), A.lbound(1) - stencil_lbound1); - int lbound2 = minmax::max(A.lbound(2), A.lbound(2) - stencil_lbound2); - - int ubound0 = minmax::min(A.ubound(0), A.ubound(0) - stencil_ubound0); - int ubound1 = minmax::min(A.ubound(1), A.ubound(1) - stencil_ubound1); - int ubound2 = minmax::min(A.ubound(2), A.ubound(2) - stencil_ubound2); - -#if 0 - cout << "Stencil bounds are:" << endl - << lbound0 << '\t' << ubound0 << endl - << lbound1 << '\t' << ubound1 << endl - << lbound2 << '\t' << ubound2 << endl; -#endif - - // Now do the actual loop - FastArrayIterator<T_numtype1,3> Aiter(A); - _bz_typename T_array2::T_iterator Biter(B); - _bz_typename T_array3::T_iterator Citer(C); - _bz_typename T_array4::T_iterator Diter(D); - _bz_typename T_array5::T_iterator Eiter(E); - _bz_typename T_array6::T_iterator Fiter(F); - _bz_typename T_array7::T_iterator Giter(G); - _bz_typename T_array8::T_iterator Hiter(H); - _bz_typename T_array9::T_iterator Iiter(I); - _bz_typename T_array10::T_iterator Jiter(J); - _bz_typename T_array11::T_iterator Kiter(K); - - // Load the strides for the innermost loop - Aiter.loadStride(2); - Biter.loadStride(2); - Citer.loadStride(2); - Diter.loadStride(2); - Eiter.loadStride(2); - Fiter.loadStride(2); - Giter.loadStride(2); - Hiter.loadStride(2); - Iiter.loadStride(2); - Jiter.loadStride(2); - Kiter.loadStride(2); - - for (int i=lbound0; i <= ubound0; ++i) - { - for (int j=lbound1; j <= ubound1; ++j) - { - Aiter.moveTo(i,j,lbound2); - Biter.moveTo(i,j,lbound2); - Citer.moveTo(i,j,lbound2); - Diter.moveTo(i,j,lbound2); - Eiter.moveTo(i,j,lbound2); - Fiter.moveTo(i,j,lbound2); - Giter.moveTo(i,j,lbound2); - Hiter.moveTo(i,j,lbound2); - Iiter.moveTo(i,j,lbound2); - Jiter.moveTo(i,j,lbound2); - Kiter.moveTo(i,j,lbound2); - - for (int k=lbound2; k <= ubound2; ++k) - { - stencil.apply(Aiter, Biter, Citer, Diter, Eiter, Fiter, Giter, - Hiter, Iiter, Jiter, Kiter); - - Aiter.advance(); - Biter.advance(); - Citer.advance(); - Diter.advance(); - Eiter.advance(); - Fiter.advance(); - Giter.advance(); - Hiter.advance(); - Iiter.advance(); - Jiter.advance(); - Kiter.advance(); - } - } - } -} - -/* - * This version applies a stencil to a set of 2D arrays. Up to 11 arrays - * may be used. Any unused arrays are turned into dummyArray objects. - * Operations on dummyArray objects are translated into no-ops. - */ -template<class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -void applyStencil_imp(const T_stencil& stencil, Array<T_numtype1,2>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - checkShapes(A,B,C,D,E,F,G,H,I,J,K); - - // Determine stencil extent - TinyVector<int,2> minb, maxb; - getStencilExtent(minb, maxb, stencil, A, B, C, D, E, F, G, H, I, J, K); - - // Now determine the subdomain over which the stencil - // can be applied without worrying about overrunning the - // boundaries of the array - int stencil_lbound0 = minb(0); - int stencil_lbound1 = minb(1); - - int stencil_ubound0 = maxb(0); - int stencil_ubound1 = maxb(1); - - int lbound0 = minmax::max(A.lbound(0), A.lbound(0) - stencil_lbound0); - int lbound1 = minmax::max(A.lbound(1), A.lbound(1) - stencil_lbound1); - - int ubound0 = minmax::min(A.ubound(0), A.ubound(0) - stencil_ubound0); - int ubound1 = minmax::min(A.ubound(1), A.ubound(1) - stencil_ubound1); - -#if 0 - cout << "Stencil bounds are:" << endl - << lbound0 << '\t' << ubound0 << endl - << lbound1 << '\t' << ubound1 << endl; -#endif - - // Now do the actual loop - FastArrayIterator<T_numtype1,2> Aiter(A); - _bz_typename T_array2::T_iterator Biter(B); - _bz_typename T_array3::T_iterator Citer(C); - _bz_typename T_array4::T_iterator Diter(D); - _bz_typename T_array5::T_iterator Eiter(E); - _bz_typename T_array6::T_iterator Fiter(F); - _bz_typename T_array7::T_iterator Giter(G); - _bz_typename T_array8::T_iterator Hiter(H); - _bz_typename T_array9::T_iterator Iiter(I); - _bz_typename T_array10::T_iterator Jiter(J); - _bz_typename T_array11::T_iterator Kiter(K); - - // Load the strides for the innermost loop - Aiter.loadStride(1); - Biter.loadStride(1); - Citer.loadStride(1); - Diter.loadStride(1); - Eiter.loadStride(1); - Fiter.loadStride(1); - Giter.loadStride(1); - Hiter.loadStride(1); - Iiter.loadStride(1); - Jiter.loadStride(1); - Kiter.loadStride(1); - - for (int i=lbound0; i <= ubound0; ++i) - { - Aiter.moveTo(i,lbound1); - Biter.moveTo(i,lbound1); - Citer.moveTo(i,lbound1); - Diter.moveTo(i,lbound1); - Eiter.moveTo(i,lbound1); - Fiter.moveTo(i,lbound1); - Giter.moveTo(i,lbound1); - Hiter.moveTo(i,lbound1); - Iiter.moveTo(i,lbound1); - Jiter.moveTo(i,lbound1); - Kiter.moveTo(i,lbound1); - - for (int k=lbound1; k <= ubound1; ++k) - { - stencil.apply(Aiter, Biter, Citer, Diter, Eiter, Fiter, Giter, - Hiter, Iiter, Jiter, Kiter); - - Aiter.advance(); - Biter.advance(); - Citer.advance(); - Diter.advance(); - Eiter.advance(); - Fiter.advance(); - Giter.advance(); - Hiter.advance(); - Iiter.advance(); - Jiter.advance(); - Kiter.advance(); - } - } -} - -/* - * This version applies a stencil to a set of 1D arrays. Up to 11 arrays - * may be used. Any unused arrays are turned into dummyArray objects. - * Operations on dummyArray objects are translated into no-ops. - */ -template<class T_stencil, class T_numtype1, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -void applyStencil_imp(const T_stencil& stencil, Array<T_numtype1,1>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - checkShapes(A,B,C,D,E,F,G,H,I,J,K); - - // Determine stencil extent - TinyVector<int,1> minb, maxb; - getStencilExtent(minb, maxb, stencil, A, B, C, D, E, F, G, H, I, J, K); - - // Now determine the subdomain over which the stencil - // can be applied without worrying about overrunning the - // boundaries of the array - int stencil_lbound0 = minb(0); - int stencil_ubound0 = maxb(0); - - int lbound0 = minmax::max(A.lbound(0), A.lbound(0) - stencil_lbound0); - int ubound0 = minmax::min(A.ubound(0), A.ubound(0) - stencil_ubound0); - -#if 0 - cout << "Stencil bounds are:" << endl - << lbound0 << '\t' << ubound0 << endl; -#endif - - // Now do the actual loop - FastArrayIterator<T_numtype1,1> Aiter(A); - _bz_typename T_array2::T_iterator Biter(B); - _bz_typename T_array3::T_iterator Citer(C); - _bz_typename T_array4::T_iterator Diter(D); - _bz_typename T_array5::T_iterator Eiter(E); - _bz_typename T_array6::T_iterator Fiter(F); - _bz_typename T_array7::T_iterator Giter(G); - _bz_typename T_array8::T_iterator Hiter(H); - _bz_typename T_array9::T_iterator Iiter(I); - _bz_typename T_array10::T_iterator Jiter(J); - _bz_typename T_array11::T_iterator Kiter(K); - - // Load the strides for the innermost loop - Aiter.loadStride(0); - Biter.loadStride(0); - Citer.loadStride(0); - Diter.loadStride(0); - Eiter.loadStride(0); - Fiter.loadStride(0); - Giter.loadStride(0); - Hiter.loadStride(0); - Iiter.loadStride(0); - Jiter.loadStride(0); - Kiter.loadStride(0); - - Aiter.moveTo(lbound0); - Biter.moveTo(lbound0); - Citer.moveTo(lbound0); - Diter.moveTo(lbound0); - Eiter.moveTo(lbound0); - Fiter.moveTo(lbound0); - Giter.moveTo(lbound0); - Hiter.moveTo(lbound0); - Iiter.moveTo(lbound0); - Jiter.moveTo(lbound0); - Kiter.moveTo(lbound0); - - for (int i=lbound0; i <= ubound0; ++i) - { - stencil.apply(Aiter, Biter, Citer, Diter, Eiter, Fiter, Giter, - Hiter, Iiter, Jiter, Kiter); - - Aiter.advance(); - Biter.advance(); - Citer.advance(); - Diter.advance(); - Eiter.advance(); - Fiter.advance(); - Giter.advance(); - Hiter.advance(); - Iiter.advance(); - Jiter.advance(); - Kiter.advance(); - } -} - -/* - * These 11 versions of applyStencil handle from 1 to 11 array parameters. - * They pad their argument list with enough dummyArray objects to call - * applyStencil_imp with 11 array parameters. - */ -template<class T_stencil, class T_numtype1, int N_rank> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A) -{ - applyStencil_imp(stencil, A, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B) -{ - applyStencil_imp(stencil, A, B, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C) -{ - applyStencil_imp(stencil, A, B, C, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, _dummyArray, - _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D) -{ - applyStencil_imp(stencil, A, B, C, D, _dummyArray, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E) -{ - applyStencil_imp(stencil, A, B, C, D, E, _dummyArray, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, - _dummyArray, _dummyArray, _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, G, - _dummyArray, _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, G, H, - _dummyArray, _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, G, H, I, - _dummyArray, _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, G, H, I, J, - _dummyArray); -} - -template<class T_stencil, class T_numtype1, int N_rank, class T_array2, - class T_array3, class T_array4, class T_array5, class T_array6, - class T_array7, class T_array8, class T_array9, class T_array10, - class T_array11> -inline void applyStencil(const T_stencil& stencil, Array<T_numtype1,N_rank>& A, - T_array2& B, T_array3& C, T_array4& D, T_array5& E, T_array6& F, - T_array7& G, T_array8& H, T_array9& I, T_array10& J, T_array11& K) -{ - applyStencil_imp(stencil, A, B, C, D, E, F, G, H, I, J, K); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYSTENCIL_CC diff --git a/weave/blitz-20001213/blitz/array/stencil.h b/weave/blitz-20001213/blitz/array/stencil.h deleted file mode 100644 index ab0634539..000000000 --- a/weave/blitz-20001213/blitz/array/stencil.h +++ /dev/null @@ -1,318 +0,0 @@ -#ifndef BZ_ARRAYSTENCIL_H -#define BZ_ARRAYSTENCIL_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/stencil.h> must be included via <blitz/array.h> -#endif - -#include <blitz/array/stencilops.h> - -BZ_NAMESPACE(blitz) - -// NEEDS_WORK: currently stencilExtent returns int(1). What if the -// stencil contains calls to math functions, or divisions, etc.? -// Should at least return a number of the appropriate type. Probably -// return a sequence of quasi-random floating point numbers. - -/* - * These macros make it easier for users to declare stencil objects. - * The syntax is: - * - * BZ_DECLARE_STENCILN(stencilname, Array1, Array2, ..., ArrayN) - * // stencil operations go here - * BZ_END_STENCIL - */ - -#define BZ_DECLARE_STENCIL2(name,A,B) \ - struct name { \ - template<class T1, class T2, class T3, class T4, class T5, class T6, \ - class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3, T4, T5, T6, T7, T8, T9, T10, T11) \ - { - -#define BZ_END_STENCIL_WITH_SHAPE(MINS,MAXS) } \ - template<int N> \ - void getExtent(TinyVector<int,N>& minb, TinyVector<int,N>& maxb) const \ - { \ - minb = MINS; \ - maxb = MAXS; \ - } \ - enum { hasExtent = 1 }; \ -}; - -#define BZ_END_STENCIL } enum { hasExtent = 0 }; }; -#define BZ_STENCIL_END BZ_END_STENCIL - -#define BZ_DECLARE_STENCIL3(name,A,B,C) \ - struct name { \ - template<class T1, class T2, class T3, class T4, class T5, class T6, \ - class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4, T5, T6, T7, T8, T9, \ - T10, T11) \ - { - -#define BZ_DECLARE_STENCIL4(name,A,B,C,D) \ - struct name { \ - template<class T1, class T2, class T3, class T4, class T5, class T6, \ - class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5, T6, T7, \ - T8, T9, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL5(name,A,B,C,D,E) \ - struct name { \ - template<class T1, class T2, class T3, class T4, class T5, class T6, \ - class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6, T7, T8, \ - T9, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL6(name,A,B,C,D,E,F) \ - struct name { \ - template<class T1, class T2, class T3, class T4, class T5, class T6, \ - class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, \ - T7, T8, T9, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL7(name,A,B,C,D,E,F,G) \ - struct name { \ - template<class T1, class T2, class T3, class T4, \ - class T5, class T6, class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, T7& G, \ - T8, T9, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL8(name,A,B,C,D,E,F,G,H) \ - struct name { \ - template<class T1, class T2, class T3, class T4, \ - class T5, class T6, class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, T7& G, \ - T8& H, T9, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL9(name,A,B,C,D,E,F,G,H,I) \ - struct name { \ - template<class T1, class T2, class T3, class T4, \ - class T5, class T6, class T7, class T8, class T9, class T10, \ - class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, T7& G, \ - T8& H, T9& I, T10, T11) \ - { - -#define BZ_DECLARE_STENCIL10(name,A,B,C,D,E,F,G,H,I,J) \ - struct name { \ - template<class T1, class T2, class T3, class T4, \ - class T5, class T6, class T7, class T8, class T9, class T10, class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, T7& G, \ - T8& H, T9& I, T10& J, T11) \ - { - -#define BZ_DECLARE_STENCIL11(name,A,B,C,D,E,F,G,H,I,J,K) \ - struct name { \ - template<class T1, class T2, class T3, class T4, \ - class T5, class T6, class T7, class T8, class T9, class T10, \ - class T11> \ - static inline void apply(T1& A, T2& B, T3& C, T4& D, T5& E, T6& F, T7& G, \ - T8& H, T9& I, T10& J, T11& K) \ - { - - - -/* - * dummyArray is used to provide "dummy" padding parameters to applyStencil(), - * so that any number of arrays (up to 11) can be given as arguments. - */ - -template<class T> class dummy; - -struct dummyArray { - typedef dummy<double> T_iterator; - - const dummyArray& shape() const { return *this; } -}; - -_bz_global dummyArray _dummyArray; - -/* - * This dummy class pretends to be a scalar of type T, or an array iterator - * of type T, but really does nothing. - */ -template<class T> -class dummy { -public: - dummy() { } - - dummy(T value) - : value_(value) - { } - - dummy(const dummyArray&) - { } - - operator T() const { return value_; }; - - template<class T2> - void operator=(T2) { } - - _bz_typename multicomponent_traits<T>::T_element operator[](int i) const - { return value_[i]; } - - void loadStride(int) { } - void moveTo(int) { } - void moveTo(int,int) { } - void moveTo(int,int,int) { } - void moveTo(int,int,int,int) { } - void advance() { } - T shift(int,int) { return T(); } - -private: - T value_; -}; - - -/* - * The stencilExtent object is passed to stencil objects to find out - * the spatial extent of the stencil. It pretends it's an array, - * but really it's just recording the locations of the array reads - * via operator(). - */ - -template<int N_rank, class P_numtype> -class stencilExtent { -public: - typedef P_numtype T_numtype; - - stencilExtent() - { - min_ = 0; - max_ = 0; - } - - dummy<T_numtype> operator()(int i) - { - update(0, i); - return dummy<T_numtype>(1); - } - - dummy<T_numtype> operator()(int i, int j) - { - update(0, i); - update(1, j); - return dummy<T_numtype>(1); - } - - dummy<T_numtype> operator()(int i, int j, int k) - { - update(0, i); - update(1, j); - update(2, k); - return dummy<T_numtype>(1); - } - - dummy<T_numtype> shift(int offset, int dim) - { - update(dim, offset); - return dummy<T_numtype>(1); - } - - dummy<T_numtype> shift(int offset1, int dim1, int offset2, int dim2) - { - update(dim1, offset1); - update(dim2, offset2); - return dummy<T_numtype>(1); - } - - dummy<_bz_typename multicomponent_traits<T_numtype>::T_element> - operator[](int) - { - return dummy<_bz_typename multicomponent_traits<T_numtype>::T_element> - (1); - } - - void update(int rank, int offset) - { - if (offset < min_[rank]) - min_[rank] = offset; - if (offset > max_[rank]) - max_[rank] = offset; - } - - template<class T_numtype2> - void combine(const stencilExtent<N_rank,T_numtype2>& x) - { - for (int i=0; i < N_rank; ++i) - { - min_[i] = minmax::min(min_[i], x.min(i)); - max_[i] = minmax::max(max_[i], x.max(i)); - } - } - - template<class T_numtype2> - void combine(const dummy<T_numtype2>&) - { } - - int min(int i) const - { return min_[i]; } - - int max(int i) const - { return max_[i]; } - - const TinyVector<int,N_rank>& min() const - { return min_; } - - const TinyVector<int,N_rank>& max() const - { return max_; } - - template<class T> - void operator=(T) - { } - - // NEEDS_WORK: other operators - template<class T> void operator+=(T) { } - template<class T> void operator-=(T) { } - template<class T> void operator*=(T) { } - template<class T> void operator/=(T) { } - - operator T_numtype() - { return T_numtype(1); } - - T_numtype operator*() - { return T_numtype(1); } - -private: - _bz_mutable TinyVector<int,N_rank> min_, max_; -}; - - -/* - * stencilExtent_traits gives a stencilExtent<N,T> object for arrays, - * and a dummy object for dummy arrays. - */ -template<class T> -struct stencilExtent_traits { - typedef dummy<double> T_stencilExtent; -}; - -template<class T_numtype, int N_rank> -struct stencilExtent_traits<Array<T_numtype,N_rank> > { - typedef stencilExtent<N_rank,T_numtype> T_stencilExtent; -}; - -/* - * Specialization of areShapesConformable(), originally - * defined in <blitz/shapecheck.h> - */ - -template<class T_shape1> -inline _bz_bool areShapesConformable(const T_shape1&, const dummyArray&) -{ - return _bz_true; -} - -BZ_NAMESPACE_END - -#include <blitz/array/stencil.cc> - -#endif // BZ_ARRAYSTENCIL_H - diff --git a/weave/blitz-20001213/blitz/array/stencilops.h b/weave/blitz-20001213/blitz/array/stencilops.h deleted file mode 100644 index 656567c98..000000000 --- a/weave/blitz-20001213/blitz/array/stencilops.h +++ /dev/null @@ -1,1147 +0,0 @@ -#ifndef BZ_ARRAYSTENCILOPS_H -#define BZ_ARRAYSTENCILOPS_H - -// NEEDS_WORK: need to factor many of the stencils in terms of the -// integer constants, e.g. 16*(A(-1,0)+A(0,-1)+A(0,1)+A(1,0)) - -#ifndef BZ_ARRAYSTENCIL_H - #error <blitz/array/stencilops.h> must be included via <blitz/array/stencil.h> -#endif - -#ifndef BZ_GEOMETRY_H - #include <blitz/array/geometry.h> -#endif - -#ifndef BZ_TINYMAT_H - #include <blitz/tinymat.h> -#endif - -BZ_NAMESPACE(blitz) - -#define BZ_DECLARE_STENCIL_OPERATOR1(name,A) \ - template<class T> \ - inline _bz_typename T::T_numtype name(T& A) \ - { - -#define BZ_END_STENCIL_OPERATOR } - -#define BZ_DECLARE_STENCIL_OPERATOR2(name,A,B) \ - template<class T> \ - inline _bz_typename T::T_numtype name(T& A, T& B) \ - { - -#define BZ_DECLARE_STENCIL_OPERATOR3(name,A,B,C) \ - template<class T> \ - inline _bz_typename T::T_numtype name(T& A, T& B, T& C) \ - { - -// These constants are accurate to 45 decimal places = 149 bits of mantissa -const double recip_2 = .500000000000000000000000000000000000000000000; -const double recip_4 = .250000000000000000000000000000000000000000000; -const double recip_6 = .166666666666666666666666666666666666666666667; -const double recip_8 = .125000000000000000000000000000000000000000000; -const double recip_12 = .0833333333333333333333333333333333333333333333; -const double recip_144 = .00694444444444444444444444444444444444444444444; - -/**************************************************************************** - * Laplacian Operators - ****************************************************************************/ - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian2D, A) - return -4.0 * A + A.shift(-1,0) + A.shift(1,0) + A.shift(-1,1) - + A.shift(1,1); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian3D, A) - return -6.0 * A - + A.shift(-1,0) + A.shift(1,0) - + A.shift(-1,1) + A.shift(1,1) - + A.shift(-1,2) + A.shift(1,2); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian2D4, A) - return -60. * A - + 16.*(A.shift(-1,0) + A.shift(1,0) + A.shift(-1,1) + A.shift(1,1)) - - (A.shift(-2,0) + A.shift(2,0) + A.shift(-2,1) + A.shift(2,1)); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian2D4n, A) - return Laplacian2D4(A) * recip_12; -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian3D4, A) - return -90. * A - + 16.*(A.shift(-1,0) + A.shift(1,0) + A.shift(-1,1) + A.shift(1,1) - + A.shift(-1,2) + A.shift(1,2)) - - (A.shift(-2,0) + A.shift(2,0) + A.shift(-2,1) + A.shift(2,1) - + A.shift(-2,2) + A.shift(2,2)); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR1(Laplacian3D4n, A) - return Laplacian3D4(A) * recip_12; -BZ_END_STENCIL_OPERATOR - -/**************************************************************************** - * Derivatives - ****************************************************************************/ - -#define BZ_DECLARE_DIFF(name) \ - template<class T> \ - inline _bz_typename T::T_numtype name(T& A, int dim = firstDim) - -#define BZ_DECLARE_MULTIDIFF(name) \ - template<class T> \ - inline _bz_typename multicomponent_traits<_bz_typename \ - T::T_numtype>::T_element name(T& A, int comp, int dim) - -/**************************************************************************** - * Central differences with accuracy O(h^2) - ****************************************************************************/ - -BZ_DECLARE_DIFF(central12) { - return A.shift(1,dim) - A.shift(-1,dim); -} - -BZ_DECLARE_DIFF(central22) { - return A.shift(-1,dim) - 2. * A + A.shift(+1,dim); -} - -BZ_DECLARE_DIFF(central32) { - return -A.shift(-2,dim) + 2.*(A.shift(-1,dim) - A.shift(+1,dim)) - + A.shift(+2,dim); -} - -BZ_DECLARE_DIFF(central42) { - return A.shift(-2,dim) + A.shift(2,dim) -4.*(A.shift(-1,dim)+A.shift(+1,dim)) - +6.*A.shift(0,dim); -} - -/**************************************************************************** - * Central differences with accuracy O(h^2) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(central12) { - return A.shift(1,dim)[comp] - A.shift(-1,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central22) { - return A.shift(-1,dim)[comp] - 2. * (*A)[comp] + A.shift(+1,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central32) { - return -A.shift(-2,dim)[comp] + 2.*A.shift(-1,dim)[comp] - -2.*A.shift(+1,dim)[comp] + A.shift(+2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central42) { - return A.shift(-2,dim)[comp] -4.*A.shift(-1,dim)[comp] - +6.*A.shift(0,dim)[comp] -4.*A.shift(1,dim)[comp] +A.shift(2,dim)[comp]; -} - -/**************************************************************************** - * Central differences with accuracy O(h^2) (normalized versions) - ****************************************************************************/ - -BZ_DECLARE_DIFF(central12n) { - return central12(A,dim) * recip_2; -} - -BZ_DECLARE_DIFF(central22n) { - return central22(A,dim); -} - -BZ_DECLARE_DIFF(central32n) { - return central32(A,dim) * recip_2; -} - -BZ_DECLARE_DIFF(central42n) { - return central42(A,dim); -} - -/**************************************************************************** - * Central differences with accuracy O(h^2) (normalized multicomponent) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(central12n) { - return central12(A,comp,dim) * recip_2; -} - -BZ_DECLARE_MULTIDIFF(central22n) { - return central22(A,comp,dim); -} - -BZ_DECLARE_MULTIDIFF(central32n) { - return central32(A,comp,dim) * recip_2; -} - -BZ_DECLARE_MULTIDIFF(central42n) { - return central42(A,comp,dim); -} - -/**************************************************************************** - * Central differences with accuracy O(h^4) - ****************************************************************************/ - -BZ_DECLARE_DIFF(central14) { - return (A.shift(-2,dim) - A.shift(2,dim)) - + 8.*(A.shift(1,dim)-A.shift(-1,dim)); -} - -BZ_DECLARE_DIFF(central24) { - return -30.*A + 16.*(A.shift(-1,dim)+A.shift(1,dim)) - - (A.shift(-2,dim)+A.shift(2,dim)); -} - -BZ_DECLARE_DIFF(central34) { - return A.shift(-3,dim) - 8.*A.shift(-2,dim) +13.*A.shift(-1,dim) - -13.*A.shift(1,dim)+8.*A.shift(2,dim)-A.shift(3,dim); -} - -BZ_DECLARE_DIFF(central44) { - return -1.*A.shift(-3,dim)+12.*A.shift(-2,dim)-39.*A.shift(-1,dim) - +56.*A-39.*A.shift(1,dim)+12.*A.shift(2,dim)-A.shift(3,dim); -} - -/**************************************************************************** - * Central differences with accuracy O(h^4) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(central14) { - return A.shift(-2,dim)[comp] - 8. * A.shift(-1,dim)[comp] - + 8. * A.shift(1,dim)[comp] - A.shift(2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central24) { - return - A.shift(-2,dim)[comp] + 16.*A.shift(-1,dim)[comp] - 30.*(*A)[comp] - + 16.*A.shift(1,dim)[comp] - A.shift(2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central34) { - return A.shift(-3,dim)[comp] - 8.*A.shift(-2,dim)[comp] - +13.*A.shift(-1,dim)[comp] - 13.*A.shift(1,dim)[comp] - + 8.*A.shift(2,dim)[comp] - A.shift(3,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(central44) { - return -1.*A.shift(-3,dim)[comp]+12.*A.shift(-2,dim)[comp] - -39.*A.shift(-1,dim)[comp] +56.*(*A)[comp]-39.*A.shift(1,dim)[comp] - +12.*A.shift(2,dim)[comp]-A.shift(3,dim)[comp]; -} - -/**************************************************************************** - * Central differences with accuracy O(h^4) (normalized) - ****************************************************************************/ - -BZ_DECLARE_DIFF(central14n) { - return central14(A,dim) * recip_12; -} - -BZ_DECLARE_DIFF(central24n) { - return central24(A,dim) * recip_12; -} - -BZ_DECLARE_DIFF(central34n) { - return central34(A,dim) * recip_8; -} - -BZ_DECLARE_DIFF(central44n) { - return central44(A,dim) * recip_6; -} - -/**************************************************************************** - * Central differences with accuracy O(h^4) (normalized, multicomponent) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(central14n) { - return central14(A,comp,dim) * recip_12; -} - -BZ_DECLARE_MULTIDIFF(central24n) { - return central24(A,comp,dim) * recip_12; -} - -BZ_DECLARE_MULTIDIFF(central34n) { - return central34(A,comp,dim) * recip_8; -} - -BZ_DECLARE_MULTIDIFF(central44n) { - return central44(A,comp,dim) * recip_6; -} - -/**************************************************************************** - * Backward differences with accuracy O(h) - ****************************************************************************/ - -BZ_DECLARE_DIFF(backward11) { - return A - A.shift(-1,dim); -} - -BZ_DECLARE_DIFF(backward21) { - return A -2.*A.shift(-1,dim) + A.shift(-2,dim); -} - -BZ_DECLARE_DIFF(backward31) { - return A -3.*A.shift(-1,dim) + 3.*A.shift(-2,dim)-A.shift(-3,dim); -} - -BZ_DECLARE_DIFF(backward41) { - return A - 4.*A.shift(-1,dim) + 6.*A.shift(-2,dim) -4.*A.shift(-3,dim) - + A.shift(-4,dim); -} - -/**************************************************************************** - * Backward differences with accuracy O(h) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(backward11) { - return (*A)[comp] - A.shift(-1,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward21) { - return (*A)[comp] -2.*A.shift(-1,dim)[comp] + A.shift(-2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward31) { - return (*A)[comp] -3.*A.shift(-1,dim)[comp] + 3.*A.shift(-2,dim)[comp] - -A.shift(-3,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward41) { - return (*A)[comp] - 4.*A.shift(-1,dim)[comp] + 6.*A.shift(-2,dim)[comp] - -4.*A.shift(-3,dim)[comp] + A.shift(-4,dim)[comp]; -} - -/**************************************************************************** - * Backward differences with accuracy O(h) (normalized) - ****************************************************************************/ - -BZ_DECLARE_DIFF(backward11n) { return backward11(A,dim); } -BZ_DECLARE_DIFF(backward21n) { return backward21(A,dim); } -BZ_DECLARE_DIFF(backward31n) { return backward31(A,dim); } -BZ_DECLARE_DIFF(backward41n) { return backward41(A,dim); } - -/**************************************************************************** - * Backward differences with accuracy O(h) (normalized, multicomponent) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(backward11n) { return backward11(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(backward21n) { return backward21(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(backward31n) { return backward31(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(backward41n) { return backward41(A,comp,dim); } - -/**************************************************************************** - * Backward differences with accuracy O(h^2) - ****************************************************************************/ - -BZ_DECLARE_DIFF(backward12) { - return 3.*A -4.*A.shift(-1,dim) + A.shift(-2,dim); -} - -BZ_DECLARE_DIFF(backward22) { - return 2.*A -5.*A.shift(-1,dim) + 4.*A.shift(-2,dim) -A.shift(-3,dim); -} - -BZ_DECLARE_DIFF(backward32) { - return 5.*A - 18.*A.shift(-1,dim) + 24.*A.shift(-2,dim) -14.*A.shift(-3,dim) - + 3.*A.shift(-4,dim); -} - -BZ_DECLARE_DIFF(backward42) { - return 3.*A -14.*A.shift(-1,dim) + 26.*A.shift(-2,dim) -24.*A.shift(-3,dim) - + 11.*A.shift(-4,dim) -2.*A.shift(-5,dim); -} - -/**************************************************************************** - * Backward differences with accuracy O(h^2) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(backward12) { - return 3.*(*A)[comp] -4.*A.shift(-1,dim)[comp] + A.shift(-2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward22) { - return 2.*(*A)[comp] -5.*A.shift(-1,dim)[comp] + 4.*A.shift(-2,dim)[comp] - -A.shift(-3,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward32) { - return 5.*(*A)[comp] - 18.*A.shift(-1,dim)[comp] + 24.*A.shift(-2,dim)[comp] - -14.*A.shift(-3,dim)[comp] + 3.*A.shift(-4,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(backward42) { - return 3.*(*A)[comp] -14.*A.shift(-1,dim)[comp] + 26.*A.shift(-2,dim)[comp] - -24.*A.shift(-3,dim)[comp] + 11.*A.shift(-4,dim)[comp] - -2.*A.shift(-5,dim)[comp]; -} - -/**************************************************************************** - * Backward differences with accuracy O(h^2) (normalized) - ****************************************************************************/ - -BZ_DECLARE_DIFF(backward12n) { return backward12(A,dim) * recip_2; } -BZ_DECLARE_DIFF(backward22n) { return backward22(A,dim); } -BZ_DECLARE_DIFF(backward32n) { return backward32(A,dim) * recip_2; } -BZ_DECLARE_DIFF(backward42n) { return backward42(A,dim); } - -/**************************************************************************** - * Backward differences with accuracy O(h^2) (normalized, multicomponent) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(backward12n) { return backward12(A,comp,dim) * recip_2; } -BZ_DECLARE_MULTIDIFF(backward22n) { return backward22(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(backward32n) { return backward32(A,comp,dim) * recip_2; } -BZ_DECLARE_MULTIDIFF(backward42n) { return backward42(A,comp,dim); } - -/**************************************************************************** - * Forward differences with accuracy O(h) - ****************************************************************************/ - -BZ_DECLARE_DIFF(forward11) { - return A.shift(1,dim) - A; -} - -BZ_DECLARE_DIFF(forward21) { - return A - 2.*A.shift(1,dim) + A.shift(2,dim); -} - -BZ_DECLARE_DIFF(forward31) { - return -A + 3.*A.shift(1,dim) -3.*A.shift(2,dim) + A.shift(3,dim); -} - -BZ_DECLARE_DIFF(forward41) { - return A -4.*A.shift(1,dim) + 6.*A.shift(2,dim) -4.*A.shift(3,dim) - + A.shift(4,dim); -} - -/**************************************************************************** - * Forward differences with accuracy O(h) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(forward11) { - return -(*A)[comp]+A.shift(1,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward21) { - return (*A)[comp] - 2.*A.shift(1,dim)[comp] + A.shift(2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward31) { - return -(*A)[comp] + 3.*A.shift(1,dim)[comp] -3.*A.shift(2,dim)[comp] - + A.shift(3,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward41) { - return (*A)[comp] -4.*A.shift(1,dim)[comp] + 6.*A.shift(2,dim)[comp] - -4.*A.shift(3,dim)[comp] + A.shift(4,dim)[comp]; -} - -/**************************************************************************** - * Forward differences with accuracy O(h) (normalized) - ****************************************************************************/ - -BZ_DECLARE_DIFF(forward11n) { return forward11(A,dim); } -BZ_DECLARE_DIFF(forward21n) { return forward21(A,dim); } -BZ_DECLARE_DIFF(forward31n) { return forward31(A,dim); } -BZ_DECLARE_DIFF(forward41n) { return forward41(A,dim); } - -/**************************************************************************** - * Forward differences with accuracy O(h) (multicomponent,normalized) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(forward11n) { return forward11(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(forward21n) { return forward21(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(forward31n) { return forward31(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(forward41n) { return forward41(A,comp,dim); } - -/**************************************************************************** - * Forward differences with accuracy O(h^2) - ****************************************************************************/ - -BZ_DECLARE_DIFF(forward12) { - return -3.*A + 4.*A.shift(1,dim) - A.shift(2,dim); -} - -BZ_DECLARE_DIFF(forward22) { - return 2.*A -5.*A.shift(1,dim) + 4.*A.shift(2,dim) -A.shift(3,dim); -} - -BZ_DECLARE_DIFF(forward32) { - return -5.*A + 18.*A.shift(1,dim) -24.*A.shift(2,dim) - + 14.*A.shift(3,dim) -3.*A.shift(4,dim); -} - -BZ_DECLARE_DIFF(forward42) { - return 3.*A -14.*A.shift(1,dim) + 26.*A.shift(2,dim) -24.*A.shift(3,dim) - +11.*A.shift(4,dim) -2.*A.shift(5,dim); -} - -/**************************************************************************** - * Forward differences with accuracy O(h^2) (multicomponent versions) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(forward12) { - return -3.*(*A)[comp] + 4.*A.shift(1,dim)[comp] - A.shift(2,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward22) { - return 2.*(*A)[comp] -5.*A.shift(1,dim)[comp] + 4.*A.shift(2,dim)[comp] - -A.shift(3,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward32) { - return -5.*(*A)[comp] + 18.*A.shift(1,dim)[comp] -24.*A.shift(2,dim)[comp] - + 14.*A.shift(3,dim)[comp] -3.*A.shift(4,dim)[comp]; -} - -BZ_DECLARE_MULTIDIFF(forward42) { - return 3.*(*A)[comp] -14.*A.shift(1,dim)[comp] + 26.*A.shift(2,dim)[comp] - -24.*A.shift(3,dim)[comp] +11.*A.shift(4,dim)[comp] - + 11.*A.shift(5,dim)[comp]; -} - - -/**************************************************************************** - * Forward differences with accuracy O(h^2) (normalized) - ****************************************************************************/ - -BZ_DECLARE_DIFF(forward12n) { return forward12(A,dim) * recip_2; } -BZ_DECLARE_DIFF(forward22n) { return forward22(A,dim); } -BZ_DECLARE_DIFF(forward32n) { return forward32(A,dim) * recip_2; } -BZ_DECLARE_DIFF(forward42n) { return forward42(A,dim); } - -/**************************************************************************** - * Forward differences with accuracy O(h^2) (normalized) - ****************************************************************************/ - -BZ_DECLARE_MULTIDIFF(forward12n) { return forward12(A,comp,dim) * recip_2; } -BZ_DECLARE_MULTIDIFF(forward22n) { return forward22(A,comp,dim); } -BZ_DECLARE_MULTIDIFF(forward32n) { return forward32(A,comp,dim) * recip_2; } -BZ_DECLARE_MULTIDIFF(forward42n) { return forward42(A,comp,dim); } - -/**************************************************************************** - * Gradient operators - ****************************************************************************/ - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> grad2D(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central12(A,firstDim), - central12(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> grad2D4(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central14(A,firstDim), - central14(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> grad3D(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central12(A,firstDim), - central12(A,secondDim), - central12(A,thirdDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> grad3D4(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central14(A,firstDim), - central14(A,secondDim), - central14(A,thirdDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> grad2Dn(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central12n(A,firstDim), - central12n(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> grad2D4n(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central14n(A,firstDim), - central14n(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> grad3Dn(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central12n(A,firstDim), - central12n(A,secondDim), - central12n(A,thirdDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> grad3D4n(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central14n(A,firstDim), - central14n(A,secondDim), - central14n(A,thirdDim)); -} - -/**************************************************************************** - * Grad-squared operators - ****************************************************************************/ - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> gradSqr2D(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central22(A,firstDim), - central22(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> gradSqr2D4(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central24(A,firstDim), - central24(A,secondDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> gradSqr3D(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central22(A,firstDim), - central22(A,secondDim), - central22(A,thirdDim)); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> gradSqr3D4(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central24(A,firstDim), - central24(A,secondDim), - central24(A,thirdDim)); -} - -/**************************************************************************** - * Grad-squared operators (normalized) - ****************************************************************************/ - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> gradSqr2Dn(T& A) { - return gradSqr2D(A); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,2> gradSqr2D4n(T& A) { - return TinyVector<_bz_typename T::T_numtype,2>( - central24(A,firstDim) * recip_12, - central24(A,secondDim) * recip_12); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> gradSqr3Dn(T& A) { - return gradSqr3D(A); -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> gradSqr3D4n(T& A) { - return TinyVector<_bz_typename T::T_numtype,3>( - central24(A,firstDim) * recip_12, - central24(A,secondDim) * recip_12, - central24(A,thirdDim) * recip_12); -} - -/**************************************************************************** - * Gradient operators on a vector field - ****************************************************************************/ - -template<class T> -inline TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> -Jacobian3D(T& A) -{ - const int x=0, y=1, z=2; - const int u=0, v=1, w=2; - - TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> grad; - - grad(u,x) = central12(A,u,x); - grad(u,y) = central12(A,u,y); - grad(u,z) = central12(A,u,z); - grad(v,x) = central12(A,v,x); - grad(v,y) = central12(A,v,y); - grad(v,z) = central12(A,v,z); - grad(w,x) = central12(A,w,x); - grad(w,y) = central12(A,w,y); - grad(w,z) = central12(A,w,z); - - return grad; -} - -template<class T> -inline TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> -Jacobian3Dn(T& A) -{ - const int x=0, y=1, z=2; - const int u=0, v=1, w=2; - - TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> grad; - - grad(u,x) = central12n(A,u,x); - grad(u,y) = central12n(A,u,y); - grad(u,z) = central12n(A,u,z); - grad(v,x) = central12n(A,v,x); - grad(v,y) = central12n(A,v,y); - grad(v,z) = central12n(A,v,z); - grad(w,x) = central12n(A,w,x); - grad(w,y) = central12n(A,w,y); - grad(w,z) = central12n(A,w,z); - - return grad; -} - -template<class T> -inline TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> -Jacobian3D4(T& A) -{ - const int x=0, y=1, z=2; - const int u=0, v=1, w=2; - - TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> grad; - - grad(u,x) = central14(A,u,x); - grad(u,y) = central14(A,u,y); - grad(u,z) = central14(A,u,z); - grad(v,x) = central14(A,v,x); - grad(v,y) = central14(A,v,y); - grad(v,z) = central14(A,v,z); - grad(w,x) = central14(A,w,x); - grad(w,y) = central14(A,w,y); - grad(w,z) = central14(A,w,z); - - return grad; -} - -template<class T> -inline TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> -Jacobian3D4n(T& A) -{ - const int x=0, y=1, z=2; - const int u=0, v=1, w=2; - - TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> grad; - - grad(u,x) = central14n(A,u,x); - grad(u,y) = central14n(A,u,y); - grad(u,z) = central14n(A,u,z); - grad(v,x) = central14n(A,v,x); - grad(v,y) = central14n(A,v,y); - grad(v,z) = central14n(A,v,z); - grad(w,x) = central14n(A,w,x); - grad(w,y) = central14n(A,w,y); - grad(w,z) = central14n(A,w,z); - - return grad; -} - -/**************************************************************************** - * Curl operators - ****************************************************************************/ - -// O(h^2) curl, using central difference - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> -curl(T& vx, T& vy, T& vz) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return TinyVector<_bz_typename T::T_numtype,3>( - central12(vz,y)-central12(vy,z), - central12(vx,z)-central12(vz,x), - central12(vy,x)-central12(vx,y)); -} - -// Normalized O(h^2) curl, using central difference -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> -curln(T& vx, T& vy, T& vz) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return TinyVector<_bz_typename T::T_numtype,3>( - (central12(vz,y)-central12(vy,z)) * recip_2, - (central12(vx,z)-central12(vz,x)) * recip_2, - (central12(vy,x)-central12(vx,y)) * recip_2); -} - -// Multicomponent curl -template<class T> -inline _bz_typename T::T_numtype curl(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return T::T_numtype( - central12(A,z,y)-central12(A,y,z), - central12(A,x,z)-central12(A,z,x), - central12(A,y,x)-central12(A,x,y)); -} - -// Normalized multicomponent curl -template<class T> -inline _bz_typename T::T_numtype curln(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return T::T_numtype( - (central12(A,z,y)-central12(A,y,z)) * recip_2, - (central12(A,x,z)-central12(A,z,x)) * recip_2, - (central12(A,y,x)-central12(A,x,y)) * recip_2); -} - -// O(h^4) curl, using 4th order central difference -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> -curl4(T& vx, T& vy, T& vz) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return TinyVector<_bz_typename T::T_numtype,3>( - central14(vz,y)-central14(vy,z), - central14(vx,z)-central14(vz,x), - central14(vy,x)-central14(vx,y)); -} - -// O(h^4) curl, using 4th order central difference (multicomponent version) -template<class T> -inline _bz_typename T::T_numtype -curl4(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return T::T_numtype( - central14(A,z,y)-central14(A,y,z), - central14(A,x,z)-central14(A,z,x), - central14(A,y,x)-central14(A,x,y)); -} - -// Normalized O(h^4) curl, using 4th order central difference -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> -curl4n(T& vx, T& vy, T& vz) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return TinyVector<_bz_typename T::T_numtype,3>( - (central14(vz,y)-central14(vy,z)) * recip_2, - (central14(vx,z)-central14(vz,x)) * recip_2, - (central14(vy,x)-central14(vx,y)) * recip_2); -} - -// O(h^4) curl, using 4th order central difference (normalized multicomponent) -template<class T> -inline _bz_typename T::T_numtype -curl4n(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - - return T::T_numtype( - (central14(A,z,y)-central14(A,y,z)) * recip_2, - (central14(A,x,z)-central14(A,z,x)) * recip_2, - (central14(A,y,x)-central14(A,x,y)) * recip_2); -} - - - -// Two-dimensional curl - -template<class T> -inline _bz_typename T::T_numtype -curl(T& vx, T& vy) { - const int x = firstDim, y = secondDim; - - return central12(vy,x)-central12(vx,y); -} - -template<class T> -inline _bz_typename T::T_numtype -curln(T& vx, T& vy) { - const int x = firstDim, y = secondDim; - - return (central12(vy,x)-central12(vx,y)) * recip_2; -} - -// Multicomponent curl -template<class T> -inline _bz_typename T::T_numtype::T_numtype curl2D(T& A) { - const int x = firstDim, y = secondDim; - return central12(A,y,x)-central12(A,x,y); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype curl2Dn(T& A) { - const int x = firstDim, y = secondDim; - return (central12(A,y,x)-central12(A,x,y)) * recip_2; -} - - -// 4th order versions - -template<class T> -inline _bz_typename T::T_numtype -curl4(T& vx, T& vy) { - const int x = firstDim, y = secondDim; - - return central14(vy,x)-central14(vx,y); -} - -template<class T> -inline _bz_typename T::T_numtype -curl4n(T& vx, T& vy) { - const int x = firstDim, y = secondDim; - - return (central14(vy,x)-central14(vx,y)) * recip_12; -} - -// Multicomponent curl -template<class T> -inline _bz_typename T::T_numtype::T_numtype curl2D4(T& A) { - const int x = firstDim, y = secondDim; - return central14(A,y,x)-central14(A,x,y); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype curl2D4n(T& A) { - const int x = firstDim, y = secondDim; - return (central14(A,y,x)-central14(A,x,y)) * recip_12; -} - -/**************************************************************************** - * Divergence - ****************************************************************************/ - - -BZ_DECLARE_STENCIL_OPERATOR2(div,vx,vy) - return central12(vx,firstDim) + central12(vy,secondDim); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR2(divn,vx,vy) - return (central12(vx,firstDim) + central12(vy,secondDim)) - * recip_2; -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR2(div4,vx,vy) - return central14(vx,firstDim) + central14(vy,secondDim); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR2(div4n,vx,vy) - return (central14(vx,firstDim) + central14(vy,secondDim)) - * recip_12; -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR3(div,vx,vy,vz) - return central12(vx,firstDim) + central12(vy,secondDim) - + central12(vz,thirdDim); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR3(divn,vx,vy,vz) - return (central12(vx,firstDim) + central12(vy,secondDim) - + central12(vz,thirdDim)) * recip_2; -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR3(div4,vx,vy,vz) - return central14(vx,firstDim) + central14(vy,secondDim) - + central14(vz,thirdDim); -BZ_END_STENCIL_OPERATOR - -BZ_DECLARE_STENCIL_OPERATOR3(div4n,vx,vy,vz) - return (central14(vx,firstDim) + central14(vy,secondDim) - + central14(vz,thirdDim)) * recip_12; -BZ_END_STENCIL_OPERATOR - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div2D(T& A) { - const int x = firstDim, y = secondDim; - return central12(A,x,x) + central12(A,y,y); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div2D4(T& A) { - const int x = firstDim, y = secondDim; - return central14(A,x,x) + central14(A,y,y); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div2Dn(T& A) { - const int x = firstDim, y = secondDim; - return (central12(A,x,x) + central12(A,y,y)) * recip_2; -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div2D4n(T& A) { - const int x = firstDim, y = secondDim; - return (central14(A,x,x) + central14(A,y,y)) * recip_12; -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div3D(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - return central12(A,x,x) + central12(A,y,y) + central12(A,z,z); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div3D4(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - return central14(A,x,x) + central14(A,y,y) + central14(A,z,z); -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div3Dn(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - return (central12(A,x,x) + central12(A,y,y) + central12(A,z,z)) - * recip_2; -} - -template<class T> -inline _bz_typename T::T_numtype::T_numtype -div3D4n(T& A) { - const int x = firstDim, y = secondDim, z = thirdDim; - return (central14(A,x,x) + central14(A,y,y) + central14(A,z,z)) - * recip_12; -} - -/**************************************************************************** - * Mixed Partial derivatives - ****************************************************************************/ - -template<class T> -inline _bz_typename T::T_numtype -mixed22(T& A, int x, int y) -{ - return A.shift(-1,x,-1,y) - A.shift(-1,x,1,y) - -A.shift(1,x,-1,y) + A.shift(1,x,1,y); -} - -template<class T> -inline _bz_typename T::T_numtype -mixed22n(T& A, int x, int y) -{ - return mixed22(A, x, y) * recip_4; -} - -template<class T> -inline _bz_typename T::T_numtype -mixed24(T& A, int x, int y) -{ - return 64.*(A.shift(-1,x,-1,y) - A.shift(-1,x,1,y) - -A.shift(1,x,-1,y) + A.shift(1,x,1,y)) - + (A.shift(-2,x,+1,y) - A.shift(-1,x,2,y) - - A.shift(1,x,2,y)-A.shift(2,x,1,y) - + A.shift(2,x,-1,y)+A.shift(1,x,-2,y) - - A.shift(-1,x,-2,y)+A.shift(-2,x,-1,y)) - + 8.*(A.shift(-1,x,1,y)+A.shift(-1,x,2,y) - -A.shift(2,x,-2,y) + A.shift(2,x,2,y)); -} - -template<class T> -inline _bz_typename T::T_numtype -mixed24n(T& A, int x, int y) -{ - return mixed24(A,x,y) * recip_144; -} - -/**************************************************************************** - * Smoothers - ****************************************************************************/ - -// NEEDS_WORK-- put other stencil operators here: -// Average5pt2D -// Average7pt3D -// etc. - -/**************************************************************************** - * Stencil operators with geometry (experimental) - ****************************************************************************/ - -template<class T> -inline _bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element div3DVec4(T& A, - const UniformCubicGeometry<3>& geom) -{ - const int x = 0, y = 1, z = 2; - - return (central14(A, x, firstDim) + central14(A, y, secondDim) - + central14(A, z, thirdDim)) * recip_12 * geom.recipSpatialStep(); -} - -template<class T> -inline _bz_typename T::T_numtype Laplacian3D4(T& A, - const UniformCubicGeometry<3>& geom) -{ - return Laplacian3D4n(A) * geom.recipSpatialStepPow2(); -} - -template<class T> -inline _bz_typename T::T_numtype Laplacian3DVec4(T& A, - const UniformCubicGeometry<3>& geom) -{ - typedef _bz_typename T::T_numtype vector3d; - typedef _bz_typename multicomponent_traits<vector3d>::T_element - T_element; - const int u = 0, v = 1, w = 2; - const int x = 0, y = 1, z = 2; - - // central24 is a 5-point stencil - // This is a 9*5 = 45 point stencil - - T_element t1 = (central24(A,u,x) + central24(A,u,y) + central24(A,u,z)) - * recip_12 * geom.recipSpatialStepPow2(); - - T_element t2 = (central24(A,v,x) + central24(A,v,y) + central24(A,v,z)) - * recip_12 * geom.recipSpatialStepPow2(); - - T_element t3 = (central24(A,w,x) + central24(A,w,y) + central24(A,w,z)) - * recip_12 * geom.recipSpatialStepPow2(); - - return vector3d(t1,t2,t3); -} - -template<class T> -inline TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> -grad3DVec4(T& A, const UniformCubicGeometry<3>& geom) -{ - const int x=0, y=1, z=2; - const int u=0, v=1, w=2; - - TinyMatrix<_bz_typename multicomponent_traits<_bz_typename - T::T_numtype>::T_element, 3, 3> grad; - - // This is a 9*4 = 36 point stencil - grad(u,x) = central14n(A,u,x) * geom.recipSpatialStep(); - grad(u,y) = central14n(A,u,y) * geom.recipSpatialStep(); - grad(u,z) = central14n(A,u,z) * geom.recipSpatialStep(); - grad(v,x) = central14n(A,v,x) * geom.recipSpatialStep(); - grad(v,y) = central14n(A,v,y) * geom.recipSpatialStep(); - grad(v,z) = central14n(A,v,z) * geom.recipSpatialStep(); - grad(w,x) = central14n(A,w,x) * geom.recipSpatialStep(); - grad(w,y) = central14n(A,w,y) * geom.recipSpatialStep(); - grad(w,z) = central14n(A,w,z) * geom.recipSpatialStep(); - - return grad; -} - -template<class T> -inline TinyVector<_bz_typename T::T_numtype,3> grad3D4(T& A, - const UniformCubicGeometry<3>& geom) { - return TinyVector<_bz_typename T::T_numtype,3>( - central14(A,firstDim) * recip_12 * geom.recipSpatialStep(), - central14(A,secondDim) * recip_12 * geom.recipSpatialStep(), - central14(A,thirdDim) * recip_12 * geom.recipSpatialStep()); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYSTENCILOPS_H - diff --git a/weave/blitz-20001213/blitz/array/storage.h b/weave/blitz-20001213/blitz/array/storage.h deleted file mode 100644 index 5b630980f..000000000 --- a/weave/blitz-20001213/blitz/array/storage.h +++ /dev/null @@ -1,221 +0,0 @@ -#ifndef BZ_ARRAY_STORAGE_H -#define BZ_ARRAY_STORAGE_H - -BZ_NAMESPACE(blitz) - -/* - * Declaration of class GeneralStorage<N_rank> - * - * This class describes a storage format for an N-dimensional array. - * The dimensions can be stored in an arbitrary order (for example, as - * a C-style row major array or Fortran-style column major array, or - * something else entirely). Each dimension can be stored in either - * ascending (the most common) or descending order. Each dimension - * can have its own base (starting index value: e.g. 0 for C-style arrays, - * 1 for Fortran arrays). - * - * GeneralArrayStorage<N> defaults to C-style arrays. To implement - * other storage formats, subclass and modify the constructor. The - * class FortranArray, below, is an example. - * - * Objects inheriting from GeneralArrayStorage<N> can be passed as - * an optional constructor argument to Array objects. - * e.g. Array<int,3> A(16,16,16, FortranArray<3>()); - * will create a 3-dimensional 16x16x16 Fortran-style array. - */ - -template<int N_rank> -class GeneralArrayStorage { -public: - class noInitializeFlag { }; - - GeneralArrayStorage(noInitializeFlag) - { } - - GeneralArrayStorage() - { - ordering_ = Range(N_rank - 1, 0, -1); - ascendingFlag_ = 1; - base_ = 0; - } - - GeneralArrayStorage(const GeneralArrayStorage<N_rank>& x) - : ordering_(x.ordering_), ascendingFlag_(x.ascendingFlag_), - base_(x.base_) - { - } - - GeneralArrayStorage(TinyVector<int,N_rank> ordering, - TinyVector<bool,N_rank> ascendingFlag) - : ordering_(ordering), ascendingFlag_(ascendingFlag) - { - base_ = 0; - } - - ~GeneralArrayStorage() - { } - - TinyVector<int, N_rank>& ordering() - { return ordering_; } - - const TinyVector<int, N_rank>& ordering() const - { return ordering_; } - - int ordering(int i) const - { return ordering_[i]; } - - void setOrdering(int i, int order) - { ordering_[i] = order; } - - _bz_bool allRanksStoredAscending() const - { - _bz_bool result = _bz_true; - for (int i=0; i < N_rank; ++i) - result &= ascendingFlag_[i]; - return result; - } - - _bz_bool isRankStoredAscending(int i) const - { return ascendingFlag_[i]; } - - TinyVector<bool, N_rank>& ascendingFlag() - { return ascendingFlag_; } - - const TinyVector<bool, N_rank>& ascendingFlag() const - { return ascendingFlag_; } - - void setAscendingFlag(int i, int ascendingFlag) - { ascendingFlag_[i] = ascendingFlag; } - - TinyVector<int, N_rank>& base() - { return base_; } - - const TinyVector<int, N_rank>& base() const - { return base_; } - - int base(int i) const - { return base_[i]; } - - void setBase(int i, int base) - { base_[i] = base; } - - void setBase(const TinyVector<int, N_rank>& base) - { base_ = base; } - -protected: - /* - * ordering_[] specifies the order in which the array is stored in - * memory. For a newly allocated array, ordering_(0) will give the - * rank with unit stride, and ordering_(N_rank-1) will be the rank - * with largest stride. An order like [2, 1, 0] corresponds to - * C-style array storage; an order like [0, 1, 2] corresponds to - * Fortran array storage. - * - * ascendingFlag_[] indicates whether the data in a rank is stored - * in ascending or descending order. Most of the time these values - * will all be true (indicating ascending order). Some peculiar - * formats (e.g. MS-Windows BMP image format) store the data in - * descending order. - * - * base_[] gives the first valid index for each rank. For a C-style - * array, all the base_ elements will be zero; for a Fortran-style - * array, they will be one. base_[] can be set arbitrarily using - * the Array constructor which takes a Range argument, e.g. - * Array<float,2> A(Range(30,40),Range(23,33)); - * will create an array with base_[] = { 30, 23 }. - */ - TinyVector<int, N_rank> ordering_; - TinyVector<bool, N_rank> ascendingFlag_; - TinyVector<int, N_rank> base_; -}; - -/* - * Class FortranArray specializes GeneralArrayStorage to provide Fortran - * style arrays (column major ordering, base of 1). The noInitializeFlag() - * passed to the base constructor indicates that the subclass will take - * care of initializing the ordering_, ascendingFlag_ and base_ members. - */ - -template<int N_rank> -class FortranArray : public GeneralArrayStorage<N_rank> { -public: - FortranArray() - : GeneralArrayStorage<N_rank>(noInitializeFlag()) - { - ordering_ = Range(0, N_rank - 1); - ascendingFlag_ = 1; - base_ = 1; - } -}; - - -// This tag class can be used to provide a nicer notation for -// constructing Fortran-style arrays: instead of -// Array<int,2> A(3, 3, FortranArray<2>()); -// one can simply write: -// Array<int,2> A(3, 3, fortranArray); -// where fortranArray is an object of type _bz_fortranTag. - -class _bz_fortranTag { -public: - operator GeneralArrayStorage<1>() - { return FortranArray<1>(); } - - operator GeneralArrayStorage<2>() - { return FortranArray<2>(); } - - operator GeneralArrayStorage<3>() - { return FortranArray<3>(); } - - operator GeneralArrayStorage<4>() - { return FortranArray<4>(); } - - operator GeneralArrayStorage<5>() - { return FortranArray<5>(); } - - operator GeneralArrayStorage<6>() - { return FortranArray<6>(); } - - operator GeneralArrayStorage<7>() - { return FortranArray<7>(); } - - operator GeneralArrayStorage<8>() - { return FortranArray<8>(); } - - operator GeneralArrayStorage<9>() - { return FortranArray<9>(); } - - operator GeneralArrayStorage<10>() - { return FortranArray<10>(); } - - operator GeneralArrayStorage<11>() - { return FortranArray<11>(); } -}; - -// A global instance of this class will be placed in -// the blitz library (libblitz.a on unix machines). - -_bz_global _bz_fortranTag fortranArray; - - -/* - * Class ColumnMajorArray specializes GeneralArrayStorage to provide column - * major arrays (column major ordering, base of 0). - */ - -template<int N_rank> -class ColumnMajorArray : public GeneralArrayStorage<N_rank> { -public: - ColumnMajorArray() - : GeneralArrayStorage<N_rank>(noInitializeFlag()) - { - ordering_ = Range(0, N_rank - 1); - ascendingFlag_ = 1; - base_ = 0; - } -}; - -BZ_NAMESPACE_END - -#endif // BZ_ARRAY_STORAGE_H - diff --git a/weave/blitz-20001213/blitz/array/uops.cc b/weave/blitz-20001213/blitz/array/uops.cc deleted file mode 100644 index dc4725e21..000000000 --- a/weave/blitz-20001213/blitz/array/uops.cc +++ /dev/null @@ -1,5354 +0,0 @@ -/*************************************************************************** - * blitz/arrayuops.cc Expression templates for arrays, unary functions - * - * $Id$ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:36 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:14 tveldhui - * Imported sources - * - */ - -// Generated source file. Do not edit. -// genarruops.cpp Dec 5 1998 17:08:40 - -#ifndef BZ_ARRAYUOPS_CC -#define BZ_ARRAYUOPS_CC - -#ifndef BZ_ARRAYEXPR_H - #error <blitz/arrayuops.cc> must be included after <blitz/arrayexpr.h> -#endif // BZ_ARRAYEXPR_H - -BZ_NAMESPACE(blitz) - -/**************************************************************************** - * abs - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_abs<T_numtype1> > > -abs(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_abs<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > > -abs(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_abs<int> > > -abs(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_abs<int> >(d1); -} - - -/**************************************************************************** - * acos - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_acos<T_numtype1> > > -acos(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_acos<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_acos<_bz_typename P_expr1::T_numtype> > > -acos(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_acos<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_acos<int> > > -acos(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_acos<int> >(d1); -} - - -/**************************************************************************** - * acosh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_acosh<T_numtype1> > > -acosh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_acosh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_acosh<_bz_typename P_expr1::T_numtype> > > -acosh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_acosh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_acosh<int> > > -acosh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_acosh<int> >(d1); -} - -#endif - -/**************************************************************************** - * asin - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_asin<T_numtype1> > > -asin(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_asin<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_asin<_bz_typename P_expr1::T_numtype> > > -asin(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_asin<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_asin<int> > > -asin(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_asin<int> >(d1); -} - - -/**************************************************************************** - * asinh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_asinh<T_numtype1> > > -asinh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_asinh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_asinh<_bz_typename P_expr1::T_numtype> > > -asinh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_asinh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_asinh<int> > > -asinh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_asinh<int> >(d1); -} - -#endif - -/**************************************************************************** - * atan - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_atan<T_numtype1> > > -atan(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_atan<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_atan<_bz_typename P_expr1::T_numtype> > > -atan(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_atan<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_atan<int> > > -atan(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_atan<int> >(d1); -} - - -/**************************************************************************** - * atanh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_atanh<T_numtype1> > > -atanh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_atanh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_atanh<_bz_typename P_expr1::T_numtype> > > -atanh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_atanh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_atanh<int> > > -atanh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_atanh<int> >(d1); -} - -#endif - -/**************************************************************************** - * atan2 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<T_numtype1,T_numtype2> > > -atan2(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<T_numtype1,_bz_typename P_expr2::T_numtype> > > -atan2(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_atan2<T_numtype1,int> > > -atan2(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_atan2<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_atan2<T_numtype1,float> > > -atan2(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_atan2<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_atan2<T_numtype1,double> > > -atan2(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_atan2<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<T_numtype1,long double> > > -atan2(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<T_numtype1,complex<T2> > > > -atan2(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,T_numtype2> > > -atan2(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -atan2(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,int> > > -atan2(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_atan2<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_atan2<_bz_typename P_expr1::T_numtype,float> > > -atan2(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_atan2<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_atan2<_bz_typename P_expr1::T_numtype,double> > > -atan2(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_atan2<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<_bz_typename P_expr1::T_numtype,long double> > > -atan2(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<_bz_typename P_expr1::T_numtype,complex<T2> > > > -atan2(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<int,T_numtype2> > > -atan2(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<int,_bz_typename P_expr2::T_numtype> > > -atan2(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_atan2<int,int> > > -atan2(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_atan2<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_atan2<int,float> > > -atan2(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_atan2<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_atan2<int,double> > > -atan2(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_atan2<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<int,long double> > > -atan2(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_atan2<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<int,complex<T2> > > > -atan2(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_atan2<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<float,T_numtype2> > > -atan2(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<float,_bz_typename P_expr2::T_numtype> > > -atan2(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_atan2<float,int> > > -atan2(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_atan2<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<double,T_numtype2> > > -atan2(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<double,_bz_typename P_expr2::T_numtype> > > -atan2(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_atan2<double,int> > > -atan2(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_atan2<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<long double,T_numtype2> > > -atan2(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<long double,_bz_typename P_expr2::T_numtype> > > -atan2(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_atan2<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_atan2<long double,int> > > -atan2(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_atan2<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<complex<T1> ,T_numtype2> > > -atan2(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_atan2<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_atan2<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -atan2(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_atan2<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_atan2<complex<T1> ,int> > > -atan2(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_atan2<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - - -/**************************************************************************** - * _class - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz__class<T_numtype1> > > -_class(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz__class<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz__class<_bz_typename P_expr1::T_numtype> > > -_class(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz__class<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz__class<int> > > -_class(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz__class<int> >(d1); -} - -#endif - -/**************************************************************************** - * cbrt - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cbrt<T_numtype1> > > -cbrt(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cbrt<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cbrt<_bz_typename P_expr1::T_numtype> > > -cbrt(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cbrt<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cbrt<int> > > -cbrt(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cbrt<int> >(d1); -} - -#endif - -/**************************************************************************** - * ceil - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_ceil<T_numtype1> > > -ceil(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_ceil<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_ceil<_bz_typename P_expr1::T_numtype> > > -ceil(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_ceil<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_ceil<int> > > -ceil(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_ceil<int> >(d1); -} - - -/**************************************************************************** - * cexp - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cexp<T_numtype1> > > -cexp(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cexp<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cexp<_bz_typename P_expr1::T_numtype> > > -cexp(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cexp<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cexp<int> > > -cexp(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cexp<int> >(d1); -} - - -/**************************************************************************** - * cos - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cos<T_numtype1> > > -cos(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cos<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cos<_bz_typename P_expr1::T_numtype> > > -cos(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cos<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cos<int> > > -cos(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cos<int> >(d1); -} - - -/**************************************************************************** - * cosh - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cosh<T_numtype1> > > -cosh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_cosh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cosh<_bz_typename P_expr1::T_numtype> > > -cosh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_cosh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cosh<int> > > -cosh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_cosh<int> >(d1); -} - - -/**************************************************************************** - * copysign - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<T_numtype1,T_numtype2> > > -copysign(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<T_numtype1,_bz_typename P_expr2::T_numtype> > > -copysign(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_copysign<T_numtype1,int> > > -copysign(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_copysign<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_copysign<T_numtype1,float> > > -copysign(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_copysign<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_copysign<T_numtype1,double> > > -copysign(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_copysign<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<T_numtype1,long double> > > -copysign(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<T_numtype1,complex<T2> > > > -copysign(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,T_numtype2> > > -copysign(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -copysign(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,int> > > -copysign(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_copysign<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_copysign<_bz_typename P_expr1::T_numtype,float> > > -copysign(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_copysign<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_copysign<_bz_typename P_expr1::T_numtype,double> > > -copysign(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_copysign<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<_bz_typename P_expr1::T_numtype,long double> > > -copysign(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<_bz_typename P_expr1::T_numtype,complex<T2> > > > -copysign(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<int,T_numtype2> > > -copysign(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<int,_bz_typename P_expr2::T_numtype> > > -copysign(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_copysign<int,int> > > -copysign(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_copysign<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_copysign<int,float> > > -copysign(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_copysign<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_copysign<int,double> > > -copysign(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_copysign<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<int,long double> > > -copysign(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_copysign<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<int,complex<T2> > > > -copysign(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_copysign<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<float,T_numtype2> > > -copysign(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<float,_bz_typename P_expr2::T_numtype> > > -copysign(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_copysign<float,int> > > -copysign(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_copysign<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<double,T_numtype2> > > -copysign(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<double,_bz_typename P_expr2::T_numtype> > > -copysign(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_copysign<double,int> > > -copysign(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_copysign<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<long double,T_numtype2> > > -copysign(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<long double,_bz_typename P_expr2::T_numtype> > > -copysign(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_copysign<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_copysign<long double,int> > > -copysign(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_copysign<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<complex<T1> ,T_numtype2> > > -copysign(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_copysign<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_copysign<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -copysign(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_copysign<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_copysign<complex<T1> ,int> > > -copysign(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_copysign<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * csqrt - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_csqrt<T_numtype1> > > -csqrt(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_csqrt<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_csqrt<_bz_typename P_expr1::T_numtype> > > -csqrt(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_csqrt<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_csqrt<int> > > -csqrt(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_csqrt<int> >(d1); -} - - -/**************************************************************************** - * drem - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<T_numtype1,T_numtype2> > > -drem(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<T_numtype1,_bz_typename P_expr2::T_numtype> > > -drem(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_drem<T_numtype1,int> > > -drem(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_drem<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_drem<T_numtype1,float> > > -drem(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_drem<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_drem<T_numtype1,double> > > -drem(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_drem<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_drem<T_numtype1,long double> > > -drem(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_drem<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<T_numtype1,complex<T2> > > > -drem(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<_bz_typename P_expr1::T_numtype,T_numtype2> > > -drem(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -drem(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_drem<_bz_typename P_expr1::T_numtype,int> > > -drem(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_drem<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_drem<_bz_typename P_expr1::T_numtype,float> > > -drem(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_drem<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_drem<_bz_typename P_expr1::T_numtype,double> > > -drem(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_drem<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_drem<_bz_typename P_expr1::T_numtype,long double> > > -drem(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_drem<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<_bz_typename P_expr1::T_numtype,complex<T2> > > > -drem(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<int,T_numtype2> > > -drem(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<int,_bz_typename P_expr2::T_numtype> > > -drem(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_drem<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_drem<int,int> > > -drem(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_drem<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_drem<int,float> > > -drem(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_drem<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_drem<int,double> > > -drem(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_drem<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_drem<int,long double> > > -drem(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_drem<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<int,complex<T2> > > > -drem(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_drem<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<float,T_numtype2> > > -drem(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_drem<float,_bz_typename P_expr2::T_numtype> > > -drem(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_drem<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_drem<float,int> > > -drem(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_drem<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<double,T_numtype2> > > -drem(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_drem<double,_bz_typename P_expr2::T_numtype> > > -drem(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_drem<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_drem<double,int> > > -drem(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_drem<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<long double,T_numtype2> > > -drem(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_drem<long double,_bz_typename P_expr2::T_numtype> > > -drem(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_drem<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_drem<long double,int> > > -drem(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_drem<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<complex<T1> ,T_numtype2> > > -drem(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_drem<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_drem<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -drem(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_drem<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_drem<complex<T1> ,int> > > -drem(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_drem<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * exp - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_exp<T_numtype1> > > -exp(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_exp<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_exp<_bz_typename P_expr1::T_numtype> > > -exp(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_exp<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_exp<int> > > -exp(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_exp<int> >(d1); -} - - -/**************************************************************************** - * expm1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_expm1<T_numtype1> > > -expm1(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_expm1<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_expm1<_bz_typename P_expr1::T_numtype> > > -expm1(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_expm1<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_expm1<int> > > -expm1(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_expm1<int> >(d1); -} - -#endif - -/**************************************************************************** - * erf - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_erf<T_numtype1> > > -erf(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_erf<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_erf<_bz_typename P_expr1::T_numtype> > > -erf(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_erf<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_erf<int> > > -erf(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_erf<int> >(d1); -} - -#endif - -/**************************************************************************** - * erfc - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_erfc<T_numtype1> > > -erfc(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_erfc<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_erfc<_bz_typename P_expr1::T_numtype> > > -erfc(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_erfc<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_erfc<int> > > -erfc(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_erfc<int> >(d1); -} - -#endif - -/**************************************************************************** - * fabs - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_abs<T_numtype1> > > -fabs(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_abs<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > > -fabs(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_abs<int> > > -fabs(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_abs<int> >(d1); -} - - -/**************************************************************************** - * floor - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_floor<T_numtype1> > > -floor(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_floor<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_floor<_bz_typename P_expr1::T_numtype> > > -floor(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_floor<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_floor<int> > > -floor(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_floor<int> >(d1); -} - - -/**************************************************************************** - * fmod - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<T_numtype1,T_numtype2> > > -fmod(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<T_numtype1,_bz_typename P_expr2::T_numtype> > > -fmod(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_fmod<T_numtype1,int> > > -fmod(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_fmod<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_fmod<T_numtype1,float> > > -fmod(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_fmod<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_fmod<T_numtype1,double> > > -fmod(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_fmod<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<T_numtype1,long double> > > -fmod(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<T_numtype1,complex<T2> > > > -fmod(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,T_numtype2> > > -fmod(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -fmod(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,int> > > -fmod(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_fmod<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_fmod<_bz_typename P_expr1::T_numtype,float> > > -fmod(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_fmod<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_fmod<_bz_typename P_expr1::T_numtype,double> > > -fmod(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_fmod<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<_bz_typename P_expr1::T_numtype,long double> > > -fmod(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<_bz_typename P_expr1::T_numtype,complex<T2> > > > -fmod(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<int,T_numtype2> > > -fmod(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<int,_bz_typename P_expr2::T_numtype> > > -fmod(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_fmod<int,int> > > -fmod(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_fmod<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_fmod<int,float> > > -fmod(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_fmod<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_fmod<int,double> > > -fmod(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_fmod<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<int,long double> > > -fmod(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_fmod<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<int,complex<T2> > > > -fmod(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_fmod<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<float,T_numtype2> > > -fmod(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<float,_bz_typename P_expr2::T_numtype> > > -fmod(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_fmod<float,int> > > -fmod(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_fmod<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<double,T_numtype2> > > -fmod(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<double,_bz_typename P_expr2::T_numtype> > > -fmod(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_fmod<double,int> > > -fmod(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_fmod<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<long double,T_numtype2> > > -fmod(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<long double,_bz_typename P_expr2::T_numtype> > > -fmod(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_fmod<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_fmod<long double,int> > > -fmod(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_fmod<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<complex<T1> ,T_numtype2> > > -fmod(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_fmod<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_fmod<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -fmod(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_fmod<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_fmod<complex<T1> ,int> > > -fmod(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_fmod<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * hypot - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<T_numtype1,T_numtype2> > > -hypot(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<T_numtype1,_bz_typename P_expr2::T_numtype> > > -hypot(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_hypot<T_numtype1,int> > > -hypot(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_hypot<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_hypot<T_numtype1,float> > > -hypot(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_hypot<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_hypot<T_numtype1,double> > > -hypot(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_hypot<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<T_numtype1,long double> > > -hypot(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<T_numtype1,complex<T2> > > > -hypot(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,T_numtype2> > > -hypot(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -hypot(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,int> > > -hypot(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_hypot<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_hypot<_bz_typename P_expr1::T_numtype,float> > > -hypot(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_hypot<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_hypot<_bz_typename P_expr1::T_numtype,double> > > -hypot(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_hypot<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<_bz_typename P_expr1::T_numtype,long double> > > -hypot(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<_bz_typename P_expr1::T_numtype,complex<T2> > > > -hypot(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<int,T_numtype2> > > -hypot(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<int,_bz_typename P_expr2::T_numtype> > > -hypot(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_hypot<int,int> > > -hypot(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_hypot<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_hypot<int,float> > > -hypot(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_hypot<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_hypot<int,double> > > -hypot(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_hypot<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<int,long double> > > -hypot(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_hypot<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<int,complex<T2> > > > -hypot(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_hypot<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<float,T_numtype2> > > -hypot(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<float,_bz_typename P_expr2::T_numtype> > > -hypot(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_hypot<float,int> > > -hypot(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_hypot<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<double,T_numtype2> > > -hypot(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<double,_bz_typename P_expr2::T_numtype> > > -hypot(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_hypot<double,int> > > -hypot(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_hypot<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<long double,T_numtype2> > > -hypot(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<long double,_bz_typename P_expr2::T_numtype> > > -hypot(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_hypot<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_hypot<long double,int> > > -hypot(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_hypot<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<complex<T1> ,T_numtype2> > > -hypot(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_hypot<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_hypot<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -hypot(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_hypot<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_hypot<complex<T1> ,int> > > -hypot(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_hypot<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * ilogb - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_ilogb<T_numtype1> > > -ilogb(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_ilogb<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_ilogb<_bz_typename P_expr1::T_numtype> > > -ilogb(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_ilogb<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_ilogb<int> > > -ilogb(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_ilogb<int> >(d1); -} - -#endif - -/**************************************************************************** - * isnan - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_isnan<T_numtype1> > > -isnan(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_isnan<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_isnan<_bz_typename P_expr1::T_numtype> > > -isnan(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_isnan<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_isnan<int> > > -isnan(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_isnan<int> >(d1); -} - -#endif - -/**************************************************************************** - * itrunc - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_itrunc<T_numtype1> > > -itrunc(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_itrunc<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_itrunc<_bz_typename P_expr1::T_numtype> > > -itrunc(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_itrunc<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_itrunc<int> > > -itrunc(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_itrunc<int> >(d1); -} - -#endif - -/**************************************************************************** - * j0 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_j0<T_numtype1> > > -j0(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_j0<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_j0<_bz_typename P_expr1::T_numtype> > > -j0(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_j0<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_j0<int> > > -j0(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_j0<int> >(d1); -} - -#endif - -/**************************************************************************** - * j1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_j1<T_numtype1> > > -j1(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_j1<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_j1<_bz_typename P_expr1::T_numtype> > > -j1(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_j1<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_j1<int> > > -j1(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_j1<int> >(d1); -} - -#endif - -/**************************************************************************** - * lgamma - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_lgamma<T_numtype1> > > -lgamma(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_lgamma<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_lgamma<_bz_typename P_expr1::T_numtype> > > -lgamma(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_lgamma<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_lgamma<int> > > -lgamma(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_lgamma<int> >(d1); -} - -#endif - -/**************************************************************************** - * log - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log<T_numtype1> > > -log(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log<_bz_typename P_expr1::T_numtype> > > -log(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log<int> > > -log(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log<int> >(d1); -} - - -/**************************************************************************** - * logb - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_logb<T_numtype1> > > -logb(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_logb<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_logb<_bz_typename P_expr1::T_numtype> > > -logb(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_logb<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_logb<int> > > -logb(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_logb<int> >(d1); -} - -#endif - -/**************************************************************************** - * log1p - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log1p<T_numtype1> > > -log1p(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log1p<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log1p<_bz_typename P_expr1::T_numtype> > > -log1p(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log1p<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log1p<int> > > -log1p(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log1p<int> >(d1); -} - -#endif - -/**************************************************************************** - * log10 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log10<T_numtype1> > > -log10(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_log10<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log10<_bz_typename P_expr1::T_numtype> > > -log10(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_log10<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log10<int> > > -log10(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_log10<int> >(d1); -} - - -/**************************************************************************** - * nearest - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_nearest<T_numtype1> > > -nearest(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_nearest<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_nearest<_bz_typename P_expr1::T_numtype> > > -nearest(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_nearest<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_nearest<int> > > -nearest(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_nearest<int> >(d1); -} - -#endif - -/**************************************************************************** - * nextafter - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<T_numtype1,T_numtype2> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<T_numtype1,_bz_typename P_expr2::T_numtype> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_nextafter<T_numtype1,int> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_nextafter<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<T_numtype1,float> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<T_numtype1,double> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<T_numtype1,long double> > > -nextafter(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<T_numtype1,complex<T2> > > > -nextafter(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,T_numtype2> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,int> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,float> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,double> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,long double> > > -nextafter(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<_bz_typename P_expr1::T_numtype,complex<T2> > > > -nextafter(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<int,T_numtype2> > > -nextafter(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<int,_bz_typename P_expr2::T_numtype> > > -nextafter(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_nextafter<int,int> > > -nextafter(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_nextafter<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<int,float> > > -nextafter(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_nextafter<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<int,double> > > -nextafter(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_nextafter<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<int,long double> > > -nextafter(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_nextafter<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<int,complex<T2> > > > -nextafter(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_nextafter<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<float,T_numtype2> > > -nextafter(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<float,_bz_typename P_expr2::T_numtype> > > -nextafter(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_nextafter<float,int> > > -nextafter(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_nextafter<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<double,T_numtype2> > > -nextafter(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<double,_bz_typename P_expr2::T_numtype> > > -nextafter(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_nextafter<double,int> > > -nextafter(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_nextafter<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<long double,T_numtype2> > > -nextafter(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<long double,_bz_typename P_expr2::T_numtype> > > -nextafter(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_nextafter<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_nextafter<long double,int> > > -nextafter(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_nextafter<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<complex<T1> ,T_numtype2> > > -nextafter(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_nextafter<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_nextafter<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -nextafter(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_nextafter<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_nextafter<complex<T1> ,int> > > -nextafter(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_nextafter<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * pow - ****************************************************************************/ - -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<T_numtype1,T_numtype2> > > -pow(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<T_numtype1,_bz_typename P_expr2::T_numtype> > > -pow(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_pow<T_numtype1,int> > > -pow(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_pow<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_pow<T_numtype1,float> > > -pow(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_pow<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_pow<T_numtype1,double> > > -pow(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_pow<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_pow<T_numtype1,long double> > > -pow(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_pow<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<T_numtype1,complex<T2> > > > -pow(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<_bz_typename P_expr1::T_numtype,T_numtype2> > > -pow(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -pow(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_pow<_bz_typename P_expr1::T_numtype,int> > > -pow(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_pow<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_pow<_bz_typename P_expr1::T_numtype,float> > > -pow(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_pow<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_pow<_bz_typename P_expr1::T_numtype,double> > > -pow(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_pow<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_pow<_bz_typename P_expr1::T_numtype,long double> > > -pow(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_pow<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<_bz_typename P_expr1::T_numtype,complex<T2> > > > -pow(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<int,T_numtype2> > > -pow(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<int,_bz_typename P_expr2::T_numtype> > > -pow(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_pow<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_pow<int,int> > > -pow(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_pow<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_pow<int,float> > > -pow(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_pow<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_pow<int,double> > > -pow(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_pow<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_pow<int,long double> > > -pow(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_pow<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<int,complex<T2> > > > -pow(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_pow<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<float,T_numtype2> > > -pow(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_pow<float,_bz_typename P_expr2::T_numtype> > > -pow(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_pow<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_pow<float,int> > > -pow(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_pow<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<double,T_numtype2> > > -pow(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_pow<double,_bz_typename P_expr2::T_numtype> > > -pow(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_pow<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_pow<double,int> > > -pow(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_pow<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<long double,T_numtype2> > > -pow(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_pow<long double,_bz_typename P_expr2::T_numtype> > > -pow(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_pow<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_pow<long double,int> > > -pow(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_pow<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<complex<T1> ,T_numtype2> > > -pow(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_pow<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_pow<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -pow(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_pow<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_pow<complex<T1> ,int> > > -pow(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_pow<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - - -/**************************************************************************** - * pow2 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow2<T_numtype1> > > -pow2(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow2<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow2<_bz_typename P_expr1::T_numtype> > > -pow2(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow2<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow2<int> > > -pow2(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow2<int> >(d1); -} - - -/**************************************************************************** - * pow3 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow3<T_numtype1> > > -pow3(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow3<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow3<_bz_typename P_expr1::T_numtype> > > -pow3(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow3<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow3<int> > > -pow3(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow3<int> >(d1); -} - - -/**************************************************************************** - * pow4 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow4<T_numtype1> > > -pow4(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow4<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow4<_bz_typename P_expr1::T_numtype> > > -pow4(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow4<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow4<int> > > -pow4(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow4<int> >(d1); -} - - -/**************************************************************************** - * pow5 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow5<T_numtype1> > > -pow5(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow5<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow5<_bz_typename P_expr1::T_numtype> > > -pow5(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow5<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow5<int> > > -pow5(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow5<int> >(d1); -} - - -/**************************************************************************** - * pow6 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow6<T_numtype1> > > -pow6(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow6<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow6<_bz_typename P_expr1::T_numtype> > > -pow6(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow6<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow6<int> > > -pow6(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow6<int> >(d1); -} - - -/**************************************************************************** - * pow7 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow7<T_numtype1> > > -pow7(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow7<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow7<_bz_typename P_expr1::T_numtype> > > -pow7(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow7<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow7<int> > > -pow7(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow7<int> >(d1); -} - - -/**************************************************************************** - * pow8 - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow8<T_numtype1> > > -pow8(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_pow8<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow8<_bz_typename P_expr1::T_numtype> > > -pow8(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_pow8<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow8<int> > > -pow8(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_pow8<int> >(d1); -} - - -/**************************************************************************** - * remainder - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<T_numtype1,T_numtype2> > > -remainder(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<T_numtype1,_bz_typename P_expr2::T_numtype> > > -remainder(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_remainder<T_numtype1,int> > > -remainder(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_remainder<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_remainder<T_numtype1,float> > > -remainder(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_remainder<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_remainder<T_numtype1,double> > > -remainder(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_remainder<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<T_numtype1,long double> > > -remainder(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<T_numtype1,complex<T2> > > > -remainder(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,T_numtype2> > > -remainder(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -remainder(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,int> > > -remainder(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_remainder<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_remainder<_bz_typename P_expr1::T_numtype,float> > > -remainder(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_remainder<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_remainder<_bz_typename P_expr1::T_numtype,double> > > -remainder(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_remainder<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<_bz_typename P_expr1::T_numtype,long double> > > -remainder(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<_bz_typename P_expr1::T_numtype,complex<T2> > > > -remainder(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<int,T_numtype2> > > -remainder(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<int,_bz_typename P_expr2::T_numtype> > > -remainder(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_remainder<int,int> > > -remainder(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_remainder<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_remainder<int,float> > > -remainder(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_remainder<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_remainder<int,double> > > -remainder(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_remainder<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<int,long double> > > -remainder(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_remainder<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<int,complex<T2> > > > -remainder(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_remainder<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<float,T_numtype2> > > -remainder(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<float,_bz_typename P_expr2::T_numtype> > > -remainder(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_remainder<float,int> > > -remainder(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_remainder<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<double,T_numtype2> > > -remainder(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<double,_bz_typename P_expr2::T_numtype> > > -remainder(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_remainder<double,int> > > -remainder(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_remainder<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<long double,T_numtype2> > > -remainder(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<long double,_bz_typename P_expr2::T_numtype> > > -remainder(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_remainder<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_remainder<long double,int> > > -remainder(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_remainder<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<complex<T1> ,T_numtype2> > > -remainder(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_remainder<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_remainder<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -remainder(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_remainder<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_remainder<complex<T1> ,int> > > -remainder(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_remainder<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * rint - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_rint<T_numtype1> > > -rint(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_rint<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_rint<_bz_typename P_expr1::T_numtype> > > -rint(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_rint<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_rint<int> > > -rint(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_rint<int> >(d1); -} - -#endif - -/**************************************************************************** - * rsqrt - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_rsqrt<T_numtype1> > > -rsqrt(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_rsqrt<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_rsqrt<_bz_typename P_expr1::T_numtype> > > -rsqrt(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_rsqrt<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_rsqrt<int> > > -rsqrt(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_rsqrt<int> >(d1); -} - -#endif - -/**************************************************************************** - * scalb - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<T_numtype1,T_numtype2> > > -scalb(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<T_numtype1,_bz_typename P_expr2::T_numtype> > > -scalb(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_scalb<T_numtype1,int> > > -scalb(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_scalb<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_scalb<T_numtype1,float> > > -scalb(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_scalb<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_scalb<T_numtype1,double> > > -scalb(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_scalb<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<T_numtype1,long double> > > -scalb(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<T_numtype1,complex<T2> > > > -scalb(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,T_numtype2> > > -scalb(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -scalb(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,int> > > -scalb(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_scalb<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_scalb<_bz_typename P_expr1::T_numtype,float> > > -scalb(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_scalb<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_scalb<_bz_typename P_expr1::T_numtype,double> > > -scalb(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_scalb<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<_bz_typename P_expr1::T_numtype,long double> > > -scalb(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<_bz_typename P_expr1::T_numtype,complex<T2> > > > -scalb(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<int,T_numtype2> > > -scalb(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<int,_bz_typename P_expr2::T_numtype> > > -scalb(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_scalb<int,int> > > -scalb(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_scalb<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_scalb<int,float> > > -scalb(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_scalb<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_scalb<int,double> > > -scalb(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_scalb<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<int,long double> > > -scalb(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_scalb<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<int,complex<T2> > > > -scalb(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_scalb<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<float,T_numtype2> > > -scalb(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<float,_bz_typename P_expr2::T_numtype> > > -scalb(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_scalb<float,int> > > -scalb(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_scalb<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<double,T_numtype2> > > -scalb(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<double,_bz_typename P_expr2::T_numtype> > > -scalb(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_scalb<double,int> > > -scalb(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_scalb<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<long double,T_numtype2> > > -scalb(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<long double,_bz_typename P_expr2::T_numtype> > > -scalb(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_scalb<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_scalb<long double,int> > > -scalb(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_scalb<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<complex<T1> ,T_numtype2> > > -scalb(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_scalb<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_scalb<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -scalb(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_scalb<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_scalb<complex<T1> ,int> > > -scalb(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_scalb<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * sin - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sin<T_numtype1> > > -sin(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sin<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sin<_bz_typename P_expr1::T_numtype> > > -sin(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sin<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sin<int> > > -sin(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sin<int> >(d1); -} - - -/**************************************************************************** - * sinh - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sinh<T_numtype1> > > -sinh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sinh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sinh<_bz_typename P_expr1::T_numtype> > > -sinh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sinh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sinh<int> > > -sinh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sinh<int> >(d1); -} - - -/**************************************************************************** - * sqr - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sqr<T_numtype1> > > -sqr(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sqr<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sqr<_bz_typename P_expr1::T_numtype> > > -sqr(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sqr<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sqr<int> > > -sqr(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sqr<int> >(d1); -} - - -/**************************************************************************** - * sqrt - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sqrt<T_numtype1> > > -sqrt(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_sqrt<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sqrt<_bz_typename P_expr1::T_numtype> > > -sqrt(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_sqrt<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sqrt<int> > > -sqrt(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_sqrt<int> >(d1); -} - - -/**************************************************************************** - * tan - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_tan<T_numtype1> > > -tan(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_tan<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_tan<_bz_typename P_expr1::T_numtype> > > -tan(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_tan<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_tan<int> > > -tan(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_tan<int> >(d1); -} - - -/**************************************************************************** - * tanh - ****************************************************************************/ - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_tanh<T_numtype1> > > -tanh(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_tanh<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_tanh<_bz_typename P_expr1::T_numtype> > > -tanh(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_tanh<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_tanh<int> > > -tanh(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_tanh<int> >(d1); -} - - -/**************************************************************************** - * uitrunc - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_uitrunc<T_numtype1> > > -uitrunc(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_uitrunc<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_uitrunc<_bz_typename P_expr1::T_numtype> > > -uitrunc(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_uitrunc<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_uitrunc<int> > > -uitrunc(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_uitrunc<int> >(d1); -} - -#endif - -/**************************************************************************** - * unordered - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class T_numtype1, int N_rank1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<T_numtype1,T_numtype2> > > -unordered(const Array<T_numtype1, N_rank1>& d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<T_numtype1,T_numtype2> >(d1.begin(), d2.begin()); -} - -template<class T_numtype1, int N_rank1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<T_numtype1,_bz_typename P_expr2::T_numtype> > > -unordered(const Array<T_numtype1, N_rank1>& d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<T_numtype1,_bz_typename P_expr2::T_numtype> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_unordered<T_numtype1,int> > > -unordered(const Array<T_numtype1, N_rank1>& d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, IndexPlaceholder<N_index2>, - _bz_unordered<T_numtype1,int> >(d1.begin(), d2); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_unordered<T_numtype1,float> > > -unordered(const Array<T_numtype1, N_rank1>& d1, float d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<float>, - _bz_unordered<T_numtype1,float> >(d1.begin(), _bz_ArrayExprConstant<float>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_unordered<T_numtype1,double> > > -unordered(const Array<T_numtype1, N_rank1>& d1, double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<double>, - _bz_unordered<T_numtype1,double> >(d1.begin(), _bz_ArrayExprConstant<double>(d2)); -} - -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<T_numtype1,long double> > > -unordered(const Array<T_numtype1, N_rank1>& d1, long double d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<T_numtype1,long double> >(d1.begin(), _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T_numtype1, int N_rank1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<T_numtype1,complex<T2> > > > -unordered(const Array<T_numtype1, N_rank1>& d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<T_numtype1,complex<T2> > >(d1.begin(), _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class P_expr1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,T_numtype2> > > -unordered(_bz_ArrayExpr<P_expr1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,T_numtype2> >(d1, d2.begin()); -} - -template<class P_expr1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> > > -unordered(_bz_ArrayExpr<P_expr1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<class P_expr1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,int> > > -unordered(_bz_ArrayExpr<P_expr1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, IndexPlaceholder<N_index2>, - _bz_unordered<_bz_typename P_expr1::T_numtype,int> >(d1, d2); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_unordered<_bz_typename P_expr1::T_numtype,float> > > -unordered(_bz_ArrayExpr<P_expr1> d1, float d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<float>, - _bz_unordered<_bz_typename P_expr1::T_numtype,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_unordered<_bz_typename P_expr1::T_numtype,double> > > -unordered(_bz_ArrayExpr<P_expr1> d1, double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<double>, - _bz_unordered<_bz_typename P_expr1::T_numtype,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<_bz_typename P_expr1::T_numtype,long double> > > -unordered(_bz_ArrayExpr<P_expr1> d1, long double d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<_bz_typename P_expr1::T_numtype,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<_bz_typename P_expr1::T_numtype,complex<T2> > > > -unordered(_bz_ArrayExpr<P_expr1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<_bz_typename P_expr1::T_numtype,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<int N_index1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<int,T_numtype2> > > -unordered(IndexPlaceholder<N_index1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<int,T_numtype2> >(d1, d2.begin()); -} - -template<int N_index1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<int,_bz_typename P_expr2::T_numtype> > > -unordered(IndexPlaceholder<N_index1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<int,_bz_typename P_expr2::T_numtype> >(d1, d2); -} - -template<int N_index1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_unordered<int,int> > > -unordered(IndexPlaceholder<N_index1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, IndexPlaceholder<N_index2>, - _bz_unordered<int,int> >(d1, d2); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_unordered<int,float> > > -unordered(IndexPlaceholder<N_index1> d1, float d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<float>, - _bz_unordered<int,float> >(d1, _bz_ArrayExprConstant<float>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_unordered<int,double> > > -unordered(IndexPlaceholder<N_index1> d1, double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<double>, - _bz_unordered<int,double> >(d1, _bz_ArrayExprConstant<double>(d2)); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<int,long double> > > -unordered(IndexPlaceholder<N_index1> d1, long double d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<long double>, - _bz_unordered<int,long double> >(d1, _bz_ArrayExprConstant<long double>(d2)); -} - -#ifdef BZ_HAVE_COMPLEX -template<int N_index1, class T2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<int,complex<T2> > > > -unordered(IndexPlaceholder<N_index1> d1, complex<T2> d2) -{ - return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, _bz_ArrayExprConstant<complex<T2> > , - _bz_unordered<int,complex<T2> > >(d1, _bz_ArrayExprConstant<complex<T2> > (d2)); -} - -#endif // BZ_HAVE_COMPLEX - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<float,T_numtype2> > > -unordered(float d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<float,T_numtype2> >(_bz_ArrayExprConstant<float>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<float,_bz_typename P_expr2::T_numtype> > > -unordered(float d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<float,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_unordered<float,int> > > -unordered(float d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, IndexPlaceholder<N_index2>, - _bz_unordered<float,int> >(_bz_ArrayExprConstant<float>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<double,T_numtype2> > > -unordered(double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<double,T_numtype2> >(_bz_ArrayExprConstant<double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<double,_bz_typename P_expr2::T_numtype> > > -unordered(double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_unordered<double,int> > > -unordered(double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, IndexPlaceholder<N_index2>, - _bz_unordered<double,int> >(_bz_ArrayExprConstant<double>(d1), d2); -} - -template<class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<long double,T_numtype2> > > -unordered(long double d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<long double,T_numtype2> >(_bz_ArrayExprConstant<long double>(d1), d2.begin()); -} - -template<class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<long double,_bz_typename P_expr2::T_numtype> > > -unordered(long double d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, _bz_ArrayExpr<P_expr2>, - _bz_unordered<long double,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -template<int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_unordered<long double,int> > > -unordered(long double d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, IndexPlaceholder<N_index2>, - _bz_unordered<long double,int> >(_bz_ArrayExprConstant<long double>(d1), d2); -} - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class T_numtype2, int N_rank2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<complex<T1> ,T_numtype2> > > -unordered(complex<T1> d1, const Array<T_numtype2, N_rank2>& d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , ArrayIterator<T_numtype2, N_rank2>, - _bz_unordered<complex<T1> ,T_numtype2> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2.begin()); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, class P_expr2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_unordered<complex<T1> ,_bz_typename P_expr2::T_numtype> > > -unordered(complex<T1> d1, _bz_ArrayExpr<P_expr2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , _bz_ArrayExpr<P_expr2>, - _bz_unordered<complex<T1> ,_bz_typename P_expr2::T_numtype> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -template<class T1, int N_index2> -inline -_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_unordered<complex<T1> ,int> > > -unordered(complex<T1> d1, IndexPlaceholder<N_index2> d2) -{ - return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , IndexPlaceholder<N_index2>, - _bz_unordered<complex<T1> ,int> >(_bz_ArrayExprConstant<complex<T1> > (d1), d2); -} - -#endif // BZ_HAVE_COMPLEX - -#endif - -/**************************************************************************** - * y0 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_y0<T_numtype1> > > -y0(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_y0<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_y0<_bz_typename P_expr1::T_numtype> > > -y0(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_y0<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_y0<int> > > -y0(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_y0<int> >(d1); -} - -#endif - -/**************************************************************************** - * y1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class T_numtype1, int N_rank1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_y1<T_numtype1> > > -y1(const Array<T_numtype1, N_rank1>& d1) -{ - return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>, - _bz_y1<T_numtype1> >(d1.begin()); -} - -template<class P_expr1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_y1<_bz_typename P_expr1::T_numtype> > > -y1(_bz_ArrayExpr<P_expr1> d1) -{ - return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>, - _bz_y1<_bz_typename P_expr1::T_numtype> >(d1); -} - -template<int N_index1> -inline -_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_y1<int> > > -y1(IndexPlaceholder<N_index1> d1) -{ - return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>, - _bz_y1<int> >(d1); -} - -#endif - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/array/where.h b/weave/blitz-20001213/blitz/array/where.h deleted file mode 100644 index 85407a910..000000000 --- a/weave/blitz-20001213/blitz/array/where.h +++ /dev/null @@ -1,207 +0,0 @@ -#ifndef BZ_ARRAYWHERE_H -#define BZ_ARRAYWHERE_H - -#ifndef BZ_ARRAYEXPR_H - #error <blitz/array/where.h> must be included via <blitz/array/expr.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr1, class P_expr2, class P_expr3> -class _bz_ArrayWhere { - -public: - typedef P_expr1 T_expr1; - typedef P_expr2 T_expr2; - typedef P_expr3 T_expr3; - typedef _bz_typename T_expr2::T_numtype T_numtype2; - typedef _bz_typename T_expr3::T_numtype T_numtype3; - typedef BZ_PROMOTE(T_numtype2, T_numtype3) T_numtype; - typedef T_expr1 T_ctorArg1; - typedef T_expr2 T_ctorArg2; - typedef T_expr3 T_ctorArg3; - - enum { numArrayOperands = BZ_ENUM_CAST(P_expr1::numArrayOperands) - + BZ_ENUM_CAST(P_expr2::numArrayOperands) - + BZ_ENUM_CAST(P_expr3::numArrayOperands), - numIndexPlaceholders = BZ_ENUM_CAST(P_expr1::numIndexPlaceholders) - + BZ_ENUM_CAST(P_expr2::numIndexPlaceholders) - + BZ_ENUM_CAST(P_expr3::numIndexPlaceholders), - rank = _bz_meta_max<_bz_meta_max<P_expr1::rank,P_expr2::rank>::max, - P_expr3::rank>::max - }; - - _bz_ArrayWhere(const _bz_ArrayWhere<T_expr1,T_expr2,T_expr3>& a) - : iter1_(a.iter1_), iter2_(a.iter2_), iter3_(a.iter3_) - { } - - template<class T1, class T2, class T3> - _bz_ArrayWhere(BZ_ETPARM(T1) a, BZ_ETPARM(T2) b, BZ_ETPARM(T3) c) - : iter1_(a), iter2_(b), iter3_(c) - { } - - T_numtype operator*() - { return (*iter1_) ? (*iter2_) : (*iter3_); } - - template<int N_rank> - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return iter1_(i) ? iter2_(i) : iter3_(i); } - - int ascending(int rank) - { - return bounds::compute_ascending(rank, bounds::compute_ascending( - rank, iter1_.ascending(rank), iter2_.ascending(rank)), - iter3_.ascending(rank)); - } - - int ordering(int rank) - { - return bounds::compute_ordering(rank, bounds::compute_ordering( - rank, iter1_.ordering(rank), iter2_.ordering(rank)), - iter3_.ordering(rank)); - } - - int lbound(int rank) - { - return bounds::compute_lbound(rank, bounds::compute_lbound( - rank, iter1_.lbound(rank), iter2_.lbound(rank)), - iter3_.lbound(rank)); - } - - int ubound(int rank) - { - return bounds::compute_ubound(rank, bounds::compute_ubound( - rank, iter1_.ubound(rank), iter2_.ubound(rank)), - iter3_.ubound(rank)); - } - - void push(int position) - { - iter1_.push(position); - iter2_.push(position); - iter3_.push(position); - } - - void pop(int position) - { - iter1_.pop(position); - iter2_.pop(position); - iter3_.pop(position); - } - - void advance() - { - iter1_.advance(); - iter2_.advance(); - iter3_.advance(); - } - - void advance(int n) - { - iter1_.advance(n); - iter2_.advance(n); - iter3_.advance(n); - } - - void loadStride(int rank) - { - iter1_.loadStride(rank); - iter2_.loadStride(rank); - iter3_.loadStride(rank); - } - - _bz_bool isUnitStride(int rank) const - { - return iter1_.isUnitStride(rank) - && iter2_.isUnitStride(rank) - && iter3_.isUnitStride(rank); - } - - void advanceUnitStride() - { - iter1_.advanceUnitStride(); - iter2_.advanceUnitStride(); - iter3_.advanceUnitStride(); - } - - _bz_bool canCollapse(int outerLoopRank, int innerLoopRank) const - { - // BZ_DEBUG_MESSAGE("_bz_ArrayExprOp<>::canCollapse"); - return iter1_.canCollapse(outerLoopRank, innerLoopRank) - && iter2_.canCollapse(outerLoopRank, innerLoopRank) - && iter3_.canCollapse(outerLoopRank, innerLoopRank); - } - - template<int N_rank> - void moveTo(const TinyVector<int,N_rank>& i) - { - iter1_.moveTo(i); - iter2_.moveTo(i); - iter3_.moveTo(i); - } - - T_numtype operator[](int i) - { return iter1_[i] ? iter2_[i] : iter3_[i]; } - - T_numtype fastRead(int i) - { return iter1_.fastRead(i) ? iter2_.fastRead(i) : iter3_.fastRead(i); } - - int suggestStride(int rank) const - { - int stride1 = iter1_.suggestStride(rank); - int stride2 = iter2_.suggestStride(rank); - int stride3 = iter3_.suggestStride(rank); - return minmax::max(minmax::max(stride1,stride2),stride3); - } - - _bz_bool isStride(int rank, int stride) const - { - return iter1_.isStride(rank,stride) - && iter2_.isStride(rank,stride) - && iter3_.isStride(rank,stride); - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - str += "where("; - iter1_.prettyPrint(str,format); - str += ","; - iter2_.prettyPrint(str,format); - str += ","; - iter3_.prettyPrint(str,format); - str += ")"; - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) - { - int t1 = iter1_.shapeCheck(shape); - int t2 = iter2_.shapeCheck(shape); - int t3 = iter3_.shapeCheck(shape); - - return t1 && t2 && t3; - } - -private: - _bz_ArrayWhere() { } - - T_expr1 iter1_; - T_expr2 iter2_; - T_expr3 iter3_; -}; - -template<class T1, class T2, class T3> -inline -_bz_ArrayExpr<_bz_ArrayWhere<_bz_typename asExpr<T1>::T_expr, - _bz_typename asExpr<T2>::T_expr, _bz_typename asExpr<T3>::T_expr> > -where(const T1& a, const T2& b, const T3& c) -{ - return _bz_ArrayExpr<_bz_ArrayWhere<_bz_typename asExpr<T1>::T_expr, - _bz_typename asExpr<T2>::T_expr, - _bz_typename asExpr<T3>::T_expr> >(a,b,c); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYWHERE_H - diff --git a/weave/blitz-20001213/blitz/array/zip.h b/weave/blitz-20001213/blitz/array/zip.h deleted file mode 100644 index 1cb349a71..000000000 --- a/weave/blitz-20001213/blitz/array/zip.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef BZ_ARRAYZIP_H -#define BZ_ARRAYZIP_H - -#ifndef BZ_ARRAY_H - #error <blitz/array/zip.h> must be included via <blitz/array.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_component, class T1, class T2> -struct Zip2 { - typedef P_component T_numtype; - - static inline T_numtype apply(T1 a, T2 b) - { return T_numtype(a,b); } - - template<class T_left, class T_right> - static inline void prettyPrint(string& str, - prettyPrintFormat& format, const T_left& t1, - const T_right& t2) - { - str += "zip("; - t1.prettyPrint(str, format); - str += ","; - t2.prettyPrint(str, format); - str += ")"; - } -}; - -template<class T_component, class T1, class T2> -inline _bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, - _bz_typename asExpr<T2>::T_expr, Zip2<T_component, - _bz_typename asExpr<T1>::T_expr::T_numtype, - _bz_typename asExpr<T2>::T_expr::T_numtype> > > -zip(const T1& a, const T2& b, T_component) -{ - return _bz_ArrayExpr<_bz_ArrayExprOp<_bz_typename asExpr<T1>::T_expr, - _bz_typename asExpr<T2>::T_expr, Zip2<T_component, - _bz_typename asExpr<T1>::T_expr::T_numtype, - _bz_typename asExpr<T2>::T_expr::T_numtype> > >(a,b); -} - -BZ_NAMESPACE_END - -#endif // BZ_ARRAYZIP_H - diff --git a/weave/blitz-20001213/blitz/bench.cc b/weave/blitz-20001213/blitz/bench.cc deleted file mode 100644 index 137503e0c..000000000 --- a/weave/blitz-20001213/blitz/bench.cc +++ /dev/null @@ -1,198 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_BENCH_CC -#define BZ_BENCH_CC - -#ifndef BZ_BENCH_H - #error <blitz/bench.cc> must be included via <blitz/bench.h> -#endif - -#ifdef BZ_HAVE_STD - #include <fstream> -#else - #include <fstream.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_parameter> -Benchmark<P_parameter>::Benchmark(unsigned numImplementations) -{ - state_ = uninitialized; - numImplementations_ = numImplementations; - numStoredImplementations_ = 0; - implementations_ = new BenchmarkImplementation<P_parameter>* [numImplementations_]; - rates_.resize(numImplementations, numParameterSettings()); - Mflops_.resize(numImplementations, numParameterSettings()); -} - -template<class P_parameter> -Benchmark<P_parameter>::~Benchmark() -{ - delete [] implementations_; -} - -template<class P_parameter> -void Benchmark<P_parameter>::addImplementation( - BenchmarkImplementation<P_parameter> * implementation) -{ - BZPRECONDITION(state_ == uninitialized); - BZPRECONDITION(numStoredImplementations_ < numImplementations_); - - implementations_[numStoredImplementations_++] = implementation; - - if (numStoredImplementations_ == numImplementations_) - state_ = initialized; -} - -template<class P_parameter> -void Benchmark<P_parameter>::run(ostream& log) -{ - BZPRECONDITION(state_ == initialized); - state_ = running; - - Timer t; - - for (unsigned j=0; j < numImplementations_; ++j) - { - for (unsigned i=0; i < numParameterSettings(); ++i) - { - log << setw(20) << implementations_[j]->implementationName() - << " " << setw(8) << getParameterSetting(i) << " "; - log.flush(); - - implementations_[j]->initialize(getParameterSetting(i)); - implementations_[j]->tickle(); - - unsigned long iterations = getIterationSetting(i); - - t.start(); - implementations_[j]->run(iterations); - t.stop(); - double tm = t.elapsedSeconds(); - - t.start(); - implementations_[j]->runOverhead(iterations); - t.stop(); - double tmOverhead = t.elapsedSeconds(); - - rates_(j,i) = iterations / (tm - tmOverhead); - Mflops_(j,i) = rates_(j,i) - * implementations_[j]->flopsPerIteration() / 1.0e+6; - - log << setw(10) << (rates_(j,i)/1.0e+6) << " Mops/s "; - - if (implementations_[j]->flopsPerIteration() != 0) - { - log << "[" << setw(7) << Mflops_(j,i) << " Mflops]"; - } - - log << endl; - log.flush(); - - implementations_[j]->done(); - } - } - - state_ = done; -} - -template<class P_parameter> -double Benchmark<P_parameter>::getMflops(unsigned implementation, - unsigned setting) const -{ - BZPRECONDITION(state_ == done); - BZPRECONDITION(implementation < numImplementations_); - BZPRECONDITION(setting < numParameterSettings()); - - return Mflops_(implementation, setting); -} - -template<class P_parameter> -double Benchmark<P_parameter>::getRate(unsigned implementation, - unsigned setting) const -{ - BZPRECONDITION(state_ == done); - BZPRECONDITION(implementation < numImplementations_); - BZPRECONDITION(setting < numParameterSettings()); - - return rates_(implementation, setting); -} - -template<class P_parameter> -void Benchmark<P_parameter>::saveMatlabGraph(const char* filename) const -{ - BZPRECONDITION(state_ == done); - - ofstream ofs(filename); - - assert(ofs.good()); - - ofs << "% This matlab file generated automatically by class Benchmark" - << endl << "% of the Blitz++ class library." << endl << endl; - - ofs.setf(ios::scientific); - - ofs << "parm = [ "; - int i; - for (i=0; i < numParameterSettings(); ++i) - ofs << setprecision(12) << double(getParameterSetting(i)) << " "; - ofs << "]; " << endl << endl; - - ofs << "Mf = [ "; - for (i=0; i < numParameterSettings(); ++i) - { - for (int j=0; j < numImplementations_; ++j) - { - ofs << setprecision(12) << getMflops(j,i) << " "; - } - if (i != numParameterSettings()-1) - ofs << ";" << endl; - } - ofs << "] ;" << endl << endl; - - ofs << "semilogx(parm,Mf), title('" << description() << "'), " << endl - << " xlabel('" << parameterDescription() << "'), " - << "ylabel('Mflops')" << endl - << "legend("; - - for (int j=0; j < numImplementations_; ++j) - { - ofs << "'" << implementations_[j]->implementationName() - << "'"; - if (j != numImplementations_ - 1) - ofs << ", "; - } - - ofs << ")" << endl; -} - -BZ_NAMESPACE_END - -#endif // BZ_BENCH_CC diff --git a/weave/blitz-20001213/blitz/bench.h b/weave/blitz-20001213/blitz/bench.h deleted file mode 100644 index 67c78da47..000000000 --- a/weave/blitz-20001213/blitz/bench.h +++ /dev/null @@ -1,156 +0,0 @@ -/*************************************************************************** - * blitz/bench.h Benchmark classes - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:30:34 tveldhui - * Prior to rewrite of Bench class; in this version, Bench contains - * each benchmark implementation. - * - */ - -#ifndef BZ_BENCH_H -#define BZ_BENCH_H - -#ifndef BZ_MATRIX_H - #include <blitz/matrix.h> -#endif - -#ifndef BZ_TIMER_H - #include <blitz/timer.h> -#endif - -#include <math.h> - -BZ_NAMESPACE(blitz) - -// Forward declaration -template<class P_parameter = unsigned> -class BenchmarkImplementation; - - -// Declaration of class Benchmark<T> -// The template parameter T is the parameter type which is varied in -// the benchmark. Typically T will be an unsigned, and will represent -// the length of a vector, size of an array, etc. - -template<class P_parameter = unsigned> -class Benchmark { - -public: - typedef P_parameter T_parameter; - - Benchmark(unsigned numImplementations); - - ~Benchmark(); - - void addImplementation(BenchmarkImplementation<T_parameter>* - implementation); - - void run(ostream& log = cout); - - double getMflops(unsigned implementation, unsigned setting) const; - - double getRate(unsigned implementation, unsigned setting) const; - - void saveMatlabGraph(const char* filename) const; - -public: - // Virtual functions - - virtual const char* description() const - { return ""; } - - virtual const char* parameterDescription() const - { return "Vector length"; } - - virtual unsigned numParameterSettings() const - { return 19; } - - virtual T_parameter getParameterSetting(unsigned i) const - { return ::pow(10.0, (i+1)/4.0); } - - virtual long getIterationSetting(unsigned i) const - { return 1000000L / getParameterSetting(i); } - -private: - Benchmark(const Benchmark<P_parameter>&) { } - void operator=(const Benchmark<P_parameter>&) { } - - enum { uninitialized, initialized, running, done } state_; - - unsigned numImplementations_; - unsigned numStoredImplementations_; - - BenchmarkImplementation<T_parameter>** implementations_; - - Matrix<double,RowMajor> rates_; // Iterations per second array - Matrix<double,RowMajor> Mflops_; -}; - -template<class P_parameter> -class BenchmarkImplementation { - -public: - typedef P_parameter T_parameter; - - virtual void initialize(P_parameter parameter) { } - - virtual void done() { } - - virtual const char* implementationName() const - { return ""; } - - virtual void run(long iterations) = 0; - - virtual void runOverhead(long iterations) - { - for (long i=0; i < iterations; ++i) - { - } - }; - - virtual void tickle() { } - - virtual long flopsPerIteration() const - { return 0; } -}; - -BZ_NAMESPACE_END - -#include <blitz/bench.cc> - -#endif // BZ_BENCH_H diff --git a/weave/blitz-20001213/blitz/benchext.cc b/weave/blitz-20001213/blitz/benchext.cc deleted file mode 100644 index 3b840bb8e..000000000 --- a/weave/blitz-20001213/blitz/benchext.cc +++ /dev/null @@ -1,325 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_BENCHEXT_CC -#define BZ_BENCHEXT_CC - -#ifndef BZ_BENCHEXT_H - #error <blitz/benchext.cc> must be included via <blitz/benchext.h> -#endif - -#ifdef BZ_HAVE_STD - #include <fstream> -#else - #include <fstream.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_parameter> -BenchmarkExt<P_parameter>::BenchmarkExt(const char* name, - int numImplementations) -{ - BZPRECONDITION(numImplementations > 0); - - description_ = name; - numImplementations_ = numImplementations; - - implementationDescriptions_.resize(numImplementations); - parameterDescription_ = "Vector length"; - rateDescription_ = "Mflops/s"; - - // Set up default parameters and iterations - setNumParameters(19); - - // NEEDS_WORK: once pow(X,Y) is supported, can just say - // parameters_ = pow(10.0, Range(1,20)/4.0); - - for (int i=0; i < numParameters_; ++i) - parameters_[i] = (P_parameter)::pow(10.0, (i+1)/4.0); - - iterations_ = 5.0e+5 / parameters_; - flopsPerIteration_ = parameters_; - - // Set up initial state - state_ = initializing; - implementationNumber_ = 0; -} - -template<class P_parameter> -BenchmarkExt<P_parameter>::~BenchmarkExt() -{ -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setNumParameters(int numParameters) -{ - BZPRECONDITION(state_ == initializing); - - numParameters_ = numParameters; - - parameters_.resize(numParameters_); - iterations_.resize(numParameters_); - flopsPerIteration_.resize(numParameters_); - - // Set up timer and Mflops array - times_.resize(numImplementations_, numParameters_); -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setParameterVector(Vector<P_parameter> parms) -{ - BZPRECONDITION(state_ == initializing); - BZPRECONDITION(parms.length() == parameters_.length()); - - // NEEDS_WORK: should use operator=(), once that problem - // gets sorted out. - // parameters_ = parms; - for (int i=0; i < parameters_.length(); ++i) - parameters_[i] = parms(i); -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setParameterDescription(const char* string) -{ - parameterDescription_ = string; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setIterations(Vector<long> iters) -{ - BZPRECONDITION(state_ == initializing); - - // NEEDS_WORK: should use operator=(), once that problem - // gets sorted out. - // iterations_ = iters; - - for (int i=0; i < iterations_.length(); ++i) - iterations_[i] = iters(i); -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setFlopsPerIteration(Vector<double> - flopsPerIteration) -{ - BZPRECONDITION(flopsPerIteration_.length() == flopsPerIteration.length()); - - // NEEDS_WORK: should use operator=(), once that problem - // gets sorted out. - // flopsPerIteration_ = flopsPerIteration; - - for (int i=0; i < flopsPerIteration_.length(); ++i) - flopsPerIteration_[i] = flopsPerIteration[i]; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::setRateDescription(const char* string) -{ - rateDescription_ = string; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::beginBenchmarking() -{ - BZPRECONDITION(state_ == initializing); - state_ = benchmarking; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::beginImplementation(const char* description) -{ - BZPRECONDITION(implementationNumber_ < numImplementations_); - BZPRECONDITION(state_ == benchmarking); - - implementationDescriptions_[implementationNumber_] = description; - - state_ = benchmarkingImplementation; - parameterNumber_ = 0; -} - -template<class P_parameter> -_bz_bool BenchmarkExt<P_parameter>::doneImplementationBenchmark() const -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - return parameterNumber_ == numParameters_; -} - -template<class P_parameter> -P_parameter BenchmarkExt<P_parameter>::getParameter() const -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - BZPRECONDITION(parameterNumber_ >= 0); - BZPRECONDITION(parameterNumber_ < numParameters_); - - return parameters_[parameterNumber_]; -} - -template<class P_parameter> -long BenchmarkExt<P_parameter>::getIterations() const -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - BZPRECONDITION(parameterNumber_ >= 0); - BZPRECONDITION(parameterNumber_ < numParameters_); - - return iterations_[parameterNumber_]; -} - -template<class P_parameter> -inline void BenchmarkExt<P_parameter>::start() -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - BZPRECONDITION(parameterNumber_ < numParameters_); - state_ = running; - timer_.start(); -} - -template<class P_parameter> -inline void BenchmarkExt<P_parameter>::stop() -{ - timer_.stop(); - BZPRECONDITION(state_ == running); - state_ = benchmarkingImplementation; - - times_(implementationNumber_, parameterNumber_) = timer_.elapsedSeconds(); - - ++parameterNumber_; -} - -template<class P_parameter> -inline void BenchmarkExt<P_parameter>::setTime(double seconds) -{ - BZPRECONDITION(state_ == running); - state_ = benchmarkingImplementation; - times_(implementationNumber_, parameterNumber_) = seconds; - ++parameterNumber_; -} - -template<class P_parameter> -inline void BenchmarkExt<P_parameter>::startOverhead() -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - BZPRECONDITION(parameterNumber_ > 0); - BZPRECONDITION(parameterNumber_ <= numParameters_); - state_ = runningOverhead; - overheadTimer_.start(); -} - -template<class P_parameter> -inline void BenchmarkExt<P_parameter>::stopOverhead() -{ - BZPRECONDITION(state_ == runningOverhead); - overheadTimer_.stop(); - times_(implementationNumber_, parameterNumber_-1) -= - overheadTimer_.elapsedSeconds(); - - state_ = benchmarkingImplementation; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::endImplementation() -{ - BZPRECONDITION(state_ == benchmarkingImplementation); - BZPRECONDITION(parameterNumber_ == numParameters_); - - ++implementationNumber_; - - state_ = benchmarking; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::endBenchmarking() -{ - BZPRECONDITION(state_ == benchmarking); - BZPRECONDITION(implementationNumber_ == numImplementations_); - - state_ = done; -} - -template<class P_parameter> -double BenchmarkExt<P_parameter>::getMflops(unsigned implementation, - unsigned parameterNum) const -{ - BZPRECONDITION(state_ == done); - BZPRECONDITION(implementation < numImplementations_); - BZPRECONDITION(parameterNum < numParameters_); - return iterations_(parameterNum) * flopsPerIteration_(parameterNum) - / times_(implementation, parameterNum) / 1.0e+6; -} - -template<class P_parameter> -void BenchmarkExt<P_parameter>::saveMatlabGraph(const char* filename) const -{ - BZPRECONDITION(state_ == done); - - ofstream ofs(filename); - - assert(ofs.good()); - - ofs << "% This matlab file generated automatically by class Benchmark" - << endl << "% of the Blitz++ class library." << endl << endl; - - ofs.setf(ios::scientific); - - // This will be a lot simpler once Matlab-style output formatting - // of vectors & matrices is finished. - - // ofs << "parm = " << parameters_ << ";" << endl << endl; - - ofs << "parm = [ "; - int i; - for (i=0; i < numParameters_; ++i) - ofs << setprecision(12) << double(parameters_[i]) << " "; - ofs << "]; " << endl << endl; - - ofs << "Mf = [ "; - for (i=0; i < numParameters_; ++i) - { - for (int j=0; j < numImplementations_; ++j) - { - ofs << setprecision(12) << getMflops(j,i) << " "; - } - if (i != numParameters_ - 1) - ofs << ";" << endl; - } - ofs << "] ;" << endl << endl; - - ofs << "semilogx(parm,Mf), title('" << description_ << "'), " << endl - << " xlabel('" << parameterDescription_ << "'), " - << "ylabel('" << rateDescription_ << "')" << endl - << "legend("; - - for (int j=0; j < numImplementations_; ++j) - { - ofs << "'" << implementationDescriptions_(j) << "'"; - if (j != numImplementations_ - 1) - ofs << ", "; - } - - ofs << ")" << endl; -} - -BZ_NAMESPACE_END - -#endif // BZ_BENCHEXT_CC diff --git a/weave/blitz-20001213/blitz/benchext.h b/weave/blitz-20001213/blitz/benchext.h deleted file mode 100644 index 71fd38228..000000000 --- a/weave/blitz-20001213/blitz/benchext.h +++ /dev/null @@ -1,139 +0,0 @@ -/*************************************************************************** - * blitz/benchext.h BenchmarkExt classes (Benchmarks with external - * control) - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_BENCHEXT_H -#define BZ_BENCHEXT_H - -#ifndef BZ_MATRIX_H - #include <blitz/matrix.h> -#endif - -#ifndef BZ_TIMER_H - #include <blitz/timer.h> -#endif - -#include <math.h> - -// NEEDS_WORK: replace use of const char* with <string>, once standard -// library is widely supported. - -BZ_NAMESPACE(blitz) - -// Declaration of class BenchmarkExt<T> -// The template parameter T is the parameter type which is varied in -// the benchmark. Typically T will be an unsigned, and will represent -// the length of a vector, size of an array, etc. - -template<class P_parameter = unsigned> -class BenchmarkExt { - -public: - typedef P_parameter T_parameter; - - BenchmarkExt(const char* description, int numImplementations); - - ~BenchmarkExt(); - - void setNumParameters(int numParameters); - void setParameterVector(Vector<T_parameter> parms); - void setParameterDescription(const char* string); - void setIterations(Vector<long> iters); - void setFlopsPerIteration(Vector<double> flopsPerIteration); - void setRateDescription(const char* string); - - void beginBenchmarking(); - - void beginImplementation(const char* description); - - _bz_bool doneImplementationBenchmark() const; - - T_parameter getParameter() const; - long getIterations() const; - - inline void start(); - inline void stop(); - void setTime(double s); - - void startOverhead(); - void stopOverhead(); - - void endImplementation(); - - void endBenchmarking(); - - double getMflops(unsigned implementation, unsigned parameterNum) const; - - void saveMatlabGraph(const char* filename) const; - -protected: - BenchmarkExt(const BenchmarkExt<P_parameter>&) { } - void operator=(const BenchmarkExt<P_parameter>&) { } - - enum { initializing, benchmarking, benchmarkingImplementation, - running, runningOverhead, done } state_; - - unsigned numImplementations_; - unsigned implementationNumber_; - - const char* description_; - Vector<const char*> implementationDescriptions_; - - Matrix<double,RowMajor> times_; // Elapsed time - - Vector<T_parameter> parameters_; - Vector<long> iterations_; - Vector<double> flopsPerIteration_; - - Timer timer_; - Timer overheadTimer_; - - const char* parameterDescription_; - const char* rateDescription_; - - int numParameters_; - int parameterNumber_; -}; - -BZ_NAMESPACE_END - -#include <blitz/benchext.cc> - -#endif // BZ_BENCHEXT_H diff --git a/weave/blitz-20001213/blitz/blitz.h b/weave/blitz-20001213/blitz/blitz.h deleted file mode 100644 index 4cf829f09..000000000 --- a/weave/blitz-20001213/blitz/blitz.h +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * blitz/blitz.h Includes all the important header files - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.7 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.6 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.5 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.4 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.2 1996/11/11 17:29:13 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/04/14 21:13:00 todd - * Initial revision - * - */ - -#ifndef BZ_BLITZ_H -#define BZ_BLITZ_H - -/* - * These symbols allow use of the IEEE and System V math libraries - * (libm.a and libmsaa.a) on some platforms. - */ - -#ifdef BZ_ENABLE_XOPEN_SOURCE - #ifndef _ALL_SOURCE - #define _ALL_SOURCE - #endif - #ifndef _XOPEN_SOURCE - #define _XOPEN_SOURCE - #endif - #ifndef _XOPEN_SOURCE_EXTENDED - #define _XOPEN_SOURCE_EXTENDED 1 - #endif -#endif - -#include <blitz/compiler.h> // Compiler-specific directives -#include <blitz/tuning.h> // Performance tuning -#include <blitz/tau.h> // Profiling - -#include <string> -#include <stdio.h> // sprintf, etc. - -#ifdef BZ_HAVE_STD - #include <iostream> - #include <iomanip> -#else - #include <iostream.h> - #include <iomanip.h> -#endif - -#ifdef BZ_MATH_FN_IN_NAMESPACE_STD - #include <cmath> -#endif - -#include <math.h> - -#ifdef BZ_HAVE_COMPLEX - #include <complex> -#endif - -#define BZ_THROW // Needed in <blitz/numinquire.h> - -BZ_NAMESPACE(blitz) - -#ifdef BZ_HAVE_STD - BZ_USING_NAMESPACE(std) -#endif - -#ifdef BZ_GENERATE_GLOBAL_INSTANCES - #define _bz_global - #define BZ_GLOBAL_INIT(X) =X -#else - #define _bz_global extern - #define BZ_GLOBAL_INIT(X) -#endif - -BZ_NAMESPACE_END - -#include <blitz/bzdebug.h> // Debugging macros - -#endif // BZ_BLITZ_H diff --git a/weave/blitz-20001213/blitz/bzdebug.h b/weave/blitz-20001213/blitz/bzdebug.h deleted file mode 100644 index ba02b91c8..000000000 --- a/weave/blitz-20001213/blitz/bzdebug.h +++ /dev/null @@ -1,247 +0,0 @@ -/*************************************************************************** - * blitz/bzdebug.h Debugging macros - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.7 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.6 1998/02/26 18:09:36 tveldhui - * Added testsuite support for precondition fail checking - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.2 1996/11/11 17:29:13 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/04/14 12:36:45 todd - * Initial revision - * - * - */ - -#ifndef BZ_DEBUG_H -#define BZ_DEBUG_H - -#include <stdlib.h> -#include <assert.h> - -#ifdef BZ_RTTI - #include <typeinfo> -#endif - -BZ_NAMESPACE(blitz) - -/* - * These globals are used by the Blitz++ testsuite. The _bz_global - * modifier ensures that they will reside in libblitz.a, but appear - * "extern" elsewhere. - */ - -_bz_global _bz_bool assertFailMode BZ_GLOBAL_INIT(_bz_false); -_bz_global int assertFailCount BZ_GLOBAL_INIT(0); -_bz_global int assertSuccessCount BZ_GLOBAL_INIT(0); - - -#ifdef BZ_TESTSUITE - /* - * In testsuite mode, these routines allow a test suite to check - * that precondition checking is being done properly. A typical - * use looks like this: - * - * beginCheckAssert(); - * // Some operation which should cause an assert to fail - * endCheckAssert(); - * - * The routine beginCheckAssert() sets a flag which results in - * failed asserts being silently tallied. If no asserts have - * failed by the time endCheckAssert() is invoked, the program - * halts and issues an error code. - * - * In normal operation (i.e. when beginCheckAssert() has not - * been called), failed preconditions will cause the program - * to halt and issue an error code. -- TV 980226 - */ - - inline void checkAssert(_bz_bool condition, const char* where=0, - int line=0) - { - if (assertFailMode == _bz_true) - { - if (condition == _bz_true) - ++assertSuccessCount; - else - ++assertFailCount; - } - else { - if (!condition) - { - cerr << "Unexpected assert failure!" << endl; - if (where) - cerr << where << ":" << line << endl; - cerr.flush(); - assert(0); - } - } - } - - inline void beginCheckAssert() - { - assertFailMode = _bz_true; - assertSuccessCount = 0; - assertFailCount = 0; - } - - inline void endCheckAssert() - { - assert(assertFailMode == _bz_true); - assertFailMode = _bz_false; - if (assertFailCount == 0) - { - cerr << "Assert check failed!" << endl; - assert(0); - } - } - - #define BZASSERT(X) checkAssert(X, __FILE__, __LINE__) - #define BZPRECONDITION(X) checkAssert(X, __FILE__, __LINE__) - #define BZPOSTCONDITION(X) checkAssert(X, __FILE__, __LINE__) - #define BZSTATECHECK(X,Y) checkAssert(X == Y, __FILE__, __LINE__) - #define BZPRECHECK(X,Y) \ - { \ - if ((assertFailMode == _bz_false) && (!(X))) \ - cerr << Y << endl; \ - checkAssert(X, __FILE__, __LINE__); \ - } - - #define BZ_DEBUG_MESSAGE(X) \ - { if (assertFailMode == _bz_false) { cout << __FILE__ << ":" << __LINE__ << " " << X << endl; } } - - #define BZ_PRE_FAIL checkAssert(0) -#else -#ifdef BZ_DEBUG - #define BZASSERT(X) assert(X) - #define BZPRECONDITION(X) assert(X) - #define BZPOSTCONDITION(X) assert(X) - #define BZSTATECHECK(X,Y) assert(X == Y) - #define BZPRECHECK(X,Y) \ - { if (!(X)) \ - { cerr << "[Blitz++] Precondition failure: Module " << __FILE__ \ - << " line " << __LINE__ << endl \ - << Y << endl; \ - cerr.flush(); \ - assert(0); \ - } \ - } - - #define BZ_PRE_FAIL assert(0) - - #define BZ_DEBUG_MESSAGE(X) \ - { cout << __FILE__ << ":" << __LINE__ << " " << X << endl; } - - void _bz_debug_marker(); - #define BZ_ASM_DEBUG_MARKER _bz_debug_marker(); -#else // !BZ_DEBUG - #define BZASSERT(X) - #define BZPRECONDITION(X) - #define BZPOSTCONDITION(X) - #define BZSTATECHECK(X,Y) - #define BZPRECHECK(X,Y) - #define BZ_PRE_FAIL - #define BZ_DEBUG_MESSAGE(X) -#endif // !BZ_DEBUG -#endif // !BZ_TESTSUITE - -// This routine doesn't exist anywhere; it's used to mark a -// position of interest in assembler (.s) files -void _bz_debug_marker(); - -#define BZ_NOT_IMPLEMENTED() { cerr << "[Blitz++] Not implemented: module " \ - << __FILE__ << " line " << __LINE__ << endl; \ - exit(1); } - -#ifdef BZ_RTTI -#define BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(X) typeid(X).name() -#else - -template<class T> -class _bz_stringLiteralForNumericType { -public: - static const char* string() - { return "unknown"; } -}; - -#define BZ_DECL_SLFNT(X,Y) \ - template<> \ - class _bz_stringLiteralForNumericType< X > { \ - public: \ - static const char* string() \ - { return Y; } \ - } - -#ifdef BZ_BOOL -BZ_DECL_SLFNT(bool, "bool"); -#endif - -BZ_DECL_SLFNT(char, "char"); -BZ_DECL_SLFNT(unsigned char, "unsigned char"); -BZ_DECL_SLFNT(short int, "short int"); -BZ_DECL_SLFNT(short unsigned int, "short unsigned int"); -BZ_DECL_SLFNT(int, "int"); -BZ_DECL_SLFNT(unsigned int, "unsigned int"); -BZ_DECL_SLFNT(long, "long"); -BZ_DECL_SLFNT(unsigned long, "unsigned long"); -BZ_DECL_SLFNT(float, "float"); -BZ_DECL_SLFNT(double, "double"); -BZ_DECL_SLFNT(long double, "long double"); - -#ifdef BZ_HAVE_COMPLEX -BZ_DECL_SLFNT(complex<float>, "complex<float>"); -BZ_DECL_SLFNT(complex<double>, "complex<double>"); -BZ_DECL_SLFNT(complex<long double>, "complex<long double>"); -#endif - -#define BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(X) \ - _bz_stringLiteralForNumericType<X>::string() - -#endif // !BZ_RTTI - -BZ_NAMESPACE_END - -#endif // BZ_DEBUG_H diff --git a/weave/blitz-20001213/blitz/compiler.h b/weave/blitz-20001213/blitz/compiler.h deleted file mode 100644 index 783a7eb94..000000000 --- a/weave/blitz-20001213/blitz/compiler.h +++ /dev/null @@ -1,189 +0,0 @@ -/*************************************************************************** - * blitz/compiler.h Compiler specific directives and kludges - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.7 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.6 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.5 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.4 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.3 1996/11/11 17:29:13 tveldhui - * Periodic RCS update - * - * - */ - - -#ifndef BZ_COMPILER_H -#define BZ_COMPILER_H - -// The file <blitz/config.h> is generated automatically by the -// script 'bzconfig', located in the 'compiler' directory. - -#include <blitz/config.h> - -/* - * Define some kludges. - */ - -#ifndef BZ_TEMPLATES - #error In <blitz/config.h>: A working template implementation is required by Blitz++ (you may need to rerun the compiler/bzconfig script) -#endif - -#ifndef BZ_MEMBER_TEMPLATES - #error In <blitz/config.h>: Your compiler does not support member templates. (you may need to rerun the compiler/bzconfig script) -#endif - -#ifndef BZ_FULL_SPECIALIZATION_SYNTAX - #error In <blitz/config.h>: Your compiler does not support template<> full specialization syntax. You may need to rerun the compiler/bzconfig script. -#endif - -#ifndef BZ_PARTIAL_ORDERING - #error In <blitz/config.h>: Your compiler does not support partial ordering (you may need to rerun the compiler/bzconfig script) -#endif - -#ifndef BZ_PARTIAL_SPECIALIZATION - #error In <blitz/config.h>: Your compiler does not support partial specialization (you may need to rerun the compiler/bzconfig script) -#endif - -#ifdef BZ_NAMESPACES - #define BZ_NAMESPACE(X) namespace X { - #define BZ_NAMESPACE_END } - #define BZ_USING_NAMESPACE(X) using namespace X; -#else - #define BZ_NAMESPACE(X) - #define BZ_NAMESPACE_END - #define BZ_USING_NAMESPACE(X) -#endif - -#ifdef BZ_TEMPLATE_QUALIFIED_RETURN_TYPE - #define BZ_USE_NUMTRAIT -#endif - -#ifdef BZ_DEFAULT_TEMPLATE_PARAMETERS - #define BZ_TEMPLATE_DEFAULT(X) = X -#else - #define BZ_TEMPLATE_DEFAULT -#endif - -#ifdef BZ_EXPLICIT - #define _bz_explicit explicit -#else - #define _bz_explicit -#endif - -#ifdef BZ_TYPENAME - #define _bz_typename typename -#else - #define _bz_typename -#endif - -#ifdef BZ_MUTABLE - #define _bz_mutable mutable -#else - #define _bz_mutable -#endif - -#ifdef BZ_DISABLE_RESTRICT - #undef BZ_NCEG_RESTRICT -#endif - -#ifdef BZ_NCEG_RESTRICT - #define _bz_restrict restrict -#elif defined(BZ_NCEG_RESTRICT_EGCS) - #define _bz_restrict __restrict__ -#else - #define _bz_restrict -#endif - -#ifdef BZ_BOOL - #define _bz_bool bool - #define _bz_true true - #define _bz_false false -#else - #define _bz_bool int - #define _bz_true 1 - #define _bz_false 0 -#endif - -#ifdef BZ_ENUM_COMPUTATIONS_WITH_CAST - #define BZ_ENUM_CAST(X) (int)X -#elif defined(BZ_ENUM_COMPUTATIONS) - #define BZ_ENUM_CAST(X) X -#else - #error In <blitz/config.h>: Your compiler does not support enum computations. You may have to rerun compiler/bzconfig. -#endif - -#if defined(BZ_MATH_FN_IN_NAMESPACE_STD) - #define BZ_MATHFN_SCOPE(x) std::x -#elif defined(BZ_NAMESPACES) - #define BZ_MATHFN_SCOPE(x) ::x -#else - #define BZ_MATHFN_SCOPE(x) x -#endif - -#if defined(BZ_COMPLEX_MATH_IN_NAMESPACE_STD) - #define BZ_CMATHFN_SCOPE(x) std::x -#elif defined(BZ_NAMESPACES) - #define BZ_CMATHFN_SCOPE(x) ::x -#else - #define BZ_CMATHFN_SCOPE(x) x -#endif - -#if defined(BZ_NAMESPACES) - #define BZ_IEEEMATHFN_SCOPE(x) ::x -#else - #define BZ_IEEEMATHFN_SCOPE(x) x -#endif - -#if defined(BZ_NAMESPACES) - #define BZ_BLITZ_SCOPE(x) blitz::x -#else - #define BZ_BLITZ_SCOPE(x) ::x -#endif - -#if defined(BZ_NAMESPACES) - #define BZ_STD_SCOPE(x) std::x -#else - #define BZ_STD_SCOPE(x) ::x -#endif - -#endif // BZ_COMPILER_H - diff --git a/weave/blitz-20001213/blitz/config.h b/weave/blitz-20001213/blitz/config.h deleted file mode 100644 index b8b1f0c32..000000000 --- a/weave/blitz-20001213/blitz/config.h +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * config.h Compiler language support flags - * - * This file was generated automatically by the script bzconfig. - * You should rerun bzconfig each time you switch compilers, install new - * standard libraries, or change compiler versions. - * - */ - - -#ifndef BZ_CONFIG_H -#define BZ_CONFIG_H - -#define BZ_COMPILER_NAME "g++" -#define BZ_COMPILER_OPTIONS "-ftemplate-depth-30" -#define BZ_OS_NAME "Linux 2.2.14-5.0" -#define BZ_BZCONFIG_DATE "Tue Apr 10 21:43:49 EDT 2001" -#define BZ_PLATFORM "i686-pc-linux-gnu" - -#define BZ_NAMESPACES -#define BZ_EXCEPTIONS -#define BZ_RTTI -#define BZ_MEMBER_CONSTANTS -#undef BZ_OLD_FOR_SCOPING -#define BZ_EXPLICIT -#define BZ_MUTABLE -#define BZ_TYPENAME -#undef BZ_NCEG_RESTRICT -#define BZ_NCEG_RESTRICT_EGCS -#define BZ_BOOL -#define BZ_CONST_CAST -#define BZ_STATIC_CAST -#define BZ_REINTERPRET_CAST -#define BZ_DYNAMIC_CAST -#define BZ_TEMPLATES -#define BZ_PARTIAL_SPECIALIZATION -#define BZ_PARTIAL_ORDERING -#define BZ_DEFAULT_TEMPLATE_PARAMETERS -#define BZ_MEMBER_TEMPLATES -#define BZ_MEMBER_TEMPLATES_OUTSIDE_CLASS -#define BZ_FULL_SPECIALIZATION_SYNTAX -#define BZ_FUNCTION_NONTYPE_PARAMETERS -#define BZ_TEMPLATE_QUALIFIED_BASE_CLASS -#define BZ_TEMPLATE_QUALIFIED_RETURN_TYPE -#define BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION -#define BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS -#define BZ_TEMPLATE_KEYWORD_QUALIFIER -#define BZ_TEMPLATE_SCOPED_ARGUMENT_MATCHING -#define BZ_TYPE_PROMOTION -#define BZ_USE_NUMTRAIT -#define BZ_ENUM_COMPUTATIONS -#define BZ_ENUM_COMPUTATIONS_WITH_CAST -#define BZ_HAVE_COMPLEX -#undef BZ_HAVE_NUMERIC_LIMITS -#define BZ_HAVE_CLIMITS -#define BZ_HAVE_VALARRAY -#undef BZ_HAVE_COMPLEX_MATH -#define BZ_HAVE_IEEE_MATH -#undef BZ_HAVE_SYSTEM_V_MATH -#define BZ_MATH_FN_IN_NAMESPACE_STD -#define BZ_COMPLEX_MATH_IN_NAMESPACE_STD -#define BZ_HAVE_STD -#define BZ_HAVE_STL -#define BZ_HAVE_RUSAGE - -#endif // BZ_CONFIG_H diff --git a/weave/blitz-20001213/blitz/etbase.h b/weave/blitz-20001213/blitz/etbase.h deleted file mode 100644 index f8cf9d0f6..000000000 --- a/weave/blitz-20001213/blitz/etbase.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef BZ_ETBASE_H -#define BZ_ETBASE_H - -BZ_NAMESPACE(blitz) - -template<class T> -class ETBase { -public: - ETBase() - { } - - ETBase(const ETBase<T>&) - { } -}; - -BZ_NAMESPACE_END - -#endif // BZ_ETBASE_H - diff --git a/weave/blitz-20001213/blitz/extremum.h b/weave/blitz-20001213/blitz/extremum.h deleted file mode 100644 index 0a42018b4..000000000 --- a/weave/blitz-20001213/blitz/extremum.h +++ /dev/null @@ -1,97 +0,0 @@ -/*************************************************************************** - * blitz/extremum.h Declaration of the Extremum<T_numtype, T_index> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_EXTREMUM_H -#define BZ_EXTREMUM_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -// The Extremum class is used for returning extreme values and their -// locations in a numeric container. It's a simple 2-tuple, with the -// first element being the extreme value, and the send its location. -// An object of type Extremum can be automatically converted to -// the numeric type via operator T_numtype(). -template<class P_numtype, class P_index> -class Extremum { -public: - typedef P_numtype T_numtype; - typedef P_index T_index; - - Extremum(T_numtype value, T_index index) - : value_(value), index_(index) - { } - - T_numtype value() const - { return value_; } - - T_index index() const - { return index_; } - - void setValue(T_numtype value) - { value_ = value; } - - void setIndex(T_index index) - { index_ = index; } - - operator T_numtype() const - { return value_; } - -protected: - T_numtype value_; - T_index index_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_EXTREMUM_H - diff --git a/weave/blitz-20001213/blitz/indexexpr.h b/weave/blitz-20001213/blitz/indexexpr.h deleted file mode 100644 index 55ed7426a..000000000 --- a/weave/blitz-20001213/blitz/indexexpr.h +++ /dev/null @@ -1,236 +0,0 @@ -/*************************************************************************** - * blitz/indexexpr.h Declaration of the IndexPlaceholder<N> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * p://seurat.uhttwaterloo.ca/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_INDEXEXPR_H -#define BZ_INDEXEXPR_H - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_PRETTYPRINT_H - #include <blitz/prettyprint.h> -#endif - -#ifndef BZ_ETBASE_H - #include <blitz/etbase.h> -#endif - -BZ_NAMESPACE(blitz) - -template<int N> -class IndexPlaceholder -#ifdef BZ_NEW_EXPRESSION_TEMPLATES - : public ETBase<IndexPlaceholder<N> > -#endif -{ -public: - IndexPlaceholder() - { } - - IndexPlaceholder(const IndexPlaceholder<N>&) - { } - - ~IndexPlaceholder() - { } - - void operator=(const IndexPlaceholder<N>&) - { } - - typedef int T_numtype; - typedef int T_ctorArg1; // Dummy; not used - typedef int T_ctorArg2; // Ditto - - enum { numArrayOperands = 0, numIndexPlaceholders = 1, - rank = N+1 }; - - // If you have a precondition failure on this routine, it means - // you are trying to use stack iteration mode on an expression - // which contains an index placeholder. You must use index - // iteration mode instead. - int operator*() - { - BZPRECONDITION(0); - return 0; - } - -#ifdef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE - template<int N_rank> - T_numtype operator()(TinyVector<int, N_rank> i) - { return i[N]; } -#else - template<int N_rank> - T_numtype operator()(const TinyVector<int, N_rank>& i) - { return i[N]; } -#endif - - int ascending(int) const - { return INT_MIN; } - - int ordering(int) const - { return INT_MIN; } - - int lbound(int) const - { return INT_MIN; } // tiny(int()); - - int ubound(int) const - { return INT_MAX; } // huge(int()); - - // See operator*() note - void push(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void pop(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance() - { - BZPRECONDITION(0); - } - - // See operator*() note - void advance(int) - { - BZPRECONDITION(0); - } - - // See operator*() note - void loadStride(int) - { - BZPRECONDITION(0); - } - - _bz_bool isUnitStride(int rank) const - { - BZPRECONDITION(0); - return false; - } - - void advanceUnitStride() - { - BZPRECONDITION(0); - } - - _bz_bool canCollapse(int,int) const - { - BZPRECONDITION(0); - return _bz_false; - } - - T_numtype operator[](int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - T_numtype fastRead(int) - { - BZPRECONDITION(0); - return T_numtype(); - } - - int suggestStride(int) const - { - BZPRECONDITION(0); - return 0; - } - - _bz_bool isStride(int,int) const - { - BZPRECONDITION(0); - return _bz_true; - } - - void prettyPrint(string& str, prettyPrintFormat& format) const - { - // NEEDS_WORK-- do real formatting for reductions - str += "index-expr[NEEDS_WORK]"; - } - - template<class T_shape> - _bz_bool shapeCheck(const T_shape& shape) const - { - return _bz_true; - } -}; - -typedef IndexPlaceholder<0> firstIndex; -typedef IndexPlaceholder<1> secondIndex; -typedef IndexPlaceholder<2> thirdIndex; -typedef IndexPlaceholder<3> fourthIndex; -typedef IndexPlaceholder<4> fifthIndex; -typedef IndexPlaceholder<5> sixthIndex; -typedef IndexPlaceholder<6> seventhIndex; -typedef IndexPlaceholder<7> eighthIndex; -typedef IndexPlaceholder<8> ninthIndex; -typedef IndexPlaceholder<9> tenthIndex; -typedef IndexPlaceholder<10> eleventhIndex; - -#ifndef BZ_NO_TENSOR_INDEX_OBJECTS - -BZ_NAMESPACE(tensor) - _bz_global blitz::IndexPlaceholder<0> i; - _bz_global blitz::IndexPlaceholder<1> j; - _bz_global blitz::IndexPlaceholder<2> k; - _bz_global blitz::IndexPlaceholder<3> l; - _bz_global blitz::IndexPlaceholder<4> m; - _bz_global blitz::IndexPlaceholder<5> n; - _bz_global blitz::IndexPlaceholder<6> o; - _bz_global blitz::IndexPlaceholder<7> p; - _bz_global blitz::IndexPlaceholder<8> q; - _bz_global blitz::IndexPlaceholder<9> r; - _bz_global blitz::IndexPlaceholder<10> s; - _bz_global blitz::IndexPlaceholder<11> t; -BZ_NAMESPACE_END // tensor - -#endif - -BZ_NAMESPACE_END - -#endif // BZ_INDEXEXPR_H - diff --git a/weave/blitz-20001213/blitz/limits-hack.h b/weave/blitz-20001213/blitz/limits-hack.h deleted file mode 100644 index 70108cc6e..000000000 --- a/weave/blitz-20001213/blitz/limits-hack.h +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Severely hacked-up version of SGI/libstdc++ limits, for use with Blitz. - */ - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/* NOTE: This is not portable code. Parts of numeric_limits<> are - * inherently machine-dependent, and this file is written for the MIPS - * architecture and the SGI MIPSpro C++ compiler. Parts of it (in - * particular, some of the characteristics of floating-point types) - * are almost certainly incorrect for any other platform. - */ - -#include <blitz/wrap-climits.h> -#include <float.h> - -BZ_NAMESPACE(std) - -enum float_round_style { - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, - round_toward_neg_infinity = 3 -}; - -enum float_denorm_style { - denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 -}; - -// Base class for all specializations of numeric_limits. - -template <class __number> -class _Numeric_limits_base { -public: - static const bool is_specialized = false; - - static __number min() { return __number(); } - static __number max() { return __number(); } - - static const int digits = 0; - static const int digits10 = 0; - - static const bool is_signed = false; - static const bool is_integer = false; - static const bool is_exact = false; - - static const int radix = 0; - - static __number epsilon() { return __number(); } - static __number round_error() { return __number(); } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static __number infinity() { return __number(); } - static __number quiet_NaN() { return __number(); } - static __number signaling_NaN() { return __number(); } - static __number denorm_min() { return __number(); } - - static const bool is_iec559 = false; - static const bool is_bounded = false; - static const bool is_modulo = false; - - static const bool traps = false; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; -}; - -#define __declare_numeric_base_member(__type, __mem) \ -template <class __number> \ - const __type _Numeric_limits_base<__number>:: __mem - -__declare_numeric_base_member(bool, is_specialized); -__declare_numeric_base_member(int, digits); -__declare_numeric_base_member(int, digits10); -__declare_numeric_base_member(bool, is_signed); -__declare_numeric_base_member(bool, is_integer); -__declare_numeric_base_member(bool, is_exact); -__declare_numeric_base_member(int, radix); -__declare_numeric_base_member(int, min_exponent); -__declare_numeric_base_member(int, max_exponent); -__declare_numeric_base_member(int, min_exponent10); -__declare_numeric_base_member(int, max_exponent10); -__declare_numeric_base_member(bool, has_infinity); -__declare_numeric_base_member(bool, has_quiet_NaN); -__declare_numeric_base_member(bool, has_signaling_NaN); -__declare_numeric_base_member(float_denorm_style, has_denorm); -__declare_numeric_base_member(bool, has_denorm_loss); -__declare_numeric_base_member(bool, is_iec559); -__declare_numeric_base_member(bool, is_bounded); -__declare_numeric_base_member(bool, is_modulo); -__declare_numeric_base_member(bool, traps); -__declare_numeric_base_member(bool, tinyness_before); -__declare_numeric_base_member(float_round_style, round_style); - -#undef __declare_numeric_base_member - -// Base class for integers. - -template <class _Int, - _Int __imin, - _Int __imax, - int __idigits = -1> -class _Integer_limits : public _Numeric_limits_base<_Int> -{ -public: - static const bool is_specialized = true; - - static _Int min() { return __imin; } - static _Int max() { return __imax; } - - static const int digits = - (__idigits < 0) ? sizeof(_Int) * CHAR_BIT - (__imin == 0 ? 0 : 1) - : __idigits; - static const int digits10 = (digits * 301) / 1000; - // log 2 = 0.301029995664... - - static const bool is_signed = __imin != 0; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - - - static const bool is_bounded = true; - static const bool is_modulo = true; -}; - -#define __declare_integer_limits_member(__type, __mem) \ -template <class _Int, _Int __imin, _Int __imax, int __idigits> \ - const __type _Integer_limits<_Int, __imin, __imax, __idigits>:: __mem - -__declare_integer_limits_member(bool, is_specialized); -__declare_integer_limits_member(int, digits); -__declare_integer_limits_member(int, digits10); -__declare_integer_limits_member(bool, is_signed); -__declare_integer_limits_member(bool, is_integer); -__declare_integer_limits_member(bool, is_exact); -__declare_integer_limits_member(int, radix); -__declare_integer_limits_member(bool, is_bounded); -__declare_integer_limits_member(bool, is_modulo); - -#undef __declare_integer_limits_member - -// Base class for floating-point numbers. -template <class __number, - int __Digits, int __Digits10, - int __MinExp, int __MaxExp, - int __MinExp10, int __MaxExp10, - unsigned int __InfinityWord, - unsigned int __QNaNWord, unsigned int __SNaNWord, - bool __IsIEC559, - float_round_style __RoundStyle> -class _Floating_limits : public _Numeric_limits_base<__number> -{ -public: - static const bool is_specialized = true; - - static const int digits = __Digits; - static const int digits10 = __Digits10; - - static const bool is_signed = true; - - static const int radix = 2; - - static const int min_exponent = __MinExp; - static const int max_exponent = __MaxExp; - static const int min_exponent10 = __MinExp10; - static const int max_exponent10 = __MaxExp10; - - static const bool has_infinity = true; - static const bool has_quiet_NaN = true; - static const bool has_signaling_NaN = true; - static const float_denorm_style has_denorm = denorm_indeterminate; - static const bool has_denorm_loss = false; - - static __number infinity() { - static unsigned int _S_inf[sizeof(__number) / sizeof(int)] = - { __InfinityWord }; - return *reinterpret_cast<__number*>(&_S_inf); - } - static __number quiet_NaN() { - static unsigned int _S_nan[sizeof(__number) / sizeof(int)] = - { __QNaNWord }; - return *reinterpret_cast<__number*>(&_S_nan); - } - static __number signaling_NaN() { - static unsigned int _S_nan[sizeof(__number) / sizeof(int)] = - { __SNaNWord }; - return *reinterpret_cast<__number*>(&_S_nan); - } - - static const bool is_iec559 = __IsIEC559; - static const bool is_bounded = true; - static const bool traps = true; - static const bool tinyness_before = false; - - static const float_round_style round_style = __RoundStyle; -}; - -#define __declare_float_limits_member(__type, __mem) \ -template <class __Num, int __Dig, int __Dig10, \ - int __MnX, int __MxX, int __MnX10, int __MxX10, \ - unsigned int __Inf, unsigned int __QNaN, unsigned int __SNaN, \ - bool __IsIEEE, float_round_style __Sty> \ -const __type _Floating_limits<__Num, __Dig, __Dig10, \ - __MnX, __MxX, __MnX10, __MxX10, \ - __Inf, __QNaN, __SNaN,__IsIEEE, __Sty>:: __mem - -__declare_float_limits_member(bool, is_specialized); -__declare_float_limits_member(int, digits); -__declare_float_limits_member(int, digits10); -__declare_float_limits_member(bool, is_signed); -__declare_float_limits_member(int, radix); -__declare_float_limits_member(int, min_exponent); -__declare_float_limits_member(int, max_exponent); -__declare_float_limits_member(int, min_exponent10); -__declare_float_limits_member(int, max_exponent10); -__declare_float_limits_member(bool, has_infinity); -__declare_float_limits_member(bool, has_quiet_NaN); -__declare_float_limits_member(bool, has_signaling_NaN); -__declare_float_limits_member(float_denorm_style, has_denorm); -__declare_float_limits_member(bool, has_denorm_loss); -__declare_float_limits_member(bool, is_iec559); -__declare_float_limits_member(bool, is_bounded); -__declare_float_limits_member(bool, traps); -__declare_float_limits_member(bool, tinyness_before); -__declare_float_limits_member(float_round_style, round_style); - -#undef __declare_float_limits_member - -// Class numeric_limits - -// The unspecialized class. - -template<class T> -class numeric_limits : public _Numeric_limits_base<T> {}; - -// Specializations for all built-in integral types. - -#ifndef __STL_NO_BOOL - -template<> -class numeric_limits<bool> - : public _Integer_limits<bool, false, true, 0> -{}; - -#endif /* __STL_NO_BOOL */ - -template<> -class numeric_limits<char> - : public _Integer_limits<char, CHAR_MIN, CHAR_MAX> -{}; - -template<> -class numeric_limits<signed char> - : public _Integer_limits<signed char, SCHAR_MIN, SCHAR_MAX> -{}; - -template<> -class numeric_limits<unsigned char> - : public _Integer_limits<unsigned char, 0, UCHAR_MAX> -{}; - -#ifdef __STL_HAS_WCHAR_T - -template<> -class numeric_limits<wchar_t> - : public _Integer_limits<wchar_t, INT_MIN, INT_MAX> -{}; - -#endif - -template<> -class numeric_limits<short> - : public _Integer_limits<short, SHRT_MIN, SHRT_MAX> -{}; - -template<> -class numeric_limits<unsigned short> - : public _Integer_limits<unsigned short, 0, USHRT_MAX> -{}; - -template<> -class numeric_limits<int> - : public _Integer_limits<int, INT_MIN, INT_MAX> -{}; - -template<> -class numeric_limits<unsigned int> - : public _Integer_limits<unsigned int, 0, UINT_MAX> -{}; - -template<> -class numeric_limits<long> - : public _Integer_limits<long, LONG_MIN, LONG_MAX> -{}; - -template<> -class numeric_limits<unsigned long> - : public _Integer_limits<unsigned long, 0, ULONG_MAX> -{}; - -#ifdef __STL_LONG_LONG -#ifdef LONG_LONG_MIN - -// CYGNUS LOCAL 9/4/1998 -// fixed LONGLONG to be LONG_LONG -template<> -class numeric_limits<long long> - : public _Integer_limits<long long, LONG_LONG_MIN, LONG_LONG_MAX> -{}; - -// CYGNUS LOCAL 9/4/1998 -// fixed LONGLONG to be LONG_LONG -template<> -class numeric_limits<unsigned long long> - : public _Integer_limits<unsigned long long, 0, ULONG_LONG_MAX> -{}; - -#endif -#endif /* __STL_LONG_LONG */ - -// Specializations for all built-in floating-point type. - -template<> class numeric_limits<float> - : public _Floating_limits<float, - FLT_MANT_DIG, // Binary digits of precision - FLT_DIG, // Decimal digits of precision - FLT_MIN_EXP, // Minimum exponent - FLT_MAX_EXP, // Maximum exponent - FLT_MIN_10_EXP, // Minimum base 10 exponent - FLT_MAX_10_EXP, // Maximum base 10 exponent - 0x7f800000u, // First word of +infinity - 0x7f810000u, // First word of quiet NaN - 0x7fc10000u, // First word of signaling NaN - true, // conforms to iec559 - round_to_nearest> -{ -public: - static float min() { return FLT_MIN; } - static float denorm_min() { return FLT_MIN; } - static float max() { return FLT_MAX; } - static float epsilon() { return FLT_EPSILON; } - static float round_error() { return 0.5f; } // Units: ulps. -}; - -template<> class numeric_limits<double> - : public _Floating_limits<double, - DBL_MANT_DIG, // Binary digits of precision - DBL_DIG, // Decimal digits of precision - DBL_MIN_EXP, // Minimum exponent - DBL_MAX_EXP, // Maximum exponent - DBL_MIN_10_EXP, // Minimum base 10 exponent - DBL_MAX_10_EXP, // Maximum base 10 exponent - 0x7ff00000u, // First word of +infinity - 0x7ff10000u, // First word of quiet NaN - 0x7ff90000u, // First word of signaling NaN - true, // conforms to iec559 - round_to_nearest> -{ -public: - static double min() { return DBL_MIN; } - static double denorm_min() { return DBL_MIN; } - static double max() { return DBL_MAX; } - static double epsilon() { return DBL_EPSILON; } - static double round_error() { return 0.5; } // Units: ulps. -}; - -template<> class numeric_limits<long double> - : public _Floating_limits<long double, - LDBL_MANT_DIG, // Binary digits of precision - LDBL_DIG, // Decimal digits of precision - LDBL_MIN_EXP, // Minimum exponent - LDBL_MAX_EXP, // Maximum exponent - LDBL_MIN_10_EXP,// Minimum base 10 exponent - LDBL_MAX_10_EXP,// Maximum base 10 exponent - 0x7ff00000u, // First word of +infinity - 0x7ff10000u, // First word of quiet NaN - 0x7ff90000u, // First word of signaling NaN - false, // Doesn't conform to iec559 - round_to_nearest> -{ -public: - static long double min() { return LDBL_MIN; } - static long double denorm_min() { return LDBL_MIN; } - static long double max() { return LDBL_MAX; } - static long double epsilon() { return LDBL_EPSILON; } - static long double round_error() { return 4; } // Units: ulps. -}; - -BZ_NAMESPACE_END - diff --git a/weave/blitz-20001213/blitz/listinit.h b/weave/blitz-20001213/blitz/listinit.h deleted file mode 100644 index bdb6d09b7..000000000 --- a/weave/blitz-20001213/blitz/listinit.h +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - * blitz/listinit.h Classes for initialization lists - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -/* - * Initialization lists provide a convenient way to set the elements - * of an array. For example, - * - * Array<int,2> A(3,3); - * A = 1, 0, 0, - * 0, 1, 0, - * 0, 0, 1; - */ - -#ifndef BZ_LISTINIT_H -#define BZ_LISTINIT_H - -BZ_NAMESPACE(blitz) - -template<class T_numtype, class T_iterator> -class ListInitializer { - -public: - ListInitializer(T_iterator iter) - : iter_(iter) - { - } - - ListInitializer<T_numtype, T_iterator> operator,(T_numtype x) - { - *iter_ = x; - return ListInitializer<T_numtype, T_iterator>(iter_ + 1); - } - -private: - ListInitializer(); - -protected: - T_iterator iter_; -}; - -template<class T_array, class T_iterator = _bz_typename T_array::T_numtype*> -class ListInitializationSwitch { - -public: - typedef _bz_typename T_array::T_numtype T_numtype; - - // HOMMEL990316: added explicit default argument _bz_typename - // T_array::T_numtype* - - ListInitializationSwitch(const ListInitializationSwitch<T_array, - _bz_typename T_array::T_numtype*>& lis) - : array_(lis.array_), value_(lis.value_), - wipeOnDestruct_(_bz_true) - { - lis.disable(); - } - - ListInitializationSwitch(T_array& array, T_numtype value) - : array_(array), value_(value), wipeOnDestruct_(_bz_true) - { } - - ~ListInitializationSwitch() - { - if (wipeOnDestruct_) - array_.initialize(value_); - } - - ListInitializer<T_numtype, T_iterator> operator,(T_numtype x) - { - wipeOnDestruct_ = _bz_false; - T_iterator iter = array_.getInitializationIterator(); - *iter = value_; - T_iterator iter2 = iter + 1; - *iter2 = x; - return ListInitializer<T_numtype, T_iterator>(iter2 + 1); - } - - void disable() const - { - wipeOnDestruct_ = _bz_false; - } - -private: - ListInitializationSwitch(); - -protected: - T_array& array_; - T_numtype value_; - mutable _bz_bool wipeOnDestruct_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_LISTINIT_H - diff --git a/weave/blitz-20001213/blitz/matbops.h b/weave/blitz-20001213/blitz/matbops.h deleted file mode 100644 index 7984ba71a..000000000 --- a/weave/blitz-20001213/blitz/matbops.h +++ /dev/null @@ -1,6070 +0,0 @@ -// Generated source file. Do not edit. -// Created by: genmatbops.cpp Aug 8 1997 15:21:36 - -#ifndef BZ_MATBOPS_H -#define BZ_MATBOPS_H - -BZ_NAMESPACE(blitz) - -#ifndef BZ_MATEXPR_H - #error <blitz/matbops.h> must be included via <blitz/matexpr.h> -#endif - -/**************************************************************************** - * Addition Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> + Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<P_numtype1, P_numtype2> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> + _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> + int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Add<P_numtype1, int> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> + float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Add<P_numtype1, float> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Add<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> + double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Add<P_numtype1, double> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Add<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> + long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Add<P_numtype1, long double> > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Add<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> + complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Add<P_numtype1, complex<float> > > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Add<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> + complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Add<P_numtype1, complex<double> > > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Add<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> + complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Add<P_numtype1, complex<long double> > > > -operator+(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Add<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> + Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator+(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> + _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator+(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> + int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Add<_bz_typename P_expr1::T_numtype, int> > > -operator+(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Add<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> + float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Add<_bz_typename P_expr1::T_numtype, float> > > -operator+(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Add<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> + double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Add<_bz_typename P_expr1::T_numtype, double> > > -operator+(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Add<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> + long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Add<_bz_typename P_expr1::T_numtype, long double> > > -operator+(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Add<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> + complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Add<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator+(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Add<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> + complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Add<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator+(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Add<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> + complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Add<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator+(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Add<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<int, P_numtype2> > > -operator+(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Add<int, _bz_typename P_expr2::T_numtype> > > -operator+(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Add<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<float, P_numtype2> > > -operator+(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Add<float, _bz_typename P_expr2::T_numtype> > > -operator+(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Add<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<double, P_numtype2> > > -operator+(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Add<double, _bz_typename P_expr2::T_numtype> > > -operator+(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Add<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<long double, P_numtype2> > > -operator+(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Add<long double, _bz_typename P_expr2::T_numtype> > > -operator+(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Add<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<complex<float> , P_numtype2> > > -operator+(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Add<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator+(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Add<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<complex<double> , P_numtype2> > > -operator+(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Add<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator+(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Add<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> + Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Add<complex<long double> , P_numtype2> > > -operator+(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Add<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> + _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Add<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator+(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Add<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Subtraction Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> - Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<P_numtype1, P_numtype2> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> - _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> - int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Subtract<P_numtype1, int> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> - float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Subtract<P_numtype1, float> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Subtract<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> - double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Subtract<P_numtype1, double> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Subtract<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> - long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Subtract<P_numtype1, long double> > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Subtract<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> - complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Subtract<P_numtype1, complex<float> > > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Subtract<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> - complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Subtract<P_numtype1, complex<double> > > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Subtract<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> - complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Subtract<P_numtype1, complex<long double> > > > -operator-(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Subtract<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> - Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator-(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> - _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator-(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> - int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Subtract<_bz_typename P_expr1::T_numtype, int> > > -operator-(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> - float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Subtract<_bz_typename P_expr1::T_numtype, float> > > -operator-(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> - double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Subtract<_bz_typename P_expr1::T_numtype, double> > > -operator-(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> - long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Subtract<_bz_typename P_expr1::T_numtype, long double> > > -operator-(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> - complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator-(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> - complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator-(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> - complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator-(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<int, P_numtype2> > > -operator-(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Subtract<int, _bz_typename P_expr2::T_numtype> > > -operator-(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<float, P_numtype2> > > -operator-(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Subtract<float, _bz_typename P_expr2::T_numtype> > > -operator-(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<double, P_numtype2> > > -operator-(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Subtract<double, _bz_typename P_expr2::T_numtype> > > -operator-(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<long double, P_numtype2> > > -operator-(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Subtract<long double, _bz_typename P_expr2::T_numtype> > > -operator-(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Subtract<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<complex<float> , P_numtype2> > > -operator-(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Subtract<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator-(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Subtract<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<complex<double> , P_numtype2> > > -operator-(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Subtract<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator-(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Subtract<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> - Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Subtract<complex<long double> , P_numtype2> > > -operator-(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Subtract<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> - _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Subtract<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator-(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Subtract<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Multiplication Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> * Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<P_numtype1, P_numtype2> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> * _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> * int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Multiply<P_numtype1, int> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> * float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Multiply<P_numtype1, float> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Multiply<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> * double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Multiply<P_numtype1, double> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Multiply<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> * long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Multiply<P_numtype1, long double> > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Multiply<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> * complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Multiply<P_numtype1, complex<float> > > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Multiply<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> * complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Multiply<P_numtype1, complex<double> > > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Multiply<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> * complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Multiply<P_numtype1, complex<long double> > > > -operator*(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Multiply<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> * Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator*(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> * _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator*(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> * int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Multiply<_bz_typename P_expr1::T_numtype, int> > > -operator*(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> * float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Multiply<_bz_typename P_expr1::T_numtype, float> > > -operator*(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> * double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Multiply<_bz_typename P_expr1::T_numtype, double> > > -operator*(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> * long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Multiply<_bz_typename P_expr1::T_numtype, long double> > > -operator*(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> * complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator*(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> * complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator*(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> * complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator*(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<int, P_numtype2> > > -operator*(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Multiply<int, _bz_typename P_expr2::T_numtype> > > -operator*(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<float, P_numtype2> > > -operator*(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Multiply<float, _bz_typename P_expr2::T_numtype> > > -operator*(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<double, P_numtype2> > > -operator*(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Multiply<double, _bz_typename P_expr2::T_numtype> > > -operator*(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<long double, P_numtype2> > > -operator*(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Multiply<long double, _bz_typename P_expr2::T_numtype> > > -operator*(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Multiply<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<complex<float> , P_numtype2> > > -operator*(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Multiply<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator*(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Multiply<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<complex<double> , P_numtype2> > > -operator*(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Multiply<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator*(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Multiply<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> * Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Multiply<complex<long double> , P_numtype2> > > -operator*(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Multiply<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> * _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Multiply<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator*(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Multiply<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Division Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> / Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<P_numtype1, P_numtype2> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> / _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> / int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Divide<P_numtype1, int> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> / float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Divide<P_numtype1, float> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Divide<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> / double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Divide<P_numtype1, double> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Divide<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> / long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Divide<P_numtype1, long double> > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Divide<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> / complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Divide<P_numtype1, complex<float> > > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Divide<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> / complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Divide<P_numtype1, complex<double> > > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Divide<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> / complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Divide<P_numtype1, complex<long double> > > > -operator/(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Divide<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> / Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator/(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> / _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator/(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> / int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Divide<_bz_typename P_expr1::T_numtype, int> > > -operator/(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Divide<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> / float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Divide<_bz_typename P_expr1::T_numtype, float> > > -operator/(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Divide<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> / double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Divide<_bz_typename P_expr1::T_numtype, double> > > -operator/(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> / long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Divide<_bz_typename P_expr1::T_numtype, long double> > > -operator/(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> / complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Divide<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator/(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Divide<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> / complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Divide<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator/(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Divide<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> / complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Divide<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator/(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Divide<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<int, P_numtype2> > > -operator/(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Divide<int, _bz_typename P_expr2::T_numtype> > > -operator/(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Divide<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<float, P_numtype2> > > -operator/(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Divide<float, _bz_typename P_expr2::T_numtype> > > -operator/(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Divide<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<double, P_numtype2> > > -operator/(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Divide<double, _bz_typename P_expr2::T_numtype> > > -operator/(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Divide<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<long double, P_numtype2> > > -operator/(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Divide<long double, _bz_typename P_expr2::T_numtype> > > -operator/(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Divide<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<complex<float> , P_numtype2> > > -operator/(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Divide<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator/(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Divide<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<complex<double> , P_numtype2> > > -operator/(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Divide<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator/(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Divide<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> / Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Divide<complex<long double> , P_numtype2> > > -operator/(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Divide<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> / _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Divide<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator/(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Divide<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Modulus Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> % Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Mod<P_numtype1, P_numtype2> > > -operator%(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> % _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator%(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> % int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Mod<P_numtype1, int> > > -operator%(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> % Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator%(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> % _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Mod<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator%(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> % int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Mod<_bz_typename P_expr1::T_numtype, int> > > -operator%(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Mod<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int % Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Mod<int, P_numtype2> > > -operator%(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int % _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Mod<int, _bz_typename P_expr2::T_numtype> > > -operator%(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Mod<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Bitwise XOR Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> ^ Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseXOR<P_numtype1, P_numtype2> > > -operator^(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> ^ _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator^(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> ^ int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_BitwiseXOR<P_numtype1, int> > > -operator^(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> ^ Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator^(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> ^ _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator^(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> ^ int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int> > > -operator^(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int ^ Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseXOR<int, P_numtype2> > > -operator^(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int ^ _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype> > > -operator^(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Bitwise And Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> & Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseAnd<P_numtype1, P_numtype2> > > -operator&(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> & _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator&(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> & int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_BitwiseAnd<P_numtype1, int> > > -operator&(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> & Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator&(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> & _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator&(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> & int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int> > > -operator&(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int & Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseAnd<int, P_numtype2> > > -operator&(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int & _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype> > > -operator&(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Bitwise Or Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> | Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseOr<P_numtype1, P_numtype2> > > -operator|(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> | _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator|(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> | int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_BitwiseOr<P_numtype1, int> > > -operator|(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> | Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator|(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> | _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator|(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> | int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int> > > -operator|(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int | Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_BitwiseOr<int, P_numtype2> > > -operator|(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int | _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype> > > -operator|(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Shift right Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> >> Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftRight<P_numtype1, P_numtype2> > > -operator>>(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> >> _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator>>(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> >> int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_ShiftRight<P_numtype1, int> > > -operator>>(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> >> Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator>>(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> >> _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator>>(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> >> int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int> > > -operator>>(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int >> Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftRight<int, P_numtype2> > > -operator>>(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int >> _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype> > > -operator>>(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Shift left Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> << Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftLeft<P_numtype1, P_numtype2> > > -operator<<(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> << _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator<<(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> << int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_ShiftLeft<P_numtype1, int> > > -operator<<(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> << Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator<<(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> << _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator<<(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> << int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int> > > -operator<<(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int << Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_ShiftLeft<int, P_numtype2> > > -operator<<(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int << _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype> > > -operator<<(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Greater-than Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> > Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<P_numtype1, P_numtype2> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> > _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> > int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Greater<P_numtype1, int> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> > float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Greater<P_numtype1, float> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Greater<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> > double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Greater<P_numtype1, double> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Greater<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> > long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Greater<P_numtype1, long double> > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Greater<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> > complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Greater<P_numtype1, complex<float> > > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Greater<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> > complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Greater<P_numtype1, complex<double> > > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Greater<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> > complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Greater<P_numtype1, complex<long double> > > > -operator>(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Greater<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> > Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator>(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> > _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator>(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> > int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Greater<_bz_typename P_expr1::T_numtype, int> > > -operator>(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Greater<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> > float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Greater<_bz_typename P_expr1::T_numtype, float> > > -operator>(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Greater<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> > double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Greater<_bz_typename P_expr1::T_numtype, double> > > -operator>(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> > long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Greater<_bz_typename P_expr1::T_numtype, long double> > > -operator>(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> > complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Greater<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator>(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Greater<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> > complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Greater<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator>(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Greater<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> > complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Greater<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator>(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Greater<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<int, P_numtype2> > > -operator>(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Greater<int, _bz_typename P_expr2::T_numtype> > > -operator>(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Greater<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<float, P_numtype2> > > -operator>(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Greater<float, _bz_typename P_expr2::T_numtype> > > -operator>(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Greater<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<double, P_numtype2> > > -operator>(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Greater<double, _bz_typename P_expr2::T_numtype> > > -operator>(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Greater<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<long double, P_numtype2> > > -operator>(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Greater<long double, _bz_typename P_expr2::T_numtype> > > -operator>(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Greater<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<complex<float> , P_numtype2> > > -operator>(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Greater<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator>(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Greater<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<complex<double> , P_numtype2> > > -operator>(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Greater<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator>(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Greater<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> > Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Greater<complex<long double> , P_numtype2> > > -operator>(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Greater<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> > _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Greater<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator>(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Greater<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Less-than Operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> < Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<P_numtype1, P_numtype2> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> < _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> < int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Less<P_numtype1, int> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> < float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Less<P_numtype1, float> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Less<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> < double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Less<P_numtype1, double> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Less<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> < long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Less<P_numtype1, long double> > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Less<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> < complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Less<P_numtype1, complex<float> > > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Less<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> < complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Less<P_numtype1, complex<double> > > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Less<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> < complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Less<P_numtype1, complex<long double> > > > -operator<(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Less<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> < Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator<(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> < _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator<(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> < int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Less<_bz_typename P_expr1::T_numtype, int> > > -operator<(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Less<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> < float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Less<_bz_typename P_expr1::T_numtype, float> > > -operator<(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Less<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> < double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Less<_bz_typename P_expr1::T_numtype, double> > > -operator<(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Less<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> < long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Less<_bz_typename P_expr1::T_numtype, long double> > > -operator<(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Less<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> < complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Less<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator<(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Less<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> < complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Less<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator<(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Less<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> < complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Less<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator<(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Less<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<int, P_numtype2> > > -operator<(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Less<int, _bz_typename P_expr2::T_numtype> > > -operator<(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Less<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<float, P_numtype2> > > -operator<(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Less<float, _bz_typename P_expr2::T_numtype> > > -operator<(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Less<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<double, P_numtype2> > > -operator<(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Less<double, _bz_typename P_expr2::T_numtype> > > -operator<(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Less<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<long double, P_numtype2> > > -operator<(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Less<long double, _bz_typename P_expr2::T_numtype> > > -operator<(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Less<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<complex<float> , P_numtype2> > > -operator<(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Less<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator<(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Less<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<complex<double> , P_numtype2> > > -operator<(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Less<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator<(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Less<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> < Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Less<complex<long double> , P_numtype2> > > -operator<(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Less<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> < _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Less<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator<(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Less<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Greater or equal (>=) operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> >= Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<P_numtype1, P_numtype2> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> >= _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> >= int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_GreaterOrEqual<P_numtype1, int> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> >= float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_GreaterOrEqual<P_numtype1, float> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> >= double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_GreaterOrEqual<P_numtype1, double> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> >= long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_GreaterOrEqual<P_numtype1, long double> > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> >= complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_GreaterOrEqual<P_numtype1, complex<float> > > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_GreaterOrEqual<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> >= complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_GreaterOrEqual<P_numtype1, complex<double> > > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_GreaterOrEqual<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> >= complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_GreaterOrEqual<P_numtype1, complex<long double> > > > -operator>=(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_GreaterOrEqual<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> >= Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator>=(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> >= _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator>=(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> >= int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> > > -operator>=(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> >= float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, float> > > -operator>=(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> >= double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, double> > > -operator>=(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> >= long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double> > > -operator>=(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> >= complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator>=(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> >= complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator>=(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> >= complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator>=(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<int, P_numtype2> > > -operator>=(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> > > -operator>=(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<float, P_numtype2> > > -operator>=(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<float, _bz_typename P_expr2::T_numtype> > > -operator>=(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<double, P_numtype2> > > -operator>=(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<double, _bz_typename P_expr2::T_numtype> > > -operator>=(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<long double, P_numtype2> > > -operator>=(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype> > > -operator>=(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<complex<float> , P_numtype2> > > -operator>=(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator>=(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<complex<double> , P_numtype2> > > -operator>=(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator>=(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> >= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_GreaterOrEqual<complex<long double> , P_numtype2> > > -operator>=(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_GreaterOrEqual<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> >= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_GreaterOrEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator>=(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_GreaterOrEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Less or equal (<=) operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> <= Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<P_numtype1, P_numtype2> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> <= _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> <= int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_LessOrEqual<P_numtype1, int> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> <= float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_LessOrEqual<P_numtype1, float> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> <= double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_LessOrEqual<P_numtype1, double> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> <= long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_LessOrEqual<P_numtype1, long double> > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> <= complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_LessOrEqual<P_numtype1, complex<float> > > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_LessOrEqual<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> <= complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_LessOrEqual<P_numtype1, complex<double> > > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_LessOrEqual<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> <= complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_LessOrEqual<P_numtype1, complex<long double> > > > -operator<=(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_LessOrEqual<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> <= Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator<=(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> <= _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator<=(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> <= int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int> > > -operator<=(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> <= float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, float> > > -operator<=(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> <= double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, double> > > -operator<=(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> <= long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, long double> > > -operator<=(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> <= complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator<=(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> <= complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator<=(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> <= complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator<=(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<int, P_numtype2> > > -operator<=(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype> > > -operator<=(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<float, P_numtype2> > > -operator<=(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<float, _bz_typename P_expr2::T_numtype> > > -operator<=(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<double, P_numtype2> > > -operator<=(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<double, _bz_typename P_expr2::T_numtype> > > -operator<=(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<long double, P_numtype2> > > -operator<=(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<long double, _bz_typename P_expr2::T_numtype> > > -operator<=(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<complex<float> , P_numtype2> > > -operator<=(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator<=(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<complex<double> , P_numtype2> > > -operator<=(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator<=(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> <= Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LessOrEqual<complex<long double> , P_numtype2> > > -operator<=(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LessOrEqual<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> <= _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_LessOrEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator<=(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_LessOrEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Equality operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> == Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<P_numtype1, P_numtype2> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> == _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> == int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_Equal<P_numtype1, int> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> == float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_Equal<P_numtype1, float> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_Equal<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> == double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_Equal<P_numtype1, double> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_Equal<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> == long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_Equal<P_numtype1, long double> > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_Equal<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> == complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_Equal<P_numtype1, complex<float> > > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_Equal<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> == complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_Equal<P_numtype1, complex<double> > > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_Equal<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> == complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_Equal<P_numtype1, complex<long double> > > > -operator==(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Equal<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> == Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator==(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> == _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator==(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> == int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_Equal<_bz_typename P_expr1::T_numtype, int> > > -operator==(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_Equal<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> == float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_Equal<_bz_typename P_expr1::T_numtype, float> > > -operator==(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_Equal<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> == double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_Equal<_bz_typename P_expr1::T_numtype, double> > > -operator==(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> == long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_Equal<_bz_typename P_expr1::T_numtype, long double> > > -operator==(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> == complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_Equal<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator==(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_Equal<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> == complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_Equal<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator==(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_Equal<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> == complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_Equal<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator==(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_Equal<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<int, P_numtype2> > > -operator==(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_Equal<int, _bz_typename P_expr2::T_numtype> > > -operator==(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_Equal<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<float, P_numtype2> > > -operator==(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_Equal<float, _bz_typename P_expr2::T_numtype> > > -operator==(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_Equal<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<double, P_numtype2> > > -operator==(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_Equal<double, _bz_typename P_expr2::T_numtype> > > -operator==(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_Equal<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<long double, P_numtype2> > > -operator==(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_Equal<long double, _bz_typename P_expr2::T_numtype> > > -operator==(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_Equal<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<complex<float> , P_numtype2> > > -operator==(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_Equal<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator==(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_Equal<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<complex<double> , P_numtype2> > > -operator==(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_Equal<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator==(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_Equal<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> == Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_Equal<complex<long double> , P_numtype2> > > -operator==(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_Equal<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> == _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_Equal<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator==(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_Equal<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Not-equal operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> != Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<P_numtype1, P_numtype2> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> != _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> != int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_NotEqual<P_numtype1, int> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// Matrix<P_numtype1, P_struct1> != float -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, _bz_NotEqual<P_numtype1, float> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<float>, - _bz_NotEqual<P_numtype1, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<float>(d2))); -} - -// Matrix<P_numtype1, P_struct1> != double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, _bz_NotEqual<P_numtype1, double> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<double>, - _bz_NotEqual<P_numtype1, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<double>(d2))); -} - -// Matrix<P_numtype1, P_struct1> != long double -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, _bz_NotEqual<P_numtype1, long double> > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> != complex<float> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, _bz_NotEqual<P_numtype1, complex<float> > > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<float> >, - _bz_NotEqual<P_numtype1, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> != complex<double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, _bz_NotEqual<P_numtype1, complex<double> > > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<double> >, - _bz_NotEqual<P_numtype1, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// Matrix<P_numtype1, P_struct1> != complex<long double> -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, _bz_NotEqual<P_numtype1, complex<long double> > > > -operator!=(const Matrix<P_numtype1, P_struct1>& d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<complex<long double> >, - _bz_NotEqual<P_numtype1, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// _bz_MatExpr<P_expr1> != Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator!=(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> != _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator!=(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> != int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, int> > > -operator!=(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> != float -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, float> > > -operator!=(_bz_MatExpr<P_expr1> d1, float d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<float>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<float>(d2))); -} - -// _bz_MatExpr<P_expr1> != double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, double> > > -operator!=(_bz_MatExpr<P_expr1> d1, double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<double>(d2))); -} - -// _bz_MatExpr<P_expr1> != long double -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, _bz_NotEqual<_bz_typename P_expr1::T_numtype, long double> > > -operator!=(_bz_MatExpr<P_expr1> d1, long double d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<long double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<long double>(d2))); -} - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> != complex<float> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<float> > > > -operator!=(_bz_MatExpr<P_expr1> d1, complex<float> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<float> >, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<float> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<float> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> != complex<double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<double> > > > -operator!=(_bz_MatExpr<P_expr1> d1, complex<double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<double> >, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// _bz_MatExpr<P_expr1> != complex<long double> -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > > -operator!=(_bz_MatExpr<P_expr1> d1, complex<long double> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<complex<long double> >, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<long double> > > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<complex<long double> >(d2))); -} -#endif // BZ_HAVE_COMPLEX - -// int != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<int, P_numtype2> > > -operator!=(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<int, _bz_typename P_expr2::T_numtype> > > -operator!=(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -// float != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<float, P_numtype2> > > -operator!=(float d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<float, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2._bz_getRef())); -} - -// float != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<float, _bz_typename P_expr2::T_numtype> > > -operator!=(float d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<float>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<float>(d1), - d2)); -} - -// double != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<double, P_numtype2> > > -operator!=(double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2._bz_getRef())); -} - -// double != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<double, _bz_typename P_expr2::T_numtype> > > -operator!=(double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<double>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<double>(d1), - d2)); -} - -// long double != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<long double, P_numtype2> > > -operator!=(long double d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<long double, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2._bz_getRef())); -} - -// long double != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, _bz_NotEqual<long double, _bz_typename P_expr2::T_numtype> > > -operator!=(long double d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<long double>, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<long double>(d1), - d2)); -} - -#ifdef BZ_HAVE_COMPLEX -// complex<float> != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<complex<float> , P_numtype2> > > -operator!=(complex<float> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<complex<float> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<float> != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, _bz_NotEqual<complex<float> , _bz_typename P_expr2::T_numtype> > > -operator!=(complex<float> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<float> >, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<complex<float> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<float> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<complex<double> , P_numtype2> > > -operator!=(complex<double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<complex<double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<double> != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, _bz_NotEqual<complex<double> , _bz_typename P_expr2::T_numtype> > > -operator!=(complex<double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<double> >, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<complex<double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> != Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_NotEqual<complex<long double> , P_numtype2> > > -operator!=(complex<long double> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_NotEqual<complex<long double> , P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2._bz_getRef())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX -// complex<long double> != _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, _bz_NotEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > > -operator!=(complex<long double> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<complex<long double> >, - _bz_MatExpr<P_expr2>, - _bz_NotEqual<complex<long double> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<complex<long double> >(d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX -/**************************************************************************** - * Logical AND operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> && Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalAnd<P_numtype1, P_numtype2> > > -operator&&(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> && _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator&&(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> && int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_LogicalAnd<P_numtype1, int> > > -operator&&(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> && Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator&&(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> && _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator&&(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> && int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int> > > -operator&&(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int && Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalAnd<int, P_numtype2> > > -operator&&(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int && _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype> > > -operator&&(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} -/**************************************************************************** - * Logical OR operators - ****************************************************************************/ - -// Matrix<P_numtype1, P_struct1> || Matrix<P_numtype2, P_struct2> -template<class P_numtype1, class P_struct1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalOr<P_numtype1, P_numtype2> > > -operator||(const Matrix<P_numtype1, P_struct1>& d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2._bz_getRef())); -} - -// Matrix<P_numtype1, P_struct1> || _bz_MatExpr<P_expr2> -template<class P_numtype1, class P_struct1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype> > > -operator||(const Matrix<P_numtype1, P_struct1>& d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - d2)); -} - -// Matrix<P_numtype1, P_struct1> || int -template<class P_numtype1, class P_struct1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, _bz_LogicalOr<P_numtype1, int> > > -operator||(const Matrix<P_numtype1, P_struct1>& d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatrixRef<P_numtype1, P_struct1>, - _bz_MatExprConstant<int>, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1._bz_getRef(), - _bz_MatExprConstant<int>(d2))); -} - -// _bz_MatExpr<P_expr1> || Matrix<P_numtype2, P_struct2> -template<class P_expr1, class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2> > > -operator||(_bz_MatExpr<P_expr1> d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2._bz_getRef())); -} - -// _bz_MatExpr<P_expr1> || _bz_MatExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, _bz_LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > > -operator||(_bz_MatExpr<P_expr1> d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExpr<P_expr2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_MatExpr<P_expr1> || int -template<class P_expr1> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int> > > -operator||(_bz_MatExpr<P_expr1> d1, int d2) -{ - typedef _bz_MatExprOp<_bz_MatExpr<P_expr1>, - _bz_MatExprConstant<int>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(d1, - _bz_MatExprConstant<int>(d2))); -} - -// int || Matrix<P_numtype2, P_struct2> -template<class P_numtype2, class P_struct2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, _bz_LogicalOr<int, P_numtype2> > > -operator||(int d1, const Matrix<P_numtype2, P_struct2>& d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatrixRef<P_numtype2, P_struct2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2._bz_getRef())); -} - -// int || _bz_MatExpr<P_expr2> -template<class P_expr2> -inline -_bz_MatExpr<_bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype> > > -operator||(int d1, _bz_MatExpr<P_expr2> d2) -{ - typedef _bz_MatExprOp<_bz_MatExprConstant<int>, - _bz_MatExpr<P_expr2>, - _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_MatExpr<T_expr>(T_expr(_bz_MatExprConstant<int>(d1), - d2)); -} - -BZ_NAMESPACE_END - -#endif // BZ_MATBOPS_H diff --git a/weave/blitz-20001213/blitz/matdiag.h b/weave/blitz-20001213/blitz/matdiag.h deleted file mode 100644 index 871211553..000000000 --- a/weave/blitz-20001213/blitz/matdiag.h +++ /dev/null @@ -1,185 +0,0 @@ -/*************************************************************************** - * blitz/matdiag.h Declarations for Diagonal matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATDIAG_H -#define BZ_MATDIAG_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/matdiag.h> must be included via <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Diagonal matrix -// [ 0 . . . ] -// [ . 1 . . ] -// [ . . 2 . ] -// [ . . . 3 ] - -class DiagonalIterator { -public: - DiagonalIterator(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - i_ = 0; - } - - operator _bz_bool() const - { - return i_ < size_; - } - - void operator++() - { - ++i_; - } - - unsigned row() const - { return i_; } - - unsigned col() const - { return i_; } - - unsigned offset() const - { return i_; } - -protected: - unsigned i_, size_; -}; - -class Diagonal : public MatrixStructure { - -public: - typedef DiagonalIterator T_iterator; - - Diagonal() - : size_(0) - { } - - Diagonal(unsigned size) - : size_(size) - { } - - Diagonal(unsigned rows, unsigned cols) - : size_(rows) - { - BZPRECONDITION(rows == cols); - } - - unsigned columns() const - { return size_; } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - BZPRECONDITION(i == j); - return i; - } - - unsigned firstInRow(unsigned i) const - { return i; } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - if (i == j) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - if (i == j) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - unsigned lastInRow(unsigned i) const - { return i; } - - unsigned firstInCol(unsigned j) const - { return j; } - - unsigned lastInCol(unsigned j) const - { return j; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < size_) && (j < size_); - } - - unsigned numElements() const - { return size_; } - - unsigned rows() const - { return size_; } - - void resize(unsigned size) - { - size_ = size; - } - - void resize(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - } - -private: - unsigned size_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATSYMM_H - diff --git a/weave/blitz-20001213/blitz/matexpr.h b/weave/blitz-20001213/blitz/matexpr.h deleted file mode 100644 index 74a2b89c4..000000000 --- a/weave/blitz-20001213/blitz/matexpr.h +++ /dev/null @@ -1,194 +0,0 @@ -/*************************************************************************** - * blitz/matexpr.h Matrix<P_numtype, P_structure> expression templates - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATEXPR_H -#define BZ_MATEXPR_H - -#ifndef BZ_MATRIX_H - #error <blitz/matexpr.h> must be included via <blitz/matrix.h> -#endif - -#include <blitz/applics.h> - -BZ_NAMESPACE(blitz) - -// BlitzMatrixExpressionsBase is a dummy class provided for users of -// graphical class browsers. -class BlitzMatrixExpressionsBase { }; - -template<class P_expr> -class _bz_MatExpr : public BlitzMatrixExpressionsBase { - -public: - typedef P_expr T_expr; - typedef _bz_typename T_expr::T_numtype T_numtype; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_MatExpr(T_expr a) - : iter_(a) - { } -#else - _bz_MatExpr(const T_expr& a) - : iter_(a) - { } -#endif - - T_numtype operator()(unsigned i, unsigned j) const - { return iter_(i,j); } - - unsigned rows(unsigned recommendedRows) const - { return iter_.rows(recommendedRows); } - - unsigned cols(unsigned recommendedCols) const - { return iter_.cols(recommendedCols); } - -private: - T_expr iter_; -}; - -template<class P_expr1, class P_expr2, class P_op> -class _bz_MatExprOp : public BlitzMatrixExpressionsBase { - -public: - typedef P_expr1 T_expr1; - typedef P_expr2 T_expr2; - typedef _bz_typename T_expr1::T_numtype T_numtype1; - typedef _bz_typename T_expr2::T_numtype T_numtype2; - typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; - typedef P_op T_op; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_MatExprOp(T_expr1 a, T_expr2 b) - : iter1_(a), iter2_(b) - { } -#else - _bz_MatExprOp(const T_expr1& a, const T_expr2& b) - : iter1_(a), iter2_(b) - { } -#endif - - T_numtype operator()(unsigned i, unsigned j) const - { return T_op::apply(iter1_(i,j), iter2_(i,j)); } - - unsigned rows(unsigned recommendedRows) const - { - BZPRECONDITION(iter2_.rows(recommendedRows) == - iter1_.rows(recommendedRows)); - return iter1_.rows(recommendedRows); - } - - unsigned cols(unsigned recommendedCols) const - { - BZPRECONDITION(iter2_.cols(recommendedCols) == - iter1_.cols(recommendedCols)); - return iter1_.cols(recommendedCols); - } - -private: - T_expr1 iter1_; - T_expr2 iter2_; -}; - -template<class P_expr, class P_unaryOp> -class _bz_MatExprUnaryOp : public BlitzMatrixExpressionsBase { - -public: - typedef P_expr T_expr; - typedef P_unaryOp T_unaryOp; - typedef _bz_typename T_unaryOp::T_numtype T_numtype; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_MatExprUnaryOp(T_expr iter) - : iter_(iter) - { } -#else - _bz_MatExprUnaryOp(const T_expr& iter) - : iter_(iter) - { } -#endif - - T_numtype operator()(unsigned i, unsigned j) const - { return T_unaryOp::apply(iter_(i,j)); } - - unsigned rows(unsigned recommendedRows) const - { return iter_.rows(recommendedRows); } - - unsigned cols(unsigned recommendedCols) const - { return iter_.cols(recommendedCols); } - -private: - T_expr iter_; -}; - -template<class P_numtype> -class _bz_MatExprConstant : public BlitzMatrixExpressionsBase { -public: - typedef P_numtype T_numtype; - - _bz_MatExprConstant(P_numtype value) - : value_(value) - { } - - T_numtype operator()(unsigned i, unsigned j) const - { return value_; } - - unsigned rows(unsigned recommendedRows) const - { return recommendedRows; } - - unsigned cols(unsigned recommendedCols) const - { return recommendedCols; } - -private: - T_numtype value_; -}; - -BZ_NAMESPACE_END - -#include <blitz/matref.h> -#include <blitz/matbops.h> -#include <blitz/matuops.h> - -#endif // BZ_MATEXPR_H diff --git a/weave/blitz-20001213/blitz/matgen.h b/weave/blitz-20001213/blitz/matgen.h deleted file mode 100644 index 4f532dd94..000000000 --- a/weave/blitz-20001213/blitz/matgen.h +++ /dev/null @@ -1,222 +0,0 @@ -/*************************************************************************** - * blitz/matgen.h Declarations for RowMajor and ColumnMajor matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATGEN_H -#define BZ_MATGEN_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/matgen.h> must be included via <blitz/mstruct.h> -#endif // BZ_MSTRUCT_H - -BZ_NAMESPACE(blitz) - -class GeneralMatrix : public AsymmetricMatrix { - -public: - GeneralMatrix() - { } - - GeneralMatrix(unsigned rows, unsigned cols) - : AsymmetricMatrix(rows, cols) - { - } - - unsigned firstInRow(unsigned i) const - { return 0; } - - unsigned lastInRow(unsigned i) const - { return cols_ - 1; } - - unsigned firstInCol(unsigned j) const - { return 0; } - - unsigned lastInCol(unsigned j) const - { return rows_ - 1; } - - unsigned numElements() const - { return rows_ * cols_; } -}; - -class GeneralIterator { -public: - GeneralIterator(unsigned rows, unsigned cols) - { - rows_ = rows; - cols_ = cols; - i_ = 0; - j_ = 0; - offset_ = 0; - good_ = true; - } - - unsigned offset() const - { return offset_; } - - operator _bz_bool() const - { return good_; } - - unsigned row() const - { return i_; } - - unsigned col() const - { return j_; } - -protected: - unsigned rows_, cols_; - unsigned offset_; - unsigned i_, j_; - _bz_bool good_; -}; - -class RowMajorIterator : public GeneralIterator { -public: - RowMajorIterator(unsigned rows, unsigned cols) - : GeneralIterator(rows, cols) - { } - - void operator++() - { - ++offset_; - ++j_; - if (j_ == cols_) - { - j_ = 0; - ++i_; - if (i_ == rows_) - good_ = false; - } - } -}; - -class RowMajor : public GeneralMatrix { - -public: - typedef RowMajorIterator T_iterator; - - RowMajor() - { } - - RowMajor(unsigned rows, unsigned cols) - : GeneralMatrix(rows, cols) - { } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - return i*cols_+j; - } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } -}; - -class ColumnMajorIterator : public GeneralIterator { -public: - ColumnMajorIterator(unsigned rows, unsigned cols) - : GeneralIterator(rows, cols) - { - } - - void operator++() - { - ++offset_; - ++i_; - if (i_ == rows_) - { - i_ = 0; - ++j_; - if (j_ == cols_) - good_ = false; - } - } -}; - -class ColumnMajor : public GeneralMatrix { - -public: - ColumnMajor() - { } - - ColumnMajor(unsigned rows, unsigned cols) - : GeneralMatrix(rows, cols) - { } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - return j*rows_ + i; - } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATGEN_H - diff --git a/weave/blitz-20001213/blitz/mathf2.h b/weave/blitz-20001213/blitz/mathf2.h deleted file mode 100644 index d80353cba..000000000 --- a/weave/blitz-20001213/blitz/mathf2.h +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef BZ_MATHF2_H -#define BZ_MATHF2_H - -#ifndef BZ_APPLICS_H - #error <blitz/mathf2.h> should be included via <blitz/applics.h> -#endif - -#ifndef BZ_PRETTYPRINT_H - #include <blitz/prettyprint.h> -#endif - -BZ_NAMESPACE(blitz) - -// cexp(z) Complex exponential -template<class P_numtype1> -class _bz_cexp : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return _bz_exp<T_numtype1>::apply(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cexp("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// csqrt(z) Complex square root -template<class P_numtype1> -class _bz_csqrt : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return _bz_sqrt<T_numtype1>::apply(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "csqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow2 Square -template<class P_numtype1> -class _bz_pow2 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - return BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow2("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow3 Cube -template<class P_numtype1> -class _bz_pow3 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - return BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x) * - BZ_NO_PROPAGATE(x); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow3("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow4 Fourth power -template<class P_numtype1> -class _bz_pow4 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - T_numtype t1 = BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x); - return BZ_NO_PROPAGATE(t1) * BZ_NO_PROPAGATE(t1); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow4("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow5 Fifth power -template<class P_numtype1> -class _bz_pow5 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - T_numtype t1 = BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x); - return BZ_NO_PROPAGATE(t1) * BZ_NO_PROPAGATE(t1) - * BZ_NO_PROPAGATE(t1); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow5("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow6 Sixth power -template<class P_numtype1> -class _bz_pow6 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - T_numtype t1 = BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x) - * BZ_NO_PROPAGATE(x); - return BZ_NO_PROPAGATE(t1) * BZ_NO_PROPAGATE(t1); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow6("; - a.prettyPrint(str,format); - str += ")"; - } -}; - - -// pow7 Seventh power -template<class P_numtype1> -class _bz_pow7 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - T_numtype t1 = BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x) - * BZ_NO_PROPAGATE(x); - return BZ_NO_PROPAGATE(t1) * BZ_NO_PROPAGATE(t1) - * BZ_NO_PROPAGATE(x); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow7("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// pow8 Eighth power -template<class P_numtype1> -class _bz_pow8 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { - T_numtype t1 = BZ_NO_PROPAGATE(x) * BZ_NO_PROPAGATE(x); - T_numtype t2 = BZ_NO_PROPAGATE(t1) * BZ_NO_PROPAGATE(t1); - return BZ_NO_PROPAGATE(t2) * BZ_NO_PROPAGATE(t2); - } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "pow8("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -/* - * These scalar versions of pow2, pow3, ..., pow8 are provided for - * convenience. - * - * NEEDS_WORK -- include BZ_NO_PROPAGATE for these scalar versions. - */ - -// NEEDS_WORK -- make these templates. Rely on specialization to -// handle expression template versions. - -#define BZ_DECLARE_POW(T) \ - inline T pow2(T x) { return x*x; } \ - inline T pow3(T x) { return x*x*x; } \ - inline T pow4(T x) { T t1 = x*x; return t1*t1; } \ - inline T pow5(T x) { T t1 = x*x; return t1*t1*x; } \ - inline T pow6(T x) { T t1 = x*x*x; return t1*t1; } \ - inline T pow7(T x) { T t1 = x*x; return t1*t1*t1*x; } \ - inline T pow8(T x) { T t1 = x*x, t2=t1*t1; return t2*t2; } - -BZ_DECLARE_POW(int) -BZ_DECLARE_POW(float) -BZ_DECLARE_POW(double) -BZ_DECLARE_POW(long double) - -#ifdef BZ_HAVE_COMPLEX -BZ_DECLARE_POW(complex<float>) -BZ_DECLARE_POW(complex<double>) -BZ_DECLARE_POW(complex<long double>) -#endif - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/mathfunc.h b/weave/blitz-20001213/blitz/mathfunc.h deleted file mode 100644 index 07777f1a6..000000000 --- a/weave/blitz-20001213/blitz/mathfunc.h +++ /dev/null @@ -1,2784 +0,0 @@ -// Generated: genmathfunc.cpp Feb 3 1999 09:08:50 - -#ifndef BZ_MATHFUNC_H -#define BZ_MATHFUNC_H - -#ifndef BZ_APPLICS_H - #error <blitz/mathfunc.h> should be included via <blitz/applics.h> -#endif - - -#ifndef BZ_PRETTYPRINT_H - #include <blitz/prettyprint.h> -#endif - -BZ_NAMESPACE(blitz) - -// abs(P_numtype1) Absolute value -template<class P_numtype1> -class _bz_abs : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(abs)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "abs("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// abs(long) -template<> -class _bz_abs<long> : public OneOperandApplicativeTemplatesBase { -public: - typedef long T_numtype1; - typedef long T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(labs)((long)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "labs("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// abs(float) -template<> -class _bz_abs<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(fabs)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "fabs("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// abs(double) -template<> -class _bz_abs<double> : public OneOperandApplicativeTemplatesBase { -public: - typedef double T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(fabs)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "fabs("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// abs(long double) -template<> -class _bz_abs<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(fabs)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "fabs("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// abs(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_abs<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(abs)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "abs("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// abs(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_abs<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(abs)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "abs("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// abs(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_abs<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(abs)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "abs("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// acos(P_numtype1) Inverse cosine -template<class P_numtype1> -class _bz_acos : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(acos)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "acos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// acos(float) -template<> -class _bz_acos<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(acos)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "acos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// acos(long double) -template<> -class _bz_acos<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(acos)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "acos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// acosh(P_numtype1) Inverse hyperbolic cosine -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_acosh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(acosh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "acosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// asin(P_numtype1) Inverse sine -template<class P_numtype1> -class _bz_asin : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(asin)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "asin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// asin(float) -template<> -class _bz_asin<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(asin)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "asin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// asin(long double) -template<> -class _bz_asin<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(asin)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "asin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// asinh(P_numtype1) Inverse hyperbolic sine -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_asinh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(asinh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "asinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// arg(P_numtype1) -#ifdef BZ_HAVE_COMPLEX_MATH -template<class P_numtype1> -class _bz_arg : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return 0; } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "0("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// arg(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_arg<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(arg)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "arg("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// arg(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_arg<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(arg)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "arg("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// arg(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_arg<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(arg)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "arg("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// atan(P_numtype1) Inverse tangent -template<class P_numtype1> -class _bz_atan : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(atan)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "atan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// atan(float) -template<> -class _bz_atan<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(atan)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "atan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// atan(long double) -template<> -class _bz_atan<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(atan)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "atan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// atanh(P_numtype1) Inverse hyperbolic tangent -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_atanh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(atanh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "atanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// atan2(P_numtype1, P_numtype2) Inverse tangent -template<class P_numtype1, class P_numtype2> -class _bz_atan2 : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(atan2)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "atan2("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// atan2(float, float) -template<> -class _bz_atan2<float, float > : public TwoOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype2; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(atan2)((float)x,(float)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "atan2("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// atan2(long double, long double) -template<> -class _bz_atan2<long double, long double > : public TwoOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype2; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(atan2)((long double)x,(long double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "atan2("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// _class(P_numtype1) Classification of float-point value (FP_xxx) -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz__class : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef int T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(_class)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "_class("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cbrt(P_numtype1) Cube root -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_cbrt : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(cbrt)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cbrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// ceil(P_numtype1) Ceiling -template<class P_numtype1> -class _bz_ceil : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(ceil)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "ceil("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// ceil(float) -template<> -class _bz_ceil<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(ceil)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "ceil("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// ceil(long double) -template<> -class _bz_ceil<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(ceil)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "ceil("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// conj(P_numtype1) -#ifdef BZ_HAVE_COMPLEX_MATH -template<class P_numtype1> -class _bz_conj : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(conj)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "conj("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cos(P_numtype1) Cosine -template<class P_numtype1> -class _bz_cos : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cos)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cos(float) -template<> -class _bz_cos<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cos)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cos(long double) -template<> -class _bz_cos<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cos)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cos(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cos<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cos)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cos(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cos<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cos)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cos(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cos<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cos)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cos("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// copysign(P_numtype1, P_numtype2) -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_copysign : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(copysign)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "copysign("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cosh(P_numtype1) Hyperbolic cosine -template<class P_numtype1> -class _bz_cosh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cosh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cosh(float) -template<> -class _bz_cosh<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cosh)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cosh(long double) -template<> -class _bz_cosh<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(cosh)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// cosh(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cosh<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cosh)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cosh(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cosh<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cosh)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// cosh(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_cosh<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(cosh)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "cosh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// drem(P_numtype1, P_numtype2) Remainder -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_drem : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(drem)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "drem("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// exp(P_numtype1) Exponential -template<class P_numtype1> -class _bz_exp : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(exp)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// exp(float) -template<> -class _bz_exp<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(exp)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// exp(long double) -template<> -class _bz_exp<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(exp)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// exp(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_exp<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(exp)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// exp(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_exp<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(exp)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// exp(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_exp<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(exp)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "exp("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// expm1(P_numtype1) Exp(x)-1 -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_expm1 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(expm1)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "expm1("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// erf(P_numtype1) Error function -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_erf : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(erf)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "erf("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// erfc(P_numtype1) Complementary error function -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_erfc : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(erfc)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "erfc("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// floor(P_numtype1) Floor function -template<class P_numtype1> -class _bz_floor : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(floor)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "floor("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// floor(float) -template<> -class _bz_floor<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(floor)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "floor("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// floor(long double) -template<> -class _bz_floor<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(floor)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "floor("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// fmod(P_numtype1, P_numtype2) Modulo remainder -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_fmod : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(fmod)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "fmod("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// hypot(P_numtype1, P_numtype2) sqrt(x*x+y*y) -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_hypot : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(hypot)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "hypot("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// ilogb(P_numtype1) Integer unbiased exponent -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz_ilogb : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef int T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(ilogb)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "ilogb("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// isnan(P_numtype1) Nonzero if NaNS or NaNQ -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_isnan : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef int T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(isnan)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "isnan("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// itrunc(P_numtype1) Truncate and convert to integer -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz_itrunc : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef int T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(itrunc)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "itrunc("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// j0(P_numtype1) Bessel function first kind, order 0 -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_j0 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(j0)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "j0("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// j1(P_numtype1) Bessel function first kind, order 1 -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_j1 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(j1)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "j1("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// lgamma(P_numtype1) Log absolute gamma -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_lgamma : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(lgamma)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "lgamma("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// log(P_numtype1) Natural logarithm -template<class P_numtype1> -class _bz_log : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// log(float) -template<> -class _bz_log<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// log(long double) -template<> -class _bz_log<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// log(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_log<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(log)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// log(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_log<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(log)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// log(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_log<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(log)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// logb(P_numtype1) Unbiased exponent (IEEE) -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_logb : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(logb)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "logb("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// log1p(P_numtype1) Compute log(1 + x) -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_log1p : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(log1p)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log1p("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// log10(P_numtype1) Logarithm base 10 -template<class P_numtype1> -class _bz_log10 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log10)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log10("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// log10(float) -template<> -class _bz_log10<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log10)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log10("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// log10(long double) -template<> -class _bz_log10<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(log10)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "log10("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// nearest(P_numtype1) Nearest floating point integer -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz_nearest : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(nearest)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "nearest("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// nextafter(P_numtype1, P_numtype2) Next representable number after x towards y -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_nextafter : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(nextafter)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "nextafter("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -template<class P_numtype> -class _bz_negate : public OneOperandApplicativeTemplatesBase { -public: - typedef BZ_SIGNEDTYPE(P_numtype) T_numtype; - - static inline T_numtype apply(T_numtype x) - { return -x; } -}; - -// norm(P_numtype1) -#ifdef BZ_HAVE_COMPLEX_MATH -template<class P_numtype1> -class _bz_norm : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype1 T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(norm)(x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "norm("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// polar(P_numtype1, P_numtype2) -#ifdef BZ_HAVE_COMPLEX_MATH -template<class P_numtype1, class P_numtype2> -class _bz_polar : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef complex<T_numtype1> T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_CMATHFN_SCOPE(polar)(x,y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "polar("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// pow(P_numtype1, P_numtype2) Power -template<class P_numtype1, class P_numtype2> -class _bz_pow : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(pow)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// pow(float, float) -template<> -class _bz_pow<float, float > : public TwoOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype2; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(pow)((float)x,(float)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// pow(long double, long double) -template<> -class _bz_pow<long double, long double > : public TwoOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype2; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_MATHFN_SCOPE(pow)((long double)x,(long double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; - -// pow(complex<float>, complex<float>) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_pow<complex<float>, complex<float> > : public TwoOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype2; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_CMATHFN_SCOPE(pow)((complex<float>)x,(complex<float>)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// pow(complex<double>, complex<double>) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_pow<complex<double>, complex<double> > : public TwoOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype2; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_CMATHFN_SCOPE(pow)((complex<double>)x,(complex<double>)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// pow(complex<long double>, complex<long double>) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_pow<complex<long double>, complex<long double> > : public TwoOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype2; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_CMATHFN_SCOPE(pow)((complex<long double>)x,(complex<long double>)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "pow("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// remainder(P_numtype1, P_numtype2) Remainder -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_remainder : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(remainder)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "remainder("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// rint(P_numtype1) Round to floating point integer -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_rint : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(rint)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "rint("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// rsqrt(P_numtype1) Reciprocal square root -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz_rsqrt : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(rsqrt)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "rsqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// scalb(P_numtype1, P_numtype2) x * (2**y) -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_scalb : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(scalb)((double)x,(double)y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "scalb("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sin(P_numtype1) Sine -template<class P_numtype1> -class _bz_sin : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sin)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sin(float) -template<> -class _bz_sin<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sin)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sin(long double) -template<> -class _bz_sin<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sin)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sin(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sin<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sin)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sin(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sin<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sin)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sin(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sin<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sin)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sin("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sinh(P_numtype1) Hyperbolic sine -template<class P_numtype1> -class _bz_sinh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sinh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sinh(float) -template<> -class _bz_sinh<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sinh)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sinh(long double) -template<> -class _bz_sinh<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sinh)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sinh(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sinh<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sinh)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sinh(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sinh<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sinh)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sinh(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sinh<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sinh)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sinh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -template<class P_numtype> -class _bz_sqr : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype T_numtype; - - static inline T_numtype apply(T_numtype x) - { return x*x; } - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqr("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -#ifdef BZ_HAVE_COMPLEX_MATH -// Specialization of _bz_sqr for complex<T> -template<class T> -class _bz_sqr<complex<T> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<T> T_numtype; - - static inline T_numtype apply(T_numtype x) - { - T r = x.real(); T i = x.imag(); - return T_numtype(r*r-i*i, 2*r*i); - } - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqr("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sqrt(P_numtype1) Square root -template<class P_numtype1> -class _bz_sqrt : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sqrt)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sqrt(float) -template<> -class _bz_sqrt<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sqrt)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sqrt(long double) -template<> -class _bz_sqrt<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(sqrt)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// sqrt(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sqrt<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sqrt)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sqrt(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sqrt<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sqrt)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// sqrt(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_sqrt<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(sqrt)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "sqrt("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tan(P_numtype1) Tangent -template<class P_numtype1> -class _bz_tan : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tan)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tan(float) -template<> -class _bz_tan<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tan)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tan(long double) -template<> -class _bz_tan<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tan)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tan(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tan<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tan)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tan(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tan<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tan)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tan(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tan<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tan)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tan("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tanh(P_numtype1) Hyperbolic tangent -template<class P_numtype1> -class _bz_tanh : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tanh)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tanh(float) -template<> -class _bz_tanh<float> : public OneOperandApplicativeTemplatesBase { -public: - typedef float T_numtype1; - typedef float T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tanh)((float)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tanh(long double) -template<> -class _bz_tanh<long double> : public OneOperandApplicativeTemplatesBase { -public: - typedef long double T_numtype1; - typedef long double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_MATHFN_SCOPE(tanh)((long double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; - -// tanh(complex<float> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tanh<complex<float> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<float> T_numtype1; - typedef complex<float> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tanh)((complex<float> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tanh(complex<double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tanh<complex<double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<double> T_numtype1; - typedef complex<double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tanh)((complex<double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// tanh(complex<long double> ) -#ifdef BZ_HAVE_COMPLEX_MATH -template<> -class _bz_tanh<complex<long double> > : public OneOperandApplicativeTemplatesBase { -public: - typedef complex<long double> T_numtype1; - typedef complex<long double> T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_CMATHFN_SCOPE(tanh)((complex<long double> )x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "tanh("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// uitrunc(P_numtype1) Truncate and convert to unsigned -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1> -class _bz_uitrunc : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef unsigned T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(uitrunc)((unsigned)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "uitrunc("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// unordered(P_numtype1, P_numtype2) True if a comparison of x and y would be unordered -#ifdef BZ_HAVE_SYSTEM_V_MATH -template<class P_numtype1, class P_numtype2> -class _bz_unordered : public TwoOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef P_numtype2 T_numtype2; - typedef int T_numtype; - - static inline T_numtype apply(T_numtype1 x, T_numtype2 y) - { return BZ_IEEEMATHFN_SCOPE(unordered)(x,y); } - - template<class T1, class T2> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a, const T2& b) - { - str += "unordered("; - a.prettyPrint(str,format); - str += ","; - b.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// y0(P_numtype1) Bessel function of the second kind, order zero -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_y0 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(y0)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "y0("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - -// y1(P_numtype1) Bessel function of the second kind, order one -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -class _bz_y1 : public OneOperandApplicativeTemplatesBase { -public: - typedef P_numtype1 T_numtype1; - typedef double T_numtype; - - static inline T_numtype apply(T_numtype1 x) - { return BZ_IEEEMATHFN_SCOPE(y1)((double)x); } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "y1("; - a.prettyPrint(str,format); - str += ")"; - } -}; -#endif - - - -BZ_NAMESPACE_END - -#endif // BZ_MATHFUNC_H diff --git a/weave/blitz-20001213/blitz/matltri.h b/weave/blitz-20001213/blitz/matltri.h deleted file mode 100644 index e21c6d3ce..000000000 --- a/weave/blitz-20001213/blitz/matltri.h +++ /dev/null @@ -1,199 +0,0 @@ -/*************************************************************************** - * blitz/matltri.h Declarations for LowerTriangular matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - - -#ifndef BZ_MATLTRI_H -#define BZ_MATLTRI_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/matltri.h> must be included via <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Lower triangular, row major ordering -// [ 0 . . . ] -// [ 1 2 . . ] -// [ 3 4 5 . ] -// [ 6 7 8 9 ] - -class LowerTriangularIterator { -public: - LowerTriangularIterator(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - good_ = true; - offset_ = 0; - i_ = 0; - j_ = 0; - } - - operator _bz_bool() const - { return good_; } - - void operator++() - { - BZPRECONDITION(good_); - ++offset_; - ++j_; - if (j_ > i_) - { - j_ = 0; - ++i_; - if (i_ == size_) - good_ = false; - } - } - - unsigned row() const - { return i_; } - - unsigned col() const - { return j_; } - - unsigned offset() const - { return offset_; } - -protected: - unsigned size_; - _bz_bool good_; - unsigned offset_; - unsigned i_, j_; -}; - -class LowerTriangular : public MatrixStructure { - -public: - typedef LowerTriangularIterator T_iterator; - - LowerTriangular() - : size_(0) - { } - - LowerTriangular(unsigned size) - : size_(size) - { } - - LowerTriangular(unsigned rows, unsigned cols) - : size_(rows) - { - BZPRECONDITION(rows == cols); - } - - unsigned columns() const - { return size_; } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - BZPRECONDITION(i >= j); - return i*(i+1)/2 + j; - } - - unsigned firstInRow(unsigned i) const - { return 0; } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - if (i >= j) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - if (i >= j) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - unsigned lastInRow(unsigned i) const - { return i; } - - unsigned firstInCol(unsigned j) const - { return j; } - - unsigned lastInCol(unsigned j) const - { return size_ - 1; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < size_) && (j < size_); - } - - unsigned numElements() const - { return size_ * (size_ + 1) / 2; } - - unsigned rows() const - { return size_; } - - void resize(unsigned size) - { - size_ = size; - } - - void resize(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - } - -private: - unsigned size_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATLTRI_H - diff --git a/weave/blitz-20001213/blitz/matref.h b/weave/blitz-20001213/blitz/matref.h deleted file mode 100644 index ab91fc475..000000000 --- a/weave/blitz-20001213/blitz/matref.h +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************** - * blitz/matref.h Declaration of the _bz_MatrixRef<P_numtype, P_structure> - * class. - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATREF_H -#define BZ_MATREF_H - -#ifndef BZ_MATEXPR_H - #error <blitz/matref.h> must be included via <blitz/matexpr.h> -#endif // BZ_MATEXPR_H - -BZ_NAMESPACE(blitz) - -template<class P_numtype, class P_structure> -class _bz_MatrixRef { - -public: - typedef P_numtype T_numtype; - - _bz_MatrixRef(const Matrix<P_numtype, P_structure>& m) - : matrix_(&m) - { } - - T_numtype operator()(unsigned i, unsigned j) const - { return (*matrix_)(i,j); } - - unsigned rows(unsigned) const - { return matrix_->rows(); } - - unsigned cols(unsigned) const - { return matrix_->cols(); } - -private: - _bz_MatrixRef() { } - - const Matrix<P_numtype, P_structure>* matrix_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATREF_H diff --git a/weave/blitz-20001213/blitz/matrix.cc b/weave/blitz-20001213/blitz/matrix.cc deleted file mode 100644 index 791735aad..000000000 --- a/weave/blitz-20001213/blitz/matrix.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_MATRIX_CC -#define BZ_MATRIX_CC - -#ifndef BZ_MATRIX_H - #include <blitz/matrix.h> -#endif - -BZ_NAMESPACE(blitz) - -// Matrix expression operand -template<class P_numtype, class P_structure> template<class P_expr> -Matrix<P_numtype, P_structure>& -Matrix<P_numtype, P_structure>::operator=(_bz_MatExpr<P_expr> expr) -{ - // Check for compatible structures. - - // Fast evaluation (compatible structures) - // (not implemented) - - // Slow evaluation - _bz_typename P_structure::T_iterator iter(rows(), cols()); - while (iter) - { - data_[iter.offset()] = expr(iter.row(), iter.col()); - ++iter; - } - - return *this; -} - -template<class P_numtype, class P_structure> -ostream& operator<<(ostream& os, const Matrix<P_numtype, P_structure>& matrix) -{ - os << "[ "; - for (int i=0; i < matrix.rows(); ++i) - { - for (int j=0; j < matrix.columns(); ++j) - { - os << setw(10) << matrix(i,j); - if ((!((j+1)%7)) && (j < matrix.cols()-1)) - os << endl << " ..."; - } - if (i != matrix.rows() - 1) - os << endl << " "; - } - os << " ]"; - return os; -} - -BZ_NAMESPACE_END - -#endif // BZ_MATRIX_CC diff --git a/weave/blitz-20001213/blitz/matrix.h b/weave/blitz-20001213/blitz/matrix.h deleted file mode 100644 index ff6a3542b..000000000 --- a/weave/blitz-20001213/blitz/matrix.h +++ /dev/null @@ -1,243 +0,0 @@ -/*************************************************************************** - * blitz/matrix.h Declaration of the Matrix<T_type, T_structure> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/11/11 17:29:13 tveldhui - * Initial revision - * - * Revision 1.2 1996/10/31 21:06:54 tveldhui - * Did away with multiple template parameters. Only numeric type - * and structure parameters now. - * - * - */ - -#ifndef BZ_MATRIX_H -#define BZ_MATRIX_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_MEMBLOCK_H - #include <blitz/memblock.h> -#endif - -#ifndef BZ_MSTRUCT_H - #include <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Forward declarations -template<class P_numtype, class P_structure> -class _bz_MatrixRef; - -template<class P_expr> -class _bz_MatExpr; - -// Declaration of class Matrix -template<class P_numtype, class P_structure BZ_TEMPLATE_DEFAULT(RowMajor)> -class Matrix : protected MemoryBlockReference<P_numtype> { - -public: - - ////////////////////////////////////////////// - // Public Types - ////////////////////////////////////////////// - - typedef P_numtype T_numtype; - typedef P_structure T_structure; - typedef Matrix<P_numtype, P_structure> T_matrix; - - ////////////////////////////////////////////// - // Constructors // - ////////////////////////////////////////////// - - Matrix() - { } - - Matrix(int rows, int cols, T_structure structure = T_structure()) - : structure_(structure) - { - structure_.resize(rows, cols); - MemoryBlockReference<T_numtype>::newBlock(structure_.numElements()); - } - - // Matrix(int rows, int cols, T_numtype initValue, - // T_structure structure = T_structure(rows, cols)); - // Matrix(int rows, int cols, Random); - // Matrix(int rows, int cols, matrix-expression); - // Matrix(int rows, int cols, T_numtype* data, int rowStride, int colStride); - // _bz_explicit Matrix(Vector<T_numtype>& matrix); - // _bz_explicit Matrix(unsigned length); - - // Create a vector view of an already allocated block of memory. - // Note that the memory will not be freed when this vector is - // destroyed. - // Matrix(unsigned length, T_numtype* data, int stride = 1); - - ////////////////////////////////////////////// - // Member functions - ////////////////////////////////////////////// - - //T_iterator begin() const; - //T_constIterator begin() const; - //T_vector copy() const; - //T_iterator end() const; - //T_constIterator end() const; - - unsigned cols() const - { return structure_.columns(); } - - unsigned columns() const - { return structure_.columns(); } - - void makeUnique() const; - - unsigned numElements() const - { return structure_.numElements(); } - - void reference(T_matrix&); - - void resize(unsigned rows, unsigned cols) - { - structure_.resize(rows, cols); - MemoryBlockReference<T_numtype>::newBlock(structure_.numElements()); - } - -// void resizeAndPreserve(unsigned newLength); - - unsigned rows() const - { return structure_.rows(); } - - _bz_MatrixRef<T_numtype, T_structure> _bz_getRef() const - { return _bz_MatrixRef<T_numtype, T_structure>(*this); } - - ////////////////////////////////////////////// - // Subscripting operators - ////////////////////////////////////////////// - - T_numtype operator()(unsigned i, unsigned j) const - { - return structure_.get(data_, i, j); - } - - T_numtype& _bz_restrict operator()(unsigned i, unsigned j) - { - return structure_.get(data_, i, j); - } - - // T_matrix operator()(Range,Range); - - // T_matrixIndirect operator()(Vector<int>,Vector<int>); - // T_matrixIndirect operator()(integer-placeholder-expression, Range); - // T_matrix operator()(difference-equation-expression) - - ////////////////////////////////////////////// - // Assignment operators - ////////////////////////////////////////////// - - // Scalar operand - T_matrix& operator=(T_numtype); - T_matrix& operator+=(T_numtype); - T_matrix& operator-=(T_numtype); - T_matrix& operator*=(T_numtype); - T_matrix& operator/=(T_numtype); - - // Matrix operand - - template<class P_numtype2, class P_structure2> - T_matrix& operator=(const Matrix<P_numtype2, P_structure2> &); - template<class P_numtype2, class P_structure2> - T_matrix& operator+=(const Matrix<P_numtype2, P_structure2>&); - template<class P_numtype2, class P_structure2> - T_matrix& operator-=(const Matrix<P_numtype2, P_structure2> &); - template<class P_numtype2, class P_structure2> - T_matrix& operator*=(const Matrix<P_numtype2, P_structure2> &); - template<class P_numtype2, class P_structure2> - T_matrix& operator/=(const Matrix<P_numtype2, P_structure2> &); - - // Matrix expression operand - template<class P_expr> - T_matrix& operator=(_bz_MatExpr<P_expr>); - - // Integer placeholder expression operand - // MatrixPick operand - - ////////////////////////////////////////////// - // Unary operators - ////////////////////////////////////////////// - - T_matrix& operator++(); - void operator++(int); - T_matrix& operator--(); - void operator--(int); - -private: - T_structure structure_; -}; - -template<class P_numtype, class P_structure> -ostream& operator<<(ostream& os, const Matrix<P_numtype, P_structure>& matrix); - -// Global operators -// +,-,*,/ with all possible combinations of: -// - scalar -// - matrix -// - matrix pick -// - matrix expression -// Pointwise Math functions: sin, cos, etc. -// Global functions - -BZ_NAMESPACE_END - -#include <blitz/matrix.cc> -#include <blitz/matexpr.h> - -#endif // BZ_MATRIX_H diff --git a/weave/blitz-20001213/blitz/matsymm.h b/weave/blitz-20001213/blitz/matsymm.h deleted file mode 100644 index d3f1296f6..000000000 --- a/weave/blitz-20001213/blitz/matsymm.h +++ /dev/null @@ -1,194 +0,0 @@ -/*************************************************************************** - * blitz/matsymm.h Declarations for Symmetric matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATSYMM_H -#define BZ_MATSYMM_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/matsymm.h> must be included via <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Symmetric, lower triangular row major ordering -// [ 0 1 3 6 ] -// [ 1 2 4 7 ] -// [ 3 4 5 8 ] -// [ 6 7 8 9 ] - -class SymmetricIterator { -public: - SymmetricIterator(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - good_ = true; - offset_ = 0; - i_ = 0; - j_ = 0; - } - - operator _bz_bool() const - { return good_; } - - void operator++() - { - BZPRECONDITION(good_); - ++offset_; - ++j_; - if (j_ > i_) - { - j_ = 0; - ++i_; - if (i_ == size_) - good_ = false; - } - } - - unsigned row() const - { return i_; } - - unsigned col() const - { return j_; } - - unsigned offset() const - { return offset_; } - -protected: - unsigned size_; - _bz_bool good_; - unsigned offset_; - unsigned i_, j_; -}; - -class Symmetric : public MatrixStructure { - -public: - typedef SymmetricIterator T_iterator; - - Symmetric() - : size_(0) - { } - - Symmetric(unsigned size) - : size_(size) - { } - - Symmetric(unsigned rows, unsigned cols) - : size_(rows) - { - BZPRECONDITION(rows == cols); - } - - unsigned columns() const - { return size_; } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - if (i >= j) - return i*(i+1)/2 + j; - else - return j*(j+1)/2 + i; - } - - unsigned firstInRow(unsigned i) const - { return 0; } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - unsigned lastInRow(unsigned i) const - { return i; } - - unsigned firstInCol(unsigned j) const - { return j; } - - unsigned lastInCol(unsigned j) const - { return size_ - 1; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < size_) && (j < size_); - } - - unsigned numElements() const - { return size_ * (size_ + 1) / 2; } - - unsigned rows() const - { return size_; } - - void resize(unsigned size) - { - size_ = size; - } - - void resize(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - } - -private: - unsigned size_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATSYMM_H - diff --git a/weave/blitz-20001213/blitz/mattoep.h b/weave/blitz-20001213/blitz/mattoep.h deleted file mode 100644 index 1c036f96f..000000000 --- a/weave/blitz-20001213/blitz/mattoep.h +++ /dev/null @@ -1,179 +0,0 @@ -/*************************************************************************** - * blitz/mattoep.h Declarations for Toeplitz matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MATTOEP_H -#define BZ_MATTOEP_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/mattoep.h> must be included via <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Toeplitz matrix -// [ 0 1 2 3 ] -// [ 1 2 3 4 ] -// [ 2 3 4 5 ] -// [ 3 4 5 6 ] - -class ToeplitzIterator { -public: - ToeplitzIterator(unsigned rows, unsigned cols) - { - rows_ = rows; - cols_ = cols; - i_ = 0; - j_ = 0; - good_ = true; - offset_ = 0; - } - - operator _bz_bool() const - { - return good_; - } - - void operator++() - { - ++offset_; - if (i_ < rows_ - 1) - ++i_; - else if (j_ < cols_ - 1) - ++j_; - else - good_ = false; - } - - unsigned row() const - { return i_; } - - unsigned col() const - { return j_; } - - unsigned offset() const - { return offset_; } - -protected: - unsigned offset_; - unsigned i_, j_; - unsigned rows_, cols_; - _bz_bool good_; -}; - -class Toeplitz : public GeneralMatrix { - -public: - typedef ToeplitzIterator T_iterator; - - Toeplitz() - : rows_(0), cols_(0) - { } - - Toeplitz(unsigned rows, unsigned cols) - : rows_(rows), cols_(cols) - { } - - unsigned columns() const - { return cols_; } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - return i + j; - } - - unsigned firstInRow(unsigned i) const - { return 0; } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - return data[coordToOffset(i,j)]; - } - - unsigned lastInRow(unsigned i) const - { return cols_ - 1; } - - unsigned firstInCol(unsigned j) const - { return 0; } - - unsigned lastInCol(unsigned j) const - { return rows_ - 1; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < rows_) && (j < cols_); - } - - unsigned numElements() const - { return rows_ + cols_ - 1; } - - unsigned rows() const - { return rows_; } - - void resize(unsigned rows, unsigned cols) - { - rows_ = rows; - cols_ = cols; - } - -private: - unsigned rows_, cols_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATSYMM_H - diff --git a/weave/blitz-20001213/blitz/matuops.h b/weave/blitz-20001213/blitz/matuops.h deleted file mode 100644 index 8b1378917..000000000 --- a/weave/blitz-20001213/blitz/matuops.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/weave/blitz-20001213/blitz/matutri.h b/weave/blitz-20001213/blitz/matutri.h deleted file mode 100644 index 1c8dd6cd4..000000000 --- a/weave/blitz-20001213/blitz/matutri.h +++ /dev/null @@ -1,196 +0,0 @@ -/*************************************************************************** - * blitz/matutri.h Declarations for UpperTriangular matrices - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - */ - -#ifndef BZ_MATUTRI_H -#define BZ_MATUTRI_H - -#ifndef BZ_MSTRUCT_H - #error <blitz/matutri.h> must be included via <blitz/mstruct.h> -#endif - -BZ_NAMESPACE(blitz) - -// Upper triangular, column major ordering -// [ 0 1 3 6 ] -// [ . 2 4 7 ] -// [ . . 5 8 ] -// [ . . . 9 ] - -class UpperTriangularIterator { -public: - UpperTriangularIterator(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - good_ = true; - offset_ = 0; - i_ = 0; - j_ = 0; - } - - operator _bz_bool() const - { return good_; } - - void operator++() - { - BZPRECONDITION(good_); - ++offset_; - ++i_; - if (i_ > j_) - { - i_ = 0; - ++j_; - if (j_ == size_) - good_ = false; - } - } - - unsigned row() const - { return i_; } - - unsigned col() const - { return j_; } - - unsigned offset() const - { return offset_; } - -protected: - unsigned size_; - _bz_bool good_; - unsigned offset_; - unsigned i_, j_; -}; - -class UpperTriangular : public MatrixStructure { - -public: - typedef UpperTriangularIterator T_iterator; - - UpperTriangular() - : size_(0) - { } - - UpperTriangular(unsigned size) - : size_(size) - { } - - UpperTriangular(unsigned rows, unsigned cols) - : size_(rows) - { - BZPRECONDITION(rows == cols); - } - - unsigned columns() const - { return size_; } - - unsigned coordToOffset(unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - BZPRECONDITION(j >= i); - return j*(j+1)/2 + i; - } - - unsigned firstInRow(unsigned i) const - { return 0; } - - template<class T_numtype> - T_numtype get(const T_numtype * _bz_restrict data, - unsigned i, unsigned j) const - { - BZPRECONDITION(inRange(i,j)); - if (j >= i) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - template<class T_numtype> - T_numtype& get(T_numtype * _bz_restrict data, unsigned i, unsigned j) - { - BZPRECONDITION(inRange(i,j)); - if (j >= i) - return data[coordToOffset(i,j)]; - else - return ZeroElement<T_numtype>::zero(); - } - - unsigned lastInRow(unsigned i) const - { return size_ - 1; } - - unsigned firstInCol(unsigned j) const - { return 0; } - - unsigned lastInCol(unsigned j) const - { return j; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < size_) && (j < size_); - } - - unsigned numElements() const - { return size_ * (size_ + 1) / 2; } - - unsigned rows() const - { return size_; } - - void resize(unsigned size) - { - size_ = size; - } - - void resize(unsigned rows, unsigned cols) - { - BZPRECONDITION(rows == cols); - size_ = rows; - } - -private: - unsigned size_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_MATUTRI_H - diff --git a/weave/blitz-20001213/blitz/memblock.cc b/weave/blitz-20001213/blitz/memblock.cc deleted file mode 100644 index 6f8eaa3ff..000000000 --- a/weave/blitz-20001213/blitz/memblock.cc +++ /dev/null @@ -1,115 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_MEMBLOCK_CC -#define BZ_MEMBLOCK_CC - -#ifndef BZ_MEMBLOCK_H - #include <blitz/memblock.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -BZ_NAMESPACE(blitz) - -// Null memory block for each (template) instantiation of MemoryBlockReference -template<class P_type> -NullMemoryBlock<P_type> MemoryBlockReference<P_type>::nullBlock_; - -template<class P_type> -void MemoryBlock<P_type>::deallocate() -{ -#ifndef BZ_ALIGN_BLOCKS_ON_CACHELINE_BOUNDARY - delete [] dataBlockAddress_; -#else - if (!NumericTypeTraits<T_type>::hasTrivialCtor) { - for (int i=0; i < length_; ++i) - data_[i].~T_type(); - delete [] reinterpret_cast<char*>(dataBlockAddress_); - } - else { - delete [] dataBlockAddress_; - } -#endif -} - -template<class P_type> -inline void MemoryBlock<P_type>::allocate(int length) -{ - TAU_TYPE_STRING(p1, "MemoryBlock<T>::allocate() [T=" - + CT(P_type) + "]"); - TAU_PROFILE(p1, "void ()", TAU_BLITZ); - -#ifndef BZ_ALIGN_BLOCKS_ON_CACHELINE_BOUNDARY - data_ = new T_type[length]; - dataBlockAddress_ = data_; -#else - int numBytes = length * sizeof(T_type); - - if (numBytes < 1024) - { - data_ = new T_type[length]; - dataBlockAddress_ = data_; - } - else - { - // We're allocating a large array. For performance reasons, - // it's advantageous to force the array to start on a - // cache line boundary. We do this by allocating a little - // more memory than necessary, then shifting the pointer - // to the next cache line boundary. - - // Patches by Petter Urkedal to support types with nontrivial - // constructors. - - const int cacheBlockSize = 128; // Will work for 32, 16 also - - dataBlockAddress_ = reinterpret_cast<T_type*> - (new char[numBytes + cacheBlockSize - 1]); - - // Shift to the next cache line boundary - - ptrdiff_t offset = ptrdiff_t(dataBlockAddress_) % cacheBlockSize; - int shift = (offset == 0) ? 0 : (cacheBlockSize - offset); - data_ = (T_type*)(((char *)dataBlockAddress_) + shift); - - // Use placement new to construct types with nontrival ctors - if (!NumericTypeTraits<T_type>::hasTrivialCtor) { - for (int i=0; i < length; ++i) - new(&data_[i]) T_type; - } - } -#endif -} - - -BZ_NAMESPACE_END - -#endif // BZ_MEMBLOCK_CC diff --git a/weave/blitz-20001213/blitz/memblock.h b/weave/blitz-20001213/blitz/memblock.h deleted file mode 100644 index d58860d00..000000000 --- a/weave/blitz-20001213/blitz/memblock.h +++ /dev/null @@ -1,381 +0,0 @@ -/*************************************************************************** - * blitz/memblock.h MemoryBlock<T> and MemoryBlockReference<T> - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.8 1998/12/06 00:00:35 tveldhui - * Prior to adding UnownedMemoryBlock - * - * Revision 1.7 1998/06/15 16:07:01 tveldhui - * When a memory block is created from an existing block of data, - * add an additional reference count so that makeUnique() will - * create a copy of the data. - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/11/11 17:29:13 tveldhui - * Initial revision - * - * - *************************************************************************** - * - */ - -#ifndef __BZ_MEMBLOCK_H__ -#define __BZ_MEMBLOCK_H__ - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -#include <stddef.h> // ptrdiff_t - -BZ_NAMESPACE(blitz) - -enum preexistingMemoryPolicy { - duplicateData, - deleteDataWhenDone, - neverDeleteData -}; - -// Forward declaration of MemoryBlockReference -template<class T_type> class MemoryBlockReference; - -// Class MemoryBlock provides a reference-counted block of memory. This block -// may be referred to by multiple vector, matrix and array objects. The memory -// is automatically deallocated when the last referring object is destructed. -// MemoryBlock may be subclassed to provide special allocators. -template<class P_type> -class MemoryBlock { - - friend class MemoryBlockReference<P_type>; - -public: - typedef P_type T_type; - -protected: - MemoryBlock() - { - length_ = 0; - data_ = 0; - dataBlockAddress_ = 0; - references_ = 0; - } - - _bz_explicit MemoryBlock(size_t items) - { - length_ = items; - allocate(length_); - -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlock: allocated " << setw(8) << length_ - << " at " << ((void *)dataBlockAddress_) << endl; -#endif - - BZASSERT(dataBlockAddress_ != 0); - - references_ = 0; - } - - MemoryBlock(size_t length, T_type* _bz_restrict data) - { - length_ = length; - data_ = data; - dataBlockAddress_ = 0; - references_ = 0; - } - - virtual ~MemoryBlock() - { - if (dataBlockAddress_) - { - -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlock: freed " << setw(8) << length_ - << " at " << ((void *)dataBlockAddress_) << endl; -#endif - - deallocate(); - } - } - - void addReference() - { - ++references_; - -#ifdef BZ_DEBUG_LOG_REFERENCES - cout << "MemoryBlock: reffed " << setw(8) << length_ - << " at " << ((void *)dataBlockAddress_) << " (r=" - << (int)references_ << ")" << endl; -#endif - - } - - T_type* _bz_restrict data() - { - return data_; - } - - const T_type* _bz_restrict data() const - { - return data_; - } - - size_t length() const - { - return length_; - } - - void removeReference() - { - --references_; - -#ifdef BZ_DEBUG_LOG_REFERENCES - cout << "MemoryBlock: dereffed " << setw(8) << length_ - << " at " << ((void *)dataBlockAddress_) << " (r=" << (int)references_ - << ")" << endl; -#endif - } - - int references() const - { - return references_; - } - -protected: - inline void allocate(int length); - void deallocate(); - -private: // Disabled member functions - MemoryBlock(const MemoryBlock<T_type>&) - { } - - void operator=(const MemoryBlock<T_type>&) - { } - -private: // Data members - T_type * _bz_restrict data_; - T_type * _bz_restrict dataBlockAddress_; - -#ifdef BZ_DEBUG_REFERENCE_ROLLOVER - unsigned char references_; -#else - int references_; -#endif - - size_t length_; -}; - -template<class P_type> -class UnownedMemoryBlock : public MemoryBlock<P_type> { -public: - UnownedMemoryBlock(size_t length, P_type* _bz_restrict data) - : MemoryBlock<P_type>(length,data) - { - } - - virtual ~UnownedMemoryBlock() - { - } -}; - -template<class P_type> -class NullMemoryBlock : public MemoryBlock<P_type> { -public: - NullMemoryBlock() - { - // This ensures that the delete operator will not be invoked - // on an instance of NullMemoryBlock in removeReference(). - this->addReference(); - } - - virtual ~NullMemoryBlock() - { } -}; - -template<class P_type> -class MemoryBlockReference { - -public: - typedef P_type T_type; - -protected: - T_type * _bz_restrict data_; - -private: - MemoryBlock<T_type>* block_; - static NullMemoryBlock<T_type> nullBlock_; - -public: - - MemoryBlockReference() - { - block_ = &nullBlock_; - block_->addReference(); - data_ = 0; - } - - MemoryBlockReference(MemoryBlockReference<T_type>& ref) - { - block_ = ref.block_; - block_->addReference(); - data_ = block_->data(); - } - - MemoryBlockReference(MemoryBlockReference<T_type>& ref, size_t offset) - { - block_ = ref.block_; - block_->addReference(); - data_ = block_->data() + offset; - } - - MemoryBlockReference(size_t length, T_type* data, - preexistingMemoryPolicy deletionPolicy) - { - // Create a memory block using already allocated memory. - - // Note: if the deletionPolicy is duplicateData, this must - // be handled by the leaf class. In MemoryBlockReference, - // this is treated as neverDeleteData; the leaf class (e.g. Array) - // must duplicate the data. - - if ((deletionPolicy == neverDeleteData) - || (deletionPolicy == duplicateData)) - block_ = new UnownedMemoryBlock<T_type>(length, data); - else if (deletionPolicy == deleteDataWhenDone) - block_ = new MemoryBlock<T_type>(length, data); - block_->addReference(); - -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlockReference: created MemoryBlock at " - << ((void*)block_) << endl; -#endif - - data_ = data; - } - - _bz_explicit MemoryBlockReference(size_t items) - { - block_ = new MemoryBlock<T_type>(items); - block_->addReference(); - data_ = block_->data(); - -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlockReference: created MemoryBlock at " - << ((void*)block_) << endl; -#endif - - } - - void blockRemoveReference() - { - block_->removeReference(); - if ((block_->references() == 0) && (block_ != &nullBlock_)) - { -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlock: no more refs, delete MemoryBlock object at " - << ((void*)block_) << endl; -#endif - - delete block_; - } - } - - ~MemoryBlockReference() - { - blockRemoveReference(); - } - - int numReferences() const - { - return block_->references(); - } - -protected: - - void changeToNullBlock() - { - blockRemoveReference(); - block_ = &nullBlock_; - block_->addReference(); - data_ = 0; - } - - void changeBlock(MemoryBlockReference<T_type>& ref, size_t offset) - { - blockRemoveReference(); - block_ = ref.block_; - block_->addReference(); - data_ = block_->data() + offset; - } - - void newBlock(size_t items) - { - blockRemoveReference(); - block_ = new MemoryBlock<T_type>(items); - block_->addReference(); - data_ = block_->data(); - -#ifdef BZ_DEBUG_LOG_ALLOCATIONS - cout << "MemoryBlockReference: created MemoryBlock at " - << ((void*)block_) << endl; -#endif - } - -private: - void operator=(const MemoryBlockReference<T_type>&) - { } -}; - - -BZ_NAMESPACE_END - -#include <blitz/memblock.cc> - -#endif // __BZ_MEMBLOCK_H__ diff --git a/weave/blitz-20001213/blitz/meta/dot.h b/weave/blitz-20001213/blitz/meta/dot.h deleted file mode 100644 index 0f42ac0bf..000000000 --- a/weave/blitz-20001213/blitz/meta/dot.h +++ /dev/null @@ -1,121 +0,0 @@ -/*************************************************************************** - * blitz/meta/dot.h Tiny vector dot product metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_DOT_H -#define BZ_META_DOT_H - -#ifndef BZ_PROMOTE_H - #include <blitz/promote.h> -#endif - -#ifndef BZ_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -BZ_NAMESPACE(blitz) - -template<int N, int I> -class _bz_meta_vectorDot { -public: - enum { loopFlag = (I < N-1) ? 1 : 0 }; - - template<class T_expr1, class T_expr2> - static inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, - _bz_typename T_expr2::T_numtype) - f(const T_expr1& a, const T_expr2& b) - { - return a[I] * b[I] - + _bz_meta_vectorDot<loopFlag * N, loopFlag * (I+1)>::f(a,b); - } - - template<class T_expr1, class T_expr2> - static inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, - _bz_typename T_expr2::T_numtype) - f_value_ref(T_expr1 a, const T_expr2& b) - { - return a[I] * b[I] - + _bz_meta_vectorDot<loopFlag * N, loopFlag * (I+1)>::f(a,b); - } - - template<class T_expr1, class T_expr2> - static inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, - _bz_typename T_expr2::T_numtype) - f_ref_value(const T_expr1& a, T_expr2 b) - { - return a[I] * b[I] - + _bz_meta_vectorDot<loopFlag * N, loopFlag * (I+1)>::f(a,b); - } - - template<class T_expr1, class P_numtype2> - static inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, - P_numtype2) - dotWithArgs(const T_expr1& a, P_numtype2 i1, P_numtype2 i2=0, - P_numtype2 i3=0, P_numtype2 i4=0, P_numtype2 i5=0, P_numtype2 i6=0, - P_numtype2 i7=0, P_numtype2 i8=0, P_numtype2 i9=0, P_numtype2 i10=0) - { - return a[I] * i1 - + _bz_meta_vectorDot<loopFlag * N, loopFlag * (I+1)>::dotWithArgs - (a, i2, i3, i4, i5, i6, i7, i8, i9); - } -}; - -template<> -class _bz_meta_vectorDot<0,0> { -public: - template<class T_expr1, class T_expr2> - static inline _bz_meta_nullOperand f(const T_expr1&, const T_expr2&) - { return _bz_meta_nullOperand(); } - - template<class T_expr1, class P_numtype2> - static inline _bz_meta_nullOperand - dotWithArgs(const T_expr1& a, P_numtype2 i1, P_numtype2 i2=0, - P_numtype2 i3=0, P_numtype2 i4=0, P_numtype2 i5=0, P_numtype2 i6=0, - P_numtype2 i7=0, P_numtype2 i8=0, P_numtype2 i9=0, P_numtype2 i10=0) - { - return _bz_meta_nullOperand(); - } - -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_DOT_H diff --git a/weave/blitz-20001213/blitz/meta/matassign.h b/weave/blitz-20001213/blitz/meta/matassign.h deleted file mode 100644 index 65ab992ff..000000000 --- a/weave/blitz-20001213/blitz/meta/matassign.h +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * blitz/meta/matassign.h TinyMatrix assignment metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - - -#ifndef BZ_META_MATASSIGN_H -#define BZ_META_MATASSIGN_H - -BZ_NAMESPACE(blitz) - -template<int N_rows, int N_columns, int I, int J> -class _bz_meta_matAssign2 { -public: - enum { go = (J < N_columns - 1) ? 1 : 0 }; - - template<class T_matrix, class T_expr, class T_updater> - static inline void f(T_matrix& mat, T_expr expr, T_updater u) - { - u.update(mat(I,J), expr(I,J)); - _bz_meta_matAssign2<N_rows * go, N_columns * go, I * go, (J+1) * go> - ::f(mat, expr, u); - } -}; - -template<> -class _bz_meta_matAssign2<0,0,0,0> { -public: - template<class T_matrix, class T_expr, class T_updater> - static inline void f(T_matrix& mat, T_expr expr, T_updater u) - { } -}; - -template<int N_rows, int N_columns, int I> -class _bz_meta_matAssign { -public: - enum { go = (I < N_rows-1) ? 1 : 0 }; - - template<class T_matrix, class T_expr, class T_updater> - static inline void f(T_matrix& mat, T_expr expr, T_updater u) - { - _bz_meta_matAssign2<N_rows, N_columns, I, 0>::f(mat, expr, u); - _bz_meta_matAssign<N_rows * go, N_columns * go, (I+1) * go> - ::f(mat, expr, u); - } -}; - -template<> -class _bz_meta_matAssign<0,0,0> { -public: - template<class T_matrix, class T_expr, class T_updater> - static inline void f(T_matrix& mat, T_expr expr, T_updater u) - { } -}; - - -BZ_NAMESPACE_END - -#endif // BZ_META_ASSIGN_H diff --git a/weave/blitz-20001213/blitz/meta/matmat.h b/weave/blitz-20001213/blitz/meta/matmat.h deleted file mode 100644 index a0b7a3887..000000000 --- a/weave/blitz-20001213/blitz/meta/matmat.h +++ /dev/null @@ -1,142 +0,0 @@ -/*************************************************************************** - * blitz/meta/matmat.h TinyMatrix matrix-matrix product metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_MATMAT_H -#define BZ_META_MATMAT_H - -#ifndef BZ_TINYMAT_H - #error <blitz/meta/matmat.h> must be included via <blitz/tinymat.h> -#endif - -#include <blitz/meta/metaprog.h> -#include <blitz/tinymatexpr.h> - -BZ_NAMESPACE(blitz) - -// Template metaprogram for matrix-matrix multiplication -template<int N_rows1, int N_columns, int N_columns2, int N_rowStride1, - int N_colStride1, int N_rowStride2, int N_colStride2, int K> -class _bz_meta_matrixMatrixProduct { -public: - enum { go = (K != N_columns - 1) }; - - template<class T_numtype1, class T_numtype2> - static inline BZ_PROMOTE(T_numtype1, T_numtype2) - f(const T_numtype1* matrix1, const T_numtype2* matrix2, int i, int j) - { - return matrix1[i * N_rowStride1 + K * N_colStride1] - * matrix2[K * N_rowStride2 + j * N_colStride2] - + _bz_meta_matrixMatrixProduct<N_rows1 * go, N_columns * go, - N_columns2 * go, N_rowStride1 * go, N_colStride1 * go, - N_rowStride2 * go, N_colStride2 * go, (K+1) * go> - ::f(matrix1, matrix2, i, j); - } -}; - -template<> -class _bz_meta_matrixMatrixProduct<0,0,0,0,0,0,0,0> { -public: - static inline _bz_meta_nullOperand f(const void*, const void*, int, int) - { return _bz_meta_nullOperand(); } -}; - - - - -template<class T_numtype1, class T_numtype2, int N_rows1, int N_columns, - int N_columns2, int N_rowStride1, int N_colStride1, - int N_rowStride2, int N_colStride2> -class _bz_tinyMatrixMatrixProduct { -public: - typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; - - enum { rows = N_rows1, columns = N_columns2 }; - - _bz_tinyMatrixMatrixProduct(const T_numtype1* matrix1, - const T_numtype2* matrix2) - : matrix1_(matrix1), matrix2_(matrix2) - { } - - _bz_tinyMatrixMatrixProduct(const _bz_tinyMatrixMatrixProduct<T_numtype1, - T_numtype2, N_rows1, N_columns, N_columns2, N_rowStride1, N_colStride1, - N_rowStride2, N_colStride2>& x) - : matrix1_(x.matrix1_), matrix2_(x.matrix2_) - { } - - const T_numtype1* matrix1() const - { return matrix1_; } - - const T_numtype2* matrix2() const - { return matrix2_; } - - T_numtype operator()(int i, int j) const - { - return _bz_meta_matrixMatrixProduct<N_rows1, N_columns, - N_columns2, N_rowStride1, N_colStride1, N_rowStride2, - N_colStride2, 0>::f(matrix1_, matrix2_, i, j); - } - -protected: - const T_numtype1* matrix1_; - const T_numtype2* matrix2_; -}; - -template<class T_numtype1, class T_numtype2, int N_rows1, int N_columns1, - int N_columns2> -inline -_bz_tinyMatExpr<_bz_tinyMatrixMatrixProduct<T_numtype1, T_numtype2, N_rows1, - N_columns1, N_columns2, N_columns1, 1, N_columns2, 1> > -product(const TinyMatrix<T_numtype1, N_rows1, N_columns1>& a, - const TinyMatrix<T_numtype2, N_columns1, N_columns2>& b) -{ - typedef _bz_tinyMatrixMatrixProduct<T_numtype1, T_numtype2, - N_rows1, N_columns1, N_columns2, N_columns1, 1, N_columns2, 1> T_expr; - return _bz_tinyMatExpr<T_expr>(T_expr(a.data(), b.data())); -} - -BZ_NAMESPACE_END - -#endif // BZ_META_MATMAT_H - diff --git a/weave/blitz-20001213/blitz/meta/matvec.h b/weave/blitz-20001213/blitz/meta/matvec.h deleted file mode 100644 index d6012f6f4..000000000 --- a/weave/blitz-20001213/blitz/meta/matvec.h +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * blitz/tiny/matvec.h TinyMatrix/TinyVector product metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_MATVEC_H -#define BZ_META_MATVEC_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_VECEXPRWRAP_H - #include <blitz/vecexprwrap.h> -#endif - -#ifndef BZ_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -BZ_NAMESPACE(blitz) - -// Forward declarations -template<int N_rows, int N_columns, int N_rowStride, int N_colStride, - int N_vecStride, int J> -class _bz_meta_matrixVectorProduct2; - - -template<class T_numtype1, class T_numtype2, int N_rows, int N_columns, - int N_rowStride, int N_colStride, int N_vecStride> -class _bz_tinyMatrixVectorProduct { -public: - typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; - - _bz_tinyMatrixVectorProduct(const _bz_tinyMatrixVectorProduct<T_numtype1, - T_numtype2, N_rows, N_columns, N_rowStride, N_colStride, - N_vecStride>& z) - : matrix_(z.matrix_), vector_(z.vector_) - { } - - _bz_tinyMatrixVectorProduct(const T_numtype1* matrix, - const T_numtype2* vector) - : matrix_(matrix), vector_(vector) - { } - - T_numtype operator[](unsigned i) const - { - return _bz_meta_matrixVectorProduct2<N_rows, N_columns, N_rowStride, - N_colStride, N_vecStride, 0>::f(matrix_, vector_, i); - } - - T_numtype operator()(unsigned i) const - { - return _bz_meta_matrixVectorProduct2<N_rows, N_columns, N_rowStride, - N_colStride, N_vecStride, 0>::f(matrix_, vector_, i); - } - - enum { - _bz_staticLengthCount = 1, - _bz_dynamicLengthCount = 0, - _bz_staticLength = N_rows - -#ifdef BZ_HAVE_COSTS - , - _bz_costPerEval = 2 * N_columns * costs::memoryAccess - + (N_columns-1) * costs::add -#endif - - }; - - unsigned _bz_suggestLength() const - { - return N_rows; - } - - _bz_bool _bz_hasFastAccess() const - { return _bz_true; } - - T_numtype _bz_fastAccess(unsigned i) const - { - return _bz_meta_matrixVectorProduct2<N_rows, N_columns, N_rowStride, - N_colStride, N_vecStride, 0>::f(matrix_, vector_, i); - } - - unsigned length(unsigned recommendedLength) const - { return N_rows; } - - const T_numtype1* matrix() const - { return matrix_; } - - const T_numtype2* vector() const - { return vector_; } - -protected: - const T_numtype1* matrix_; - const T_numtype2* vector_; -}; - -template<class T_numtype1, class T_numtype2, int N_rows, int N_columns> -inline _bz_VecExpr<_bz_tinyMatrixVectorProduct<T_numtype1, T_numtype2, - N_rows, N_columns, N_columns, 1, 1> > -product(const TinyMatrix<T_numtype1, N_rows, N_columns>& matrix, - const TinyVector<T_numtype2, N_columns>& vector) -{ - typedef _bz_tinyMatrixVectorProduct<T_numtype1, T_numtype2, N_rows, - N_columns, N_columns, 1, 1> T_expr; - return _bz_VecExpr<T_expr>(T_expr(matrix.data(), vector.data())); -} - -// productTranspose added by Marc Duflot (m.duflot@ulg.ac.be) - -template<class T_numtype1, class T_numtype2, int N_rows, int N_columns> -inline _bz_VecExpr<_bz_tinyMatrixVectorProduct<T_numtype1, T_numtype2, - N_columns, N_rows, 1, N_columns, 1> > -productTranspose(const TinyMatrix<T_numtype1, N_rows, N_columns>& matrix, - const TinyVector<T_numtype2, N_rows>& vector) -{ - typedef _bz_tinyMatrixVectorProduct<T_numtype1, T_numtype2, - N_columns, N_rows, 1, N_columns, 1> T_expr; - return _bz_VecExpr<T_expr>(T_expr(matrix.data(), vector.data())); -} - - -// Template metaprogram for matrix-vector multiplication - -template<int N_rows, int N_columns, int N_rowStride, int N_colStride, - int N_vecStride, int J> -class _bz_meta_matrixVectorProduct2 { - -public: - enum { go = J < (N_columns-1) }; - - template<class T_numtype1, class T_numtype2> - static inline BZ_PROMOTE(T_numtype1, T_numtype2) - f(const T_numtype1* matrix, const T_numtype2* vector, int i) - { - return matrix[i * N_rowStride + J * N_colStride] - * vector[J * N_vecStride] - - + _bz_meta_matrixVectorProduct2<N_rows * go, N_columns * go, - N_rowStride * go, N_colStride * go, N_vecStride * go, (J+1)*go> - ::f(matrix, vector, i); - } - -}; - -template<> -class _bz_meta_matrixVectorProduct2<0,0,0,0,0,0> { -public: - static inline _bz_meta_nullOperand f(const void*, const void*, int) - { return _bz_meta_nullOperand(); } -}; - -template<int N_rows, int N_columns, int N_rowStride, int N_colStride, - int N_vecStride, int I> -class _bz_meta_matrixVectorProduct { -public: - enum { go = I < (N_rows - 1) }; - - template<class T_numtype1, class T_numtype2, class T_numtype3> - static inline void f(TinyVector<T_numtype3, N_rows>& result, - const T_numtype1* matrix, const T_numtype2* vector) - { - result[I] = _bz_meta_matrixVectorProduct2<N_rows, N_columns, - N_rowStride, N_colStride, N_vecStride, 0>::f(matrix,vector, I); - - _bz_meta_matrixVectorProduct<N_rows * go, N_columns * go, - N_rowStride * go, N_colStride * go, N_vecStride * go, (I+1)*go> - ::f(result, matrix, vector); - } -}; - -template<> -class _bz_meta_matrixVectorProduct<0,0,0,0,0,0> { -public: - static inline void f(const _bz_tinyBase&, const void*, const void*) - { } -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_MATVEC_H - diff --git a/weave/blitz-20001213/blitz/meta/metaprog.h b/weave/blitz-20001213/blitz/meta/metaprog.h deleted file mode 100644 index 47eb9253a..000000000 --- a/weave/blitz-20001213/blitz/meta/metaprog.h +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * blitz/meta/metaprog.h Useful metaprogram declarations - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_METAPROG_H -#define BZ_META_METAPROG_H - -BZ_NAMESPACE(blitz) - -// Null Operand - -class _bz_meta_nullOperand { -public: - _bz_meta_nullOperand() { } -}; - -template<class T> inline T operator+(const T& a, _bz_meta_nullOperand) -{ return a; } -template<class T> inline T operator*(const T& a, _bz_meta_nullOperand) -{ return a; } - - -// MetaMax - -template<int N1, int N2> -class _bz_meta_max { -public: - enum { max = (N1 > N2) ? N1 : N2 }; -}; - -// MetaMin - -template<int N1, int N2> -class _bz_meta_min { -public: - enum { min = (N1 < N2) ? N1 : N2 }; -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_METAPROG_H diff --git a/weave/blitz-20001213/blitz/meta/product.h b/weave/blitz-20001213/blitz/meta/product.h deleted file mode 100644 index 18830605b..000000000 --- a/weave/blitz-20001213/blitz/meta/product.h +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * blitz/meta/product.h TinyVector product metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_PRODUCT_H -#define BZ_META_PRODUCT_H - -#ifndef BZ_PROMOTE_H - #include <blitz/promote.h> -#endif - -#ifndef BZ_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -BZ_NAMESPACE(blitz) - -template<int N, int I> -class _bz_meta_vectorProduct { -public: - enum { loopFlag = (I < N-1) ? 1 : 0 }; - - template<class T_expr1> - static inline BZ_SUMTYPE(_bz_typename T_expr1::T_numtype) - f(const T_expr1& a) - { - return a[I] * _bz_meta_vectorProduct<loopFlag * N, - loopFlag * (I+1)>::f(a); - } -}; - -template<> -class _bz_meta_vectorProduct<0,0> { -public: - template<class T_expr1> - static inline _bz_meta_nullOperand f(const T_expr1&) - { return _bz_meta_nullOperand(); } -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_PRODUCT_H diff --git a/weave/blitz-20001213/blitz/meta/sum.h b/weave/blitz-20001213/blitz/meta/sum.h deleted file mode 100644 index 6a777d0c4..000000000 --- a/weave/blitz-20001213/blitz/meta/sum.h +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * blitz/meta/sum.h TinyVector sum metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_SUM_H -#define BZ_META_SUM_H - -#ifndef BZ_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -BZ_NAMESPACE(blitz) - -template<int N, int I> -class _bz_meta_vectorSum { -public: - enum { loopFlag = (I < N-1) ? 1 : 0 }; - - template<class T_expr1> - static inline _bz_typename T_expr1::T_numtype - f(const T_expr1& a) - { - return a[I] + - + _bz_meta_vectorSum<loopFlag * N, loopFlag * (I+1)>::f(a); - } -}; - -template<> -class _bz_meta_vectorSum<0,0> { -public: - template<class T_expr1> - static inline _bz_meta_nullOperand f(const T_expr1&) - { return _bz_meta_nullOperand(); } - -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_SUM_H diff --git a/weave/blitz-20001213/blitz/meta/vecassign.h b/weave/blitz-20001213/blitz/meta/vecassign.h deleted file mode 100644 index bbca2efd3..000000000 --- a/weave/blitz-20001213/blitz/meta/vecassign.h +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************** - * blitz/meta/vecassign.h TinyVector assignment metaprogram - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:38 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:13 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:08:44 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_META_VECASSIGN_H -#define BZ_META_VECASSIGN_H - -BZ_NAMESPACE(blitz) - -template<int N, int I> -class _bz_meta_vecAssign { -public: - enum { loopFlag = (I < N-1) ? 1 : 0 }; - - template<class T_vector, class T_expr, class T_updater> - static inline void fastAssign(T_vector& vec, T_expr expr, T_updater u) - { - u.update(vec[I], expr._bz_fastAccess(I)); - _bz_meta_vecAssign<N * loopFlag, (I+1) * loopFlag> - ::fastAssign(vec,expr,u); - } - - template<class T_vector, class T_expr, class T_updater> - static inline void assign(T_vector& vec, T_expr expr, T_updater u) - { - u.update(vec[I], expr[I]); - _bz_meta_vecAssign<N * loopFlag, (I+1) * loopFlag> - ::assign(vec,expr,u); - } - - template<class T_vector, class T_numtype, class T_updater> - static inline void assignWithArgs(T_vector& vec, T_updater u, - T_numtype x0, T_numtype x1=0, T_numtype x2=0, T_numtype x3=0, - T_numtype x4=0, T_numtype x5=0, T_numtype x6=0, T_numtype x7=0, - T_numtype x8=0, T_numtype x9=0) - { - u.update(vec[I], x0); - _bz_meta_vecAssign<N * loopFlag, (I+1) * loopFlag> - ::assignWithArgs(vec, u, x1, x2, x3, x4, x5, x6, x7, x8, x9); - } - -}; - -template<> -class _bz_meta_vecAssign<0,0> { -public: - template<class T_vector, class T_expr, class T_updater> - static inline void fastAssign(T_vector& vec, T_expr expr, T_updater u) - { } - - template<class T_vector, class T_expr, class T_updater> - static inline void assign(T_vector& vec, T_expr expr, T_updater u) - { } - - template<class T_vector, class T_numtype, class T_updater> - static inline void assignWithArgs(T_vector& vec, T_updater u, - T_numtype x0, T_numtype x1=0, T_numtype x2=0, T_numtype x3=0, - T_numtype x4=0, T_numtype x5=0, T_numtype x6=0, T_numtype x7=0, - T_numtype x8=0, T_numtype x9=0) - { - } -}; - -BZ_NAMESPACE_END - -#endif // BZ_META_ASSIGN_H diff --git a/weave/blitz-20001213/blitz/minmax.h b/weave/blitz-20001213/blitz/minmax.h deleted file mode 100644 index 1a2d0e5a5..000000000 --- a/weave/blitz-20001213/blitz/minmax.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef BZ_MINMAX_H -#define BZ_MINMAX_H - -#include <blitz/promote.h> - -BZ_NAMESPACE(blitz) - -/* - * These functions are in their own namespace (blitz::minmax) to avoid - * conflicts with the array reduction operations min and max. - */ - -BZ_NAMESPACE(minmax) - -template<class T1, class T2> -BZ_PROMOTE(T1,T2) min(const T1& a, const T2& b) -{ - typedef BZ_PROMOTE(T1,T2) T_promote; - - if (a <= b) - return T_promote(a); - else - return T_promote(b); -} - -template<class T1, class T2> -BZ_PROMOTE(T1,T2) max(const T1& a, const T2& b) -{ - typedef BZ_PROMOTE(T1,T2) T_promote; - - if (a >= b) - return T_promote(a); - else - return T_promote(b); -} - -BZ_NAMESPACE_END - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/mstruct.h b/weave/blitz-20001213/blitz/mstruct.h deleted file mode 100644 index 0bb5fd88f..000000000 --- a/weave/blitz-20001213/blitz/mstruct.h +++ /dev/null @@ -1,158 +0,0 @@ -/*************************************************************************** - * blitz/mstruct.h Matrix structure classes - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_MSTRUCT_H -#define BZ_MSTRUCT_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_ZERO_H - #include <blitz/zero.h> -#endif - -/* - * Each matrix structure class encapsulates a storage format for matrix - * data. It is responsible for: - * - Storing the size of the matrix - * - Calculating how many unique elements the matrix will have - * - Mapping indices (i,j) onto memory locations - * - Performing any sign reversals or conjugations when matrix - * elements are retrieved (e.g. in a Hermitian or Skew symmetric - * matrix) - * - * Every matrix structure class must provide these methods: - * - * ctor() - * ctor(unsigned rows, unsigned cols) - * unsigned columns() const; - * unsigned cols() const; - * unsigned firstInRow() const; - * unsigned firstInCol() const; - * template<class T> T& get(T* data, unsigned i, unsigned j); - * template<class T> T get(const T* data, unsigned i, unsigned j) const; - * bool inRange(unsigned i, unsigned j) const - * unsigned lastInRow() const; - * unsigned lastInCol() const; - * unsigned numElements() const; - * void resize(unsigned rows, unsigned cols); - * unsigned rows() const; - * - * Each matrix structure class must declare a public type - * T_iterator which is an iterator to scan through the unique - * entries of the matrix. The iterator class must provide - * these methods: - * - * ctor(unsigned rows, unsigned cols) - * unsigned offset() const - * operator bool() const - * unsigned row() const - * unsigned col() const - */ - -BZ_NAMESPACE(blitz) - -class MatrixStructure { }; - -class AsymmetricMatrix : public MatrixStructure { -public: - AsymmetricMatrix() - : rows_(0), cols_(0) - { } - - AsymmetricMatrix(unsigned rows, unsigned cols) - : rows_(rows), cols_(cols) - { } - - unsigned columns() const - { return cols_; } - - unsigned cols() const - { return cols_; } - - _bz_bool inRange(unsigned i, unsigned j) const - { - return (i < rows_) && (j < cols_); - } - - void resize(unsigned rows, unsigned cols) - { - rows_ = rows; - cols_ = cols; - } - - unsigned rows() const - { return rows_; } - -protected: - unsigned rows_, cols_; -}; - -// Still to be implemented: -// SkewSymmetric -// Hermitian -// Tridiagonal -// Banded<L,H> -// Upper bidiagonal -// Lower bidiagonal -// Upper Hessenberg -// Lower Hessenberg - -BZ_NAMESPACE_END - -#include <blitz/matgen.h> // RowMajor and ColumnMajor general matrices -#include <blitz/matsymm.h> // Symmetric -#include <blitz/matdiag.h> // Diagonal -#include <blitz/mattoep.h> // Toeplitz -#include <blitz/matltri.h> // Lower triangular -#include <blitz/matutri.h> // Upper triangular - -#endif // BZ_MSTRUCT_H diff --git a/weave/blitz-20001213/blitz/numinquire.h b/weave/blitz-20001213/blitz/numinquire.h deleted file mode 100644 index 69b13dbf2..000000000 --- a/weave/blitz-20001213/blitz/numinquire.h +++ /dev/null @@ -1,333 +0,0 @@ -/*************************************************************************** - * blitz/numinquire.h Numeric inquiry functions - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -/* - * These numeric inquiry functions are provided as an alternative - * to the somewhat klunky numeric_limits<T>::yadda_yadda syntax. - * Where a similar Fortran 90 function exists, the same name has - * been used. - * - * The argument in all cases is a dummy of the appropriate type - * (double, int, etc.) - * - * These functions assume that numeric_limits<T> has been specialized - * for the appropriate case. If not, the results are not useful. - */ - -#ifndef BZ_NUMINQUIRE_H -#define BZ_NUMINQUIRE_H - -#ifndef BZ_HAVE_NUMERIC_LIMITS - #include <blitz/limits-hack.h> -#else - #include <limits> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * This traits class provides zero and one values for numeric - * types. This was previously a template function with specializations, - * but the specializations were causing multiply-defined symbols - * at link time. TV 980226 - */ - -template<class T_numtype> -struct _bz_OneZeroTraits { - static inline T_numtype zero() { return 0; } - static inline T_numtype one() { return 1; } -}; - -#ifdef BZ_HAVE_COMPLEX - -template<> -struct _bz_OneZeroTraits<complex<float> > { - static inline complex<float> zero() { return complex<float>(0.0f,0.0f); } - static inline complex<float> one() { return complex<float>(1.0f,0.0f); } -}; - -template<> -struct _bz_OneZeroTraits<complex<double> > { - static inline complex<double> zero() { return complex<double>(0.0,0.0); } - static inline complex<double> one() { return complex<double>(1.0,0.0); } -}; - -template<> -struct _bz_OneZeroTraits<complex<long double> > { - static inline complex<long double> zero() - { return complex<long double>(0.0,0.0); } - - static inline complex<long double> one() - { return complex<long double>(1.0,0.0); } -}; - -#endif // BZ_HAVE_COMPLEX - -template<class T> -inline T zero(T) -{ - return _bz_OneZeroTraits<T>::zero(); -} - -template<class T> -inline T one(T) -{ - return _bz_OneZeroTraits<T>::one(); -} - -template<class T> -inline int digits(T) -{ - return numeric_limits<T>::digits; -} - -template<class T> -inline int digits10(T) -{ - return numeric_limits<T>::digits10; -} - -template<class T> -inline T epsilon(T) BZ_THROW -{ - return numeric_limits<T>::epsilon(); -} - -// neghuge() by Theodore Papadopoulo, to fix a problem with -// max() reductions. -template<class T> -inline T neghuge(T) BZ_THROW -{ - return numeric_limits<T>::is_integer ? numeric_limits<T>::min() - : - numeric_limits<T>::max(); -} - -template<class T> -inline T huge(T) BZ_THROW -{ - return numeric_limits<T>::max(); -} - -template<class T> -inline T tiny(T) BZ_THROW -{ - return numeric_limits<T>::min(); -} - -template<class T> -inline int max_exponent(T) -{ - return numeric_limits<T>::max_exponent; -} - -template<class T> -inline int min_exponent(T) -{ - return numeric_limits<T>::min_exponent; -} - -template<class T> -inline int min_exponent10(T) -{ - return numeric_limits<T>::min_exponent10; -} - -template<class T> -inline int max_exponent10(T) -{ - return numeric_limits<T>::max_exponent10; -} - -template<class T> -inline int precision(T) -{ - return numeric_limits<T>::digits10; -} - -template<class T> -inline int radix(T) -{ - return numeric_limits<T>::radix; -} - -template<class T> -inline Range range(T) -{ - return Range(numeric_limits<T>::min_exponent10, - numeric_limits<T>::max_exponent10); -} - -template<class T> -inline bool is_signed(T) -{ - return numeric_limits<T>::is_signed; -} - -template<class T> -inline bool is_integer(T) -{ - return numeric_limits<T>::is_integer; -} - -template<class T> -inline bool is_exact(T) -{ - return numeric_limits<T>::is_exact; -} - -template<class T> -inline T round_error(T) BZ_THROW -{ - return numeric_limits<T>::round_error(); -} - -template<class T> -inline bool has_infinity(T) -{ - return numeric_limits<T>::has_infinity; -} - -template<class T> -inline bool has_quiet_NaN(T) -{ - return numeric_limits<T>::has_quiet_NaN; -} - -template<class T> -inline bool has_signaling_NaN(T) -{ - return numeric_limits<T>::has_signaling_NaN; -} - -// Provided for non-US english users -template<class T> -inline bool has_signalling_NaN(T) -{ - return numeric_limits<T>::has_signaling_NaN; -} - -template<class T> -inline bool has_denorm(T) -{ - return numeric_limits<T>::has_denorm; -} - -template<class T> -inline bool has_denorm_loss(T) -{ - return numeric_limits<T>::has_denorm_loss; -} - -template<class T> -inline T infinity(T) BZ_THROW -{ - return numeric_limits<T>::infinity(); -} - -template<class T> -inline T quiet_NaN(T) BZ_THROW -{ - return numeric_limits<T>::quiet_NaN(); -} - -template<class T> -inline T signaling_NaN(T) BZ_THROW -{ - return numeric_limits<T>::signaling_NaN(); -} - -template<class T> -inline T signalling_NaN(T) BZ_THROW -{ - return numeric_limits<T>::signaling_NaN(); -} - -template<class T> -inline T denorm_min(T) BZ_THROW -{ - return numeric_limits<T>::denorm_min(); -} - -template<class T> -inline bool is_iec559(T) -{ - return numeric_limits<T>::is_iec559; -} - -template<class T> -inline bool is_bounded(T) -{ - return numeric_limits<T>::is_bounded; -} - -template<class T> -inline bool is_modulo(T) -{ - return numeric_limits<T>::is_modulo; -} - -template<class T> -inline bool traps(T) -{ - return numeric_limits<T>::traps; -} - -template<class T> -inline bool tinyness_before(T) -{ - return numeric_limits<T>::tinyness_before; -} - -template<class T> -inline BZ_STD_SCOPE(float_round_style) round_style(T) -{ - return numeric_limits<T>::round_style; -} - -BZ_NAMESPACE_END - -#endif // BZ_NUMINQUIRE_H - diff --git a/weave/blitz-20001213/blitz/numtrait.h b/weave/blitz-20001213/blitz/numtrait.h deleted file mode 100644 index dfcc26a39..000000000 --- a/weave/blitz-20001213/blitz/numtrait.h +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** - * blitz/numtrait.h Declaration of the NumericTypeTraits class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_NUMTRAIT_H -#define BZ_NUMTRAIT_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -#ifndef BZ_USE_NUMTRAIT - #define BZ_SUMTYPE(X) X - #define BZ_DIFFTYPE(X) X - #define BZ_FLOATTYPE(X) X - #define BZ_SIGNEDTYPE(X) X -#else - -#define BZ_SUMTYPE(X) _bz_typename NumericTypeTraits<X>::T_sumtype -#define BZ_DIFFTYPE(X) _bz_typename NumericTypeTraits<X>::T_difftype -#define BZ_FLOATTYPE(X) _bz_typename NumericTypeTraits<X>::T_floattype -#define BZ_SIGNEDTYPE(X) _bz_typename NumericTypeTraits<X>::T_signedtype - -template<class P_numtype> -class NumericTypeTraits { -public: - typedef P_numtype T_sumtype; // Type to be used for summing - typedef P_numtype T_difftype; // Type to be used for difference - typedef P_numtype T_floattype; // Type to be used for floating-point - // calculations - typedef P_numtype T_signedtype; // Type to be used for signed calculations - enum { hasTrivialCtor = 0 }; // Assume the worst -}; - -#define BZDECLNUMTRAIT(X,Y,Z,W,U) \ - template<> \ - class NumericTypeTraits<X> { \ - public: \ - typedef Y T_sumtype; \ - typedef Z T_difftype; \ - typedef W T_floattype; \ - typedef U T_signedtype; \ - enum { hasTrivialCtor = 1 }; \ - } - -#ifdef BZ_BOOL - BZDECLNUMTRAIT(bool,unsigned,int,float,int); -#endif - -BZDECLNUMTRAIT(char,int,int,float,char); -BZDECLNUMTRAIT(unsigned char, unsigned, int, float,int); -BZDECLNUMTRAIT(short int, int, int, float, short int); -BZDECLNUMTRAIT(short unsigned int, unsigned int, int, float, int); -BZDECLNUMTRAIT(int, long, int, float, int); -BZDECLNUMTRAIT(unsigned int, unsigned long, int, float, long); -BZDECLNUMTRAIT(long, long, long, double, long); -BZDECLNUMTRAIT(unsigned long, unsigned long, long, double, long); -BZDECLNUMTRAIT(float, double, float, float, float); -BZDECLNUMTRAIT(double, double, double, double, double); - -#ifdef BZ_HAVE_COMPLEX -// BZDECLNUMTRAIT(complex<float>, complex<double>, complex<float>, complex<float>); -// BZDECLNUMTRAIT(complex<double>, complex<long double>, complex<double>, complex<double>); -#endif // BZ_HAVE_COMPLEX - -#endif // BZ_USE_NUMTRAIT - -BZ_NAMESPACE_END - -#endif // BZ_NUMTRAIT_H diff --git a/weave/blitz-20001213/blitz/ops.h b/weave/blitz-20001213/blitz/ops.h deleted file mode 100644 index acea6ba46..000000000 --- a/weave/blitz-20001213/blitz/ops.h +++ /dev/null @@ -1,220 +0,0 @@ -/*************************************************************************** - * blitz/ops.h Function objects for operators - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - ************************************************************************* - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_OPS_H -#define BZ_OPS_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_PROMOTE_H - #include <blitz/promote.h> -#endif - -#ifndef BZ_MATHFUNC_H - #include <blitz/mathfunc.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * Originally these function objects had no template arguments, e.g. - * - * struct Add { - * template<class T_numtype1, class T_numtype2> - * static inline BZ_PROMOTE(T_numtype1, T_numtype2) - * apply(T_numtype1 a, T_numtype2 b) - * { return a + b; } - * }; - * - * This made for neater expression templates syntax. However, there are - * some situations in which users may want to override type promotion - * for certain operations. For example, in theoretical physics, there - * are U1 objects which when multiplied yield U1 objects, but when added - * yield a different type. To allow for this kind of behaviour, function - * objects have been changed to take template parameters: - * - * template<class T_numtype1, class T_numtype2> - * struct Add { - * typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; - * - * static inline T_numtype apply(T_numtype1 a, T_numtype2 b) - * { return a + b; } - * }; - * - * Type promotion is performed inside the function object. The expression - * templates code always looks inside the function object to determine - * the type promotion, e.g. Add<int,float>::T_numtype - * - * Users are free to specialize these function objects for their own types. - */ - -#define BZ_DEFINE_OP(name,op,symbol) \ -template<class T_numtype1, class T_numtype2> \ -struct name { \ - typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; \ - \ - static inline T_numtype \ - apply(T_numtype1 a, T_numtype2 b) \ - { return a op b; } \ - \ - template<class T1, class T2> \ - static inline void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& t1, \ - const T2& t2) \ - { \ - str += "("; \ - t1.prettyPrint(str, format); \ - str += symbol; \ - t2.prettyPrint(str, format); \ - str += ")"; \ - } \ -} - -BZ_DEFINE_OP(Add,+,"+"); -BZ_DEFINE_OP(Subtract,-,"-"); -BZ_DEFINE_OP(Multiply,*,"*"); -BZ_DEFINE_OP(Divide,/,"/"); -BZ_DEFINE_OP(Modulo,%,"%"); -BZ_DEFINE_OP(BitwiseXor,^,"^"); -BZ_DEFINE_OP(BitwiseAnd,&,"&"); -BZ_DEFINE_OP(BitwiseOr,|,"|"); -BZ_DEFINE_OP(ShiftRight,>>,">>"); -BZ_DEFINE_OP(ShiftLeft,<<,"<<"); - -#define BZ_DEFINE_BOOL_OP(name,op,symbol) \ -template<class T_numtype1, class T_numtype2> \ -struct name { \ - typedef bool T_numtype; \ - static inline bool \ - apply(T_numtype1 a, T_numtype2 b) \ - { return a op b; } \ - \ - template<class T1, class T2> \ - static inline void prettyPrint(string& str, \ - prettyPrintFormat& format, const T1& t1, \ - const T2& t2) \ - { \ - str += "("; \ - t1.prettyPrint(str, format); \ - str += symbol; \ - t2.prettyPrint(str, format); \ - str += ")"; \ - } \ -} - -BZ_DEFINE_BOOL_OP(Greater,>,">"); -BZ_DEFINE_BOOL_OP(Less,<,"<"); -BZ_DEFINE_BOOL_OP(GreaterOrEqual,>=,">="); -BZ_DEFINE_BOOL_OP(LessOrEqual,<=,"<="); -BZ_DEFINE_BOOL_OP(Equal,==,"=="); -BZ_DEFINE_BOOL_OP(NotEqual,!=,"!="); -BZ_DEFINE_BOOL_OP(LogicalAnd,&&,"&&"); -BZ_DEFINE_BOOL_OP(LogicalOr,||,"||"); - -template<class T_numtype1, class T_cast> -struct Cast { - typedef T_cast T_numtype; - static inline T_cast apply(T_numtype1 a) - { return a; } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_cast); - str += "("; - a.prettyPrint(str, format); - str += ")"; - } -}; - -template<class T_numtype1> -struct LogicalNot { - typedef bool T_numtype; - static inline bool apply(T_numtype1 a) - { return !a; } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "!"; - a.prettyPrint(str, format); - } -}; - -template<class T_numtype1> -struct BitwiseNot { - typedef T_numtype1 T_numtype; - static inline T_numtype apply(T_numtype1 a) - { return ~a; } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "~"; - a.prettyPrint(str,format); - } -}; - -template<class T_numtype1> -struct Negate { - typedef T_numtype1 T_numtype; - static inline T_numtype apply(T_numtype1 a) - { return -a; } - - template<class T1> - static void prettyPrint(string& str, prettyPrintFormat& format, - const T1& a) - { - str += "-"; - a.prettyPrint(str, format); - } -}; -BZ_NAMESPACE_END - -#endif - - diff --git a/weave/blitz-20001213/blitz/prettyprint.h b/weave/blitz-20001213/blitz/prettyprint.h deleted file mode 100644 index c7c81fc1b..000000000 --- a/weave/blitz-20001213/blitz/prettyprint.h +++ /dev/null @@ -1,91 +0,0 @@ -/*************************************************************************** - * blitz/prettyprint.h Format object for pretty-printing of - * array expressions - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -#ifndef BZ_PRETTYPRINT_H -#define BZ_PRETTYPRINT_H - -BZ_NAMESPACE(blitz) - -class prettyPrintFormat { - -public: - prettyPrintFormat(_bz_bool terse = _bz_false) - : tersePrintingSelected_(terse) - { - arrayOperandCounter_ = 0; - scalarOperandCounter_ = 0; - dumpArrayShapes_ = _bz_false; - } - - void setDumpArrayShapesMode() - { - dumpArrayShapes_ = _bz_true; - } - - char nextArrayOperandSymbol() - { - return 'A' + ((arrayOperandCounter_++) % 26); - } - - char nextScalarOperandSymbol() - { - return 's' + ((scalarOperandCounter_++) % 26); - } - - _bz_bool tersePrintingSelected() const - { - return tersePrintingSelected_; - } - - _bz_bool dumpArrayShapesMode() const - { - return dumpArrayShapes_; - } - -private: - _bz_bool tersePrintingSelected_; - _bz_bool dumpArrayShapes_; - int arrayOperandCounter_; - int scalarOperandCounter_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_PRETTYPRINT_H diff --git a/weave/blitz-20001213/blitz/promote-old.h b/weave/blitz-20001213/blitz/promote-old.h deleted file mode 100644 index 2e3ff429f..000000000 --- a/weave/blitz-20001213/blitz/promote-old.h +++ /dev/null @@ -1,1360 +0,0 @@ -/*********************************************************************** - * promote.h Arithmetic type promotion trait class - * Author: Todd Veldhuizen (tveldhui@oonumerics.org) - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - */ - -// Generated: genpromote.cpp Aug 7 1997 14:59:32 - -template<class A, class B> -class promote_trait { -public: - typedef A T_promote; -}; - - -template<> -class promote_trait<char, char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<char, unsigned char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<char, short int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<char, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<char, int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<char, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<char, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<char, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<char, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<char, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<char, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<char, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<char, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<char, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<unsigned char, char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<unsigned char, unsigned char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<unsigned char, short int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<unsigned char, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned char, int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<unsigned char, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned char, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<unsigned char, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned char, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<unsigned char, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<unsigned char, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned char, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned char, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned char, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<short int, char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<short int, unsigned char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<short int, short int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<short int, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short int, int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<short int, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short int, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<short int, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<short int, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<short int, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<short int, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short int, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short int, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short int, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<short unsigned int, char> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, unsigned char> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, short int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<short unsigned int, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<short unsigned int, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<short unsigned int, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<short unsigned int, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<short unsigned int, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short unsigned int, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short unsigned int, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<short unsigned int, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<int, char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<int, unsigned char> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<int, short int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<int, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<int, int> { -public: - typedef int T_promote; -}; - -template<> -class promote_trait<int, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<int, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<int, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<int, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<int, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<int, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<int, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<int, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<int, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<unsigned int, char> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, unsigned char> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, short int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, short unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, unsigned int> { -public: - typedef unsigned int T_promote; -}; - -template<> -class promote_trait<unsigned int, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<unsigned int, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned int, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<unsigned int, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<unsigned int, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned int, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned int, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned int, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<long, char> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, unsigned char> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, short int> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, short unsigned int> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, int> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, unsigned int> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, long> { -public: - typedef long T_promote; -}; - -template<> -class promote_trait<long, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<long, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<long, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<long, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<unsigned long, char> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, unsigned char> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, short int> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, short unsigned int> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, int> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, unsigned int> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, unsigned long> { -public: - typedef unsigned long T_promote; -}; - -template<> -class promote_trait<unsigned long, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<unsigned long, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<unsigned long, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned long, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned long, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<unsigned long, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<float, char> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, unsigned char> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, short int> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, short unsigned int> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, int> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, unsigned int> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, long> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, unsigned long> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, float> { -public: - typedef float T_promote; -}; - -template<> -class promote_trait<float, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<float, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<float, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<float, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<float, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<double, char> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, unsigned char> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, short int> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, short unsigned int> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, int> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, unsigned int> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, long> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, unsigned long> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, float> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, double> { -public: - typedef double T_promote; -}; - -template<> -class promote_trait<double, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<double, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<double, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<double, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -template<> -class promote_trait<long double, char> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, unsigned char> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, short int> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, short unsigned int> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, int> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, unsigned int> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, long> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, unsigned long> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, float> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, double> { -public: - typedef long double T_promote; -}; - -template<> -class promote_trait<long double, long double> { -public: - typedef long double T_promote; -}; - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long double, complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long double, complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<long double, complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , char> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , unsigned char> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , short int> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , short unsigned int> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , int> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , unsigned int> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , long> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , unsigned long> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , float> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , double> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , long double> { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , complex<float> > { -public: - typedef complex<float> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<float> , complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , char> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , unsigned char> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , short int> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , short unsigned int> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , int> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , unsigned int> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , long> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , unsigned long> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , float> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , double> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , long double> { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , complex<float> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , complex<double> > { -public: - typedef complex<double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<double> , complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , char> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , unsigned char> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , short int> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , short unsigned int> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , int> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , unsigned int> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , long> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , unsigned long> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , float> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , double> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , long double> { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , complex<float> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , complex<double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - -#ifdef BZ_HAVE_COMPLEX -template<> -class promote_trait<complex<long double> , complex<long double> > { -public: - typedef complex<long double> T_promote; -}; -#endif - diff --git a/weave/blitz-20001213/blitz/promote.h b/weave/blitz-20001213/blitz/promote.h deleted file mode 100644 index 7ab5b9183..000000000 --- a/weave/blitz-20001213/blitz/promote.h +++ /dev/null @@ -1,160 +0,0 @@ -/*********************************************************************** - * promote.h Arithmetic type promotion trait class - * Author: Todd Veldhuizen (tveldhui@oonumerics.org) - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - */ - -#ifndef BZ_PROMOTE_H -#define BZ_PROMOTE_H - -#include <blitz/blitz.h> - -BZ_NAMESPACE(blitz) - -#ifdef BZ_TEMPLATE_QUALIFIED_RETURN_TYPE - #define BZ_PROMOTE(A,B) _bz_typename promote_trait<A,B>::T_promote -#else - #define BZ_PROMOTE(A,B) A -#endif - -#if defined(BZ_PARTIAL_SPECIALIZATION) && !defined(BZ_DISABLE_NEW_PROMOTE) - -/* - * This compiler supports partial specialization, so type promotion - * can be done the elegant way. This implementation is after ideas - * by Jean-Louis Leroy. - */ - -template<class T> -struct precision_trait { - enum { precisionRank = 0, - knowPrecisionRank = 0 }; -}; - -#define BZ_DECLARE_PRECISION(T,rank) \ - template<> \ - struct precision_trait< T > { \ - enum { precisionRank = rank, \ - knowPrecisionRank = 1 }; \ - }; - -BZ_DECLARE_PRECISION(int,100) -BZ_DECLARE_PRECISION(unsigned int,200) -BZ_DECLARE_PRECISION(long,300) -BZ_DECLARE_PRECISION(unsigned long,400) -BZ_DECLARE_PRECISION(float,500) -BZ_DECLARE_PRECISION(double,600) -BZ_DECLARE_PRECISION(long double,700) - -#ifdef BZ_HAVE_COMPLEX -BZ_DECLARE_PRECISION(complex<float>,800) -BZ_DECLARE_PRECISION(complex<double>,900) -BZ_DECLARE_PRECISION(complex<long double>,1000) -#endif - -template<class T> -struct autopromote_trait { - typedef T T_numtype; -}; - -#define BZ_DECLARE_AUTOPROMOTE(T1,T2) \ - template<> \ - struct autopromote_trait<T1> { \ - typedef T2 T_numtype; \ - }; - -// These are the odd cases where small integer types -// are automatically promoted to int or unsigned int for -// arithmetic. -BZ_DECLARE_AUTOPROMOTE(bool, int) -BZ_DECLARE_AUTOPROMOTE(char, int) -BZ_DECLARE_AUTOPROMOTE(unsigned char, int) -BZ_DECLARE_AUTOPROMOTE(short int, int) -BZ_DECLARE_AUTOPROMOTE(short unsigned int, unsigned int) - -template<class T1, class T2, int promoteToT1> -struct _bz_promote2 { - typedef T1 T_promote; -}; - -template<class T1, class T2> -struct _bz_promote2<T1,T2,0> { - typedef T2 T_promote; -}; - -template<class T1_orig, class T2_orig> -struct promote_trait { - // Handle promotion of small integers to int/unsigned int - typedef _bz_typename autopromote_trait<T1_orig>::T_numtype T1; - typedef _bz_typename autopromote_trait<T2_orig>::T_numtype T2; - - // True if T1 is higher ranked - enum { - T1IsBetter = - BZ_ENUM_CAST(precision_trait<T1>::precisionRank) > - BZ_ENUM_CAST(precision_trait<T2>::precisionRank), - - // True if we know ranks for both T1 and T2 - knowBothRanks = - BZ_ENUM_CAST(precision_trait<T1>::knowPrecisionRank) - && BZ_ENUM_CAST(precision_trait<T2>::knowPrecisionRank), - - // True if we know T1 but not T2 - knowT1butNotT2 = BZ_ENUM_CAST(precision_trait<T1>::knowPrecisionRank) - && !(BZ_ENUM_CAST(precision_trait<T2>::knowPrecisionRank)), - - // True if we know T2 but not T1 - knowT2butNotT1 = BZ_ENUM_CAST(precision_trait<T2>::knowPrecisionRank) - && !(BZ_ENUM_CAST(precision_trait<T1>::knowPrecisionRank)), - - // True if T1 is bigger than T2 - T1IsLarger = sizeof(T1) >= sizeof(T2), - - // We know T1 but not T2: true - // We know T2 but not T1: false - // Otherwise, if T1 is bigger than T2: true - defaultPromotion = knowT1butNotT2 ? _bz_false : - (knowT2butNotT1 ? _bz_true : T1IsLarger) - }; - - // If we have both ranks, then use them. - // If we have only one rank, then use the unknown type. - // If we have neither rank, then promote to the larger type. - - enum { - promoteToT1 = (BZ_ENUM_CAST(knowBothRanks) ? BZ_ENUM_CAST(T1IsBetter) - : BZ_ENUM_CAST(defaultPromotion)) ? 1 : 0 - }; - - typedef typename _bz_promote2<T1,T2,promoteToT1>::T_promote T_promote; -}; - -#else // !BZ_PARTIAL_SPECIALIZATION - - // No partial specialization -- have to do it the ugly way. - #include <blitz/promote-old.h> - -#endif // !BZ_PARTIAL_SPECIALIZATION - -BZ_NAMESPACE_END - -#endif // BZ_PROMOTE_H diff --git a/weave/blitz-20001213/blitz/rand-dunif.h b/weave/blitz-20001213/blitz/rand-dunif.h deleted file mode 100644 index 704e3b07b..000000000 --- a/weave/blitz-20001213/blitz/rand-dunif.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * blitz/rand-dunif.h Discrete uniform generator - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_RAND_DUNIF_H -#define BZ_RAND_DUNIF_H - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif - -#ifndef BZ_RAND_UNIFORM_H - #include <blitz/rand-uniform.h> -#endif - -#include <math.h> - -BZ_NAMESPACE(blitz) - -template<class P_uniform BZ_TEMPLATE_DEFAULT(Uniform)> -class DiscreteUniform { - -public: - typedef int T_numtype; - typedef P_uniform T_uniform; - - DiscreteUniform(int low, int high, double=0) - : low_(low), range_(high-low+1) - { - } - - void randomize() - { - uniform_.randomize(); - } - - int random() - { - return int(uniform_.random() * range_ + low_); - } - -private: - int low_, range_; - T_uniform uniform_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RAND_DUNIF_H - diff --git a/weave/blitz-20001213/blitz/rand-mt.h b/weave/blitz-20001213/blitz/rand-mt.h deleted file mode 100644 index 76f4f5f03..000000000 --- a/weave/blitz-20001213/blitz/rand-mt.h +++ /dev/null @@ -1,166 +0,0 @@ -/* A C-program for MT19937: Integer version (1998/4/6) */ -/* genrand() generates one pseudorandom unsigned integer (32bit) */ -/* which is uniformly distributed among 0 to 2^32-1 for each */ -/* call. sgenrand(seed) set initial values to the working area */ -/* of 624 words. Before genrand(), sgenrand(seed) must be */ -/* called once. (seed is any 32-bit integer except for 0). */ -/* Coded by Takuji Nishimura, considering the suggestions by */ -/* Topher Cooper and Marc Rieffel in July-Aug. 1997. */ - -/* This library is free software; you can redistribute it and/or */ -/* modify it under the terms of the GNU Library General Public */ -/* License as published by the Free Software Foundation; either */ -/* version 2 of the License, or (at your option) any later */ -/* version. */ -/* This library is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -/* See the GNU Library General Public License for more details. */ -/* You should have received a copy of the GNU Library General */ -/* Public License along with this library; if not, write to the */ -/* Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ -/* 02111-1307 USA */ - -/* Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. */ -/* When you use this, send an email to: matumoto@math.keio.ac.jp */ -/* with an appropriate reference to your work. */ - -/* REFERENCE */ -/* M. Matsumoto and T. Nishimura, */ -/* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform */ -/* Pseudo-Random Number Generator", */ -/* ACM Transactions on Modeling and Computer Simulation, */ -/* Vol. 8, No. 1, January 1998, pp 3--30. */ - -// See http://www.math.keio.ac.jp/~matumoto/emt.html - -// 1999-01-25 adapted to STL-like idiom -// allan@stokes.ca (Allan Stokes) www.stokes.ca - -#ifndef BZ_RAND_MT -#define BZ_RAND_MT - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#include <vector> - -BZ_NAMESPACE(blitz) - -// decomposition issues: -// machine representation of integer types -// output buffer option verses inline post-conditioning - -class MersenneTwister -{ -private: - typedef unsigned int twist_int; // must be at least 32 bits - // larger might be faster - typedef vector<twist_int> State; - typedef State::iterator Iter; - - struct BitMixer { - enum { K = 0x9908b0df }; - BitMixer() : s0(0) {} - inline friend twist_int low_mask (twist_int s1) { - return (s1&1u) ? K : 0u; - } - inline twist_int high_mask (twist_int s1) const { - return ((s0&0x80000000)|(s1&0x7fffffff))>>1; - } - inline twist_int operator() (twist_int s1) { - twist_int r = high_mask(s1) ^ low_mask(s1); - s0 = s1; - return r; - } - twist_int s0; - }; - -enum { N = 624, PF = 397, reference_seed = 4357 }; - -public: - MersenneTwister () {} // S empty will trigger auto-seed - - void seed (twist_int seed = reference_seed) - { - if (!S.size()) S.resize (N); - enum { Knuth_A = 69069 }; - twist_int x = seed & 0xFFFFFFFF; - Iter s = &S[0]; - twist_int mask = (seed == reference_seed) ? 0 : 0xFFFFFFFF; - for (int j = 0; j < N; ++j) { - // adding j here avoids the risk of all zeros - // we suppress this term in "compatibility" mode - *s++ = (x + (mask & j)) & 0xFFFFFFFF; - x *= Knuth_A; - } - } - - void reload (void) - { - if (!S.size()) seed (); // auto-seed detection - - Iter p0 = &S[0]; - Iter pM = p0 + PF; - BitMixer twist; - twist (S[0]); // prime the pump - for (Iter pf_end = &S[N-PF]; p0 != pf_end; ++p0, ++pM) - *p0 = *pM ^ twist (p0[1]); - pM = S.begin(); - for (Iter s_end = &S[N-1]; p0 != s_end; ++p0, ++pM) - *p0 = *pM ^ twist (p0[1]); - *p0 = *pM ^ twist (S[0]); - - I = &S[0]; - } - - inline twist_int random (void) - { - if (I >= S.end()) reload(); - twist_int y = *I++; - y ^= (y >> 11); - y ^= (y << 7) & 0x9D2C5680; - y ^= (y << 15) & 0xEFC60000; - y ^= (y >> 18); - return y; - } - -private: - State S; - Iter I; -}; - - -// This version returns a double in the range [0,1). - -class MersenneTwisterDouble { - -public: - MersenneTwisterDouble() - { - // f = 1/(2^32); - f = (1.0 / 65536) / 65536; - } - - void randomize(unsigned int seed) - { - gen_.seed(seed); - } - - double random() - { - unsigned long y1 = gen_.random(); - unsigned long y2 = gen_.random(); - - return ((y1 * f) * y2 * f); - } - -private: - MersenneTwister gen_; - double f; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RAND_MT diff --git a/weave/blitz-20001213/blitz/rand-normal.h b/weave/blitz-20001213/blitz/rand-normal.h deleted file mode 100644 index b7bbfb333..000000000 --- a/weave/blitz-20001213/blitz/rand-normal.h +++ /dev/null @@ -1,110 +0,0 @@ -/*************************************************************************** - * blitz/rand-normal.h Random Gaussian (Normal) generator - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * - * This generator transforms a (0,1] uniform distribution into - * a Normal distribution. Let u,v be (0,1] random variables. Then - * - * x = sqrt(-2 ln v) cos(pi (2u-1)) - * - * is N(0,1) distributed. - * - * Reference: Athanasios Papoulis, "Probability, random variables, - * and stochastic processes," McGraw-Hill : Toronto, 1991. - * - *************************************************************************** - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_RAND_NORMAL_H -#define BZ_RAND_NORMAL_H - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif - -#ifndef BZ_RAND_UNIFORM_H - #include <blitz/rand-uniform.h> -#endif - -#include <math.h> - -BZ_NAMESPACE(blitz) - -template<class P_uniform BZ_TEMPLATE_DEFAULT(Uniform)> -class Normal { - -public: - typedef double T_numtype; - - Normal(double mean = 0.0, double variance = 1.0, double = 0.0) - : mean_(mean), sigma_(::sqrt(variance)) - { - } - - void randomize() - { - uniform_.randomize(); - } - - double random() - { - double u, v; - - do { - u = uniform_.random(); - v = uniform_.random(); - } while (v == 0); - - return mean_ + sigma_ * ::sqrt(-2*::log(v)) * ::cos(M_PI * (2*u - 1)); - } - -private: - double mean_, sigma_; - P_uniform uniform_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RAND_NORMAL_H - diff --git a/weave/blitz-20001213/blitz/rand-tt800.h b/weave/blitz-20001213/blitz/rand-tt800.h deleted file mode 100644 index 7ef5c9b32..000000000 --- a/weave/blitz-20001213/blitz/rand-tt800.h +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * blitz/rand-tt800.h Matsumoto and Kurita's TT800 uniform random - * number generator. - * - * $Id$ - * - *************************************************************************** - * - * The class TT800 encapsulates Makoto Matsumoto and Yoshiharu Kurita's - * TT800 twisted generalized feedback shift register (TGFSR) random number - * generator. The generator has period 2^800 - 1. - * - * Contact: M. Matsumoto <matumoto@math.keio.ac.jp> - * - * See: M. Matsumoto and Y. Kurita, Twisted GFSR Generators II, - * ACM Transactions on Modelling and Computer Simulation, - * Vol. 4, No. 3, 1994, pages 254-266. - * - * (c) 1994 Association for Computing Machinery. - * - * Distributed with consent of the authors. - * - *************************************************************************** - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.1 1997/02/28 13:39:51 tveldhui - * Initial revision - * - */ - -#ifndef BZ_RAND_TT800_H -#define BZ_RAND_TT800_H - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif - -BZ_NAMESPACE(blitz) - -class TT800 { - -public: - typedef double T_numtype; - - TT800(double low = 0.0, double high = 1.0, double = 0.0) - : low_(low), length_(high-low) - { - // Initial 25 seeds - x[0] = 0x95f24dab; x[1] = 0x0b685215; x[2] = 0xe76ccae7; - x[3] = 0xaf3ec239; x[4] = 0x715fad23; x[5] = 0x24a590ad; - x[6] = 0x69e4b5ef; x[7] = 0xbf456141; x[8] = 0x96bc1b7b; - x[9] = 0xa7bdf825; x[10] = 0xc1de75b7; x[11] = 0x8858a9c9; - x[12] = 0x2da87693; x[13] = 0xb657f9dd; x[14] = 0xffdc8a9f; - x[15] = 0x8121da71; x[16] = 0x8b823ecb; x[17] = 0x885d05f5; - x[18] = 0x4e20cd47; x[19] = 0x5a9ad5d9; x[20] = 0x512c0c03; - x[21] = 0xea857ccd; x[22] = 0x4cc1d30f; x[23] = 0x8891a8a1; - x[24] = 0xa6b7aadb; - - // Magic vector 'a', don't change - mag01[0] = 0; - mag01[1] = 0x8ebfd028; - - k = 0; - - // f = 1/(2^32); - - f = (1.0 / 65536) / 65536; - } - - void randomize() - { - BZ_NOT_IMPLEMENTED(); // NEEDS_WORK - } - - unsigned long randomUint32() - { - if (k==N) - generate(); - - unsigned long y = x[k]; - y ^= (y << 7) & 0x2b5b2500; /* s and b, magic vectors */ - y ^= (y << 15) & 0xdb8b0000; /* t and c, magic vectors */ - y &= 0xffffffff; /* you may delete this line if word size = 32 */ - - // the following line was added by Makoto Matsumoto in the 1996 version - // to improve lower bit's corellation. - // Delete this line to use the code published in 1994. - - y ^= (y >> 16); /* added to the 1994 version */ - k++; - } - - double random() - { - unsigned long y1 = randomUint32(); - unsigned long y2 = randomUint32(); - - return low_ + length_ * ((y1 * f) * y2 * f); - } - -protected: - void generate() - { - /* generate N words at one time */ - int kk; - for (kk=0;kk<N-M;kk++) { - x[kk] = x[kk+M] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2]; - } - for (; kk<N;kk++) { - x[kk] = x[kk+(M-N)] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2]; - } - k=0; - } - -private: - enum { N = 25, M = 7 }; - - double low_, length_; - double f; - int k; - unsigned long x[N]; - unsigned long mag01[2]; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RAND_TT800_H - diff --git a/weave/blitz-20001213/blitz/rand-uniform.h b/weave/blitz-20001213/blitz/rand-uniform.h deleted file mode 100644 index 867debf11..000000000 --- a/weave/blitz-20001213/blitz/rand-uniform.h +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************** - * blitz/rand-uniform.h Uniform class, which provides uniformly - * distributed random numbers. - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * - * This random number generator is based on the LAPACK auxilliary - * routine DLARAN by Jack Dongarra. It's a multiplicative congruential - * generator with modulus 2^48 and multiplier 33952834046453. - * - * See also: G. S. Fishman, Multiplicative congruential random number - * generators with modulus 2^b: an exhaustive analysis for b=32 and - * a partial analysis for b=48, Math. Comp. 189, pp 331-344, 1990. - * - * This routine requires 32-bit integers. - * - * The generated number lies in the open interval (low,high). i.e. low and - * high themselves will never be generated. - * - *************************************************************************** - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_RAND_UNIFORM_H -#define BZ_RAND_UNIFORM_H - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif - -BZ_NAMESPACE(blitz) - -class Uniform { - -public: - typedef double T_numtype; - - Uniform(double low = 0.0, double high = 1.0, double = 0.0) - : low_(low), length_(high-low) - { - BZPRECONDITION(sizeof(int) >= 4); // Need 32 bit integers! - - seed[0] = 24; // All seeds in the range [0,4095] - seed[1] = 711; - seed[2] = 3; - seed[3] = 3721; // The last seed must be odd - } - - void randomize() - { - BZ_NOT_IMPLEMENTED(); // NEEDS_WORK - - BZPOSTCONDITION(seed[3] % 2 == 1); - } - - // I'm trying to avoid having a compiled - // portion of the library, so this is inline until I - // figure out a better way to do this or I change my mind. - // -- TV - // NEEDS_WORK - double random() - { - BZPRECONDITION(seed[3] % 2 == 1); - - int it0, it1, it2, it3; - it3 = seed[3] * 2549; - it2 = it3 / 4096; - it3 -= it2 << 12; - it2 += seed[2] * 2549 + seed[3] * 2508; - it1 = it2 / 4096; - it2 -= it1 << 12; - it1 += seed[1] * 2549 + seed[2] * 2508 + seed[3] * 322; - it0 = it1 / 4096; - it1 -= it0 << 12; - it0 += seed[0] * 2549 + seed[1] * 2508 + seed[2] * 322 + seed[3] * 494; - it0 %= 4096; - seed[0] = it0; - seed[1] = it1; - seed[2] = it2; - seed[3] = it3; - - const double z = 1 / 4096.; - return low_ + length_ * (it0 + (it1 + (it2 + it3 * z) * z) * z) * z; - } - - operator double() - { return random(); } - -private: - double low_, length_; - - int seed[4]; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RAND_UNIFORM_H - diff --git a/weave/blitz-20001213/blitz/random.h b/weave/blitz-20001213/blitz/random.h deleted file mode 100644 index ba553d6d3..000000000 --- a/weave/blitz-20001213/blitz/random.h +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************** - * blitz/random.h Random number generator wrapper class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_RANDOM_H -#define BZ_RANDOM_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_distribution> -class Random { - -public: - typedef P_distribution T_distribution; - typedef _bz_typename T_distribution::T_numtype T_numtype; - - Random(double parm1=0.0, double parm2=1.0, double parm3=0.0) - : generator_(parm1, parm2, parm3) - { } - - void randomize() - { generator_.randomize(); } - - T_numtype random() - { return generator_.random(); } - - operator T_numtype() - { return generator_.random(); } - -protected: - T_distribution generator_; -}; - -BZ_NAMESPACE_END - -#include <blitz/randref.h> - -#endif // BZ_RANDOM_H - diff --git a/weave/blitz-20001213/blitz/randref.h b/weave/blitz-20001213/blitz/randref.h deleted file mode 100644 index 8dd0ef343..000000000 --- a/weave/blitz-20001213/blitz/randref.h +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * blitz/randref.h Random number generators, expression templates - * wrapper - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.3 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_RANDREF_H -#define BZ_RANDREF_H - -#ifndef BZ_RANDOM_H - #error <blitz/randref.h> must be included via <blitz/random.h> -#endif // BZ_RANDOM_H - -BZ_NAMESPACE(blitz) - -template<class P_distribution> -class _bz_VecExprRandom { - -public: - typedef _bz_typename Random<P_distribution>::T_numtype T_numtype; - - _bz_VecExprRandom(Random<P_distribution>& random) - : random_(random) - { } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecExprRandom(_bz_VecExprRandom<P_distribution>& x) - : random_(x.random_) - { } -#endif - - T_numtype operator[](unsigned) const - { return random_.random(); } - - T_numtype operator()(unsigned) const - { return random_.random(); } - - unsigned length(unsigned recommendedLength) const - { return recommendedLength; } - - unsigned _bz_suggestLength() const - { return 0; } - - _bz_bool _bz_hasFastAccess() const - { return 1; } - - T_numtype _bz_fastAccess(unsigned) const - { return random_.random(); } - -private: - _bz_VecExprRandom() { } - - Random<P_distribution>& random_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RANDREF_H - diff --git a/weave/blitz-20001213/blitz/range.h b/weave/blitz-20001213/blitz/range.h deleted file mode 100644 index 9f740d210..000000000 --- a/weave/blitz-20001213/blitz/range.h +++ /dev/null @@ -1,238 +0,0 @@ -/*************************************************************************** - * blitz/range.h Declaration of the Range class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/11/11 17:29:13 tveldhui - * Initial revision - * - * - */ - -#ifndef BZ_RANGE_H -#define BZ_RANGE_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_VECEXPRWRAP_H - #include <blitz/vecexprwrap.h> // _bz_VecExpr wrapper -#endif - -#include <blitz/wrap-climits.h> // for INT_MIN - -BZ_NAMESPACE(blitz) - -// Examples: -// Vector<double> x(7); -// Range::all() [0,1,2,3,4,5,6] -// Range(3,5) [3,4,5] -// Range(3,Range::toEnd) [3,4,5,6] -// Range(Range::fromStart,3) [0,1,2,3] -// Range(1,5,2); [1,3,5] - -enum { fromStart = INT_MIN, toEnd = INT_MIN }; - -// Class Range -class Range { - -public: - // This declaration not yet supported by all compilers - // const int fromStart = INT_MIN; - // const int toEnd = INT_MIN; - - typedef int T_numtype; - - enum { fromStart = INT_MIN, toEnd = INT_MIN }; - - Range() - { - first_ = fromStart; - last_ = toEnd; - stride_ = 1; - } - - // Range(Range r): allow default copy constructor to be used -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - Range(const Range& r) - { - first_ = r.first_; - last_ = r.last_; - stride_ = r.stride_; - } -#endif - - _bz_explicit Range(int slicePosition) - { - first_ = slicePosition; - last_ = slicePosition; - stride_ = 1; - } - - Range(int first, int last, int stride=1) - : first_(first), last_(last), stride_(stride) - { - BZPRECHECK((first == fromStart) || (last == toEnd) || - (first < last) && (stride > 0) || - (first > last) && (stride < 0) || - (first == last), (*this) << " is an invalid range."); - BZPRECHECK((last-first) % stride == 0, - (*this) << ": the stride must evenly divide the range"); - } - - int first(int lowRange = 0) const - { - if (first_ == fromStart) - return lowRange; - return first_; - } - - int last(int highRange = 0) const - { - if (last_ == toEnd) - return highRange; - return last_; - } - - unsigned length(int recommendedLength = 0) const - { - BZPRECONDITION(first_ != fromStart); - BZPRECONDITION(last_ != toEnd); - BZPRECONDITION((last_ - first_) % stride_ == 0); - return (last_ - first_) / stride_ + 1; - } - - int stride() const - { return stride_; } - - _bz_bool isAscendingContiguous() const - { - return (first_ <= last_) && (stride_ == 1); - } - - void setRange(int first, int last, int stride=1) - { - BZPRECONDITION((first < last) && (stride > 0) || - (first > last) && (stride < 0) || - (first == last)); - BZPRECONDITION((last-first) % stride == 0); - first_ = first; - last_ = last; - stride_ = stride; - } - - static Range all() - { return Range(fromStart,toEnd,1); } - - bool isUnitStride() const - { return stride_ == 1; } - - // Operators - Range operator-(int shift) const - { - BZPRECONDITION(first_ != fromStart); - BZPRECONDITION(last_ != toEnd); - return Range(first_ - shift, last_ - shift, stride_); - } - - Range operator+(int shift) const - { - BZPRECONDITION(first_ != fromStart); - BZPRECONDITION(last_ != toEnd); - return Range(first_ + shift, last_ + shift, stride_); - } - - int operator[](unsigned i) const - { - return first_ + i * stride_; - } - - int operator()(unsigned i) const - { - return first_ + i * stride_; - } - - friend inline ostream& operator<<(ostream& os, const Range& range) - { - os << "Range(" << range.first() << "," << range.last() << "," - << range.stride() << ")"; - - return os; - } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 0, - _bz_staticLength = 0 }; - - _bz_bool _bz_hasFastAccess() const - { return stride_ == 1; } - - T_numtype _bz_fastAccess(unsigned i) const - { return first_ + i; } - - unsigned _bz_suggestLength() const - { - return length(); - } - - _bz_VecExpr<Range> _bz_asVecExpr() const - { return _bz_VecExpr<Range>(*this); } - -private: - int first_, last_, stride_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_RANGE_H diff --git a/weave/blitz-20001213/blitz/reduce.h b/weave/blitz-20001213/blitz/reduce.h deleted file mode 100644 index 1a2621398..000000000 --- a/weave/blitz-20001213/blitz/reduce.h +++ /dev/null @@ -1,809 +0,0 @@ -/*************************************************************************** - * blitz/reduce.h Reduction operators: sum, mean, min, max, - * minIndex, maxIndex, product, count, any, all - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_REDUCE_H -#define BZ_REDUCE_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -#ifndef BZ_NUMINQUIRE_H - #include <blitz/numinquire.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_sourcetype, class P_resulttype = BZ_SUMTYPE(P_sourcetype)> -class ReduceSum { - -public: - typedef P_sourcetype T_sourcetype; - typedef P_resulttype T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 1 }; - - ReduceSum() - { reset(); } - - ReduceSum(T_resulttype initialValue) - { sum_ = initialValue; } - - bool operator()(T_sourcetype x) - { - sum_ += x; - return true; - } - - bool operator()(T_sourcetype x, int) - { - sum_ += x; - return true; - } - - T_resulttype result(int) - { return sum_; } - - void reset() - { sum_ = zero(T_resulttype()); } - - void reset(T_resulttype initialValue) - { sum_ = initialValue; } - - static const char* name() - { return "sum"; } - -protected: - T_resulttype sum_; -}; - -template<class P_sourcetype, class P_resulttype = BZ_FLOATTYPE(P_sourcetype)> -class ReduceMean { - -public: - typedef P_sourcetype T_sourcetype; - typedef P_resulttype T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 0 }; - - ReduceMean() - { reset(); } - - ReduceMean(T_resulttype) - { - BZPRECHECK(0, "Provided an initial value for ReduceMean"); - reset(); - } - - bool operator()(T_sourcetype x) - { - sum_ += x; - return true; - } - - bool operator()(T_sourcetype x, int) - { - sum_ += x; - return true; - } - - T_resulttype result(int count) - { return sum_ / count; } - - void reset() - { sum_ = zero(T_resulttype()); } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided an initial value for ReduceMean"); - reset(); - } - - static const char* name() - { return "mean"; } - -protected: - T_resulttype sum_; -}; - -template<class P_sourcetype> -class ReduceMin { - -public: - typedef P_sourcetype T_sourcetype; - typedef P_sourcetype T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 1 }; - - ReduceMin() - { reset(); } - - ReduceMin(T_resulttype min) - { - min_ = min; - } - - bool operator()(T_sourcetype x) - { - if (x < min_) - min_ = x; - return true; - } - - bool operator()(T_sourcetype x, int) - { - if (x < min_) - min_ = x; - return true; - } - - T_resulttype result(int) - { return min_; } - - void reset() - { min_ = huge(P_sourcetype()); } - - void reset(T_resulttype initialValue) - { min_ = initialValue; } - - static const char* name() - { return "min"; } - -protected: - T_resulttype min_; -}; - -template<class P_sourcetype> -class ReduceMax { - -public: - typedef P_sourcetype T_sourcetype; - typedef P_sourcetype T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 1 }; - - ReduceMax() - { reset(); } - - ReduceMax(T_resulttype max) - { - max_ = max; - } - - bool operator()(T_sourcetype x) - { - if (x > max_) - max_ = x; - return true; - } - - bool operator()(T_sourcetype x, int) - { - if (x > max_) - max_ = x; - return true; - } - - T_resulttype result(int) - { return max_; } - - void reset() - { max_ = neghuge(P_sourcetype()); } - - void reset(T_resulttype initialValue) - { max_ = initialValue; } - - static const char* name() - { return "max"; } - -protected: - T_resulttype max_; -}; - -template<class P_sourcetype> -class ReduceMinIndex { - -public: - typedef P_sourcetype T_sourcetype; - typedef int T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 1, canProvideInitialValue = 0 }; - - ReduceMinIndex() - { reset(); } - - ReduceMinIndex(T_resulttype min) - { - reset(min); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, int index) - { - if (x < min_) - { - min_ = x; - index_ = index; - } - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - min_ = huge(T_sourcetype()); - index_ = tiny(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceMinIndex"); - reset(); - } - - static const char* name() - { return "minIndex"; } - -protected: - T_sourcetype min_; - int index_; -}; - -template<class P_sourcetype, int N> -class ReduceMinIndexVector { - -public: - typedef P_sourcetype T_sourcetype; - typedef TinyVector<int,N> T_resulttype; - typedef T_resulttype T_numtype; - - enum { canProvideInitialValue = 0 }; - - ReduceMinIndexVector() - { reset(); } - - ReduceMinIndexVector(T_resulttype min) - { - reset(min); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype, int) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, const TinyVector<int,N>& index) - { - if (x < min_) - { - min_ = x; - index_ = index; - } - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - min_ = huge(T_sourcetype()); - index_ = tiny(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceMinIndex"); - reset(); - } - - static const char* name() - { return "minIndex"; } - -protected: - T_sourcetype min_; - TinyVector<int,N> index_; -}; - -template<class P_sourcetype> -class ReduceMaxIndex { - -public: - typedef P_sourcetype T_sourcetype; - typedef int T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 1, canProvideInitialValue = 0 }; - - ReduceMaxIndex() - { reset(); } - - ReduceMaxIndex(T_resulttype max) - { - reset(max); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, int index) - { - if (x > max_) - { - max_ = x; - index_ = index; - } - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - max_ = neghuge(T_sourcetype()); - index_ = tiny(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceMaxIndex"); - reset(); - } - - static const char* name() - { return "maxIndex"; } - -protected: - T_sourcetype max_; - int index_; -}; - -template<class P_sourcetype, int N_rank> -class ReduceMaxIndexVector { - -public: - typedef P_sourcetype T_sourcetype; - typedef TinyVector<int,N_rank> T_resulttype; - typedef T_resulttype T_numtype; - - enum { canProvideInitialValue = 0 }; - - ReduceMaxIndexVector() - { reset(); } - - ReduceMaxIndexVector(T_resulttype max) - { - reset(max); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, const TinyVector<int,N_rank>& index) - { - if (x > max_) - { - max_ = x; - index_ = index; - } - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - max_ = neghuge(T_sourcetype()); - index_ = tiny(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceMaxIndex"); - reset(); - } - - static const char* name() - { return "maxIndex"; } - -protected: - T_sourcetype max_; - TinyVector<int,N_rank> index_; -}; - -template<class P_sourcetype> -class ReduceFirst { - -public: - typedef P_sourcetype T_sourcetype; - typedef int T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 1, canProvideInitialValue = 0 }; - - ReduceFirst() - { reset(); } - - ReduceFirst(T_resulttype) - { - BZPRECONDITION(0); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, int index) - { - if (x) - { - index_ = index; - return false; - } - else - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - index_ = tiny(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceFirst"); - reset(); - } - - static const char* name() - { return "first"; } - -protected: - int index_; -}; - -template<class P_sourcetype> -class ReduceLast { - -public: - typedef P_sourcetype T_sourcetype; - typedef int T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 1, canProvideInitialValue = 0 }; - - ReduceLast() - { reset(); } - - ReduceLast(T_resulttype) - { - BZPRECONDITION(0); - } - - bool operator()(T_sourcetype x) - { - BZPRECONDITION(0); - return false; - } - - bool operator()(T_sourcetype x, int index) - { - if (x) - { - index_ = index; - return true; - } - else - return true; - } - - T_resulttype result(int) - { return index_; } - - void reset() - { - index_ = huge(int()); - } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceFirst"); - reset(); - } - - static const char* name() - { return "last"; } - -protected: - int index_; -}; - -template<class P_sourcetype, class P_resulttype = BZ_SUMTYPE(P_sourcetype)> -class ReduceProduct { - -public: - typedef P_sourcetype T_sourcetype; - typedef P_resulttype T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 1 }; - - ReduceProduct() - { product_ = one(T_resulttype()); } - - ReduceProduct(T_resulttype initialValue) - { product_ = initialValue; } - - bool operator()(T_sourcetype x) - { - product_ *= x; - return true; - } - - bool operator()(T_sourcetype x, int) - { - product_ *= x; - return true; - } - - T_resulttype result(int) - { return product_; } - - void reset() - { product_ = one(T_resulttype()); } - - void reset(T_resulttype initialValue) - { product_ = initialValue; } - - static const char* name() - { return "product"; } - -protected: - T_resulttype product_; -}; - -template<class P_sourcetype> -class ReduceCount { - -public: - typedef P_sourcetype T_sourcetype; - typedef int T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 1 }; - - ReduceCount() - { reset(); } - - ReduceCount(T_resulttype count) - { - count_ = count; - } - - bool operator()(T_sourcetype x) - { - if (x) - ++count_; - return true; - } - - bool operator()(T_sourcetype x, int) - { - if (x) - ++count_; - return true; - } - - T_resulttype result(int) - { return count_; } - - void reset() - { count_ = zero(T_resulttype()); } - - void reset(T_resulttype initialValue) - { count_ = initialValue; } - - static const char* name() - { return "count"; } - -protected: - T_resulttype count_; -}; - -template<class P_sourcetype> -class ReduceAny { - -public: - typedef P_sourcetype T_sourcetype; - typedef _bz_bool T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 0 }; - - ReduceAny() - { reset(); } - - ReduceAny(T_resulttype initialValue) - { - reset(initialValue); - } - - bool operator()(T_sourcetype x) - { - if (x) - { - any_ = _bz_true; - return false; - } - - return true; - } - - bool operator()(T_sourcetype x, int) - { - if (x) - { - any_ = _bz_true; - return false; - } - - return true; - } - - T_resulttype result(int) - { return any_; } - - void reset() - { any_ = _bz_false; } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceAny"); - reset(); - } - - static const char* name() - { return "any"; } - -protected: - T_resulttype any_; -}; - -template<class P_sourcetype> -class ReduceAll { - -public: - typedef P_sourcetype T_sourcetype; - typedef _bz_bool T_resulttype; - typedef T_resulttype T_numtype; - - enum { needIndex = 0, canProvideInitialValue = 0 }; - - ReduceAll() - { reset(); } - - ReduceAll(T_resulttype initialValue) - { - reset(initialValue); - } - - bool operator()(T_sourcetype x) - { - if (!_bz_bool(x)) - { - all_ = _bz_false; - return false; - } - else - return true; - } - - bool operator()(T_sourcetype x, int) - { - if (!_bz_bool(x)) - { - all_ = _bz_false; - return false; - } - else - return true; - } - - T_resulttype result(int) - { return all_; } - - void reset() - { all_ = _bz_true; } - - void reset(T_resulttype) - { - BZPRECHECK(0, "Provided initial value for ReduceAll"); - reset(); - } - - static const char* name() - { return "all"; } - -protected: - T_resulttype all_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_REDUCE_H diff --git a/weave/blitz-20001213/blitz/shapecheck.h b/weave/blitz-20001213/blitz/shapecheck.h deleted file mode 100644 index b30377c67..000000000 --- a/weave/blitz-20001213/blitz/shapecheck.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * blitz/shapecheck.h Functions for checking conformability of arrays - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.1 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -#ifndef BZ_SHAPECHECK_H -#define BZ_SHAPECHECK_H - -BZ_NAMESPACE(blitz) - -/* - * The function areShapesConformable(A,B) checks that the shapes - * A and B are conformable (i.e. the same size/geometry). Typically - * the A and B parameters are of type TinyVector<int,N_rank> and represent - * the extent of the arrays. It's possible that in the future jagged-edged - * arrays will be supported, in which case shapes may be lists - * of subdomains. - */ - -template<class T_shape1, class T_shape2> -inline _bz_bool areShapesConformable(const T_shape1&, const T_shape2&) -{ - // If the shape objects are different types, this means - // that the arrays are different ranks, or one is jagged - // edged, etc. In this case the two arrays are not - // conformable. - return _bz_false; -} - -template<class T_shape> -inline _bz_bool areShapesConformable(const T_shape& a, const T_shape& b) -{ - // The shape objects are the same type, so compare them. - - // NEEDS_WORK-- once the "all" reduction is implemented, should - // use it. - // return all(a == b); - - for (unsigned i=0; i < a.length(); ++i) - { - if (a[i] != b[i]) - { - BZ_DEBUG_MESSAGE("Incompatible shapes detected: " << endl - << a << endl << b << endl); - return _bz_false; - } - } - - return _bz_true; -} - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/tau.h b/weave/blitz-20001213/blitz/tau.h deleted file mode 100644 index f6e865e63..000000000 --- a/weave/blitz-20001213/blitz/tau.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * blitz/tau.h Integration with the Tau profiling package. - * See http://www.acl.lanl.gov/tau/ - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -#ifndef BZ_TAU_H -#define BZ_TAU_H - -#ifdef BZ_TAU_PROFILING - #define TAU_BLITZ TAU_USER1 - #include <Profile/Profiler.h> - -#else - #define TYPE_STRING(profileString, str) - #define PROFILED_BLOCK(name, type) - #define TAU_TYPE_STRING(profileString, str) - #define TAU_PROFILE(name, type, group) - #define TAU_PROFILE_TIMER(var, name, type, group) - #define TAU_PROFILE_START(var) - #define TAU_PROFILE_STOP(var) - #define TAU_PROFILE_STMT(stmt) - #define TAU_PROFILE_EXIT(msg) - #define TAU_PROFILE_INIT(argc, argv) - #define TAU_PROFILE_SET_NODE(node) - #define CT(obj) -#endif // ! BZ_TAU_PROFILING - -#endif // BZ_TAU_H diff --git a/weave/blitz-20001213/blitz/timer.h b/weave/blitz-20001213/blitz/timer.h deleted file mode 100644 index a5fe49ccf..000000000 --- a/weave/blitz-20001213/blitz/timer.h +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - * blitz/Timer.h Timer class, for use in benchmarking - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -// This class is not portable to non System V platforms. -// It will need to be rewritten for Windows, NT, Mac. -// NEEDS_WORK - -#ifndef BZ_TIMER_H -#define BZ_TIMER_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifdef BZ_HAVE_RUSAGE - #include <sys/resource.h> -#else - #include <time.h> -#endif - -BZ_NAMESPACE(blitz) - -class Timer { - -public: - Timer() - { - state_ = uninitialized; - } - - void start() - { - state_ = running; - t1_ = systemTime(); - } - - void stop() - { - t2_ = systemTime(); - BZPRECONDITION(state_ == running); - state_ = stopped; - } - - long double elapsedSeconds() - { - BZPRECONDITION(state_ == stopped); - return t2_ - t1_; - } - -private: - Timer(Timer&) { } - void operator=(Timer&) { } - - long double systemTime() - { -#ifdef BZ_HAVE_RUSAGE - getrusage(RUSAGE_SELF, &resourceUsage_); - double seconds = resourceUsage_.ru_utime.tv_sec - + resourceUsage_.ru_stime.tv_sec; - double micros = resourceUsage_.ru_utime.tv_usec - + resourceUsage_.ru_stime.tv_usec; - return seconds + micros/1.0e6; -#else - return clock() / (long double) CLOCKS_PER_SEC; -#endif - } - - enum { uninitialized, running, stopped } state_; - -#ifdef BZ_HAVE_RUSAGE - struct rusage resourceUsage_; -#endif - - long double t1_, t2_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_TIMER_H - diff --git a/weave/blitz-20001213/blitz/tiny.h b/weave/blitz-20001213/blitz/tiny.h deleted file mode 100644 index 978783a9b..000000000 --- a/weave/blitz-20001213/blitz/tiny.h +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - * blitz/tiny.h Tiny base class; now defunct; delete? - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - - -#ifndef BZ_TINY_H -#define BZ_TINY_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -class _bz_tinyBase { -}; - -BZ_NAMESPACE_END - -#endif - diff --git a/weave/blitz-20001213/blitz/tinymat.h b/weave/blitz-20001213/blitz/tinymat.h deleted file mode 100644 index 3f984abff..000000000 --- a/weave/blitz-20001213/blitz/tinymat.h +++ /dev/null @@ -1,161 +0,0 @@ -/*************************************************************************** - * blitz/tinymat.h Declaration of TinyMatrix<T, N, M> - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_TINYMAT_H -#define BZ_TINYMAT_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_LISTINIT_H - #include <blitz/listinit.h> -#endif - -#include <blitz/tinymatexpr.h> -#include <blitz/meta/matassign.h> - -BZ_NAMESPACE(blitz) - -// Forward declarations -template<class T_expr> -class _bz_tinyMatExpr; - -template<class T_numtype, int N_rows, int N_columns, int N_rowStride, - int N_colStride> -class _bz_tinyMatrixRef { - -public: - _bz_tinyMatrixRef(T_numtype* _bz_restrict const data) - : data_(data) - { } - - T_numtype * _bz_restrict data() - { return (T_numtype * _bz_restrict)data_; } - - T_numtype& _bz_restrict operator()(int i, int j) - { return data_[i * N_rowStride + j * N_colStride]; } - - T_numtype operator()(int i, int j) const - { return data_[i * N_rowStride + j * N_colStride]; } - -protected: - T_numtype * _bz_restrict const data_; -}; - -template<class P_numtype, int N_rows, int N_columns> -class TinyMatrix { - -public: - typedef P_numtype T_numtype; - typedef _bz_tinyMatrixRef<T_numtype, N_rows, N_columns, N_columns, 1> - T_reference; - typedef TinyMatrix<T_numtype, N_rows, N_columns> T_matrix; - - TinyMatrix() { } - - T_numtype* _bz_restrict data() - { return data_; } - - const T_numtype* _bz_restrict data() const - { return data_; } - - T_numtype* _bz_restrict dataFirst() - { return data_; } - - const T_numtype* _bz_restrict dataFirst() const - { return data_; } - - // NEEDS_WORK -- precondition checks - T_numtype& _bz_restrict operator()(int i, int j) - { return data_[i*N_columns + j]; } - - T_numtype operator()(int i, int j) const - { return data_[i*N_columns + j]; } - - T_reference getRef() - { return T_reference((T_numtype*)data_); } - - const T_reference getRef() const - { return T_reference((T_numtype*)data_); } - - // Scalar operand - ListInitializationSwitch<T_matrix> - operator=(T_numtype x) - { - return ListInitializationSwitch<T_matrix>(*this, x); - } - - template<class T_expr> - TinyMatrix<T_numtype, N_rows, N_columns>& - operator=(_bz_tinyMatExpr<T_expr> expr) - { - _bz_meta_matAssign<N_rows, N_columns, 0>::f(*this, expr, - _bz_update<T_numtype, _bz_typename T_expr::T_numtype>()); - return *this; - } - - void initialize(T_numtype x) - { - for (int i=0; i < N_rows; ++i) - for (int j=0; j < N_columns; ++j) - (*this)(i,j) = x; - } - - T_numtype* _bz_restrict getInitializationIterator() - { return dataFirst(); } - -protected: - T_numtype data_[N_rows * N_columns]; -}; - -BZ_NAMESPACE_END - -#include <blitz/meta/matvec.h> // Matrix-vector product metaprogram -#include <blitz/meta/matmat.h> // Matrix-matrix products - -#endif // BZ_TINYMAT_H - diff --git a/weave/blitz-20001213/blitz/tinymatexpr.h b/weave/blitz-20001213/blitz/tinymatexpr.h deleted file mode 100644 index 7ea00e766..000000000 --- a/weave/blitz-20001213/blitz/tinymatexpr.h +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * blitz/tinymatexpr.h Tiny Matrix Expressions - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_TINYMATEXPR_H -#define BZ_TINYMATEXPR_H - -#ifndef BZ_TINYMAT_H - #error <blitz/tinymatexpr.h> must be included via <blitz/tinymat.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class T_expr> -class _bz_tinyMatExpr { -public: - typedef _bz_typename T_expr::T_numtype T_numtype; - - enum { - rows = T_expr::rows, - columns = T_expr::columns - }; - - _bz_tinyMatExpr(T_expr expr) - : expr_(expr) - { } - - _bz_tinyMatExpr(const _bz_tinyMatExpr<T_expr>& x) - : expr_(x.expr_) - { } - - T_numtype operator()(int i, int j) const - { return expr_(i,j); } - -protected: - T_expr expr_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_TINYMATEXPR_H - diff --git a/weave/blitz-20001213/blitz/tinyvec.cc b/weave/blitz-20001213/blitz/tinyvec.cc deleted file mode 100644 index 5d7791f2b..000000000 --- a/weave/blitz-20001213/blitz/tinyvec.cc +++ /dev/null @@ -1,661 +0,0 @@ -#ifndef BZ_TINYVEC_CC -#define BZ_TINYVEC_CC - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -#ifndef BZ_VECPICK_H - #include <blitz/vecpick.h> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -#include <blitz/meta/vecassign.h> - -BZ_NAMESPACE(blitz) - -template<class T_numtype, int N_length> -inline TinyVector<T_numtype, N_length>::TinyVector(T_numtype initValue) -{ - for (int i=0; i < N_length; ++i) - data_[i] = initValue; -} - -template<class T_numtype, int N_length> -inline TinyVector<T_numtype, N_length>::TinyVector(const - TinyVector<T_numtype, N_length>& x) -{ - for (int i=0; i < N_length; ++i) - data_[i] = x.data_[i]; -} - -template<class T_numtype, int N_length> template<class P_expr, class P_updater> -inline -void TinyVector<T_numtype, N_length>::_bz_assign(P_expr expr, P_updater up) -{ - BZPRECHECK(expr.length(N_length) == N_length, - "An expression with length " << expr.length(N_length) - << " was assigned to a TinyVector<" - << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype) - << "," << N_length << ">"); - - if (expr._bz_hasFastAccess()) - { - _bz_meta_vecAssign<N_length, 0>::fastAssign(*this, expr, up); - } - else { - _bz_meta_vecAssign<N_length, 0>::assign(*this, expr, up); - } -} - -// Constructor added by Peter Nordlund (peter.nordlund@ind.af.se) -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>::TinyVector(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_update<P_numtype, _bz_typename P_expr::T_numtype>()); -} - -/***************************************************************************** - * Assignment operators with vector expression operand - */ - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_update<P_numtype, _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_plus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_minus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_multiply_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_divide_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_mod_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_xor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitand_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator<<=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftl_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_expr> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftr_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -/***************************************************************************** - * Assignment operators with scalar operand - */ - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::initialize(P_numtype x) -{ -#ifndef BZ_KCC_COPY_PROPAGATION_KLUDGE - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) = _bz_VecExpr<T_expr>(T_expr(x)); -#else - // Avoid using the copy propagation kludge for this simple - // operation. - for (int i=0; i < N_length; ++i) - data_[i] = x; -#endif - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) += _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) -= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) *= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) /= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) %= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) ^= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) &= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) |= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator<<=(int x) -{ - typedef _bz_VecExprConstant<int> T_expr; - (*this) <<= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(int x) -{ - typedef _bz_VecExprConstant<int> T_expr; - (*this) >>= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -/***************************************************************************** - * Assignment operators with TinyVector operand - */ - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) = _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) += _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) -= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) *= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) /= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) %= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) ^= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) &= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) |= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator<<=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) <<= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(const - TinyVector<P_numtype2, N_length>& x) -{ - (*this) >>= _bz_VecExpr<_bz_typename - TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin()); - return *this; -} - -/***************************************************************************** - * Assignment operators with Vector operand - */ - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator=(const Vector<P_numtype2>& x) -{ - (*this) = x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(const Vector<P_numtype2>& x) -{ - (*this) += x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(const Vector<P_numtype2>& x) -{ - (*this) -= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(const Vector<P_numtype2>& x) -{ - (*this) *= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(const Vector<P_numtype2>& x) -{ - (*this) /= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(const Vector<P_numtype2>& x) -{ - (*this) %= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(const Vector<P_numtype2>& x) -{ - (*this) ^= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(const Vector<P_numtype2>& x) -{ - (*this) &= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(const Vector<P_numtype2>& x) -{ - (*this) |= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator<<=(const Vector<P_numtype2>& x) -{ - (*this) <<= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(const Vector<P_numtype2>& x) -{ - (*this) >>= x._bz_asVecExpr(); - return *this; -} - -/***************************************************************************** - * Assignment operators with Range operand - */ - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator=(Range r) -{ - (*this) = r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(Range r) -{ - (*this) += r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(Range r) -{ - (*this) -= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(Range r) -{ - (*this) *= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(Range r) -{ - (*this) /= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(Range r) -{ - (*this) %= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(Range r) -{ - (*this) ^= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(Range r) -{ - (*this) &= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(Range r) -{ - (*this) |= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator<<=(Range r) -{ - (*this) <<= r._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(Range r) -{ - (*this) >>= r._bz_asVecExpr(); - return *this; -} - -/***************************************************************************** - * Assignment operators with VectorPick operand - */ - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator=(const VectorPick<P_numtype2>& x) -{ - (*this) = x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator+=(const VectorPick<P_numtype2>& x) -{ - (*this) += x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator-=(const VectorPick<P_numtype2>& x) -{ - (*this) -= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator*=(const VectorPick<P_numtype2>& x) -{ - (*this) *= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator/=(const VectorPick<P_numtype2>& x) -{ - (*this) /= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator%=(const VectorPick<P_numtype2>& x) -{ - (*this) %= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator^=(const VectorPick<P_numtype2>& x) -{ - (*this) ^= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator&=(const VectorPick<P_numtype2>& x) -{ - (*this) &= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator|=(const VectorPick<P_numtype2>& x) -{ - (*this) |= x._bz_asVecExpr(); - return *this; -} - -template<class P_numtype, int N_length> template<class P_numtype2> -inline TinyVector<P_numtype, N_length>& -TinyVector<P_numtype, N_length>::operator>>=(const VectorPick<P_numtype2>& x) -{ - (*this) <<= x._bz_asVecExpr(); - return *this; -} - -BZ_NAMESPACE_END - -#endif // BZ_TINYVEC_CC diff --git a/weave/blitz-20001213/blitz/tinyvec.h b/weave/blitz-20001213/blitz/tinyvec.h deleted file mode 100644 index 532dacc37..000000000 --- a/weave/blitz-20001213/blitz/tinyvec.h +++ /dev/null @@ -1,456 +0,0 @@ -/*************************************************************************** - * blitz/tinyvec.h Declaration of the TinyVector<T, N> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_TINYVEC_H -#define BZ_TINYVEC_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -#ifndef BZ_LISTINIT_H - #include <blitz/listinit.h> -#endif - -#include <blitz/tiny.h> - -BZ_NAMESPACE(blitz) - -/***************************************************************************** - * Forward declarations - */ - -template<class P_numtype, int N_length, int N_stride BZ_TEMPLATE_DEFAULT(1) > -class TinyVectorIter; - -template<class P_numtype, int N_length, int N_stride BZ_TEMPLATE_DEFAULT(1) > -class TinyVectorIterConst; - -template<class P_numtype> -class Vector; - -template<class P_expr> -class _bz_VecExpr; - -template<class P_distribution> -class Random; - -template<class P_numtype> -class VectorPick; - -template<class T_numtype1, class T_numtype2, int N_rows, int N_columns, - int N_vecStride> -class _bz_matrixVectorProduct; - - - -/***************************************************************************** - * Declaration of class TinyVector - */ - -template<class P_numtype, int N_length> -class TinyVector { - -public: - ////////////////////////////////////////////// - // Public Types - ////////////////////////////////////////////// - - typedef P_numtype T_numtype; - typedef TinyVector<T_numtype,N_length> T_vector; - typedef TinyVectorIter<T_numtype,N_length,1> T_iterator; - typedef TinyVectorIterConst<T_numtype,N_length,1> T_constIterator; - typedef T_iterator iterator; - typedef T_constIterator const_iterator; - enum { numElements = N_length }; - - TinyVector() - { } - - ~TinyVector() - { } - - inline TinyVector(const TinyVector<P_numtype,N_length>& x); - - inline TinyVector(T_numtype initValue); - - TinyVector(T_numtype x0, T_numtype x1) - { - data_[0] = x0; - data_[1] = x1; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - data_[6] = x6; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, - T_numtype x7) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - data_[6] = x6; - data_[7] = x7; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, - T_numtype x7, T_numtype x8) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - data_[6] = x6; - data_[7] = x7; - data_[8] = x8; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, - T_numtype x7, T_numtype x8, T_numtype x9) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - data_[6] = x6; - data_[7] = x7; - data_[8] = x8; - data_[9] = x9; - } - - TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, - T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, - T_numtype x7, T_numtype x8, T_numtype x9, T_numtype x10) - { - data_[0] = x0; - data_[1] = x1; - data_[2] = x2; - data_[3] = x3; - data_[4] = x4; - data_[5] = x5; - data_[6] = x6; - data_[7] = x7; - data_[8] = x8; - data_[9] = x9; - data_[10] = x10; - } - - // Constructor added by Peter Nordlund - template<class P_expr> - inline TinyVector(_bz_VecExpr<P_expr> expr); - - T_iterator begin() - { return T_iterator(*this); } - - T_constIterator begin() const - { return T_constIterator(*this); } - - // T_iterator end(); - // T_constIterator end() const; - - T_numtype * _bz_restrict data() - { return data_; } - - const T_numtype * _bz_restrict data() const - { return data_; } - - T_numtype * _bz_restrict dataFirst() - { return data_; } - - const T_numtype * _bz_restrict dataFirst() const - { return data_; } - - unsigned length() const - { return N_length; } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - unsigned _bz_suggestLength() const - { return N_length; } - - _bz_bool _bz_hasFastAccess() const - { return _bz_true; } - - T_numtype& _bz_restrict _bz_fastAccess(unsigned i) - { return data_[i]; } - - T_numtype _bz_fastAccess(unsigned i) const - { return data_[i]; } - - template<class P_expr, class P_updater> - void _bz_assign(P_expr, P_updater); - - _bz_VecExpr<T_constIterator> _bz_asVecExpr() const - { return _bz_VecExpr<T_constIterator>(begin()); } - - ////////////////////////////////////////////// - // Subscripting operators - ////////////////////////////////////////////// - - int lengthCheck(unsigned i) const - { - BZPRECHECK(i < N_length, - "TinyVector<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype) - << "," << N_length << "> index out of bounds: " << i); - return 1; - } - - T_numtype operator()(unsigned i) const - { - BZPRECONDITION(lengthCheck(i)); - return data_[i]; - } - - T_numtype& _bz_restrict operator()(unsigned i) - { - BZPRECONDITION(lengthCheck(i)); - return data_[i]; - } - - T_numtype operator[](unsigned i) const - { - BZPRECONDITION(lengthCheck(i)); - return data_[i]; - } - - T_numtype& _bz_restrict operator[](unsigned i) - { - BZPRECONDITION(lengthCheck(i)); - return data_[i]; - } - - ////////////////////////////////////////////// - // Assignment operators - ////////////////////////////////////////////// - - // Scalar operand - ListInitializationSwitch<T_vector> operator=(T_numtype x) - { - return ListInitializationSwitch<T_vector>(*this, x); - } - - T_vector& initialize(T_numtype); - T_vector& operator+=(T_numtype); - T_vector& operator-=(T_numtype); - T_vector& operator*=(T_numtype); - T_vector& operator/=(T_numtype); - T_vector& operator%=(T_numtype); - T_vector& operator^=(T_numtype); - T_vector& operator&=(T_numtype); - T_vector& operator|=(T_numtype); - T_vector& operator>>=(int); - T_vector& operator<<=(int); - - template<class P_numtype2> - T_vector& operator=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator+=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator-=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator*=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator/=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator%=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator^=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator&=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator|=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator>>=(const TinyVector<P_numtype2, N_length> &); - template<class P_numtype2> - T_vector& operator<<=(const TinyVector<P_numtype2, N_length> &); - - template<class P_numtype2> T_vector& operator=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator+=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator-=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator*=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator/=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator%=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator^=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator&=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator|=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator>>=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator<<=(const Vector<P_numtype2> &); - - // Vector expression operand - template<class P_expr> T_vector& operator=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator+=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator-=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator*=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator/=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator%=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator^=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator&=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator|=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator>>=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator<<=(_bz_VecExpr<P_expr>); - - // VectorPick operand - template<class P_numtype2> - T_vector& operator=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator+=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator-=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator*=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator/=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator%=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator^=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator&=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator|=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator>>=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator<<=(const VectorPick<P_numtype2> &); - - // Range operand - T_vector& operator=(Range); - T_vector& operator+=(Range); - T_vector& operator-=(Range); - T_vector& operator*=(Range); - T_vector& operator/=(Range); - T_vector& operator%=(Range); - T_vector& operator^=(Range); - T_vector& operator&=(Range); - T_vector& operator|=(Range); - T_vector& operator>>=(Range); - T_vector& operator<<=(Range); - - T_numtype* _bz_restrict getInitializationIterator() - { return dataFirst(); } - -private: - T_numtype data_[N_length]; -}; - - -// Specialization for N = 0: KCC is giving some -// peculiar errors, perhaps this will fix. - -template<class T> -class TinyVector<T,0> { -}; - -BZ_NAMESPACE_END - -#include <blitz/tinyveciter.h> // Iterators -#include <blitz/tvecglobs.h> // Global functions -#include <blitz/vector.h> // Expression templates -#include <blitz/tinyvec.cc> // Member functions -#include <blitz/tinyvecio.cc> // I/O functions - -#endif // BZ_TINYVEC_H - diff --git a/weave/blitz-20001213/blitz/tinyvecio.cc b/weave/blitz-20001213/blitz/tinyvecio.cc deleted file mode 100644 index 0328465c8..000000000 --- a/weave/blitz-20001213/blitz/tinyvecio.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_TINYVECIO_CC -#define BZ_TINYVECIO_CC - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -BZ_NAMESPACE(blitz) - -// NEEDS_WORK - -template<class P_numtype, int N_length> -ostream& operator<<(ostream& os, const TinyVector<P_numtype, N_length>& x) -{ - os << N_length << " [ "; - for (int i=0; i < N_length; ++i) - { - os << setw(10) << x[i]; - if (!((i+1)%7)) - os << endl << " "; - } - os << " ]"; - return os; -} - -// Input of tinyvec contribute by Adam Levar <adaml@mcneilhouse.com> -template <typename T_numtype, int N_length> -istream& operator>>(istream& is, TinyVector<T_numtype, N_length>& x) -{ - int length; - char sep; - - is >> length; - is >> sep; - BZPRECHECK(sep == '[', "Format error while scanning input array" - << endl << " (expected '[' before beginning of array data)"); - - BZPRECHECK(length == N_length, "Size mismatch"); - for (int i = 0; i < N_length; ++i) - { - BZPRECHECK(!is.bad(), "Premature end of input while scanning array"); - is >> x(i); - } - is >> sep; - BZPRECHECK(sep == ']', "Format error while scanning input array" - << endl << " (expected ']' after end of array data)"); - - return is; -} - -BZ_NAMESPACE_END - -#endif // BZ_TINYVECIO_CC diff --git a/weave/blitz-20001213/blitz/tinyveciter.h b/weave/blitz-20001213/blitz/tinyveciter.h deleted file mode 100644 index 09b9d3897..000000000 --- a/weave/blitz-20001213/blitz/tinyveciter.h +++ /dev/null @@ -1,179 +0,0 @@ -/*************************************************************************** - * blitz/tinyveciter.h Declaration of TinyVectorIter<T,N,stride> - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - - -#ifndef BZ_TINYVECITER_H -#define BZ_TINYVECITER_H - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - #error "Debug in tinyveciter.h (this line shouldn't be here)" -#endif - -BZ_NAMESPACE(blitz) - -// N_stride has default 1, in forward declaration in <blitz/tinyvec.h> -template<class P_numtype, int N_length, int N_stride> -class TinyVectorIter { -public: - typedef P_numtype T_numtype; - - _bz_explicit TinyVectorIter(TinyVector<T_numtype, N_length>& x) - : data_(x.data()) - { } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - TinyVectorIter(const TinyVectorIter<T_numtype, N_length, N_stride>& iter) - : data_(iter.data_) - { - } -#endif - - T_numtype operator[](unsigned i) const - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - T_numtype& _bz_restrict operator[](unsigned i) - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - T_numtype operator()(unsigned i) const - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - T_numtype& _bz_restrict operator()(unsigned i) - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - unsigned length(unsigned) const - { return N_length; } - - enum { _bz_staticLengthCount = 1, - _bz_dynamicLengthCount = 0, - _bz_staticLength = 0 }; - - _bz_bool _bz_hasFastAccess() const - { return _bz_true; } - - T_numtype _bz_fastAccess(unsigned i) const - { return data_[i * N_stride]; } - - T_numtype& _bz_fastAccess(unsigned i) - { return data_[i * N_stride]; } - - unsigned _bz_suggestLength() const - { return N_length; } - -private: - T_numtype * _bz_restrict data_; -}; - -// N_stride has default 1, in forward declaration in <blitz/tinyvec.h> -template<class P_numtype, int N_length, int N_stride> -class TinyVectorIterConst { -public: - typedef P_numtype T_numtype; - - _bz_explicit TinyVectorIterConst(const TinyVector<T_numtype, N_length>& x) - : data_(x.data()) - { } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - TinyVectorIterConst(const TinyVectorIterConst<T_numtype, N_length, - N_stride>& iter) - : data_(iter.data_) - { - } - - void operator=(const TinyVectorIterConst<T_numtype, N_length, N_stride>& - iter) - { - data_ = iter.data_; - } -#endif - - T_numtype operator[](unsigned i) const - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - T_numtype operator()(unsigned i) const - { - BZPRECONDITION(i < N_length); - return data_[i * N_stride]; - } - - unsigned length(unsigned) const - { return N_length; } - - enum { _bz_staticLengthCount = 1, - _bz_dynamicLengthCount = 0, - _bz_staticLength = 0 }; - - _bz_bool _bz_hasFastAccess() const - { return _bz_true; } - - T_numtype _bz_fastAccess(unsigned i) const - { return data_[i * N_stride]; } - - unsigned _bz_suggestLength() const - { return N_length; } - -private: - const T_numtype * _bz_restrict data_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_TINYVECITER_H diff --git a/weave/blitz-20001213/blitz/traversal.cc b/weave/blitz-20001213/blitz/traversal.cc deleted file mode 100644 index 581225cae..000000000 --- a/weave/blitz-20001213/blitz/traversal.cc +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef BZ_TRAVERSAL_CC -#define BZ_TRAVERSAL_CC - -#ifndef BZ_TRAVERSAL_H - #error <blitz/traversal.cc> must be included via <blitz/traversal.h> -#endif - -BZ_NAMESPACE(blitz) - -// Next line is a workaround for Intel C++ V4.0 oddity, due -// to Allan Stokes. - -#ifdef BZ_INTEL_KLUDGE - static set<TraversalOrder<2> > *_bz_intel_kludge; -#endif - -template<int N_dimensions> -_bz_typename TraversalOrderCollection<N_dimensions>::T_set - TraversalOrderCollection<N_dimensions>::traversals_; - -template<int N> -void makeHilbert(Vector<TinyVector<int,N> >& coord, - int x0, int y0, int xis, int xjs, - int yis, int yjs, int n, int& i) -{ - // N != 2 is not yet implemented. - BZPRECONDITION(N == 2); - - if (!n) - { - if (i > coord.length()) - { - cerr << "makeHilbert: vector not long enough" << endl; - exit(1); - } - coord[i][0] = x0 + (xis+yis)/2; - coord[i][1] = y0 + (xjs+yjs)/2; - ++i; - } - else { - makeHilbert(coord,x0,y0,yis/2, yjs/2, xis/2, xjs/2, n-1, i); - makeHilbert(coord,x0+xis/2,y0+xjs/2,xis/2,xjs/2,yis/2,yjs/2,n-1,i); - makeHilbert(coord,x0+xis/2+yis/2,y0+xjs/2+yjs/2,xis/2,xjs/2,yis/2, - yjs/2,n-1,i); - makeHilbert(coord,x0+xis/2+yis, y0+xjs/2+yjs, -yis/2,-yjs/2,-xis/2, - -xjs/2,n-1,i); - } -} - -template<int N_dimensions> -void MakeHilbertTraversal(Vector<TinyVector<int,N_dimensions> >& coord, - int length) -{ - // N_dimensions != 2 not yet implemented - BZPRECONDITION(N_dimensions == 2); - - // The constant on the next line is ln(2) - int d = (int)(::ceil(::log((double)length) / 0.693147180559945309417)); - - int N = 1 << d; - const int Npoints = N*N; - Vector<TinyVector<int,2> > coord2(Npoints); - - int i=0; - makeHilbert(coord2,0,0,32768,0,0,32768,d,i); - - int xp0 = coord2[0][0]; - int yp0 = coord2[0][1]; - - int j=0; - - coord.resize(length * length); - - for (int i=0; i < Npoints; ++i) - { - coord2[i][0] = (coord2[i][0]-xp0)/(2*xp0); - coord2[i][1] = (coord2[i][1]-yp0)/(2*yp0); - - if ((coord2[i][0] < length) && (coord2[i][1] < length) - && (coord2[i][0] >= 0) && (coord2[i][1] >= 0)) - { - coord[j][0] = coord2[i][0]; - coord[j][1] = coord2[i][1]; - ++j; - } - } -} - -template<int N_dimensions> -void generateFastTraversalOrder(const TinyVector<int,N_dimensions>& size) -{ - BZPRECONDITION(N_dimensions == 2); - BZPRECONDITION(size[0] == size[1]); - - TraversalOrderCollection<2> travCol; - if (travCol.find(size)) - return; - - Vector<TinyVector<int,2> > ordering(size[0]); - - MakeHilbertTraversal(ordering, size[0]); - travCol.insert(TraversalOrder<2>(size, ordering)); -} - -BZ_NAMESPACE_END - -#endif // BZ_TRAVERSAL_CC diff --git a/weave/blitz-20001213/blitz/traversal.h b/weave/blitz-20001213/blitz/traversal.h deleted file mode 100644 index 9077aa159..000000000 --- a/weave/blitz-20001213/blitz/traversal.h +++ /dev/null @@ -1,178 +0,0 @@ -/*************************************************************************** - * blitz/traversal.h Declaration of the TraversalOrder classes - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -// Fast traversal orders require the ISO/ANSI C++ standard library -// (particularly set). -#ifdef BZ_HAVE_STD - -#ifndef BZ_TRAVERSAL_H -#define BZ_TRAVERSAL_H - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -#include <set> - -BZ_NAMESPACE(blitz) - -template<int N_dimensions> -class TraversalOrder { - -public: - typedef TinyVector<int, N_dimensions> T_coord; - typedef Vector<T_coord> T_traversal; - - TraversalOrder() - { - size_ = 0; - } - - TraversalOrder(const T_coord& size, T_traversal& order) - : size_(size), order_(order) - { } - - TraversalOrder(const T_coord& size) - : size_(size) - { } - - T_coord operator[](int i) const - { return order_[i]; } - - T_coord& operator[](int i) - { return order_[i]; } - - int length() const - { return order_.length(); } - - bool operator<(const TraversalOrder<N_dimensions>& x) const - { - for (int i=0; i < N_dimensions; ++i) - { - if (size_[i] < x.size_[i]) - return true; - else if (size_[i] > x.size_[i]) - return false; - } - return false; - } - - bool operator==(const TraversalOrder<N_dimensions>& x) const - { - for (int i=0; i < N_dimensions; ++i) - { - if (size_[i] != x.size_[i]) - return false; - } - - return true; - } - -protected: - T_traversal order_; - T_coord size_; -}; - -/* - * This specialization is provided to avoid problems with zero-length - * vectors. - */ -template<> -class TraversalOrder<0> { -public: - TraversalOrder () {} // AJS -}; - -template<int N_dimensions> -class TraversalOrderCollection { -public: - typedef TraversalOrder<N_dimensions> T_traversal; - typedef _bz_typename T_traversal::T_coord T_coord; - typedef set<T_traversal> T_set; - typedef _bz_typename set<T_traversal>::const_iterator T_iterator; - - const T_traversal* find(const T_coord& size) - { - T_iterator iter = traversals_.find(T_traversal(size)); - if (iter != traversals_.end()) - return &(*iter); - return 0; - } - - void insert(T_traversal x) - { - traversals_.insert(x); - } - -protected: - static T_set traversals_; -}; - -/* - * This specialization is provided to avoid problems with zero-length - * vectors. - */ - -template<> -class TraversalOrderCollection<0> { -public: - typedef int T_traversal; - typedef int T_coord; - typedef int T_set; - typedef int T_iterator; - - const T_traversal* find(const T_coord& size) - { return 0; } -}; - -BZ_NAMESPACE_END - -#include <blitz/traversal.cc> - -#endif // BZ_TRAVERSAL_H - -#endif // BZ_HAVE_STD - diff --git a/weave/blitz-20001213/blitz/tuning.h b/weave/blitz-20001213/blitz/tuning.h deleted file mode 100644 index 852e87430..000000000 --- a/weave/blitz-20001213/blitz/tuning.h +++ /dev/null @@ -1,172 +0,0 @@ -/*************************************************************************** - * blitz/tuning.h Platform-specific code tuning - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.1 1996/11/11 17:29:13 tveldhui - * Initial revision - * - * - */ - -#ifndef BZ_TUNING_H -#define BZ_TUNING_H - -// These estimates should be conservative (i.e. underestimate the -// cache sizes). -#define BZ_L1_CACHE_ESTIMATED_SIZE 8192 -#define BZ_L2_CACHE_ESTIMATED_SIZE 65536 - - -#undef BZ_PARTIAL_LOOP_UNROLL -#define BZ_PASS_EXPR_BY_VALUE -#undef BZ_PTR_INC_FASTER_THAN_INDIRECTION -#define BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR -#undef BZ_KCC_COPY_PROPAGATION_KLUDGE -#undef BZ_ALTERNATE_FORWARD_BACKWARD_TRAVERSALS -#undef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE -#define BZ_INLINE_GROUP1 -#define BZ_INLINE_GROUP2 -#define BZ_COLLAPSE_LOOPS -#define BZ_USE_FAST_READ_ARRAY_EXPR -#define BZ_ARRAY_EXPR_USE_COMMON_STRIDE -#undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL -#undef BZ_ARRAY_STACK_TRAVERSAL_CSE_AND_ANTIALIAS -#undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL -#define BZ_ARRAY_2D_STENCIL_TILING -#define BZ_ARRAY_2D_STENCIL_TILE_SIZE 128 -#undef BZ_INTERLACE_ARRAYS -#undef BZ_ALIGN_BLOCKS_ON_CACHELINE_BOUNDARY -#define BZ_FAST_COMPILE - - -#ifndef BZ_DISABLE_NEW_ET - #define BZ_NEW_EXPRESSION_TEMPLATES -#endif - -#ifdef BZ_FAST_COMPILE -#define BZ_ETPARMS_CONSTREF -#define BZ_NO_INLINE_ET -#endif - -/* - * Platform-specific tuning - */ - -#ifdef _CRAYT3E - // The backend compiler on the T3E does a better job of - // loop unrolling. - #undef BZ_PARTIAL_LOOP_UNROLL - #undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL - #undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL -#endif - -#ifdef __GNUC__ - // The egcs compiler does a good job of loop unrolling, if - // -funroll-loops is used. - #undef BZ_PARTIAL_LOOP_UNROLL - #undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL - #undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL -#endif - -#ifdef BZ_DISABLE_KCC_COPY_PROPAGATION_KLUDGE - #undef BZ_KCC_COPY_PROPAGATION_KLUDGE -#endif - -#ifdef BZ_INLINE_GROUP1 - #define _bz_inline1 inline -#else - #define _bz_inline1 -#endif - -#ifdef BZ_INLINE_GROUP2 - #define _bz_inline2 inline -#else - #define _bz_inline2 -#endif - -#ifdef BZ_NO_INLINE_ET - #define _bz_inline_et -#else - #define _bz_inline_et inline -#endif - -#ifdef BZ_ETPARMS_CONSTREF - #define BZ_ETPARM(X) const X& -#else - #define BZ_ETPARM(X) X -#endif - -#ifdef __DECCXX - // The DEC cxx compiler has problems with loop unrolling - // because of aliasing. Loop unrolling and anti-aliasing - // is done by Blitz++. - - #define BZ_PARTIAL_LOOP_UNROLL - #define BZ_ARRAY_STACK_TRAVERSAL_CSE_AND_ANTIALIAS - #define BZ_ARRAY_STACK_TRAVERSAL_UNROLL -#endif - -/* - * BZ_NO_PROPAGATE(X) prevents the compiler from performing - * copy propagation on a variable. This is used for loop - * unrolling to prevent KAI C++ from rearranging the - * ordering of memory accesses. - */ - -#define BZ_NO_PROPAGATE(X) X - -#ifdef __KCC -#ifdef BZ_USE_NO_PROPAGATE - extern "C" int __kai_apply(const char*, ...); - - #undef BZ_NO_PROPAGATE(X) - #define BZ_NO_PROPAGATE(X) __kai_apply("(%a)",&X) -#endif -#endif - -#endif // BZ_TUNING_H diff --git a/weave/blitz-20001213/blitz/tvcross.h b/weave/blitz-20001213/blitz/tvcross.h deleted file mode 100644 index 7606d5b43..000000000 --- a/weave/blitz-20001213/blitz/tvcross.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * blitz/tvcross.h Cross product of TinyVector<N,3>'s - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.1 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -#ifndef BZ_TVCROSS_H -#define BZ_TVCROSS_H - -#ifndef BZ_TINYVEC_H - #error <blitz/tvcross.h> must be included via <blitz/tinyvec.h> -#endif - -BZ_NAMESPACE(blitz) - -/* - * cross product. - * - * NEEDS_WORK: - cross product of two different vector types - * - cross product involving expressions - */ - -template<class T_numtype> -TinyVector<T_numtype,3> cross(const TinyVector<T_numtype,3>& x, - const TinyVector<T_numtype,3>& y) -{ - return TinyVector<T_numtype,3>(x[1]*y[2] - y[1]*x[2], - y[0]*x[2] - x[0]*y[2], x[0]*y[1] - y[0]*x[1]); -} - - -BZ_NAMESPACE_END - -#endif // BZ_TVCROSS_H diff --git a/weave/blitz-20001213/blitz/tvecglobs.h b/weave/blitz-20001213/blitz/tvecglobs.h deleted file mode 100644 index 0eb383411..000000000 --- a/weave/blitz-20001213/blitz/tvecglobs.h +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************** - * blitz/tvecglobs.h TinyVector global functions - * - * $Id$ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_TVECGLOBS_H -#define BZ_TVECGLOBS_H - -#ifndef BZ_META_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -#include <blitz/tvcross.h> // Cross products -#include <blitz/meta/dot.h> -#include <blitz/meta/product.h> -#include <blitz/meta/sum.h> - -BZ_NAMESPACE(blitz) - -template<class T_numtype1, class T_numtype2, int N_length> -inline BZ_PROMOTE(T_numtype1, T_numtype2) -dot(const TinyVector<T_numtype1, N_length>& a, - const TinyVector<T_numtype2, N_length>& b) -{ - return _bz_meta_vectorDot<N_length, 0>::f(a,b); -} - -template<class T_expr1, class T_numtype2, int N_length> -inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, T_numtype2) -dot(_bz_VecExpr<T_expr1> a, const TinyVector<T_numtype2, N_length>& b) -{ - return _bz_meta_vectorDot<N_length, 0>::f_value_ref(a,b); -} - -template<class T_numtype1, class T_expr2, int N_length> -inline BZ_PROMOTE(T_numtype1, _bz_typename T_expr2::T_numtype) -dot(const TinyVector<T_numtype1, N_length>& a, _bz_VecExpr<T_expr2> b) -{ - return _bz_meta_vectorDot<N_length, 0>::f_ref_value(a,b); -} - -template<class T_numtype1, int N_length> -inline BZ_SUMTYPE(T_numtype1) -product(const TinyVector<T_numtype1, N_length>& a) -{ - return _bz_meta_vectorProduct<N_length, 0>::f(a); -} - -template<class T_numtype, int N_length> -inline T_numtype -sum(const TinyVector<T_numtype, N_length>& a) -{ - return _bz_meta_vectorSum<N_length, 0>::f(a); -} - -BZ_NAMESPACE_END - -#endif // BZ_TVECGLOBS_H - diff --git a/weave/blitz-20001213/blitz/update.h b/weave/blitz-20001213/blitz/update.h deleted file mode 100644 index dde941167..000000000 --- a/weave/blitz-20001213/blitz/update.h +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************** - * blitz/update.h Declaration of the _bz_XXXX updater classes - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_UPDATE_H -#define BZ_UPDATE_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -class _bz_updater_base { }; - -#define BZ_DECL_UPDATER(name,op,symbol) \ - template<class X, class Y> \ - class name : public _bz_updater_base { \ - public: \ - static inline void update(X& _bz_restrict x, Y y) \ - { x op y; } \ - static void prettyPrint(string& str) \ - { str += symbol; } \ - } - -template<class X, class Y> -class _bz_update : public _bz_updater_base { - public: - static inline void update(X& _bz_restrict x, Y y) - { x = (X)y; } - - static void prettyPrint(string& str) - { str += "="; } -}; - -BZ_DECL_UPDATER(_bz_plus_update, +=, "+="); -BZ_DECL_UPDATER(_bz_minus_update, -=, "-="); -BZ_DECL_UPDATER(_bz_multiply_update, *=, "*="); -BZ_DECL_UPDATER(_bz_divide_update, /=, "/="); -BZ_DECL_UPDATER(_bz_mod_update, %=, "%="); -BZ_DECL_UPDATER(_bz_xor_update, ^=, "^="); -BZ_DECL_UPDATER(_bz_bitand_update, &=, "&="); -BZ_DECL_UPDATER(_bz_bitor_update, |=, "|="); -BZ_DECL_UPDATER(_bz_shiftl_update, <<=, "<<="); -BZ_DECL_UPDATER(_bz_shiftr_update, >>=, ">>="); - -BZ_NAMESPACE_END - -#endif // BZ_UPDATE_H - diff --git a/weave/blitz-20001213/blitz/vecaccum.cc b/weave/blitz-20001213/blitz/vecaccum.cc deleted file mode 100644 index eceb0652d..000000000 --- a/weave/blitz-20001213/blitz/vecaccum.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECACCUM_CC -#define BZ_VECACCUM_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecaccum.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P> -inline -Vector<BZ_SUMTYPE(_bz_typename P::T_numtype)> _bz_vec_accumulate(P expr) -{ - typedef BZ_SUMTYPE(_bz_typename P::T_numtype) T_sumtype; - int length = expr._bz_suggestLength(); - Vector<T_sumtype> z(length); - T_sumtype sum = 0; - - if (expr._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - { - sum += expr._bz_fastAccess(i); - z[i] = sum; - } - } - else { - for (int i=0; i < length; ++i) - { - sum += expr(i); - z[i] = sum; - } - } - - return z; -} -template<class P_numtype> -Vector<BZ_SUMTYPE(P_numtype)> accumulate(const Vector<P_numtype>& x) -{ - return _bz_vec_accumulate(x); -} - -template<class P_expr> -Vector<BZ_SUMTYPE(_bz_typename P_expr::T_numtype)> -accumulate(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_accumulate(x); -} - -template<class P_numtype> -Vector<BZ_SUMTYPE(P_numtype)> accumulate(const VectorPick<P_numtype>& x) -{ - return _bz_vec_accumulate(x); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECACCUM_CC - diff --git a/weave/blitz-20001213/blitz/vecall.cc b/weave/blitz-20001213/blitz/vecall.cc deleted file mode 100644 index d38a45b4b..000000000 --- a/weave/blitz-20001213/blitz/vecall.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECALL_CC -#define BZ_VECALL_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecall.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline _bz_bool _bz_vec_all(P_expr vector) -{ - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - if (!vector._bz_fastAccess(i)) - return _bz_false; - } - else { - for (int i=0; i < length; ++i) - if (!vector[i]) - return _bz_false; - } - - return _bz_true; -} - -template<class P_numtype> -inline _bz_bool all(const Vector<P_numtype>& x) -{ - return _bz_vec_all(x._bz_asVecExpr()); -} - -template<class P_expr> -inline _bz_bool all(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_all(expr); -} - -template<class P_numtype> -inline _bz_bool all(const VectorPick<P_numtype>& x) -{ - return _bz_vec_all(x._bz_asVecExpr()); -} - -template<class P_numtype, int N_dimensions> -inline _bz_bool all(const TinyVector<P_numtype, N_dimensions>& x) -{ - return _bz_vec_all(x._bz_asVecExpr()); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECALL_CC - diff --git a/weave/blitz-20001213/blitz/vecany.cc b/weave/blitz-20001213/blitz/vecany.cc deleted file mode 100644 index 0f99bef8e..000000000 --- a/weave/blitz-20001213/blitz/vecany.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECANY_CC -#define BZ_VECANY_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecany.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline _bz_bool _bz_vec_any(P_expr vector) -{ - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - if (vector._bz_fastAccess(i)) - return _bz_true; - } - else { - for (int i=0; i < length; ++i) - if (vector[i]) - return _bz_true; - } - - return _bz_false; -} - -template<class P_numtype> -inline _bz_bool any(const Vector<P_numtype>& x) -{ - return _bz_vec_any(x._bz_asVecExpr()); -} - -template<class P_expr> -inline _bz_bool any(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_any(expr); -} - -template<class P_numtype> -inline _bz_bool any(const VectorPick<P_numtype>& x) -{ - return _bz_vec_any(x._bz_asVecExpr()); -} - -template<class P_numtype, int N_dimensions> -inline _bz_bool any(const TinyVector<P_numtype, N_dimensions>& x) -{ - return _bz_vec_any(x._bz_asVecExpr()); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECANY_CC - diff --git a/weave/blitz-20001213/blitz/vecbfn.cc b/weave/blitz-20001213/blitz/vecbfn.cc deleted file mode 100644 index 6b5fc98c4..000000000 --- a/weave/blitz-20001213/blitz/vecbfn.cc +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef BZ_VECBFN_H -#define BZ_VECBFN_H - -#ifndef BZ_VECEXPR_H - #error <blitz/vecbfn.h> must be included via <blitz/vecexpr.h> -#endif - -BZ_NAMESPACE(blitz) - -// Math functions with 2 operands have not yet been implemented. - -BZ_NAMESPACE_END - -#endif - diff --git a/weave/blitz-20001213/blitz/vecbops.cc b/weave/blitz-20001213/blitz/vecbops.cc deleted file mode 100644 index de2601599..000000000 --- a/weave/blitz-20001213/blitz/vecbops.cc +++ /dev/null @@ -1,17299 +0,0 @@ -/*************************************************************************** - * blitz/vecbops.cc Vector expression templates (2 operands) - * - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * Licensing inquiries: blitz-licenses@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - */ - -// Generated source file. Do not edit. -// genvecbops.cpp Aug 7 1997 15:15:07 - -#ifndef BZ_VECBOPS_CC -#define BZ_VECBOPS_CC - -#ifndef BZ_VECEXPR_H - #error <blitz/vecbops.cc> must be included via <blitz/vecexpr.h> -#endif - -BZ_NAMESPACE(blitz) - -/**************************************************************************** - * Addition Operators - ****************************************************************************/ - -// Vector<P_numtype1> + Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> + _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator+(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> + VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> + Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Add<P_numtype1, int > > > -operator+(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> + TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> + int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int > > > -operator+(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> + float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float > > > -operator+(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> + double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double > > > -operator+(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> + long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double > > > -operator+(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> + complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > > -operator+(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> + Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator+(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> + _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator+(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> + VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator+(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> + Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Add<_bz_typename P_expr1::T_numtype, int > > > -operator+(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Add<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> + TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator+(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> + int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Add<_bz_typename P_expr1::T_numtype, int > > > -operator+(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Add<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> + float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Add<_bz_typename P_expr1::T_numtype, float > > > -operator+(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Add<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> + double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Add<_bz_typename P_expr1::T_numtype, double > > > -operator+(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Add<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> + long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Add<_bz_typename P_expr1::T_numtype, long double > > > -operator+(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Add<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> + complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator+(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> + Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> + _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator+(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> + VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> + Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Add<P_numtype1, int > > > -operator+(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> + TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> + int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int > > > -operator+(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> + float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float > > > -operator+(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> + double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double > > > -operator+(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> + long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double > > > -operator+(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> + complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > > -operator+(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range + Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Add<int, P_numtype2 > > > -operator+(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range + _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Add<int, _bz_typename P_expr2::T_numtype > > > -operator+(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Add<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range + VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Add<int, P_numtype2 > > > -operator+(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range + Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Add<int, int > > > -operator+(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Add<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range + TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<int, P_numtype2 > > > -operator+(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range + float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Add<int, float > > > -operator+(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Add<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range + double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Add<int, double > > > -operator+(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Add<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range + long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Add<int, long double > > > -operator+(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Add<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range + complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<int, complex<T2> > > > -operator+(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> + Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> + _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Add<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> + VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> + Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Add<P_numtype1, int > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> + TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2 > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> + int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Add<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> + float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Add<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> + double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Add<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> + long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Add<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> + complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > > -operator+(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Add<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int + Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Add<int, P_numtype2 > > > -operator+(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int + _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Add<int, _bz_typename P_expr2::T_numtype > > > -operator+(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Add<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int + VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Add<int, P_numtype2 > > > -operator+(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int + TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<int, P_numtype2 > > > -operator+(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float + Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Add<float, P_numtype2 > > > -operator+(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Add<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float + _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Add<float, _bz_typename P_expr2::T_numtype > > > -operator+(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Add<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float + VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Add<float, P_numtype2 > > > -operator+(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Add<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float + Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Add<float, int > > > -operator+(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Add<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float + TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<float, P_numtype2 > > > -operator+(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double + Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Add<double, P_numtype2 > > > -operator+(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Add<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double + _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Add<double, _bz_typename P_expr2::T_numtype > > > -operator+(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Add<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double + VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Add<double, P_numtype2 > > > -operator+(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Add<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double + Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Add<double, int > > > -operator+(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Add<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double + TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<double, P_numtype2 > > > -operator+(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double + Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Add<long double, P_numtype2 > > > -operator+(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Add<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double + _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Add<long double, _bz_typename P_expr2::T_numtype > > > -operator+(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Add<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double + VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Add<long double, P_numtype2 > > > -operator+(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Add<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double + Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Add<long double, int > > > -operator+(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Add<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double + TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<long double, P_numtype2 > > > -operator+(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> + Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Add<complex<T1> , P_numtype2 > > > -operator+(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Add<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> + _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Add<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator+(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Add<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> + VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Add<complex<T1> , P_numtype2 > > > -operator+(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Add<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> + Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Add<complex<T1> , int > > > -operator+(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Add<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> + TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<complex<T1> , P_numtype2 > > > -operator+(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Add<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Subtraction Operators - ****************************************************************************/ - -// Vector<P_numtype1> - Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> - _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator-(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> - VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> - Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Subtract<P_numtype1, int > > > -operator-(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> - TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> - int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int > > > -operator-(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> - float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float > > > -operator-(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> - double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double > > > -operator-(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> - long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double > > > -operator-(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> - complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > > -operator-(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> - Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator-(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> - _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator-(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> - VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator-(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> - Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Subtract<_bz_typename P_expr1::T_numtype, int > > > -operator-(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Subtract<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> - TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator-(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> - int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, int > > > -operator-(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> - float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, float > > > -operator-(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> - double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, double > > > -operator-(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> - long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, long double > > > -operator-(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> - complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator-(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> - Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> - _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator-(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> - VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> - Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Subtract<P_numtype1, int > > > -operator-(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> - TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> - int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int > > > -operator-(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> - float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float > > > -operator-(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> - double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double > > > -operator-(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> - long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double > > > -operator-(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> - complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > > -operator-(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range - Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range - _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Subtract<int, _bz_typename P_expr2::T_numtype > > > -operator-(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Subtract<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range - VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range - Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Subtract<int, int > > > -operator-(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Subtract<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range - TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range - float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Subtract<int, float > > > -operator-(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Subtract<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range - double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Subtract<int, double > > > -operator-(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Subtract<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range - long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Subtract<int, long double > > > -operator-(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Subtract<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range - complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<int, complex<T2> > > > -operator-(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> - Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> - _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> - VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> - Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Subtract<P_numtype1, int > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> - TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2 > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> - int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Subtract<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> - float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Subtract<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> - double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Subtract<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> - long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Subtract<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> - complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > > -operator-(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Subtract<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int - Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int - _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<int, _bz_typename P_expr2::T_numtype > > > -operator-(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int - VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int - TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<int, P_numtype2 > > > -operator-(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float - Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Subtract<float, P_numtype2 > > > -operator-(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Subtract<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float - _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<float, _bz_typename P_expr2::T_numtype > > > -operator-(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float - VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<float, P_numtype2 > > > -operator-(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float - Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Subtract<float, int > > > -operator-(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Subtract<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float - TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<float, P_numtype2 > > > -operator-(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double - Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Subtract<double, P_numtype2 > > > -operator-(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Subtract<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double - _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<double, _bz_typename P_expr2::T_numtype > > > -operator-(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double - VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<double, P_numtype2 > > > -operator-(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double - Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Subtract<double, int > > > -operator-(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Subtract<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double - TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<double, P_numtype2 > > > -operator-(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double - Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Subtract<long double, P_numtype2 > > > -operator-(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Subtract<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double - _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<long double, _bz_typename P_expr2::T_numtype > > > -operator-(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Subtract<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double - VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<long double, P_numtype2 > > > -operator-(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Subtract<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double - Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Subtract<long double, int > > > -operator-(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Subtract<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double - TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<long double, P_numtype2 > > > -operator-(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> - Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Subtract<complex<T1> , P_numtype2 > > > -operator-(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Subtract<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> - _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Subtract<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator-(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Subtract<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> - VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Subtract<complex<T1> , P_numtype2 > > > -operator-(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Subtract<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> - Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Subtract<complex<T1> , int > > > -operator-(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Subtract<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> - TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<complex<T1> , P_numtype2 > > > -operator-(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Subtract<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Multiplication Operators - ****************************************************************************/ - -// Vector<P_numtype1> * Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> * _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator*(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> * VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> * Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Multiply<P_numtype1, int > > > -operator*(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> * TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> * int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int > > > -operator*(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> * float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float > > > -operator*(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> * double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double > > > -operator*(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> * long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double > > > -operator*(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> * complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > > -operator*(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> * Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator*(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> * _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator*(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> * VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator*(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> * Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Multiply<_bz_typename P_expr1::T_numtype, int > > > -operator*(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Multiply<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> * TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator*(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> * int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, int > > > -operator*(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> * float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, float > > > -operator*(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> * double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, double > > > -operator*(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> * long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, long double > > > -operator*(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> * complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator*(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> * Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> * _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator*(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> * VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> * Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Multiply<P_numtype1, int > > > -operator*(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> * TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> * int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int > > > -operator*(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> * float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float > > > -operator*(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> * double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double > > > -operator*(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> * long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double > > > -operator*(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> * complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > > -operator*(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range * Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range * _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Multiply<int, _bz_typename P_expr2::T_numtype > > > -operator*(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Multiply<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range * VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range * Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Multiply<int, int > > > -operator*(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Multiply<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range * TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range * float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Multiply<int, float > > > -operator*(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Multiply<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range * double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Multiply<int, double > > > -operator*(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Multiply<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range * long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Multiply<int, long double > > > -operator*(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Multiply<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range * complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<int, complex<T2> > > > -operator*(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> * Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> * _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> * VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> * Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Multiply<P_numtype1, int > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> * TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2 > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> * int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Multiply<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> * float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Multiply<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> * double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Multiply<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> * long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Multiply<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> * complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > > -operator*(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Multiply<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int * Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int * _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<int, _bz_typename P_expr2::T_numtype > > > -operator*(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int * VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int * TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<int, P_numtype2 > > > -operator*(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float * Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Multiply<float, P_numtype2 > > > -operator*(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Multiply<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float * _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<float, _bz_typename P_expr2::T_numtype > > > -operator*(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float * VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<float, P_numtype2 > > > -operator*(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float * Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Multiply<float, int > > > -operator*(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Multiply<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float * TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<float, P_numtype2 > > > -operator*(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double * Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Multiply<double, P_numtype2 > > > -operator*(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Multiply<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double * _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<double, _bz_typename P_expr2::T_numtype > > > -operator*(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double * VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<double, P_numtype2 > > > -operator*(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double * Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Multiply<double, int > > > -operator*(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Multiply<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double * TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<double, P_numtype2 > > > -operator*(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double * Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Multiply<long double, P_numtype2 > > > -operator*(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Multiply<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double * _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<long double, _bz_typename P_expr2::T_numtype > > > -operator*(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Multiply<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double * VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<long double, P_numtype2 > > > -operator*(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Multiply<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double * Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Multiply<long double, int > > > -operator*(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Multiply<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double * TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<long double, P_numtype2 > > > -operator*(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> * Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Multiply<complex<T1> , P_numtype2 > > > -operator*(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Multiply<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> * _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Multiply<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator*(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Multiply<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> * VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Multiply<complex<T1> , P_numtype2 > > > -operator*(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Multiply<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> * Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Multiply<complex<T1> , int > > > -operator*(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Multiply<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> * TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<complex<T1> , P_numtype2 > > > -operator*(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Multiply<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Division Operators - ****************************************************************************/ - -// Vector<P_numtype1> / Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> / _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator/(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> / VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> / Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Divide<P_numtype1, int > > > -operator/(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> / TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> / int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int > > > -operator/(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> / float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float > > > -operator/(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> / double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double > > > -operator/(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> / long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double > > > -operator/(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> / complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > > -operator/(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> / Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator/(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> / _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator/(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> / VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator/(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> / Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Divide<_bz_typename P_expr1::T_numtype, int > > > -operator/(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Divide<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> / TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator/(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> / int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Divide<_bz_typename P_expr1::T_numtype, int > > > -operator/(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Divide<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> / float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Divide<_bz_typename P_expr1::T_numtype, float > > > -operator/(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Divide<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> / double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, double > > > -operator/(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> / long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, long double > > > -operator/(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Divide<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> / complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator/(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> / Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> / _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator/(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> / VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> / Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Divide<P_numtype1, int > > > -operator/(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> / TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> / int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int > > > -operator/(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> / float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float > > > -operator/(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> / double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double > > > -operator/(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> / long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double > > > -operator/(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> / complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > > -operator/(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range / Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2 > > > -operator/(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range / _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Divide<int, _bz_typename P_expr2::T_numtype > > > -operator/(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Divide<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range / VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2 > > > -operator/(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range / Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Divide<int, int > > > -operator/(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Divide<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range / TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<int, P_numtype2 > > > -operator/(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range / float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Divide<int, float > > > -operator/(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Divide<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range / double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Divide<int, double > > > -operator/(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Divide<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range / long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Divide<int, long double > > > -operator/(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Divide<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range / complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<int, complex<T2> > > > -operator/(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> / Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> / _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Divide<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> / VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> / Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Divide<P_numtype1, int > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> / TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2 > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> / int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Divide<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> / float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Divide<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> / double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Divide<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> / long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Divide<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> / complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > > -operator/(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Divide<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int / Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2 > > > -operator/(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int / _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Divide<int, _bz_typename P_expr2::T_numtype > > > -operator/(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Divide<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int / VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2 > > > -operator/(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int / TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<int, P_numtype2 > > > -operator/(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float / Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Divide<float, P_numtype2 > > > -operator/(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Divide<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float / _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Divide<float, _bz_typename P_expr2::T_numtype > > > -operator/(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Divide<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float / VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<float, P_numtype2 > > > -operator/(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float / Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Divide<float, int > > > -operator/(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Divide<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float / TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<float, P_numtype2 > > > -operator/(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double / Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Divide<double, P_numtype2 > > > -operator/(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Divide<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double / _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Divide<double, _bz_typename P_expr2::T_numtype > > > -operator/(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Divide<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double / VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<double, P_numtype2 > > > -operator/(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double / Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Divide<double, int > > > -operator/(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Divide<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double / TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<double, P_numtype2 > > > -operator/(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double / Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Divide<long double, P_numtype2 > > > -operator/(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Divide<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double / _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Divide<long double, _bz_typename P_expr2::T_numtype > > > -operator/(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Divide<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double / VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<long double, P_numtype2 > > > -operator/(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Divide<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double / Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Divide<long double, int > > > -operator/(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Divide<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double / TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<long double, P_numtype2 > > > -operator/(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> / Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Divide<complex<T1> , P_numtype2 > > > -operator/(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Divide<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> / _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Divide<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator/(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Divide<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> / VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Divide<complex<T1> , P_numtype2 > > > -operator/(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Divide<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> / Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Divide<complex<T1> , int > > > -operator/(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Divide<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> / TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<complex<T1> , P_numtype2 > > > -operator/(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Divide<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Modulus Operators - ****************************************************************************/ - -// Vector<P_numtype1> % Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> % _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator%(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> % VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> % Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Mod<P_numtype1, int > > > -operator%(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> % TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> % int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int > > > -operator%(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> % Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator%(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> % _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator%(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> % VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator%(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> % Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Mod<_bz_typename P_expr1::T_numtype, int > > > -operator%(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Mod<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> % TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator%(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> % int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Mod<_bz_typename P_expr1::T_numtype, int > > > -operator%(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Mod<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> % Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> % _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator%(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> % VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> % Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Mod<P_numtype1, int > > > -operator%(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> % TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> % int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int > > > -operator%(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range % Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2 > > > -operator%(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range % _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Mod<int, _bz_typename P_expr2::T_numtype > > > -operator%(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Mod<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range % VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2 > > > -operator%(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range % Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Mod<int, int > > > -operator%(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Mod<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range % TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<int, P_numtype2 > > > -operator%(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> % Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> % _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Mod<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> % VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> % Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Mod<P_numtype1, int > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> % TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2 > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> % int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int > > > -operator%(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Mod<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int % Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2 > > > -operator%(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int % _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Mod<int, _bz_typename P_expr2::T_numtype > > > -operator%(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Mod<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int % VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2 > > > -operator%(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int % TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<int, P_numtype2 > > > -operator%(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Mod<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Bitwise XOR Operators - ****************************************************************************/ - -// Vector<P_numtype1> ^ Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> ^ _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator^(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> ^ VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> ^ Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> ^ TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> ^ int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> ^ Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator^(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> ^ _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator^(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> ^ VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator^(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> ^ Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int > > > -operator^(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> ^ TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator^(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> ^ int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int > > > -operator^(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> ^ Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> ^ _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator^(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> ^ VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> ^ Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> ^ TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> ^ int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range ^ Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range ^ _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype > > > -operator^(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range ^ VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range ^ Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_BitwiseXOR<int, int > > > -operator^(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_BitwiseXOR<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range ^ TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> ^ Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> ^ _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> ^ VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> ^ Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> ^ TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2 > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> ^ int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int > > > -operator^(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseXOR<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int ^ Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int ^ _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype > > > -operator^(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseXOR<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int ^ VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int ^ TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<int, P_numtype2 > > > -operator^(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseXOR<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Bitwise And Operators - ****************************************************************************/ - -// Vector<P_numtype1> & Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> & _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> & VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> & Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> & TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> & int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> & Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> & _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator&(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> & VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> & Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int > > > -operator&(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> & TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> & int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int > > > -operator&(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> & Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> & _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> & VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> & Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> & TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> & int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range & Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range & _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype > > > -operator&(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range & VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range & Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_BitwiseAnd<int, int > > > -operator&(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_BitwiseAnd<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range & TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> & Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> & _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> & VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> & Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> & TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2 > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> & int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int > > > -operator&(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int & Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int & _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype > > > -operator&(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int & VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int & TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<int, P_numtype2 > > > -operator&(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Bitwise Or Operators - ****************************************************************************/ - -// Vector<P_numtype1> | Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> | _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator|(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> | VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> | Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> | TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> | int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> | Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator|(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> | _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator|(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> | VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator|(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> | Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int > > > -operator|(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> | TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator|(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> | int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int > > > -operator|(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> | Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> | _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator|(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> | VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> | Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> | TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> | int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range | Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range | _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype > > > -operator|(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range | VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range | Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_BitwiseOr<int, int > > > -operator|(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_BitwiseOr<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range | TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> | Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> | _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> | VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> | Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> | TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2 > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> | int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int > > > -operator|(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_BitwiseOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int | Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int | _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype > > > -operator|(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_BitwiseOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int | VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int | TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<int, P_numtype2 > > > -operator|(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_BitwiseOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Shift right Operators - ****************************************************************************/ - -// Vector<P_numtype1> >> Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >> _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>>(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> >> VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >> Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> >> TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >> int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> >> Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>>(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >> _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator>>(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> >> VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>>(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >> Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int > > > -operator>>(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> >> TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>>(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >> int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int > > > -operator>>(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> >> Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >> _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>>(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> >> VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >> Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> >> TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >> int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range >> Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range >> _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype > > > -operator>>(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range >> VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range >> Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_ShiftRight<int, int > > > -operator>>(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_ShiftRight<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range >> TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >> Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >> _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> >> VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >> Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> >> TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2 > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >> int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int > > > -operator>>(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_ShiftRight<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int >> Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int >> _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype > > > -operator>>(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_ShiftRight<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int >> VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int >> TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<int, P_numtype2 > > > -operator>>(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftRight<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Shift left Operators - ****************************************************************************/ - -// Vector<P_numtype1> << Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> << _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<<(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> << VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> << Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> << TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> << int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> << Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<<(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> << _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator<<(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> << VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<<(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> << Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int > > > -operator<<(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> << TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<<(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> << int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int > > > -operator<<(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> << Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> << _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<<(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> << VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> << Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> << TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> << int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range << Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range << _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype > > > -operator<<(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range << VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range << Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_ShiftLeft<int, int > > > -operator<<(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_ShiftLeft<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range << TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> << Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> << _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> << VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> << Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> << TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2 > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> << int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int > > > -operator<<(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_ShiftLeft<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int << Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int << _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype > > > -operator<<(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_ShiftLeft<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int << VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int << TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<int, P_numtype2 > > > -operator<<(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_ShiftLeft<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Greater-than Operators - ****************************************************************************/ - -// Vector<P_numtype1> > Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> > _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> > VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> > Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Greater<P_numtype1, int > > > -operator>(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> > TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> > int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int > > > -operator>(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> > float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float > > > -operator>(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> > double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double > > > -operator>(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> > long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double > > > -operator>(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> > complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > > -operator>(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> > Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> > _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator>(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> > VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> > Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Greater<_bz_typename P_expr1::T_numtype, int > > > -operator>(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Greater<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> > TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> > int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Greater<_bz_typename P_expr1::T_numtype, int > > > -operator>(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Greater<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> > float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Greater<_bz_typename P_expr1::T_numtype, float > > > -operator>(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Greater<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> > double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, double > > > -operator>(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> > long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, long double > > > -operator>(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Greater<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> > complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator>(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> > Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> > _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> > VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> > Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Greater<P_numtype1, int > > > -operator>(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> > TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> > int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int > > > -operator>(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> > float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float > > > -operator>(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> > double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double > > > -operator>(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> > long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double > > > -operator>(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> > complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > > -operator>(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range > Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2 > > > -operator>(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range > _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Greater<int, _bz_typename P_expr2::T_numtype > > > -operator>(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Greater<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range > VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2 > > > -operator>(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range > Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Greater<int, int > > > -operator>(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Greater<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range > TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<int, P_numtype2 > > > -operator>(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range > float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Greater<int, float > > > -operator>(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Greater<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range > double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Greater<int, double > > > -operator>(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Greater<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range > long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Greater<int, long double > > > -operator>(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Greater<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range > complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<int, complex<T2> > > > -operator>(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> > Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> > _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Greater<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> > VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> > Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Greater<P_numtype1, int > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> > TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2 > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> > int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Greater<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> > float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Greater<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> > double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Greater<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> > long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Greater<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> > complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > > -operator>(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Greater<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int > Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2 > > > -operator>(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int > _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Greater<int, _bz_typename P_expr2::T_numtype > > > -operator>(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Greater<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int > VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2 > > > -operator>(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int > TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<int, P_numtype2 > > > -operator>(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float > Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Greater<float, P_numtype2 > > > -operator>(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Greater<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float > _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Greater<float, _bz_typename P_expr2::T_numtype > > > -operator>(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Greater<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float > VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<float, P_numtype2 > > > -operator>(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float > Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Greater<float, int > > > -operator>(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Greater<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float > TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<float, P_numtype2 > > > -operator>(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double > Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Greater<double, P_numtype2 > > > -operator>(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Greater<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double > _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Greater<double, _bz_typename P_expr2::T_numtype > > > -operator>(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Greater<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double > VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<double, P_numtype2 > > > -operator>(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double > Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Greater<double, int > > > -operator>(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Greater<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double > TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<double, P_numtype2 > > > -operator>(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double > Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Greater<long double, P_numtype2 > > > -operator>(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Greater<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double > _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Greater<long double, _bz_typename P_expr2::T_numtype > > > -operator>(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Greater<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double > VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<long double, P_numtype2 > > > -operator>(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Greater<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double > Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Greater<long double, int > > > -operator>(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Greater<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double > TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<long double, P_numtype2 > > > -operator>(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> > Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Greater<complex<T1> , P_numtype2 > > > -operator>(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Greater<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> > _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Greater<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator>(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Greater<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> > VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Greater<complex<T1> , P_numtype2 > > > -operator>(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Greater<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> > Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Greater<complex<T1> , int > > > -operator>(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Greater<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> > TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<complex<T1> , P_numtype2 > > > -operator>(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Greater<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Less-than Operators - ****************************************************************************/ - -// Vector<P_numtype1> < Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> < _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> < VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> < Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Less<P_numtype1, int > > > -operator<(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> < TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> < int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int > > > -operator<(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> < float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float > > > -operator<(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> < double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double > > > -operator<(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> < long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double > > > -operator<(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> < complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > > -operator<(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> < Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> < _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator<(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> < VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> < Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Less<_bz_typename P_expr1::T_numtype, int > > > -operator<(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Less<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> < TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> < int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Less<_bz_typename P_expr1::T_numtype, int > > > -operator<(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Less<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> < float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Less<_bz_typename P_expr1::T_numtype, float > > > -operator<(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Less<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> < double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Less<_bz_typename P_expr1::T_numtype, double > > > -operator<(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Less<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> < long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Less<_bz_typename P_expr1::T_numtype, long double > > > -operator<(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Less<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> < complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator<(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> < Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> < _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> < VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> < Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Less<P_numtype1, int > > > -operator<(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> < TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> < int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int > > > -operator<(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> < float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float > > > -operator<(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> < double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double > > > -operator<(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> < long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double > > > -operator<(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> < complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > > -operator<(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range < Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Less<int, P_numtype2 > > > -operator<(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range < _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Less<int, _bz_typename P_expr2::T_numtype > > > -operator<(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Less<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range < VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Less<int, P_numtype2 > > > -operator<(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range < Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Less<int, int > > > -operator<(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Less<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range < TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<int, P_numtype2 > > > -operator<(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range < float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Less<int, float > > > -operator<(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Less<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range < double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Less<int, double > > > -operator<(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Less<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range < long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Less<int, long double > > > -operator<(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Less<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range < complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<int, complex<T2> > > > -operator<(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> < Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> < _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Less<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> < VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> < Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Less<P_numtype1, int > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> < TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2 > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> < int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Less<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> < float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Less<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> < double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Less<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> < long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Less<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> < complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > > -operator<(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Less<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int < Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Less<int, P_numtype2 > > > -operator<(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int < _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Less<int, _bz_typename P_expr2::T_numtype > > > -operator<(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Less<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int < VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Less<int, P_numtype2 > > > -operator<(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int < TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<int, P_numtype2 > > > -operator<(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float < Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Less<float, P_numtype2 > > > -operator<(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Less<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float < _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Less<float, _bz_typename P_expr2::T_numtype > > > -operator<(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Less<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float < VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Less<float, P_numtype2 > > > -operator<(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Less<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float < Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Less<float, int > > > -operator<(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Less<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float < TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<float, P_numtype2 > > > -operator<(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double < Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Less<double, P_numtype2 > > > -operator<(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Less<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double < _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Less<double, _bz_typename P_expr2::T_numtype > > > -operator<(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Less<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double < VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Less<double, P_numtype2 > > > -operator<(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Less<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double < Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Less<double, int > > > -operator<(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Less<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double < TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<double, P_numtype2 > > > -operator<(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double < Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Less<long double, P_numtype2 > > > -operator<(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Less<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double < _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Less<long double, _bz_typename P_expr2::T_numtype > > > -operator<(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Less<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double < VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Less<long double, P_numtype2 > > > -operator<(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Less<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double < Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Less<long double, int > > > -operator<(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Less<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double < TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<long double, P_numtype2 > > > -operator<(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> < Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Less<complex<T1> , P_numtype2 > > > -operator<(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Less<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> < _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Less<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator<(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Less<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> < VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Less<complex<T1> , P_numtype2 > > > -operator<(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Less<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> < Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Less<complex<T1> , int > > > -operator<(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Less<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> < TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<complex<T1> , P_numtype2 > > > -operator<(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Less<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Greater or equal (>=) operators - ****************************************************************************/ - -// Vector<P_numtype1> >= Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >= _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>=(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> >= VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >= Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> >= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> >= int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> >= float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float > > > -operator>=(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> >= double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double > > > -operator>=(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> >= long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double > > > -operator>=(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> >= complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > > -operator>=(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> >= Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>=(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >= _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator>=(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> >= VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>=(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >= Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int > > > -operator>=(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> >= TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator>=(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> >= int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int > > > -operator>=(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> >= float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, float > > > -operator>=(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> >= double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, double > > > -operator>=(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> >= long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double > > > -operator>=(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> >= complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator>=(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> >= Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >= _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>=(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> >= VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >= Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> >= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> >= int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> >= float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float > > > -operator>=(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> >= double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double > > > -operator>=(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> >= long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double > > > -operator>=(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> >= complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > > -operator>=(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range >= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range >= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype > > > -operator>=(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range >= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range >= Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_GreaterOrEqual<int, int > > > -operator>=(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_GreaterOrEqual<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range >= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range >= float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<int, float > > > -operator>=(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range >= double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<int, double > > > -operator>=(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range >= long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<int, long double > > > -operator>=(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range >= complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<int, complex<T2> > > > -operator>=(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> >= Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >= _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> >= VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >= Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> >= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2 > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> >= int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_GreaterOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> >= float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_GreaterOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> >= double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_GreaterOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> >= long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_GreaterOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> >= complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > > -operator>=(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_GreaterOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int >= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int >= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype > > > -operator>=(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int >= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int >= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<int, P_numtype2 > > > -operator>=(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float >= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<float, P_numtype2 > > > -operator>=(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float >= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<float, _bz_typename P_expr2::T_numtype > > > -operator>=(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float >= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<float, P_numtype2 > > > -operator>=(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float >= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_GreaterOrEqual<float, int > > > -operator>=(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_GreaterOrEqual<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float >= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<float, P_numtype2 > > > -operator>=(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double >= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<double, P_numtype2 > > > -operator>=(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double >= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<double, _bz_typename P_expr2::T_numtype > > > -operator>=(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double >= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<double, P_numtype2 > > > -operator>=(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double >= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_GreaterOrEqual<double, int > > > -operator>=(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_GreaterOrEqual<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double >= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<double, P_numtype2 > > > -operator>=(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double >= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<long double, P_numtype2 > > > -operator>=(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double >= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype > > > -operator>=(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double >= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<long double, P_numtype2 > > > -operator>=(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double >= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_GreaterOrEqual<long double, int > > > -operator>=(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_GreaterOrEqual<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double >= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<long double, P_numtype2 > > > -operator>=(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> >= Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2 > > > -operator>=(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> >= _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator>=(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_GreaterOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> >= VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2 > > > -operator>=(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> >= Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_GreaterOrEqual<complex<T1> , int > > > -operator>=(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_GreaterOrEqual<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> >= TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2 > > > -operator>=(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_GreaterOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Less or equal (<=) operators - ****************************************************************************/ - -// Vector<P_numtype1> <= Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> <= _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<=(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> <= VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> <= Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> <= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> <= int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> <= float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float > > > -operator<=(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> <= double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double > > > -operator<=(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> <= long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double > > > -operator<=(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> <= complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > > -operator<=(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> <= Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<=(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> <= _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator<=(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> <= VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<=(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> <= Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int > > > -operator<=(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> <= TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator<=(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> <= int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int > > > -operator<=(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> <= float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, float > > > -operator<=(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> <= double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, double > > > -operator<=(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> <= long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, long double > > > -operator<=(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> <= complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator<=(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> <= Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> <= _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<=(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> <= VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> <= Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> <= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> <= int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> <= float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float > > > -operator<=(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> <= double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double > > > -operator<=(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> <= long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double > > > -operator<=(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> <= complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > > -operator<=(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range <= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range <= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype > > > -operator<=(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range <= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range <= Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_LessOrEqual<int, int > > > -operator<=(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_LessOrEqual<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range <= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range <= float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<int, float > > > -operator<=(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range <= double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<int, double > > > -operator<=(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range <= long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<int, long double > > > -operator<=(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range <= complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<int, complex<T2> > > > -operator<=(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> <= Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> <= _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> <= VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> <= Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> <= TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2 > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> <= int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LessOrEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> <= float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_LessOrEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> <= double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_LessOrEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> <= long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_LessOrEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> <= complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > > -operator<=(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_LessOrEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int <= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int <= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype > > > -operator<=(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int <= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int <= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<int, P_numtype2 > > > -operator<=(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float <= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<float, P_numtype2 > > > -operator<=(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float <= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<float, _bz_typename P_expr2::T_numtype > > > -operator<=(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float <= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<float, P_numtype2 > > > -operator<=(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float <= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_LessOrEqual<float, int > > > -operator<=(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_LessOrEqual<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float <= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<float, P_numtype2 > > > -operator<=(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double <= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<double, P_numtype2 > > > -operator<=(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double <= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<double, _bz_typename P_expr2::T_numtype > > > -operator<=(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double <= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<double, P_numtype2 > > > -operator<=(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double <= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_LessOrEqual<double, int > > > -operator<=(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_LessOrEqual<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double <= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<double, P_numtype2 > > > -operator<=(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double <= Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<long double, P_numtype2 > > > -operator<=(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double <= _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<long double, _bz_typename P_expr2::T_numtype > > > -operator<=(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double <= VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<long double, P_numtype2 > > > -operator<=(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double <= Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_LessOrEqual<long double, int > > > -operator<=(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_LessOrEqual<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double <= TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<long double, P_numtype2 > > > -operator<=(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> <= Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<complex<T1> , P_numtype2 > > > -operator<=(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_LessOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> <= _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator<=(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_LessOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> <= VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<complex<T1> , P_numtype2 > > > -operator<=(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_LessOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> <= Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_LessOrEqual<complex<T1> , int > > > -operator<=(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_LessOrEqual<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> <= TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<complex<T1> , P_numtype2 > > > -operator<=(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LessOrEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Equality operators - ****************************************************************************/ - -// Vector<P_numtype1> == Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> == _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator==(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> == VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> == Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Equal<P_numtype1, int > > > -operator==(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> == TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> == int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int > > > -operator==(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> == float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float > > > -operator==(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> == double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double > > > -operator==(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> == long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double > > > -operator==(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> == complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > > -operator==(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> == Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator==(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> == _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator==(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> == VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator==(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> == Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Equal<_bz_typename P_expr1::T_numtype, int > > > -operator==(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_Equal<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> == TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator==(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> == int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Equal<_bz_typename P_expr1::T_numtype, int > > > -operator==(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_Equal<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> == float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Equal<_bz_typename P_expr1::T_numtype, float > > > -operator==(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_Equal<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> == double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, double > > > -operator==(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> == long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, long double > > > -operator==(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_Equal<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> == complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator==(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> == Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> == _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator==(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> == VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> == Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Equal<P_numtype1, int > > > -operator==(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> == TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> == int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int > > > -operator==(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> == float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float > > > -operator==(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> == double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double > > > -operator==(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> == long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double > > > -operator==(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> == complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > > -operator==(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range == Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2 > > > -operator==(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range == _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Equal<int, _bz_typename P_expr2::T_numtype > > > -operator==(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_Equal<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range == VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2 > > > -operator==(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range == Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_Equal<int, int > > > -operator==(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_Equal<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range == TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<int, P_numtype2 > > > -operator==(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range == float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Equal<int, float > > > -operator==(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_Equal<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range == double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Equal<int, double > > > -operator==(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_Equal<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range == long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Equal<int, long double > > > -operator==(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_Equal<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range == complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<int, complex<T2> > > > -operator==(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> == Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> == _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_Equal<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> == VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> == Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Equal<P_numtype1, int > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> == TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2 > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> == int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_Equal<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> == float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_Equal<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> == double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_Equal<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> == long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_Equal<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> == complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > > -operator==(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_Equal<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int == Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2 > > > -operator==(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int == _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Equal<int, _bz_typename P_expr2::T_numtype > > > -operator==(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_Equal<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int == VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2 > > > -operator==(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int == TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<int, P_numtype2 > > > -operator==(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float == Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Equal<float, P_numtype2 > > > -operator==(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_Equal<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float == _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Equal<float, _bz_typename P_expr2::T_numtype > > > -operator==(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_Equal<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float == VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<float, P_numtype2 > > > -operator==(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float == Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Equal<float, int > > > -operator==(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_Equal<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float == TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<float, P_numtype2 > > > -operator==(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double == Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Equal<double, P_numtype2 > > > -operator==(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_Equal<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double == _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Equal<double, _bz_typename P_expr2::T_numtype > > > -operator==(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_Equal<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double == VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<double, P_numtype2 > > > -operator==(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double == Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Equal<double, int > > > -operator==(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_Equal<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double == TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<double, P_numtype2 > > > -operator==(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double == Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Equal<long double, P_numtype2 > > > -operator==(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_Equal<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double == _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Equal<long double, _bz_typename P_expr2::T_numtype > > > -operator==(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_Equal<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double == VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<long double, P_numtype2 > > > -operator==(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_Equal<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double == Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Equal<long double, int > > > -operator==(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_Equal<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double == TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<long double, P_numtype2 > > > -operator==(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> == Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Equal<complex<T1> , P_numtype2 > > > -operator==(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_Equal<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> == _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Equal<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator==(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_Equal<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> == VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Equal<complex<T1> , P_numtype2 > > > -operator==(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_Equal<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> == Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Equal<complex<T1> , int > > > -operator==(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_Equal<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> == TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<complex<T1> , P_numtype2 > > > -operator==(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_Equal<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Not-equal operators - ****************************************************************************/ - -// Vector<P_numtype1> != Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> != _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator!=(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> != VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> != Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> != TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> != int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Vector<P_numtype1> != float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float > > > -operator!=(const Vector<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// Vector<P_numtype1> != double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double > > > -operator!=(const Vector<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// Vector<P_numtype1> != long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double > > > -operator!=(const Vector<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Vector<P_numtype1> != complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > > -operator!=(const Vector<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// _bz_VecExpr<P_expr1> != Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator!=(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> != _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator!=(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> != VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator!=(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> != Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, int > > > -operator!=(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> != TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator!=(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> != int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, int > > > -operator!=(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> != float -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, float > > > -operator!=(_bz_VecExpr<P_expr1> d1, - float d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// _bz_VecExpr<P_expr1> != double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, double > > > -operator!=(_bz_VecExpr<P_expr1> d1, - double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// _bz_VecExpr<P_expr1> != long double -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, long double > > > -operator!=(_bz_VecExpr<P_expr1> d1, - long double d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<_bz_typename P_expr1::T_numtype, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// _bz_VecExpr<P_expr1> != complex<T2> -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > > -operator!=(_bz_VecExpr<P_expr1> d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<_bz_typename P_expr1::T_numtype, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// VectorPick<P_numtype1> != Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> != _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator!=(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> != VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> != Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> != TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> != int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> != float -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float > > > -operator!=(const VectorPick<P_numtype1>& d1, - float d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// VectorPick<P_numtype1> != double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double > > > -operator!=(const VectorPick<P_numtype1>& d1, - double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// VectorPick<P_numtype1> != long double -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double > > > -operator!=(const VectorPick<P_numtype1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// VectorPick<P_numtype1> != complex<T2> -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > > -operator!=(const VectorPick<P_numtype1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// Range != Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range != _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<int, _bz_typename P_expr2::T_numtype > > > -operator!=(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range != VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range != Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_NotEqual<int, int > > > -operator!=(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_NotEqual<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range != TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range != float - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_NotEqual<int, float > > > -operator!=(Range d1, - float d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<float>, - _bz_NotEqual<int, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2))); -} - -// Range != double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_NotEqual<int, double > > > -operator!=(Range d1, - double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<double>, - _bz_NotEqual<int, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2))); -} - -// Range != long double - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_NotEqual<int, long double > > > -operator!=(Range d1, - long double d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<long double>, - _bz_NotEqual<int, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// Range != complex<T2> -template<class T2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<int, complex<T2> > > > -operator!=(Range d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<int, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// TinyVector<P_numtype1, N_length1> != Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> != _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> != VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> != Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> != TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2 > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> != int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_NotEqual<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// TinyVector<P_numtype1, N_length1> != float -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - float d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_NotEqual<P_numtype1, float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2))); -} - -// TinyVector<P_numtype1, N_length1> != double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_NotEqual<P_numtype1, double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2))); -} - -// TinyVector<P_numtype1, N_length1> != long double -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - long double d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_NotEqual<P_numtype1, long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2))); -} -#ifdef BZ_HAVE_COMPLEX - -// TinyVector<P_numtype1, N_length1> != complex<T2> -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > > -operator!=(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_NotEqual<P_numtype1, complex<T2> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2))); -} -#endif // BZ_HAVE_COMPLEX - - -// int != Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int != _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<int, _bz_typename P_expr2::T_numtype > > > -operator!=(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int != VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int != TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<int, P_numtype2 > > > -operator!=(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// float != Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<float, P_numtype2 > > > -operator!=(float d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float != _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<float, _bz_typename P_expr2::T_numtype > > > -operator!=(float d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<float, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float != VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<float, P_numtype2 > > > -operator!=(float d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// float != Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_NotEqual<float, int > > > -operator!=(float d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - Range, - _bz_NotEqual<float, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2)); -} - -// float != TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<float, P_numtype2 > > > -operator!=(float d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<float, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<float>(d1), - d2.begin())); -} - -// double != Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<double, P_numtype2 > > > -operator!=(double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double != _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<double, _bz_typename P_expr2::T_numtype > > > -operator!=(double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double != VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<double, P_numtype2 > > > -operator!=(double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// double != Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_NotEqual<double, int > > > -operator!=(double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - Range, - _bz_NotEqual<double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2)); -} - -// double != TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<double, P_numtype2 > > > -operator!=(double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<double>(d1), - d2.begin())); -} - -// long double != Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<long double, P_numtype2 > > > -operator!=(long double d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorIterConst<P_numtype2>, - _bz_NotEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double != _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<long double, _bz_typename P_expr2::T_numtype > > > -operator!=(long double d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr2>, - _bz_NotEqual<long double, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double != VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<long double, P_numtype2 > > > -operator!=(long double d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} - -// long double != Range - -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_NotEqual<long double, int > > > -operator!=(long double d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - Range, - _bz_NotEqual<long double, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2)); -} - -// long double != TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<long double, P_numtype2 > > > -operator!=(long double d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<long double, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<long double>(d1), - d2.begin())); -} -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> != Vector<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_NotEqual<complex<T1> , P_numtype2 > > > -operator!=(complex<T1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorIterConst<P_numtype2>, - _bz_NotEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> != _bz_VecExpr<P_expr2> -template<class T1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_NotEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > > -operator!=(complex<T1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - _bz_VecExpr<P_expr2>, - _bz_NotEqual<complex<T1> , _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> != VectorPick<P_numtype2> -template<class T1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<complex<T1> , P_numtype2 > > > -operator!=(complex<T1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - VectorPickIterConst<P_numtype2>, - _bz_NotEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> != Range -template<class T1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_NotEqual<complex<T1> , int > > > -operator!=(complex<T1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - Range, - _bz_NotEqual<complex<T1> , int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2)); -} -#endif // BZ_HAVE_COMPLEX - -#ifdef BZ_HAVE_COMPLEX - -// complex<T1> != TinyVector<P_numtype2, N_length2> -template<class T1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<complex<T1> , P_numtype2 > > > -operator!=(complex<T1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<complex<T1> > , - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_NotEqual<complex<T1> , P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<complex<T1> > (d1), - d2.begin())); -} -#endif // BZ_HAVE_COMPLEX - -/**************************************************************************** - * Logical AND operators - ****************************************************************************/ - -// Vector<P_numtype1> && Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> && _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&&(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> && VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> && Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> && TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> && int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> && Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&&(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> && _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator&&(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> && VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&&(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> && Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int > > > -operator&&(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> && TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator&&(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> && int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int > > > -operator&&(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> && Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> && _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&&(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> && VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> && Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> && TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> && int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range && Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range && _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype > > > -operator&&(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range && VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range && Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_LogicalAnd<int, int > > > -operator&&(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_LogicalAnd<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range && TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> && Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> && _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> && VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> && Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> && TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2 > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> && int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int > > > -operator&&(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LogicalAnd<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int && Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int && _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype > > > -operator&&(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LogicalAnd<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int && VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int && TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<int, P_numtype2 > > > -operator&&(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalAnd<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -/**************************************************************************** - * Logical OR operators - ****************************************************************************/ - -// Vector<P_numtype1> || Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> || _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator||(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> || VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> || Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const Vector<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - Range, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// Vector<P_numtype1> || TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// Vector<P_numtype1> || int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const Vector<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// _bz_VecExpr<P_expr1> || Vector<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator||(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> || _bz_VecExpr<P_expr2> -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > > -operator||(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> || VectorPick<P_numtype2> -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator||(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> || Range -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int > > > -operator||(_bz_VecExpr<P_expr1> d1, - Range d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - Range, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// _bz_VecExpr<P_expr1> || TinyVector<P_numtype2, N_length2> -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2 > > > -operator||(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// _bz_VecExpr<P_expr1> || int -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int > > > -operator||(_bz_VecExpr<P_expr1> d1, - int d2) -{ - typedef _bz_VecExprOp<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<_bz_typename P_expr1::T_numtype, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2))); -} - -// VectorPick<P_numtype1> || Vector<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> || _bz_VecExpr<P_expr2> -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator||(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> || VectorPick<P_numtype2> -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> || Range -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const VectorPick<P_numtype1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - Range, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// VectorPick<P_numtype1> || TinyVector<P_numtype2, N_length2> -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// VectorPick<P_numtype1> || int -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const VectorPick<P_numtype1>& d1, - int d2) -{ - typedef _bz_VecExprOp<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// Range || Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(Range d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range || _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype > > > -operator||(Range d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<Range, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range || VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(Range d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<Range, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// Range || Range - -inline -_bz_VecExpr<_bz_VecExprOp<Range, - Range, - _bz_LogicalOr<int, int > > > -operator||(Range d1, - Range d2) -{ - typedef _bz_VecExprOp<Range, - Range, - _bz_LogicalOr<int, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2)); -} - -// Range || TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(Range d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> || Vector<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> || _bz_VecExpr<P_expr2> -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<P_numtype1, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> || VectorPick<P_numtype2> -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> || Range -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - Range d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2)); -} - -// TinyVector<P_numtype1, N_length1> || TinyVector<P_numtype2, N_length2> -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2 > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<P_numtype1, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin())); -} - -// TinyVector<P_numtype1, N_length1> || int -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int > > > -operator||(const TinyVector<P_numtype1, N_length1>& d1, - int d2) -{ - typedef _bz_VecExprOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_LogicalOr<P_numtype1, int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2))); -} - -// int || Vector<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(int d1, - const Vector<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int || _bz_VecExpr<P_expr2> -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype > > > -operator||(int d1, - _bz_VecExpr<P_expr2> d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - _bz_VecExpr<P_expr2>, - _bz_LogicalOr<int, _bz_typename P_expr2::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2)); -} - -// int || VectorPick<P_numtype2> -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(int d1, - const VectorPick<P_numtype2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} - -// int || TinyVector<P_numtype2, N_length2> -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<int, P_numtype2 > > > -operator||(int d1, - const TinyVector<P_numtype2, N_length2>& d2) -{ - typedef _bz_VecExprOp<_bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_LogicalOr<int, P_numtype2> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(_bz_VecExprConstant<int>(d1), - d2.begin())); -} -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/veccount.cc b/weave/blitz-20001213/blitz/veccount.cc deleted file mode 100644 index f1453992a..000000000 --- a/weave/blitz-20001213/blitz/veccount.cc +++ /dev/null @@ -1,83 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_VECCOUNT_CC -#define BZ_VECCOUNT_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/veccount.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline int _bz_vec_count(P_expr vector) -{ - int length = vector._bz_suggestLength(); - int count = 0; - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - if (vector._bz_fastAccess(i)) - ++count; - } - else { - for (int i=0; i < length; ++i) - if (vector[i]) - ++count; - } - - return count; -} - -template<class P_numtype> -inline int count(const Vector<P_numtype>& x) -{ - return _bz_vec_count(x._bz_asVecExpr()); -} - -template<class P_expr> -inline int count(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_count(expr); -} - -template<class P_numtype> -inline int count(const VectorPick<P_numtype>& x) -{ - return _bz_vec_count(x._bz_asVecExpr()); -} - -template<class P_numtype, int N_dimensions> -inline int count(const TinyVector<P_numtype, N_dimensions>& x) -{ - return _bz_vec_count(x._bz_asVecExpr()); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECCOUNT_CC - diff --git a/weave/blitz-20001213/blitz/vecdelta.cc b/weave/blitz-20001213/blitz/vecdelta.cc deleted file mode 100644 index 4aa235122..000000000 --- a/weave/blitz-20001213/blitz/vecdelta.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECDELTA_CC -#define BZ_VECDELTA_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecdelta.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P> -inline -Vector<BZ_DIFFTYPE(_bz_typename P::T_numtype)> _bz_vec_delta(P expr) -{ - typedef _bz_typename P::T_numtype T_numtype; - typedef BZ_DIFFTYPE(T_numtype) T_difftype; - - int length = expr._bz_suggestLength(); - Vector<T_difftype> z(length); - T_numtype currentElement = 0; - T_numtype previousElement = 0; - - if (expr._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - { - currentElement = expr._bz_fastAccess(i); - z[i] = currentElement - previousElement; - previousElement = currentElement; - } - } - else { - for (int i=1; i < length; ++i) - { - currentElement = expr(i); - z[i] = currentElement - previousElement; - previousElement = currentElement; - } - } - - return z; -} - -template<class P_numtype> -Vector<BZ_DIFFTYPE(P_numtype)> delta(const Vector<P_numtype>& x) -{ - return _bz_vec_delta(x); -} - -// delta(expr) -template<class P_expr> -Vector<BZ_DIFFTYPE(_bz_typename P_expr::T_numtype)> delta(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_delta(x); -} - -// delta(vecpick) -template<class P_numtype> -Vector<BZ_DIFFTYPE(P_numtype)> delta(const VectorPick<P_numtype>& x) -{ - return _bz_vec_delta(x); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECDELTA_CC - diff --git a/weave/blitz-20001213/blitz/vecdot.cc b/weave/blitz-20001213/blitz/vecdot.cc deleted file mode 100644 index 10f36a238..000000000 --- a/weave/blitz-20001213/blitz/vecdot.cc +++ /dev/null @@ -1,151 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECDOT_CC -#define BZ_VECDOT_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecdot.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P1, class P2> -inline -BZ_SUMTYPE(BZ_PROMOTE(_bz_typename P1::T_numtype, _bz_typename P2::T_numtype)) -_bz_dot(P1 vector1, P2 vector2) -{ - BZPRECONDITION(vector1._bz_suggestLength() == vector2._bz_suggestLength()); - - typedef BZ_SUMTYPE(BZ_PROMOTE(_bz_typename P1::T_numtype, - _bz_typename P2::T_numtype)) T_sumtype; - - T_sumtype sum = 0; - int length = vector1._bz_suggestLength(); - - if (vector1._bz_hasFastAccess() && vector2._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - sum += vector1._bz_fastAccess(i) - * vector2._bz_fastAccess(i); - } - else { - for (int i=0; i < length; ++i) - sum += vector1[i] * vector2[i]; - } - - return sum; -} - - -// dot() -template<class P_numtype1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1,P_numtype2)) -dot(const Vector<P_numtype1>& a, const Vector<P_numtype2>& b) -{ - return _bz_dot(a, b); -} - -// dot(expr,expr) -template<class P_expr1, class P_expr2> -inline -BZ_SUMTYPE(BZ_PROMOTE(_bz_typename P_expr1::T_numtype, - _bz_typename P_expr2::T_numtype)) -dot(_bz_VecExpr<P_expr1> expr1, _bz_VecExpr<P_expr2> expr2) -{ - return _bz_dot(expr1, expr2); -} - -// dot(expr,vec) -template<class P_expr1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(_bz_typename P_expr1::T_numtype, P_numtype2)) -dot(_bz_VecExpr<P_expr1> expr1, const Vector<P_numtype2>& vector2) -{ - return _bz_dot(vector2, expr1); -} - -// dot(vec,expr) -template<class P_numtype1, class P_expr2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1, _bz_typename P_expr2::T_numtype)) -dot(const Vector<P_numtype1>& vector1, _bz_VecExpr<P_expr2> expr2) -{ - return _bz_dot(vector1, expr2); -} - -// dot(vec,vecpick) -template<class P_numtype1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1, P_numtype2)) -dot(const Vector<P_numtype1>& vector1, const VectorPick<P_numtype2>& vector2) -{ - return _bz_dot(vector1, vector2); -} - -// dot(vecpick,vec) -template<class P_numtype1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1, P_numtype2)) -dot(const VectorPick<P_numtype1>& vector1, const Vector<P_numtype2>& vector2) -{ - return _bz_dot(vector1, vector2); -} - -// dot(vecpick,vecpick) -template<class P_numtype1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1, P_numtype2)) -dot(const VectorPick<P_numtype1>& vector1, const VectorPick<P_numtype2>& vector2) -{ - return _bz_dot(vector1, vector2); -} - -// dot(expr, vecpick) -template<class P_expr1, class P_numtype2> -inline -BZ_SUMTYPE(BZ_PROMOTE(_bz_typename P_expr1::T_numtype, P_numtype2)) -dot(_bz_VecExpr<P_expr1> expr1, const VectorPick<P_numtype2>& vector2) -{ - return _bz_dot(expr1, vector2); -} - -// dot(vecpick, expr) -template<class P_numtype1, class P_expr2> -inline -BZ_SUMTYPE(BZ_PROMOTE(P_numtype1, _bz_typename P_expr2::T_numtype)) -dot(const VectorPick<P_numtype1>& vector1, _bz_VecExpr<P_expr2> expr2) -{ - return _bz_dot(vector1, expr2); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECDOT_CC - diff --git a/weave/blitz-20001213/blitz/vecexpr.h b/weave/blitz-20001213/blitz/vecexpr.h deleted file mode 100644 index 8e4dbf9d3..000000000 --- a/weave/blitz-20001213/blitz/vecexpr.h +++ /dev/null @@ -1,298 +0,0 @@ -/*************************************************************************** - * blitz/vecexpr.h Vector<P_numtype> expression templates - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - - -#ifndef BZ_VECEXPR_H -#define BZ_VECEXPR_H - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -#ifndef BZ_APPLICS_H - #include <blitz/applics.h> -#endif - -#ifndef BZ_META_METAPROG_H - #include <blitz/meta/metaprog.h> -#endif - -#ifndef BZ_VECEXPRWRAP_H - #include <blitz/vecexprwrap.h> // _bz_VecExpr wrapper class -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr1, class P_expr2, class P_op> -class _bz_VecExprOp { - -public: - typedef P_expr1 T_expr1; - typedef P_expr2 T_expr2; - typedef _bz_typename T_expr1::T_numtype T_numtype1; - typedef _bz_typename T_expr2::T_numtype T_numtype2; - typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; - typedef P_op T_op; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_VecExprOp(T_expr1 a, T_expr2 b) - : iter1_(a), iter2_(b) - { } -#else - _bz_VecExprOp(const T_expr1& a, const T_expr2& b) - : iter1_(a), iter2_(b) - { } -#endif - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecExprOp(const _bz_VecExprOp<P_expr1, P_expr2, P_op>& x) - : iter1_(x.iter1_), iter2_(x.iter2_) - { } -#endif - - T_numtype operator[](int i) const - { return T_op::apply(iter1_[i], iter2_[i]); } - - T_numtype operator()(int i) const - { return T_op::apply(iter1_(i), iter2_(i)); } - - int length(int recommendedLength) const - { - BZPRECONDITION(iter2_.length(recommendedLength) == - iter1_.length(recommendedLength)); - return iter1_.length(recommendedLength); - } - - enum { - _bz_staticLengthCount = - BZ_ENUM_CAST(P_expr1::_bz_staticLengthCount) - + BZ_ENUM_CAST(P_expr2::_bz_staticLengthCount), - - _bz_dynamicLengthCount = - BZ_ENUM_CAST(P_expr1::_bz_dynamicLengthCount) - + BZ_ENUM_CAST(P_expr2::_bz_dynamicLengthCount), - - _bz_staticLength = (BZ_ENUM_CAST(P_expr1::_bz_staticLength) > BZ_ENUM_CAST(P_expr2::_bz_staticLength)) ? BZ_ENUM_CAST(P_expr1::_bz_staticLength) : BZ_ENUM_CAST(P_expr2::_bz_staticLength) - -// _bz_meta_max<P_expr1::_bz_staticLength, P_expr2::_bz_staticLength>::max - }; - - int _bz_suggestLength() const - { - int length1 = iter1_._bz_suggestLength(); - if (length1 != 0) - return length1; - return iter2_._bz_suggestLength(); - } - - _bz_bool _bz_hasFastAccess() const - { return iter1_._bz_hasFastAccess() && iter2_._bz_hasFastAccess(); } - - T_numtype _bz_fastAccess(int i) const - { - return T_op::apply(iter1_._bz_fastAccess(i), - iter2_._bz_fastAccess(i)); - } - -private: - _bz_VecExprOp(); - - T_expr1 iter1_; - T_expr2 iter2_; -}; - -template<class P_expr, class P_unaryOp> -class _bz_VecExprUnaryOp { - -public: - typedef P_expr T_expr; - typedef P_unaryOp T_unaryOp; - typedef _bz_typename T_unaryOp::T_numtype T_numtype; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_VecExprUnaryOp(T_expr iter) - : iter_(iter) - { } -#else - _bz_VecExprUnaryOp(const T_expr& iter) - : iter_(iter) - { } -#endif - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecExprUnaryOp(const _bz_VecExprUnaryOp<P_expr, P_unaryOp>& x) - : iter_(x.iter_) - { } -#endif - - T_numtype operator[](int i) const - { return T_unaryOp::apply(iter_[i]); } - - T_numtype operator()(int i) const - { return T_unaryOp::apply(iter_(i)); } - - int length(int recommendedLength) const - { return iter_.length(recommendedLength); } - - enum { _bz_staticLengthCount = BZ_ENUM_CAST(P_expr::_bz_staticLengthCount), - _bz_dynamicLengthCount =BZ_ENUM_CAST(P_expr::_bz_dynamicLengthCount), - _bz_staticLength = BZ_ENUM_CAST(P_expr::_bz_staticLength) }; - - int _bz_suggestLength() const - { return iter_._bz_suggestLength(); } - - _bz_bool _bz_hasFastAccess() const - { return iter_._bz_hasFastAccess(); } - - T_numtype _bz_fastAccess(int i) const - { return T_unaryOp::apply(iter_._bz_fastAccess(i)); } - -private: - _bz_VecExprUnaryOp() { } - - T_expr iter_; -}; - -template<class P_numtype> -class _bz_VecExprConstant { -public: - typedef P_numtype T_numtype; - - _bz_VecExprConstant(P_numtype value) - : value_(BZ_NO_PROPAGATE(value)) - { - } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecExprConstant(const _bz_VecExprConstant<P_numtype>& x) - : value_(x.value_) - { } -#endif - - T_numtype operator[](int) const - { return value_; } - - T_numtype operator()(int) const - { return value_; } - - int length(int recommendedLength) const - { return recommendedLength; } - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 0, - _bz_staticLength = 0 - }; - - int _bz_suggestLength() const - { return 0; } - - _bz_bool _bz_hasFastAccess() const - { return 1; } - - T_numtype _bz_fastAccess(int) const - { return value_; } - -private: - - _bz_VecExprConstant() { } - - T_numtype value_; -}; - -// Some miscellaneous operators that don't seem to belong anywhere else. - -template<class P_expr> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr>, - _bz_negate<_bz_typename P_expr::T_numtype> > > -operator-(_bz_VecExpr<P_expr> a) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr>, - _bz_negate<_bz_typename P_expr::T_numtype> > T_expr; - return _bz_VecExpr<T_expr>(T_expr(a)); -} - -template<class P_numtype> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype>, - _bz_negate<P_numtype> > > -operator-(const Vector<P_numtype>& a) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype>, - _bz_negate<P_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(a.begin())); -} - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, _bz_negate<Range::T_numtype> > > -operator-(Range r) -{ - typedef _bz_VecExprUnaryOp<Range, _bz_negate<Range::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(r)); -} - - -// NEEDS_WORK: implement operator- for Range, VectorPick, TinyVector - -BZ_NAMESPACE_END - -#ifndef BZ_TINYVEC_H - #include <blitz/tinyvec.h> -#endif - -#include <blitz/vecbops.cc> // Operators with two operands -#include <blitz/vecuops.cc> // Functions with one argument -#include <blitz/vecbfn.cc> // Functions with two arguments - -#endif // BZ_VECEXPR_H diff --git a/weave/blitz-20001213/blitz/vecexprwrap.h b/weave/blitz-20001213/blitz/vecexprwrap.h deleted file mode 100644 index 8cc3d14eb..000000000 --- a/weave/blitz-20001213/blitz/vecexprwrap.h +++ /dev/null @@ -1,105 +0,0 @@ -/*************************************************************************** - * blitz/vecexprwrap.h Vector expression templates wrapper class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:12 tveldhui - * Imported sources - * - * Revision 1.2 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -#ifndef BZ_VECEXPRWRAP_H -#define BZ_VECEXPRWRAP_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -class _bz_VecExpr { - -public: - typedef P_expr T_expr; - typedef _bz_typename T_expr::T_numtype T_numtype; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_VecExpr(T_expr a) - : iter_(a) - { } -#else - _bz_VecExpr(const T_expr& a) - : iter_(a) - { } -#endif - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecExpr(const _bz_VecExpr<T_expr>& a) - : iter_(a.iter_) - { } -#endif - - T_numtype operator[](int i) const - { return iter_[i]; } - - T_numtype operator()(int i) const - { return iter_(i); } - - int length(int recommendedLength) const - { return iter_.length(recommendedLength); } - - enum { _bz_staticLengthCount = BZ_ENUM_CAST(P_expr::_bz_staticLengthCount), - _bz_dynamicLengthCount = BZ_ENUM_CAST(P_expr::_bz_dynamicLengthCount), - _bz_staticLength = BZ_ENUM_CAST(P_expr::_bz_staticLength) }; - - int _bz_suggestLength() const - { return iter_._bz_suggestLength(); } - - _bz_bool _bz_hasFastAccess() const - { return iter_._bz_hasFastAccess(); } - - T_numtype _bz_fastAccess(int i) const - { return iter_._bz_fastAccess(i); } - -private: - _bz_VecExpr(); - - T_expr iter_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_VECEXPRWRAP_H diff --git a/weave/blitz-20001213/blitz/vecglobs.cc b/weave/blitz-20001213/blitz/vecglobs.cc deleted file mode 100644 index e304126d3..000000000 --- a/weave/blitz-20001213/blitz/vecglobs.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECGLOBS_CC -#define BZ_VECGLOBS_CC - -#ifndef BZ_VECGLOBS_H - #include <blitz/vecglobs.h> -#endif - -#include <blitz/vecaccum.cc> // accumulate() -#include <blitz/vecdelta.cc> // delta() -#include <blitz/vecmin.cc> // min(), minValue(), minIndex() -#include <blitz/vecmax.cc> // max(), maxValue(), maxIndex() -#include <blitz/vecsum.cc> // sum(), mean() -#include <blitz/vecdot.cc> // dot() -#include <blitz/vecnorm.cc> // norm() -#include <blitz/vecnorm1.cc> // norm1() -#include <blitz/vecany.cc> // any() -#include <blitz/vecall.cc> // all() -#include <blitz/veccount.cc> // count() - -#endif // BZ_VECGLOBS_CC diff --git a/weave/blitz-20001213/blitz/vecglobs.h b/weave/blitz-20001213/blitz/vecglobs.h deleted file mode 100644 index 2b7eac92b..000000000 --- a/weave/blitz-20001213/blitz/vecglobs.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * blitz/vecglobs.h Global vector functions - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_VECGLOBS_H -#define BZ_VECGLOBS_H - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -#ifndef BZ_NUMTRAIT_H - #include <blitz/numtrait.h> -#endif - -#ifndef BZ_PROMOTE_H - #include <blitz/promote.h> -#endif - -#ifndef BZ_EXTREMUM_H - #include <blitz/extremum.h> -#endif - - -BZ_NAMESPACE(blitz) - -BZ_NAMESPACE_END - -#include <blitz/vecglobs.cc> - -#endif // BZ_VECGLOBS_H diff --git a/weave/blitz-20001213/blitz/vecio.cc b/weave/blitz-20001213/blitz/vecio.cc deleted file mode 100644 index ffa9aefaf..000000000 --- a/weave/blitz-20001213/blitz/vecio.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECIO_CC -#define BZ_VECIO_CC - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -BZ_NAMESPACE(blitz) - -// This version of operator<< is provided as a temporary measure -// only. It will be revised in a future release. -// NEEDS_WORK - -template<class P_numtype> -ostream& operator<<(ostream& os, const Vector<P_numtype>& x) -{ - os << "[ "; - for (int i=0; i < x.length(); ++i) - { - os << setw(10) << x[i]; - if (!((i+1)%7)) - os << endl << " "; - } - os << " ]"; - return os; -} - -template<class P_expr> -ostream& operator<<(ostream& os, _bz_VecExpr<P_expr> expr) -{ - Vector<_bz_typename P_expr::T_numtype> result(expr); - os << result; - return os; -} - -BZ_NAMESPACE_END - -#endif // BZ_VECIO_CC diff --git a/weave/blitz-20001213/blitz/veciter.h b/weave/blitz-20001213/blitz/veciter.h deleted file mode 100644 index cf99197e6..000000000 --- a/weave/blitz-20001213/blitz/veciter.h +++ /dev/null @@ -1,229 +0,0 @@ -/*************************************************************************** - * blitz/veciter.h Iterator classes for Vector<P_numtype> - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.3 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - - -#ifndef BZ_VECITER_H -#define BZ_VECITER_H - -#ifndef BZ_VECTOR_H - #error <blitz/veciter.h> should be included via <blitz/vector.h> -#endif - -BZ_NAMESPACE(blitz) - -// Declaration of class VectorIter -template<class P_numtype> -class VectorIter { -public: - typedef P_numtype T_numtype; - - _bz_explicit VectorIter(Vector<P_numtype>& x) - : data_(x.data()) - { - stride_ = x.stride(); - length_ = x.length(); - } - - VectorIter(P_numtype* _bz_restrict data, int stride, int length) - : data_(data), stride_(stride), length_(length) - { } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - VectorIter(const VectorIter<P_numtype>& x) - { - data_ = x.data_; - stride_ = x.stride_; - length_ = x.length_; - } -#endif - - P_numtype operator[](int i) const - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - P_numtype& _bz_restrict operator[](int i) - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - P_numtype operator()(int i) const - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - P_numtype& _bz_restrict operator()(int i) - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - P_numtype operator*() const - { return *data_; } - - P_numtype& operator*() - { return *data_; } - - VectorIter<P_numtype> operator+(int i) - { - // NEEDS_WORK -- precondition checking? - return VectorIter<P_numtype>(data_+i*stride_, stride_, length_-i); - } - - int length(int) const - { return length_; } - - _bz_bool isUnitStride() const - { return (stride_ == 1); } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 1, - _bz_staticLength = 0 }; - - _bz_bool _bz_hasFastAccess() const - { return isUnitStride(); } - - P_numtype _bz_fastAccess(int i) const - { return data_[i]; } - - P_numtype& _bz_restrict _bz_fastAccess(int i) - { return data_[i]; } - - int _bz_suggestLength() const - { return length_; } - -private: - VectorIter() { } - P_numtype * _bz_restrict data_; - int stride_; - int length_; -}; - - -template<class P_numtype> -class VectorIterConst { -public: - typedef P_numtype T_numtype; - - _bz_explicit VectorIterConst(const Vector<P_numtype>& x) - : data_(x.data()) - { - stride_ = x.stride(); - length_ = x.length(); - } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - VectorIterConst(const VectorIterConst<P_numtype>& x) - { - data_ = x.data_; - stride_ = x.stride_; - length_ = x.length_; - } -#endif - - P_numtype operator[](int i) const - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - P_numtype operator()(int i) const - { - BZPRECONDITION(i < length_); - return data_[i*stride_]; - } - - int length(int) const - { return length_; } - - _bz_bool isUnitStride() const - { return (stride_ == 1); } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 1, - _bz_staticLength = 0 }; - - _bz_bool _bz_hasFastAccess() const - { return isUnitStride(); } - - P_numtype _bz_fastAccess(int i) const - { - return data_[i]; - } - - int _bz_suggestLength() const - { return length_; } - -private: - const P_numtype * _bz_restrict data_; - int stride_; - int length_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_VECITER_H diff --git a/weave/blitz-20001213/blitz/vecmax.cc b/weave/blitz-20001213/blitz/vecmax.cc deleted file mode 100644 index 5d3223edc..000000000 --- a/weave/blitz-20001213/blitz/vecmax.cc +++ /dev/null @@ -1,172 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECMAX_CC -#define BZ_VECMAX_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecmax.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline -Extremum<_bz_typename P_expr::T_numtype, int> _bz_vec_max(P_expr vector) -{ - typedef _bz_typename P_expr::T_numtype T_numtype; - - T_numtype maxValue = vector(0); - int maxIndex = 0; - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=1; i < length; ++i) - { - T_numtype value = vector._bz_fastAccess(i); - if (value > maxValue) - { - maxValue = value; - maxIndex = i; - } - } - } - else { - for (int i=1; i < length; ++i) - { - T_numtype value = vector(i); - if (value > maxValue) - { - maxValue = value; - maxIndex = i; - } - } - } - - return Extremum<T_numtype, int>(maxValue, maxIndex); -} - -// max(vector) -template<class P_numtype> -inline -Extremum<P_numtype, int> max(const Vector<P_numtype>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()); -} - -// max(expr) -template<class P_expr> -inline -Extremum<_bz_typename P_expr::T_numtype,int> max(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_max(x); -} - -// max(vecpick) -template<class P_numtype> -inline -Extremum<P_numtype, int> max(const VectorPick<P_numtype>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()); -} - -// max(TinyVector) -template<class P_numtype, int N_length> -inline -Extremum<P_numtype, int> -max(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()); -} - - -// maxIndex(vector) -template<class P_numtype> -inline -int maxIndex(const Vector<P_numtype>& x) -{ - return _bz_vec_max(x).index(); -} - -// maxIndex(expr) -template<class P_expr> -inline -int maxIndex(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_max(x._bz_asVecExpr()).index(); -} - -// maxIndex(vecpick) -template<class P_numtype> -int maxIndex(const VectorPick<P_numtype>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()).index(); -} - -// maxIndex(TinyVector) -template<class P_numtype, int N_length> -int maxIndex(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()).index(); -} - -// maxValue(vector) -template<class P_numtype> -inline -int maxValue(const Vector<P_numtype>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()).value(); -} - -// maxValue(expr) -template<class P_expr> -inline -int maxValue(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_max(x).value(); -} - -// maxValue(vecpick) -template<class P_numtype> -int maxValue(const VectorPick<P_numtype>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()).value(); -} - -// maxValue(TinyVector) -template<class P_numtype, int N_length> -int maxValue(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_max(x._bz_asVecExpr()).value(); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECMAX_CC - diff --git a/weave/blitz-20001213/blitz/vecmin.cc b/weave/blitz-20001213/blitz/vecmin.cc deleted file mode 100644 index c90f85793..000000000 --- a/weave/blitz-20001213/blitz/vecmin.cc +++ /dev/null @@ -1,170 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECMIN_CC -#define BZ_VECMIN_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecmin.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline -Extremum<_bz_typename P_expr::T_numtype, int> _bz_vec_min(P_expr vector) -{ - typedef _bz_typename P_expr::T_numtype T_numtype; - - T_numtype minValue = vector(0); - int minIndex = 0; - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=1; i < length; ++i) - { - T_numtype value = vector._bz_fastAccess(i); - if (value < minValue) - { - minValue = value; - minIndex = i; - } - } - } - else { - for (int i=1; i < length; ++i) - { - T_numtype value = vector(i); - if (value < minValue) - { - minValue = value; - minIndex = i; - } - } - } - - return Extremum<T_numtype, int>(minValue, minIndex); -} - -// min(vector) -template<class P_numtype> -inline -Extremum<P_numtype,int> min(const Vector<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()); -} - -// min(expr) -template<class P_expr> -inline -Extremum<_bz_typename P_expr::T_numtype,int> min(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_min(x); -} - -// min(vecpick) -template<class P_numtype> -inline -Extremum<P_numtype, int> min(const VectorPick<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()); -} - -// min(TinyVector) -template<class P_numtype, int N_length> -inline -Extremum<P_numtype, int> min(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()); -} - -// minIndex(vector) -template<class P_numtype> -inline -int minIndex(const Vector<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).index(); -} - -// maxIndex(expr) -template<class P_expr> -inline -int minIndex(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_min(x).index(); -} - -// minIndex(vecpick) -template<class P_numtype> -int minIndex(const VectorPick<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).index(); -} - -// minIndex(TinyVector) -template<class P_numtype, int N_length> -int minIndex(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).index(); -} - -// minValue(vector) -template<class P_numtype> -inline -int minValue(const Vector<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).value(); -} - -// minValue(expr) -template<class P_expr> -inline -int minValue(_bz_VecExpr<P_expr> x) -{ - return _bz_vec_min(x).value(); -} - -// minValue(vecpick) -template<class P_numtype> -int minValue(const VectorPick<P_numtype>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).value(); -} - -// minValue(TinyVector) -template<class P_numtype, int N_length> -int minValue(const TinyVector<P_numtype, N_length>& x) -{ - return _bz_vec_min(x._bz_asVecExpr()).value(); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECMIN_CC - diff --git a/weave/blitz-20001213/blitz/vecnorm.cc b/weave/blitz-20001213/blitz/vecnorm.cc deleted file mode 100644 index a67d43678..000000000 --- a/weave/blitz-20001213/blitz/vecnorm.cc +++ /dev/null @@ -1,111 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECNORM_CC -#define BZ_VECNORM_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecnorm.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(_bz_typename P_expr::T_numtype)) -_bz_vec_norm(P_expr vector) -{ - // An extreme use of traits here. It's necessary to - // handle odd cases such as the norm of a Vector<char>. - // To avoid overflow, BZ_SUMTYPE(char) is int. - // To take the sqrt of the sum, BZ_FLOATTYPE(char) is float. - // So float is returned for Vector<char>. - typedef _bz_typename P_expr::T_numtype T_numtype; - typedef BZ_SUMTYPE(T_numtype) T_sumtype; - typedef BZ_FLOATTYPE(T_sumtype) T_floattype; - - T_sumtype sum = 0; - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - { - T_numtype value = vector._bz_fastAccess(i); - sum += value * T_sumtype(value); - } - } - else { - for (int i=0; i < length; ++i) - { - T_numtype value = vector(i); - sum += value * T_sumtype(value); - } - } - - return _bz_sqrt<T_floattype>::apply(sum); -} - -template<class P_numtype> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) norm(const Vector<P_numtype>& x) -{ - return _bz_vec_norm(x._bz_asVecExpr()); -} - -// norm(expr) -template<class P_expr> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(_bz_typename P_expr::T_numtype)) -norm(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_norm(expr); -} - -// norm(vecpick) -template<class P_numtype> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) -norm(const VectorPick<P_numtype>& x) -{ - return _bz_vec_norm(x._bz_asVecExpr()); -} - -// norm(TinyVector) -template<class P_numtype, int N_dimensions> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) -norm(const TinyVector<P_numtype, N_dimensions>& x) -{ - return _bz_vec_norm(x._bz_asVecExpr()); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECNORM_CC - diff --git a/weave/blitz-20001213/blitz/vecnorm1.cc b/weave/blitz-20001213/blitz/vecnorm1.cc deleted file mode 100644 index d9f6e24dc..000000000 --- a/weave/blitz-20001213/blitz/vecnorm1.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:08 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECNORM1_CC -#define BZ_VECNORM1_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecnorm1.cc> must be included via <blitz/vecglobs.h> -#endif - -#include <blitz/applics.h> - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline -BZ_SUMTYPE(_bz_typename P_expr::T_numtype) -_bz_vec_norm1(P_expr vector) -{ - typedef _bz_typename P_expr::T_numtype T_numtype; - typedef BZ_SUMTYPE(T_numtype) T_sumtype; - - T_sumtype sum = 0; - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - sum += _bz_abs<T_numtype>::apply(vector._bz_fastAccess(i)); - } - else { - for (int i=0; i < length; ++i) - sum += _bz_abs<T_numtype>::apply(vector(i)); - } - - return sum; -} - -// norm1(vector) -template<class P_numtype> -BZ_SUMTYPE(P_numtype) norm1(const Vector<P_numtype>& x) -{ - return _bz_vec_norm1(x._bz_asVecExpr()); -} - -// norm1(expr) -template<class P_expr> -BZ_SUMTYPE(_bz_typename P_expr::T_numtype) norm1(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_norm1(expr); -} - -// norm1(vecpick) -template<class P_numtype> -BZ_SUMTYPE(P_numtype) norm1(const VectorPick<P_numtype>& x) -{ - return _bz_vec_norm1(x._bz_asVecExpr()); -} - -// norm1(TinyVector) -template<class P_numtype, int N_dimensions> -BZ_SUMTYPE(P_numtype) norm1(const TinyVector<P_numtype, N_dimensions>& x) -{ - return _bz_vec_norm1(x._bz_asVecExpr()); -} - - -BZ_NAMESPACE_END - -#endif // BZ_VECNORM1_CC - diff --git a/weave/blitz-20001213/blitz/vecpick.cc b/weave/blitz-20001213/blitz/vecpick.cc deleted file mode 100644 index 62d716545..000000000 --- a/weave/blitz-20001213/blitz/vecpick.cc +++ /dev/null @@ -1,667 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECPICK_CC -#define BZ_VECPICK_CC - -#ifndef BZ_VECPICK_H - #include <blitz/vecpick.h> -#endif - -#ifndef BZ_UPDATE_H - #include <blitz/update.h> -#endif - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif - -#ifndef BZ_VECEXPR_H - #include <blitz/vecexpr.h> -#endif - -#ifndef BZ_RANDOM_H - #include <blitz/random.h> -#endif -BZ_NAMESPACE(blitz) - -/***************************************************************************** - * Assignment operators with vector expression operand - */ - -template<class P_numtype> template<class P_expr, class P_updater> -inline -void VectorPick<P_numtype>::_bz_assign(P_expr expr, P_updater) -{ - BZPRECONDITION(expr.length(length()) == length()); - - // If all vectors in the expression, plus the vector to which the - // result is being assigned have unit stride, then avoid stride - // calculations. - if (_bz_hasFastAccess() && expr._bz_hasFastAccess()) - { -#ifndef BZ_PARTIAL_LOOP_UNROLL - for (int i=0; i < length(); ++i) - P_updater::update(vector_(index_(i)), expr._bz_fastAccess(i)); -#else - // Unwind the inner loop, five elements at a time. - int leftover = length() % 5; - - int i=0; - for (; i < leftover; ++i) - P_updater::update(vector_(index_(i)), expr._bz_fastAccess(i)); - - for (; i < length(); i += 5) - { - P_updater::update(vector_(index_(i)), expr._bz_fastAccess(i)); - P_updater::update(vector_(index_(i+1)), expr._bz_fastAccess(i+1)); - P_updater::update(vector_(index_(i+2)), expr._bz_fastAccess(i+2)); - P_updater::update(vector_(index_(i+3)), expr._bz_fastAccess(i+3)); - P_updater::update(vector_(index_(i+4)), expr._bz_fastAccess(i+4)); - } -#endif - } - else { - // Not all unit strides -- have to access all the vector elements - // as data_[i*stride_], which is slower. - for (int i=0; i < length(); ++i) - P_updater::update(vector_[index_[i]], expr[i]); - } -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator=(_bz_VecExpr<P_expr> expr) -{ - BZPRECONDITION(expr.length(length()) == length()); - - // If all vectors in the expression, plus the vector to which the - // result is being assigned have unit stride, then avoid stride - // calculations. - if (_bz_hasFastAccess() && expr._bz_hasFastAccess()) - { -#ifndef BZ_PARTIAL_LOOP_UNROLL - for (int i=0; i < length(); ++i) - (*this)(i) = expr._bz_fastAccess(i); -#else - // Unwind the inner loop, five elements at a time. - int leftover = length() % 5; - - int i=0; - for (; i < leftover; ++i) - (*this)(i) = expr._bz_fastAccess(i); - - for (; i < length(); i += 5) - { - (*this)(i) = expr._bz_fastAccess(i); - (*this)(i+1) = expr._bz_fastAccess(i+1); - (*this)(i+2) = expr._bz_fastAccess(i+2); - (*this)(i+3) = expr._bz_fastAccess(i+3); - (*this)(i+4) = expr._bz_fastAccess(i+4); - } -#endif - } - else { - // Not all unit strides -- have to access all the vector elements - // as data_[i*stride_], which is slower. - for (int i=0; i < length(); ++i) - (*this)[i] = expr[i]; - } - return *this; -} - - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator+=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_plus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator-=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_minus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator*=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_multiply_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator/=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_divide_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator%=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_mod_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator^=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_xor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator&=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitand_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator|=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator>>=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftr_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator<<=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftl_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -/***************************************************************************** - * Assignment operators with scalar operand - */ - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) = _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator+=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) += _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator-=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) -= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator*=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) *= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator/=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) /= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator%=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) %= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator^=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) ^= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator&=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) &= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator|=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) |= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator>>=(int x) -{ - typedef _bz_VecExprConstant<int> T_expr; - (*this) >>= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator<<=(int x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) <<= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -/***************************************************************************** - * Assignment operators with vector operand - */ - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator=(const Vector<P_numtype2>& x) -{ - (*this) = _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator+=(const Vector<P_numtype2>& x) -{ - (*this) += _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator-=(const Vector<P_numtype2>& x) -{ - (*this) -= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator*=(const Vector<P_numtype2>& x) -{ - (*this) *= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator/=(const Vector<P_numtype2>& x) -{ - (*this) /= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator%=(const Vector<P_numtype2>& x) -{ - (*this) %= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator^=(const Vector<P_numtype2>& x) -{ - (*this) ^= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator&=(const Vector<P_numtype2>& x) -{ - (*this) &= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator|=(const Vector<P_numtype2>& x) -{ - (*this) |= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator<<=(const Vector<P_numtype2>& x) -{ - (*this) <<= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& -VectorPick<P_numtype>::operator>>=(const Vector<P_numtype2>& x) -{ - (*this) >>= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -/***************************************************************************** - * Assignment operators with Range operand - */ - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator=(Range r) -{ - (*this) = _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator+=(Range r) -{ - (*this) += _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator-=(Range r) -{ - (*this) -= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator*=(Range r) -{ - (*this) *= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator/=(Range r) -{ - (*this) /= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator%=(Range r) -{ - (*this) %= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator^=(Range r) -{ - (*this) ^= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator&=(Range r) -{ - (*this) &= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator|=(Range r) -{ - (*this) |= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator>>=(Range r) -{ - (*this) >>= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator<<=(Range r) -{ - (*this) <<= _bz_VecExpr<Range>(r); - return *this; -} - -/***************************************************************************** - * Assignment operators with VectorPick operand - */ - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) = _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator+=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) += _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator-=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) -= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator*=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) *= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator/=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) /= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator%=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) %= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator^=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) ^= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator&=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) &= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline VectorPick<P_numtype>& VectorPick<P_numtype>::operator|=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) |= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -/***************************************************************************** - * Assignment operators with Random operand - */ - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator=(Random<P_distribution>& rand) -{ - (*this) = _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator+=(Random<P_distribution>& rand) -{ - (*this) += _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator-=(Random<P_distribution>& rand) -{ - (*this) -= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator*=(Random<P_distribution>& rand) -{ - (*this) *= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator/=(Random<P_distribution>& rand) -{ - (*this) /= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator%=(Random<P_distribution>& rand) -{ - (*this) %= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator^=(Random<P_distribution>& rand) -{ - (*this) ^= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator&=(Random<P_distribution>& rand) -{ - (*this) &= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -VectorPick<P_numtype>& -VectorPick<P_numtype>::operator|=(Random<P_distribution>& rand) -{ - (*this) |= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -BZ_NAMESPACE_END - -#endif // BZ_VECPICK_CC diff --git a/weave/blitz-20001213/blitz/vecpick.h b/weave/blitz-20001213/blitz/vecpick.h deleted file mode 100644 index 15525fe7a..000000000 --- a/weave/blitz-20001213/blitz/vecpick.h +++ /dev/null @@ -1,331 +0,0 @@ -/*************************************************************************** - * blitz/vecpick.h Declaration of the VectorPick<T_numtype> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_VECPICK_H -#define BZ_VECPICK_H - -// >>>HOMMEL990316 -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -BZ_NAMESPACE(blitz) - -// Forward declarations - -template<class P_numtype> class VectorPickIter; -template<class P_numtype> class VectorPickIterConst; - -// Declaration of class VectorPick<P_numtype> - -template<class P_numtype> -class VectorPick { - -public: - ////////////////////////////////////////////// - // Public Types - ////////////////////////////////////////////// - - typedef P_numtype T_numtype; - typedef Vector<T_numtype> T_vector; - typedef Vector<int> T_indexVector; - typedef VectorPick<T_numtype> T_pick; - typedef VectorPickIter<T_numtype> T_iterator; - typedef VectorPickIterConst<T_numtype> T_constIterator; - - ////////////////////////////////////////////// - // Constructors // - ////////////////////////////////////////////// - - VectorPick(T_vector& vector, T_indexVector& indexarg) - : vector_(vector), index_(indexarg) - { } - - VectorPick(const T_pick& vecpick) - : vector_(const_cast<T_vector&>(vecpick.vector_)), - index_(const_cast<T_indexVector&>(vecpick.index_)) - { } - - VectorPick(T_pick& vecpick, Range r) - : vector_(vecpick.vector_), index_(vecpick.index_[r]) - { } - - ////////////////////////////////////////////// - // Member functions - ////////////////////////////////////////////// - - T_iterator begin() - { return VectorPickIter<T_numtype>(*this); } - - T_constIterator begin() const - { return VectorPickIterConst<T_numtype>(*this); } - - // T_vector copy() const; - - // T_iterator end(); - - // T_constIterator end() const; - - T_indexVector& indexSet() - { return index_; } - - const T_indexVector& indexSet() const - { return index_; } - - int length() const - { return index_.length(); } - - void setVector(Vector<T_numtype>& x) - { vector_.reference(x); } - - void setIndex(Vector<int>& index) - { index_.reference(index); } - - T_vector& vector() - { return vector_; } - - const T_vector& vector() const - { return vector_; } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - int _bz_suggestLength() const - { return index_.length(); } - - _bz_bool _bz_hasFastAccess() const - { return vector_._bz_hasFastAccess() && index_._bz_hasFastAccess(); } - - T_numtype& _bz_fastAccess(int i) - { return vector_._bz_fastAccess(index_._bz_fastAccess(i)); } - - T_numtype _bz_fastAccess(int i) const - { return vector_._bz_fastAccess(index_._bz_fastAccess(i)); } - - _bz_VecExpr<T_constIterator> _bz_asVecExpr() const - { return _bz_VecExpr<T_constIterator>(begin()); } - - ////////////////////////////////////////////// - // Subscripting operators - ////////////////////////////////////////////// - - T_numtype operator()(int i) const - { - BZPRECONDITION(index_.stride() == 1); - BZPRECONDITION(vector_.stride() == 1); - BZPRECONDITION(i < index_.length()); - BZPRECONDITION(index_[i] < vector_.length()); - return vector_(index_(i)); - } - - T_numtype& operator()(int i) - { - BZPRECONDITION(index_.stride() == 1); - BZPRECONDITION(vector_.stride() == 1); - BZPRECONDITION(i < index_.length()); - BZPRECONDITION(index_[i] < vector_.length()); - return vector_(index_(i)); - } - - T_numtype operator[](int i) const - { - BZPRECONDITION(index_.stride() == 1); - BZPRECONDITION(vector_.stride() == 1); - BZPRECONDITION(i < index_.length()); - BZPRECONDITION(index_[i] < vector_.length()); - return vector_[index_[i]]; - } - - T_numtype& operator[](int i) - { - BZPRECONDITION(index_.stride() == 1); - BZPRECONDITION(vector_.stride() == 1); - BZPRECONDITION(i < index_.length()); - BZPRECONDITION(index_[i] < vector_.length()); - return vector_[index_[i]]; - } - - T_pick operator()(Range r) - { - return T_pick(*this, index_[r]); - } - - T_pick operator[](Range r) - { - return T_pick(*this, index_[r]); - } - - ////////////////////////////////////////////// - // Assignment operators - ////////////////////////////////////////////// - - // Scalar operand - T_pick& operator=(T_numtype); - T_pick& operator+=(T_numtype); - T_pick& operator-=(T_numtype); - T_pick& operator*=(T_numtype); - T_pick& operator/=(T_numtype); - T_pick& operator%=(T_numtype); - T_pick& operator^=(T_numtype); - T_pick& operator&=(T_numtype); - T_pick& operator|=(T_numtype); - T_pick& operator>>=(int); - T_pick& operator<<=(int); - - // Vector operand - template<class P_numtype2> T_pick& operator=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator+=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator-=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator*=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator/=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator%=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator^=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator&=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator|=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator>>=(const Vector<P_numtype2> &); - template<class P_numtype2> T_pick& operator<<=(const Vector<P_numtype2> &); - - // Vector expression operand - template<class P_expr> T_pick& operator=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator+=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator-=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator*=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator/=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator%=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator^=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator&=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator|=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator>>=(_bz_VecExpr<P_expr>); - template<class P_expr> T_pick& operator<<=(_bz_VecExpr<P_expr>); - - // Range operand - T_pick& operator=(Range); - T_pick& operator+=(Range); - T_pick& operator-=(Range); - T_pick& operator*=(Range); - T_pick& operator/=(Range); - T_pick& operator%=(Range); - T_pick& operator^=(Range); - T_pick& operator&=(Range); - T_pick& operator|=(Range); - T_pick& operator>>=(Range); - T_pick& operator<<=(Range); - - // Vector pick operand - template<class P_numtype2> - T_pick& operator=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator+=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator-=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator*=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator/=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator%=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator^=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator&=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator|=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator>>=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_pick& operator<<=(const VectorPick<P_numtype2> &); - - // Random operand - template<class P_distribution> - T_pick& operator=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator+=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator-=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator*=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator/=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator%=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator^=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator&=(Random<P_distribution>& random); - template<class P_distribution> - T_pick& operator|=(Random<P_distribution>& random); - -private: - VectorPick() { } - - template<class P_expr, class P_updater> - inline void _bz_assign(P_expr, P_updater); - -private: - T_vector vector_; - T_indexVector index_; -}; - -BZ_NAMESPACE_END - -#include <blitz/vecpick.cc> -#include <blitz/vecpickio.cc> -#include <blitz/vecpickiter.h> - -#endif // BZ_VECPICK_H diff --git a/weave/blitz-20001213/blitz/vecpickio.cc b/weave/blitz-20001213/blitz/vecpickio.cc deleted file mode 100644 index 1fad37237..000000000 --- a/weave/blitz-20001213/blitz/vecpickio.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECPICKIO_CC -#define BZ_VECPICKIO_CC - -#ifndef BZ_VECPICK_H - #error <blitz/vecpickio.cc> must be included via <blitz/vecpick.h> -#endif // BZ_VECPICK_H - -BZ_NAMESPACE(blitz) - -template<class P_numtype> -ostream& operator<<(ostream& os, const VectorPick<P_numtype>& x) -{ - Vector<P_numtype> y(x.length()); - y = x; - os << y; - return os; -} - -BZ_NAMESPACE_END - -#endif // BZ_VECPICKIO_CC diff --git a/weave/blitz-20001213/blitz/vecpickiter.h b/weave/blitz-20001213/blitz/vecpickiter.h deleted file mode 100644 index 51fe7c03a..000000000 --- a/weave/blitz-20001213/blitz/vecpickiter.h +++ /dev/null @@ -1,197 +0,0 @@ -/*************************************************************************** - * blitz/vecpickiter.h Declaration of VectorPickIter<T_numtype> and - * VectorPickIterConst<T_numtype> classes - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.5 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.4 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.3 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.2 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - */ - -#ifndef BZ_VECPICKITER_H -#define BZ_VECPICKITER_H - -#ifndef BZ_VECPICK_H - #include <blitz/vecpick.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_numtype> -class VectorPickIter { - -public: - typedef P_numtype T_numtype; - - _bz_explicit VectorPickIter(VectorPick<T_numtype>& x) - : data_(x.vector().data()), index_(x.indexSet().data()) - { - dataStride_ = x.vector().stride(); - indexStride_ = x.indexSet().stride(); - length_ = x.indexSet().length(); - } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - VectorPickIter(const VectorPickIter<T_numtype>& x) - { - data_ = x.data_; - index_ = x.index_; - dataStride_ = x.dataStride_; - indexStride_ = x.indexStride_; - length_ = x.length_; - } -#endif - - T_numtype operator[](int i) const - { - BZPRECONDITION(i < length_); - return data_[dataStride_ * index_[i * indexStride_]]; - } - - T_numtype& operator[](int i) - { - BZPRECONDITION(i < length_); - return data_[dataStride_ * index_[i * indexStride_]]; - } - - int length(int) const - { return length_; } - - int _bz_suggestLength() const - { return length_; } - - _bz_bool isUnitStride() const - { return (dataStride_ == 1) && (indexStride_ == 1); } - - _bz_bool _bz_hasFastAccess() const - { return isUnitStride(); } - - T_numtype _bz_fastAccess(int i) const - { - return data_[index_[i]]; - } - - T_numtype& _bz_fastAccess(int i) - { - return data_[index_[i]]; - } - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 1, - _bz_staticLength = 0 }; - -private: - T_numtype * _bz_restrict data_; - int dataStride_; - const int * _bz_restrict index_; - int indexStride_; - int length_; -}; - -template<class P_numtype> -class VectorPickIterConst { - -public: - typedef P_numtype T_numtype; - - _bz_explicit VectorPickIterConst(const VectorPick<T_numtype>& x) - : data_(x.vector().data()), index_(x.indexSet().data()) - { - dataStride_ = x.vector().stride(); - indexStride_ = x.indexSet().stride(); - length_ = x.indexSet().length(); - } - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - VectorPickIterConst(const VectorPickIterConst<T_numtype>& x) - { - data_ = x.data_; - index_ = x.index_; - dataStride_ = x.dataStride_; - indexStride_ = x.indexStride_; - length_ = x.length_; - } -#endif - - T_numtype operator[](int i) const - { - BZPRECONDITION(i < length_); - return data_[dataStride_ * index_[i * indexStride_]]; - } - - int length(int) const - { return length_; } - - int _bz_suggestLength() const - { return length_; } - - _bz_bool isUnitStride() const - { return (dataStride_ == 1) && (indexStride_ == 1); } - - _bz_bool _bz_hasFastAccess() const - { return isUnitStride(); } - - T_numtype _bz_fastAccess(int i) const - { - return data_[index_[i]]; - } - - enum { _bz_staticLengthCount = 0, - _bz_dynamicLengthCount = 1, - _bz_staticLength = 0 }; - -private: - const T_numtype * _bz_restrict data_; - int dataStride_; - const int * _bz_restrict index_; - int indexStride_; - int length_; -}; - -BZ_NAMESPACE_END - -#endif // BZ_VECPICKITER_H - diff --git a/weave/blitz-20001213/blitz/vecsum.cc b/weave/blitz-20001213/blitz/vecsum.cc deleted file mode 100644 index d63a0bcac..000000000 --- a/weave/blitz-20001213/blitz/vecsum.cc +++ /dev/null @@ -1,126 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECSUM_CC -#define BZ_VECSUM_CC - -#ifndef BZ_VECGLOBS_H - #error <blitz/vecsum.cc> must be included via <blitz/vecglobs.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr> -inline -BZ_SUMTYPE(_bz_typename P_expr::T_numtype) -_bz_vec_sum(P_expr vector) -{ - typedef _bz_typename P_expr::T_numtype T_numtype; - typedef BZ_SUMTYPE(T_numtype) T_sumtype; - - T_sumtype sum = 0; - int length = vector._bz_suggestLength(); - - if (vector._bz_hasFastAccess()) - { - for (int i=0; i < length; ++i) - sum += vector._bz_fastAccess(i); - } - else { - for (int i=0; i < length; ++i) - sum += vector(i); - } - - return sum; -} - -template<class P_numtype> -inline -BZ_SUMTYPE(P_numtype) sum(const Vector<P_numtype>& x) -{ - return _bz_vec_sum(x._bz_asVecExpr()); -} - -// sum(expr) -template<class P_expr> -inline -BZ_SUMTYPE(_bz_typename P_expr::T_numtype) -sum(_bz_VecExpr<P_expr> expr) -{ - return _bz_vec_sum(expr); -} - -// sum(vecpick) -template<class P_numtype> -inline -BZ_SUMTYPE(P_numtype) -sum(const VectorPick<P_numtype>& x) -{ - return _bz_vec_sum(x._bz_asVecExpr()); -} - -// mean(vector) -template<class P_numtype> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) mean(const Vector<P_numtype>& x) -{ - BZPRECONDITION(x.length() > 0); - - typedef BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) T_floattype; - return _bz_vec_sum(x._bz_asVecExpr()) / (T_floattype) x.length(); -} - -// mean(expr) -template<class P_expr> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(_bz_typename P_expr::T_numtype)) -mean(_bz_VecExpr<P_expr> expr) -{ - BZPRECONDITION(expr._bz_suggestLength() > 0); - - typedef BZ_FLOATTYPE(BZ_SUMTYPE(_bz_typename P_expr::T_numtype)) - T_floattype; - return _bz_vec_sum(expr) / (T_floattype) expr._bz_suggestLength(); -} - -// mean(vecpick) -template<class P_numtype> -inline -BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) -mean(const VectorPick<P_numtype>& x) -{ - BZPRECONDITION(x.length() > 0); - - typedef BZ_FLOATTYPE(BZ_SUMTYPE(P_numtype)) T_floattype; - return _bz_vec_sum(x._bz_asVecExpr()) / (T_floattype) x.length(); -} - -BZ_NAMESPACE_END - -#endif // BZ_VECSUM_CC - diff --git a/weave/blitz-20001213/blitz/vector.cc b/weave/blitz-20001213/blitz/vector.cc deleted file mode 100644 index d75752940..000000000 --- a/weave/blitz-20001213/blitz/vector.cc +++ /dev/null @@ -1,871 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.6 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.5 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.4 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECTOR_CC -#define BZ_VECTOR_CC - -#ifndef BZ_VECTOR_H - #include <blitz/vector.h> -#endif - -#ifndef BZ_UPDATE_H - #include <blitz/update.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_numtype> -Vector<P_numtype> Vector<P_numtype>::copy() const -{ - Vector<P_numtype> newCopy(length_); - - if (stride_ == 1) - { - memcpy(newCopy.data(), data(), length_ * sizeof(P_numtype)); - } - else { - for (int i=0; i < length_; ++i) - { - // Can assume that newCopy has unit stride, and hence use - // the operator(), which assumes unit stride. Since this - // vector doesn't have unit stride, use []. - newCopy(i) = (*this)[i]; - } - } - - return newCopy; -} - -template<class P_numtype> -void Vector<P_numtype>::makeUnique() -{ - if ((stride_ != 1) || (numReferences() > 1)) - { - Vector<P_numtype> tmp = copy(); - reference(tmp); - } -} - -template<class P_numtype> -void Vector<P_numtype>::reference(Vector<P_numtype>& x) -{ - MemoryBlockReference<P_numtype>::changeBlock(x, 0); - length_ = x.length_; - stride_ = x.stride_; -} - -template<class P_numtype> -void Vector<P_numtype>::resize(int length) -{ - if (length != length_) - { - MemoryBlockReference<P_numtype>::newBlock(length); - length_ = length; - stride_ = 1; - } -} - -template<class P_numtype> -void Vector<P_numtype>::resizeAndPreserve(int newLength) -{ - Vector<P_numtype> newVector(newLength); - - if (newLength > length_) - newVector(Range(0,length_-1)) = (*this); - else - newVector(Range(0,newLength-1)) = (*this); - - reference(newVector); -} - -/***************************************************************************** - * Assignment operators with vector expression operand - */ - -template<class P_numtype> template<class P_expr, class P_updater> -inline -void Vector<P_numtype>::_bz_assign(P_expr expr, P_updater) -{ - BZPRECONDITION(expr.length(length_) == length_); - - // If all vectors in the expression, plus the vector to which the - // result is being assigned have unit stride, then avoid stride - // calculations. - if ((stride_ == 1) && (expr._bz_hasFastAccess())) - { -#ifndef BZ_PARTIAL_LOOP_UNROLL - for (int i=0; i < length_; ++i) - P_updater::update(data_[i], expr._bz_fastAccess(i)); -#else - // Unwind the inner loop, four elements at a time. - int leftover = length_ & 0x03; - - int i=0; - for (; i < leftover; ++i) - P_updater::update(data_[i], expr._bz_fastAccess(i)); - - for (; i < length_; i += 4) - { - // Common subexpression elimination: avoid doing i+1, i+2, i+3 - // multiple times (compilers *won't* do this cse automatically) - int t1 = i+1; - int t2 = i+2; - int t3 = i+3; - - _bz_typename P_expr::T_numtype tmp1, tmp2, tmp3, tmp4; - - // Reading all the results first avoids aliasing - // ambiguities, and provides more flexibility in - // register allocation & instruction scheduling - tmp1 = expr._bz_fastAccess(i); - tmp2 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t1)); - tmp3 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t2)); - tmp4 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t3)); - - P_updater::update(data_[i], BZ_NO_PROPAGATE(tmp1)); - P_updater::update(data_[t1], tmp2); - P_updater::update(data_[t2], tmp3); - P_updater::update(data_[t3], tmp4); - } -#endif - } - else { - // Not all unit strides -- have to access all the vector elements - // as data_[i*stride_], which is slower. - for (int i=0; i < length_; ++i) - P_updater::update((*this)[i], expr[i]); - } -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator=(_bz_VecExpr<P_expr> expr) -{ - BZPRECONDITION(expr.length(length_) == length_); - - // If all vectors in the expression, plus the vector to which the - // result is being assigned have unit stride, then avoid stride - // calculations. - if ((stride_ == 1) && (expr._bz_hasFastAccess())) - { -#ifndef BZ_PARTIAL_LOOP_UNROLL - for (int i=0; i < length_; ++i) - data_[i] = (P_numtype)expr._bz_fastAccess(i); -#else - // Unwind the inner loop, four elements at a time. - int leftover = length_ & 3; - - int i=0; - for (; i < leftover; ++i) - data_[i] = (P_numtype)expr._bz_fastAccess(i); - - for (; i < length_; i += 4) - { - // Common subexpression elimination: avoid doing i+1, i+2, i+3 - // multiple times (compilers *won't* do this cse automatically) - int t1 = i+1; - int t2 = i+2; - int t3 = i+3; - - _bz_typename P_expr::T_numtype tmp1, tmp2, tmp3, tmp4; - - // Reading all the results first avoids aliasing - // ambiguities, and provides more flexibility in - // register allocation & instruction scheduling - tmp1 = expr._bz_fastAccess(i); - tmp2 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t1)); - tmp3 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t2)); - tmp4 = expr._bz_fastAccess(BZ_NO_PROPAGATE(t3)); - - data_[i] = (P_numtype)BZ_NO_PROPAGATE(tmp1); - data_[t1] = (P_numtype)tmp2; - data_[t2] = (P_numtype)tmp3; - data_[t3] = (P_numtype)tmp4; - } -#endif - } - else { - // Not all unit strides -- have to access all the vector elements - // as data_[i*stride_], which is slower. - for (int i=0; i < length_; ++i) - (*this)[i] = (P_numtype)expr[i]; - } - return *this; -} - -#ifdef BZ_PARTIAL_LOOP_UNROLL - -#define BZ_VECTOR_ASSIGN(op) \ -template<class P_numtype> template<class P_expr> \ -inline Vector<P_numtype>& Vector<P_numtype>:: \ - operator op (_bz_VecExpr<P_expr> expr) \ -{ \ - BZPRECONDITION(expr.length(length_) == length_); \ - if ((stride_ == 1) && (expr._bz_hasFastAccess())) \ - { \ - int leftover = length_ & 0x03; \ - \ - int i=0; \ - for (; i < leftover; ++i) \ - data_[i] op expr._bz_fastAccess(i); \ - \ - for (; i < length_; i += 4) \ - { \ - int t1 = i+1; \ - int t2 = i+2; \ - int t3 = i+3; \ - \ - _bz_typename P_expr::T_numtype tmp1, tmp2, tmp3, tmp4; \ - \ - tmp1 = expr._bz_fastAccess(i); \ - tmp2 = expr._bz_fastAccess(t1); \ - tmp3 = expr._bz_fastAccess(t2); \ - tmp4 = expr._bz_fastAccess(t3); \ - \ - data_[i] op tmp1; \ - data_[t1] op tmp2; \ - data_[t2] op tmp3; \ - data_[t3] op tmp4; \ - } \ - } \ - else { \ - for (int i=0; i < length_; ++i) \ - (*this)[i] op expr[i]; \ - } \ - return *this; \ -} - -#else // not BZ_PARTIAL_LOOP_UNROLL - -#ifdef BZ_ALTERNATE_FORWARD_BACKWARD_TRAVERSALS - -/* - * NEEDS_WORK: need to incorporate BZ_NO_PROPAGATE here. This - * will require doing away with the macro BZ_VECTOR_ASSIGN, and - * adopting an approach similar to that used in arrayeval.cc. - */ - -#define BZ_VECTOR_ASSIGN(op) \ -template<class P_numtype> template<class P_expr> \ -inline Vector<P_numtype>& Vector<P_numtype>:: \ - operator op (_bz_VecExpr<P_expr> expr) \ -{ \ - BZPRECONDITION(expr.length(length_) == length_); \ - static int traversalOrder = 0; \ - if ((stride_ == 1) && (expr._bz_hasFastAccess())) \ - { \ - if (traversalOrder & 0x01) \ - for (int i=length_-1; i >= 0; --i) \ - data_[i] op expr._bz_fastAccess(i); \ - else \ - for (int i=0; i < length_; ++i) \ - data_[i] op expr._bz_fastAccess(i); \ - } \ - else { \ - for (int i=0; i < length_; ++i) \ - (*this)[i] op expr[i]; \ - } \ - traversalOrder ^= 0x01; \ - return *this; \ -} - -#else // not BZ_ALTERNATE_FORWARD_BACKWARD_TRAVERSALS - -#define BZ_VECTOR_ASSIGN(op) \ -template<class P_numtype> template<class P_expr> \ -inline Vector<P_numtype>& Vector<P_numtype>:: \ - operator op (_bz_VecExpr<P_expr> expr) \ -{ \ - BZPRECONDITION(expr.length(length_) == length_); \ - if ((stride_ == 1) && (expr._bz_hasFastAccess())) \ - { \ - for (int i=0; i < length_; ++i) \ - data_[i] op expr._bz_fastAccess(i); \ - } \ - else { \ - for (int i=0; i < length_; ++i) \ - (*this)[i] op expr[i]; \ - } \ - return *this; \ -} -#endif // BZ_ALTERNATE_FORWARD_BACKWARD_TRAVERSALS -#endif // BZ_PARTIAL_LOOP_UNROLL - -BZ_VECTOR_ASSIGN(+=) -BZ_VECTOR_ASSIGN(-=) -BZ_VECTOR_ASSIGN(*=) -BZ_VECTOR_ASSIGN(/=) -BZ_VECTOR_ASSIGN(%=) -BZ_VECTOR_ASSIGN(^=) -BZ_VECTOR_ASSIGN(&=) -BZ_VECTOR_ASSIGN(|=) -BZ_VECTOR_ASSIGN(>>=) -BZ_VECTOR_ASSIGN(<<=) - -#if NOT_DEFINED - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator+=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_plus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator-=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_minus_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator*=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_multiply_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator/=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_divide_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator%=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_mod_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator^=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_xor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator&=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitand_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator|=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_bitor_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator>>=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftr_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} - -template<class P_numtype> template<class P_expr> -inline Vector<P_numtype>& Vector<P_numtype>::operator<<=(_bz_VecExpr<P_expr> expr) -{ - _bz_assign(expr, _bz_shiftl_update<P_numtype, - _bz_typename P_expr::T_numtype>()); - return *this; -} -#endif // NOT_DEFINED - -/***************************************************************************** - * Assignment operators with scalar operand - */ - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::initialize(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) = _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator+=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) += _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator-=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) -= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator*=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) *= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator/=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) /= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator%=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) %= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator^=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) ^= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator&=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) &= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator|=(P_numtype x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) |= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator>>=(int x) -{ - typedef _bz_VecExprConstant<int> T_expr; - (*this) >>= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator<<=(int x) -{ - typedef _bz_VecExprConstant<P_numtype> T_expr; - (*this) <<= _bz_VecExpr<T_expr>(T_expr(x)); - return *this; -} - -/***************************************************************************** - * Assignment operators with vector operand - */ - -// This version is for two vectors with the same template parameter. -// Does not appear to be supported by the current C++ standard; or -// is it? -#if 0 -template<class P_numtype> template<> -inline Vector<P_numtype>& -Vector<P_numtype>::operator=(const Vector<P_numtype>& x) -{ - // NEEDS_WORK: if unit strides, use memcpy or something similar. - - typedef VectorIterConst<P_numtype> T_expr; - (*this) = _bz_VecExpr<T_expr>(T_expr(*this)); - return *this; -} -#endif - -// This version is for two vectors with *different* template -// parameters. -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator=(const Vector<P_numtype2>& x) -{ - (*this) = _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator+=(const Vector<P_numtype2>& x) -{ - (*this) += _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator-=(const Vector<P_numtype2>& x) -{ - (*this) -= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator*=(const Vector<P_numtype2>& x) -{ - (*this) *= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator/=(const Vector<P_numtype2>& x) -{ - (*this) /= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator%=(const Vector<P_numtype2>& x) -{ - (*this) %= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator^=(const Vector<P_numtype2>& x) -{ - (*this) ^= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator&=(const Vector<P_numtype2>& x) -{ - (*this) &= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator|=(const Vector<P_numtype2>& x) -{ - (*this) |= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator<<=(const Vector<P_numtype2>& x) -{ - (*this) <<= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& -Vector<P_numtype>::operator>>=(const Vector<P_numtype2>& x) -{ - (*this) >>= _bz_VecExpr<VectorIterConst<P_numtype2> >(x.begin()); - return *this; -} - -/***************************************************************************** - * Assignment operators with Range operand - */ - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator=(Range r) -{ - (*this) = _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator+=(Range r) -{ - (*this) += _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator-=(Range r) -{ - (*this) -= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator*=(Range r) -{ - (*this) *= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator/=(Range r) -{ - (*this) /= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator%=(Range r) -{ - (*this) %= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator^=(Range r) -{ - (*this) ^= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator&=(Range r) -{ - (*this) &= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator|=(Range r) -{ - (*this) |= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator>>=(Range r) -{ - (*this) >>= _bz_VecExpr<Range>(r); - return *this; -} - -template<class P_numtype> -inline Vector<P_numtype>& Vector<P_numtype>::operator<<=(Range r) -{ - (*this) <<= _bz_VecExpr<Range>(r); - return *this; -} - -/***************************************************************************** - * Assignment operators with VectorPick operand - */ - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) = _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator+=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) += _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator-=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) -= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator*=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) *= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator/=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) /= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator%=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) %= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator^=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) ^= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator&=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) &= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -template<class P_numtype> template<class P_numtype2> -inline Vector<P_numtype>& Vector<P_numtype>::operator|=(const - VectorPick<P_numtype2>& x) -{ - typedef VectorPickIterConst<P_numtype2> T_expr; - (*this) |= _bz_VecExpr<T_expr>(x.begin()); - return *this; -} - -/***************************************************************************** - * Assignment operators with Random operand - */ - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator=(Random<P_distribution>& rand) -{ - for (int i=0; i < length_; ++i) - (*this)[i] = rand.random(); - return *this; -} - -#ifdef BZ_PECULIAR_RANDOM_VECTOR_ASSIGN_BUG - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator=(Random<P_distribution>& rand) -{ - (*this) = _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator+=(Random<P_distribution>& rand) -{ - (*this) += _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator-=(Random<P_distribution>& rand) -{ - (*this) -= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator*=(Random<P_distribution>& rand) -{ - (*this) *= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator/=(Random<P_distribution>& rand) -{ - (*this) /= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator%=(Random<P_distribution>& rand) -{ - (*this) %= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator^=(Random<P_distribution>& rand) -{ - (*this) ^= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator&=(Random<P_distribution>& rand) -{ - (*this) &= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -template<class P_numtype> template<class P_distribution> -Vector<P_numtype>& Vector<P_numtype>::operator|=(Random<P_distribution>& rand) -{ - (*this) |= _bz_VecExpr<_bz_VecExprRandom<P_distribution> > - (_bz_VecExprRandom<P_distribution>(rand)); - return *this; -} - -#endif // BZ_PECULIAR_RANDOM_VECTOR_ASSIGN_BUG - -BZ_NAMESPACE_END - -#endif // BZ_VECTOR_CC diff --git a/weave/blitz-20001213/blitz/vector.h b/weave/blitz-20001213/blitz/vector.h deleted file mode 100644 index 9fb8512cd..000000000 --- a/weave/blitz-20001213/blitz/vector.h +++ /dev/null @@ -1,507 +0,0 @@ -/*************************************************************************** - * blitz/vector.h Declaration of the Vector<P_numtype> class - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.8 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.7 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.6 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.5 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - * Revision 1.4 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * Revision 1.3 1996/11/11 17:29:13 tveldhui - * Periodic RCS update - * - * Revision 1.2 1996/10/31 21:06:54 tveldhui - * Did away with multiple template parameters. - */ - -/* - * KNOWN BUGS - * - * 1. operator[](Vector<int>) won't match; compiler complains of no - * suitable copy constructor for VectorPick<T> - * 2. Vector<T>(_bz_VecExpr<E>) constructor generates warning - * 3. operator+=,-=,..etc.(Random<D>) won't match; compiler complains of - * no suitable copy constructor for _bz_VecExpr(...). - */ - -#ifndef BZ_VECTOR_H -#define BZ_VECTOR_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -#ifndef BZ_MEMBLOCK_H - #include <blitz/memblock.h> -#endif - -#ifndef BZ_RANGE_H - #include <blitz/range.h> -#endif - -#ifndef BZ_LISTINIT_H - #include <blitz/listinit.h> -#endif - -BZ_NAMESPACE(blitz) - -// Forward declarations -template<class P_numtype> class VectorIter; -template<class P_numtype> class VectorIterConst; -template<class P_expr> class _bz_VecExpr; -template<class P_numtype> class VectorPick; -template<class P_numtype> class Random; - -// Declaration of class Vector<P_numtype> - -template<class P_numtype> -class Vector : protected MemoryBlockReference<P_numtype> { - -public: - ////////////////////////////////////////////// - // Public Types - ////////////////////////////////////////////// - - typedef MemoryBlockReference<P_numtype> T_Base; - typedef P_numtype T_numtype; - typedef Vector<T_numtype> T_vector; - typedef VectorIter<T_numtype> T_iterator; - typedef VectorIterConst<T_numtype> T_constIterator; - typedef VectorPick<T_numtype> T_pick; - typedef Vector<int> T_indexVector; - - ////////////////////////////////////////////// - // Constructors // - ////////////////////////////////////////////// - // Most of the constructors are inlined so that - // the setting of the stride_ data member will - // be visible to the optimizer. - - Vector() - { - length_ = 0; - stride_ = 0; - } - - // This constructor is provided inline because it involves - // no memory allocation. - Vector(Vector<T_numtype>& vec) - : MemoryBlockReference<T_numtype>(vec) - { - length_ = vec.length_; - stride_ = vec.stride_; - } - - // Slightly unsafe cast-away-const version - Vector(const Vector<T_numtype>& vec) - : MemoryBlockReference<T_numtype> - (const_cast<Vector<T_numtype>& >(vec)) - { - length_ = vec.length_; - stride_ = vec.stride_; - } - - _bz_explicit Vector(int length) - : MemoryBlockReference<T_numtype>(length) - { - length_ = length; - stride_ = 1; - } - - Vector(Vector<T_numtype>& vec, Range r) - : MemoryBlockReference<T_numtype>(vec, - r.first() * vec.stride()) - { - BZPRECONDITION((r.first() >= 0) && (r.first() < vec.length())); - BZPRECONDITION((r.last(vec.length()-1) >= 0) - && (r.last(vec.length()-1) < vec.length())); - length_ = (r.last(vec.length()-1) - r.first()) / r.stride() + 1; - stride_ = vec.stride_ * r.stride(); - } - - Vector(int length, T_numtype initValue) - : MemoryBlockReference<T_numtype>(length) - { - length_ = length; - stride_ = 1; - (*this) = initValue; - } - - Vector(int length, T_numtype firstValue, T_numtype delta) - : MemoryBlockReference<T_numtype>(length) - { - length_ = length; - stride_ = 1; - for (int i=0; i < length; ++i) - data_[i] = firstValue + i * delta; - } - - template<class P_distribution> - Vector(int length, Random<P_distribution>& random) - : MemoryBlockReference<T_numtype>(length) - { - length_ = length; - stride_ = 1; - (*this) = random; - } - - template<class P_expr> - Vector(_bz_VecExpr<P_expr> expr) - : MemoryBlockReference<T_numtype>(expr._bz_suggestLength()) - { - length_ = expr._bz_suggestLength(); - stride_ = 1; - (*this) = expr; - } - - // Create a vector view of an already allocated block of memory. - // Note that the memory will not be freed when this vector is - // destroyed. - Vector(int length, T_numtype* _bz_restrict data, int stride = 1) - : MemoryBlockReference<T_numtype>(length, data, neverDeleteData) - { - length_ = length; - stride_ = stride; - } - - // Create a vector containing a range of numbers - Vector(Range r) - : MemoryBlockReference<T_numtype>(r._bz_suggestLength()) - { - length_ = r._bz_suggestLength(); - stride_ = 1; - (*this) = _bz_VecExpr<Range>(r); - } - - ////////////////////////////////////////////// - // Member functions - ////////////////////////////////////////////// - - // assertUnitStride() is provided as an optimizing trick. When - // vectors are constructed outside the function scope, the optimizer - // is unaware that they have unit stride. This function sets the - // stride to 1 in the local scope so the optimizer can do copy - // propagation & dead code elimination. Obviously, you don't - // want to use this routine unless you are certain that the - // vectors have unit stride. - void assertUnitStride() - { - BZPRECONDITION(stride_ == 1); - stride_ = 1; - } - - T_iterator begin() - { return T_iterator(*this); } - - T_constIterator begin() const - { return T_constIterator(*this); } - - T_vector copy() const; - - // T_iterator end(); - // T_constIterator end() const; - - T_numtype * _bz_restrict data() - { return data_; } - - const T_numtype * _bz_restrict data() const - { return data_; } - - _bz_bool isUnitStride() const - { return stride_ == 1; } - - int length() const - { return length_; } - - void makeUnique(); - - // int storageSize() const; - - // void storeToBuffer(void* buffer, int bufferLength) const; - - void reference(T_vector&); - - void resize(int length); - - void resizeAndPreserve(int newLength); - - // int restoreFromBuffer(void* buffer, int bufferLength); - - T_vector reverse() - { return T_vector(*this,Range(length()-1,0,-1)); } - - int stride() const - { return stride_; } - - operator _bz_VecExpr<VectorIterConst<T_numtype> > () const - { return _bz_VecExpr<VectorIterConst<T_numtype> >(begin()); } - - ///////////////////////////////////////////// - // Library-internal member functions - // These are undocumented and may change or - // disappear in future releases. - ///////////////////////////////////////////// - - int _bz_suggestLength() const - { return length_; } - - _bz_bool _bz_hasFastAccess() const - { return stride_ == 1; } - - T_numtype& _bz_fastAccess(int i) - { return data_[i]; } - - T_numtype _bz_fastAccess(int i) const - { return data_[i]; } - - template<class P_expr, class P_updater> - void _bz_assign(P_expr, P_updater); - - _bz_VecExpr<T_constIterator> _bz_asVecExpr() const - { return _bz_VecExpr<T_constIterator>(begin()); } - - ////////////////////////////////////////////// - // Subscripting operators - ////////////////////////////////////////////// - - // operator()(int) may be used only when the vector has unit - // stride. Otherwise, use operator[]. - T_numtype operator()(int i) const - { - BZPRECONDITION(i < length_); - BZPRECONDITION(stride_ == 1); - return data_[i]; - } - - // operator()(int) may be used only when the vector has unit - // stride. Otherwise, use operator[]. - T_numtype& _bz_restrict operator()(int i) - { - BZPRECONDITION(i < length_); - BZPRECONDITION(stride_ == 1); - return data_[i]; - } - - T_numtype operator[](int i) const - { - BZPRECONDITION(i < length_); - return data_[i * stride_]; - } - - T_numtype& _bz_restrict operator[](int i) - { - BZPRECONDITION(i < length_); - return data_[i * stride_]; - } - - T_vector operator()(Range r) - { - return T_vector(*this, r); - } - - T_vector operator[](Range r) - { - return T_vector(*this, r); - } - - T_pick operator()(T_indexVector i) - { - return T_pick(*this, i); - } - - T_pick operator[](T_indexVector i) - { - return T_pick(*this, i); - } - - // T_vector operator()(difference-equation-expression) - - ////////////////////////////////////////////// - // Assignment operators - ////////////////////////////////////////////// - - // Scalar operand - ListInitializationSwitch<T_vector,T_iterator> operator=(T_numtype x) - { - return ListInitializationSwitch<T_vector,T_iterator>(*this, x); - } - - T_iterator getInitializationIterator() - { return begin(); } - - T_vector& initialize(T_numtype); - T_vector& operator+=(T_numtype); - T_vector& operator-=(T_numtype); - T_vector& operator*=(T_numtype); - T_vector& operator/=(T_numtype); - T_vector& operator%=(T_numtype); - T_vector& operator^=(T_numtype); - T_vector& operator&=(T_numtype); - T_vector& operator|=(T_numtype); - T_vector& operator>>=(int); - T_vector& operator<<=(int); - - // Vector operand - - template<class P_numtype2> T_vector& operator=(const Vector<P_numtype2> &); - - // Specialization uses memcpy instead of element-by-element cast and - // copy - // NEEDS_WORK -- KCC won't accept this syntax; standard?? - // template<> T_vector& operator=(const T_vector&); - - template<class P_numtype2> T_vector& operator+=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator-=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator*=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator/=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator%=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator^=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator&=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator|=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator>>=(const Vector<P_numtype2> &); - template<class P_numtype2> T_vector& operator<<=(const Vector<P_numtype2> &); - - // Vector expression operand - template<class P_expr> T_vector& operator=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator+=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator-=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator*=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator/=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator%=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator^=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator&=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator|=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator>>=(_bz_VecExpr<P_expr>); - template<class P_expr> T_vector& operator<<=(_bz_VecExpr<P_expr>); - - // VectorPick operand - template<class P_numtype2> - T_vector& operator=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator+=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator-=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator*=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator/=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator%=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator^=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator&=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator|=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator>>=(const VectorPick<P_numtype2> &); - template<class P_numtype2> - T_vector& operator<<=(const VectorPick<P_numtype2> &); - - // Range operand - T_vector& operator=(Range); - T_vector& operator+=(Range); - T_vector& operator-=(Range); - T_vector& operator*=(Range); - T_vector& operator/=(Range); - T_vector& operator%=(Range); - T_vector& operator^=(Range); - T_vector& operator&=(Range); - T_vector& operator|=(Range); - T_vector& operator>>=(Range); - T_vector& operator<<=(Range); - - // Random operand - template<class P_distribution> - T_vector& operator=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator+=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator-=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator*=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator/=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator%=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator^=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator&=(Random<P_distribution>& random); - template<class P_distribution> - T_vector& operator|=(Random<P_distribution>& random); - - ////////////////////////////////////////////// - // Unary operators - ////////////////////////////////////////////// - -// T_vector& operator++(); -// void operator++(int); -// T_vector& operator--(); -// void operator--(int); - - using T_Base::data_; - -private: - int length_; - int stride_; -}; - -// Global I/O functions - -template<class P_numtype> -ostream& operator<<(ostream& os, const Vector<P_numtype>& x); - -template<class P_expr> -ostream& operator<<(ostream& os, _bz_VecExpr<P_expr> expr); - -BZ_NAMESPACE_END - -#include <blitz/veciter.h> // Iterators -#include <blitz/vecpick.h> // VectorPick -#include <blitz/vecexpr.h> // Expression templates -#include <blitz/vecglobs.h> // Global functions -#include <blitz/vector.cc> // Member functions -#include <blitz/vecio.cc> // IO functions - -#endif // BZ_VECTOR_H diff --git a/weave/blitz-20001213/blitz/vecuops.cc b/weave/blitz-20001213/blitz/vecuops.cc deleted file mode 100644 index b712bdc22..000000000 --- a/weave/blitz-20001213/blitz/vecuops.cc +++ /dev/null @@ -1,2693 +0,0 @@ -/*************************************************************************** - * blitz/vecuops.cc Expression templates for vectors, unary functions - * - * $Id$ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - */ - -// Generated source file. Do not edit. -// genvecuops.cpp Dec 5 1998 17:06:25 - -#ifndef BZ_VECUOPS_CC -#define BZ_VECUOPS_CC - -#ifndef BZ_VECEXPR_H - #error <blitz/vecuops.cc> must be included via <blitz/vecexpr.h> -#endif // BZ_VECEXPR_H - -BZ_NAMESPACE(blitz) - -/**************************************************************************** - * abs - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_abs<P_numtype1> > > -abs(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > > -abs(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_abs<P_numtype1> > > -abs(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_abs<int> > > -abs(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_abs<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_abs<P_numtype1> > > -abs(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * acos - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_acos<P_numtype1> > > -acos(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_acos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_acos<_bz_typename P_expr1::T_numtype> > > -acos(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_acos<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_acos<P_numtype1> > > -acos(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_acos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_acos<int> > > -acos(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_acos<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_acos<P_numtype1> > > -acos(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_acos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * acosh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_acosh<P_numtype1> > > -acosh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_acosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_acosh<_bz_typename P_expr1::T_numtype> > > -acosh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_acosh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_acosh<P_numtype1> > > -acosh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_acosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_acosh<int> > > -acosh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_acosh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_acosh<P_numtype1> > > -acosh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_acosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * asin - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_asin<P_numtype1> > > -asin(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_asin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_asin<_bz_typename P_expr1::T_numtype> > > -asin(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_asin<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_asin<P_numtype1> > > -asin(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_asin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_asin<int> > > -asin(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_asin<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_asin<P_numtype1> > > -asin(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_asin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * asinh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_asinh<P_numtype1> > > -asinh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_asinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_asinh<_bz_typename P_expr1::T_numtype> > > -asinh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_asinh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_asinh<P_numtype1> > > -asinh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_asinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_asinh<int> > > -asinh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_asinh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_asinh<P_numtype1> > > -asinh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_asinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * atan - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_atan<P_numtype1> > > -atan(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_atan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_atan<_bz_typename P_expr1::T_numtype> > > -atan(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_atan<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_atan<P_numtype1> > > -atan(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_atan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_atan<int> > > -atan(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_atan<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_atan<P_numtype1> > > -atan(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_atan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * atanh - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_atanh<P_numtype1> > > -atanh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_atanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_atanh<_bz_typename P_expr1::T_numtype> > > -atanh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_atanh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_atanh<P_numtype1> > > -atanh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_atanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_atanh<int> > > -atanh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_atanh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_atanh<P_numtype1> > > -atanh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_atanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * _class - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz__class<P_numtype1> > > -_class(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz__class<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz__class<_bz_typename P_expr1::T_numtype> > > -_class(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz__class<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz__class<P_numtype1> > > -_class(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz__class<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz__class<int> > > -_class(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz__class<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz__class<P_numtype1> > > -_class(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz__class<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * cbrt - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cbrt<P_numtype1> > > -cbrt(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cbrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cbrt<_bz_typename P_expr1::T_numtype> > > -cbrt(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cbrt<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cbrt<P_numtype1> > > -cbrt(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cbrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_cbrt<int> > > -cbrt(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_cbrt<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cbrt<P_numtype1> > > -cbrt(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cbrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * ceil - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_ceil<P_numtype1> > > -ceil(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_ceil<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_ceil<_bz_typename P_expr1::T_numtype> > > -ceil(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_ceil<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_ceil<P_numtype1> > > -ceil(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_ceil<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_ceil<int> > > -ceil(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_ceil<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_ceil<P_numtype1> > > -ceil(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_ceil<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * cos - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cos<P_numtype1> > > -cos(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cos<_bz_typename P_expr1::T_numtype> > > -cos(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cos<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cos<P_numtype1> > > -cos(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_cos<int> > > -cos(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_cos<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cos<P_numtype1> > > -cos(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cos<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * cosh - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cosh<P_numtype1> > > -cosh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_cosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cosh<_bz_typename P_expr1::T_numtype> > > -cosh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_cosh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cosh<P_numtype1> > > -cosh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_cosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_cosh<int> > > -cosh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_cosh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cosh<P_numtype1> > > -cosh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_cosh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * exp - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_exp<P_numtype1> > > -exp(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_exp<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_exp<_bz_typename P_expr1::T_numtype> > > -exp(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_exp<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_exp<P_numtype1> > > -exp(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_exp<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_exp<int> > > -exp(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_exp<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_exp<P_numtype1> > > -exp(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_exp<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * expm1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_expm1<P_numtype1> > > -expm1(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_expm1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_expm1<_bz_typename P_expr1::T_numtype> > > -expm1(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_expm1<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_expm1<P_numtype1> > > -expm1(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_expm1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_expm1<int> > > -expm1(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_expm1<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_expm1<P_numtype1> > > -expm1(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_expm1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * erf - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_erf<P_numtype1> > > -erf(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_erf<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_erf<_bz_typename P_expr1::T_numtype> > > -erf(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_erf<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_erf<P_numtype1> > > -erf(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_erf<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_erf<int> > > -erf(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_erf<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_erf<P_numtype1> > > -erf(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_erf<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * erfc - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_erfc<P_numtype1> > > -erfc(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_erfc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_erfc<_bz_typename P_expr1::T_numtype> > > -erfc(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_erfc<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_erfc<P_numtype1> > > -erfc(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_erfc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_erfc<int> > > -erfc(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_erfc<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_erfc<P_numtype1> > > -erfc(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_erfc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * fabs - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_abs<P_numtype1> > > -fabs(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > > -fabs(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_abs<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_abs<P_numtype1> > > -fabs(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_abs<int> > > -fabs(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_abs<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_abs<P_numtype1> > > -fabs(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_abs<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * floor - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_floor<P_numtype1> > > -floor(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_floor<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_floor<_bz_typename P_expr1::T_numtype> > > -floor(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_floor<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_floor<P_numtype1> > > -floor(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_floor<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_floor<int> > > -floor(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_floor<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_floor<P_numtype1> > > -floor(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_floor<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * ilogb - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_ilogb<P_numtype1> > > -ilogb(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_ilogb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_ilogb<_bz_typename P_expr1::T_numtype> > > -ilogb(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_ilogb<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_ilogb<P_numtype1> > > -ilogb(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_ilogb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_ilogb<int> > > -ilogb(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_ilogb<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_ilogb<P_numtype1> > > -ilogb(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_ilogb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * isnan - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_isnan<P_numtype1> > > -isnan(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_isnan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_isnan<_bz_typename P_expr1::T_numtype> > > -isnan(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_isnan<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_isnan<P_numtype1> > > -isnan(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_isnan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_isnan<int> > > -isnan(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_isnan<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_isnan<P_numtype1> > > -isnan(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_isnan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * itrunc - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_itrunc<P_numtype1> > > -itrunc(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_itrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_itrunc<_bz_typename P_expr1::T_numtype> > > -itrunc(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_itrunc<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_itrunc<P_numtype1> > > -itrunc(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_itrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_itrunc<int> > > -itrunc(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_itrunc<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_itrunc<P_numtype1> > > -itrunc(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_itrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * j0 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_j0<P_numtype1> > > -j0(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_j0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_j0<_bz_typename P_expr1::T_numtype> > > -j0(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_j0<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_j0<P_numtype1> > > -j0(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_j0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_j0<int> > > -j0(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_j0<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_j0<P_numtype1> > > -j0(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_j0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * j1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_j1<P_numtype1> > > -j1(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_j1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_j1<_bz_typename P_expr1::T_numtype> > > -j1(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_j1<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_j1<P_numtype1> > > -j1(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_j1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_j1<int> > > -j1(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_j1<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_j1<P_numtype1> > > -j1(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_j1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * lgamma - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_lgamma<P_numtype1> > > -lgamma(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_lgamma<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_lgamma<_bz_typename P_expr1::T_numtype> > > -lgamma(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_lgamma<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_lgamma<P_numtype1> > > -lgamma(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_lgamma<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_lgamma<int> > > -lgamma(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_lgamma<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_lgamma<P_numtype1> > > -lgamma(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_lgamma<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * log - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log<P_numtype1> > > -log(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log<_bz_typename P_expr1::T_numtype> > > -log(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log<P_numtype1> > > -log(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_log<int> > > -log(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_log<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log<P_numtype1> > > -log(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * logb - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_logb<P_numtype1> > > -logb(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_logb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_logb<_bz_typename P_expr1::T_numtype> > > -logb(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_logb<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_logb<P_numtype1> > > -logb(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_logb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_logb<int> > > -logb(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_logb<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_logb<P_numtype1> > > -logb(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_logb<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * log1p - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log1p<P_numtype1> > > -log1p(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log1p<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log1p<_bz_typename P_expr1::T_numtype> > > -log1p(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log1p<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log1p<P_numtype1> > > -log1p(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log1p<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_log1p<int> > > -log1p(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_log1p<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log1p<P_numtype1> > > -log1p(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log1p<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * log10 - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log10<P_numtype1> > > -log10(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_log10<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log10<_bz_typename P_expr1::T_numtype> > > -log10(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_log10<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log10<P_numtype1> > > -log10(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_log10<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_log10<int> > > -log10(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_log10<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log10<P_numtype1> > > -log10(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_log10<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * nearest - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_nearest<P_numtype1> > > -nearest(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_nearest<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_nearest<_bz_typename P_expr1::T_numtype> > > -nearest(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_nearest<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_nearest<P_numtype1> > > -nearest(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_nearest<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_nearest<int> > > -nearest(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_nearest<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_nearest<P_numtype1> > > -nearest(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_nearest<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * rint - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_rint<P_numtype1> > > -rint(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_rint<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_rint<_bz_typename P_expr1::T_numtype> > > -rint(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_rint<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_rint<P_numtype1> > > -rint(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_rint<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_rint<int> > > -rint(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_rint<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_rint<P_numtype1> > > -rint(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_rint<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * rsqrt - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_rsqrt<P_numtype1> > > -rsqrt(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_rsqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_rsqrt<_bz_typename P_expr1::T_numtype> > > -rsqrt(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_rsqrt<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_rsqrt<P_numtype1> > > -rsqrt(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_rsqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_rsqrt<int> > > -rsqrt(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_rsqrt<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_rsqrt<P_numtype1> > > -rsqrt(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_rsqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * sin - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sin<P_numtype1> > > -sin(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sin<_bz_typename P_expr1::T_numtype> > > -sin(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sin<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sin<P_numtype1> > > -sin(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_sin<int> > > -sin(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_sin<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sin<P_numtype1> > > -sin(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sin<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * sinh - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sinh<P_numtype1> > > -sinh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sinh<_bz_typename P_expr1::T_numtype> > > -sinh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sinh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sinh<P_numtype1> > > -sinh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_sinh<int> > > -sinh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_sinh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sinh<P_numtype1> > > -sinh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sinh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * sqr - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sqr<P_numtype1> > > -sqr(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sqr<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sqr<_bz_typename P_expr1::T_numtype> > > -sqr(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sqr<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sqr<P_numtype1> > > -sqr(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sqr<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_sqr<int> > > -sqr(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_sqr<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sqr<P_numtype1> > > -sqr(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sqr<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * sqrt - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sqrt<P_numtype1> > > -sqrt(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_sqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sqrt<_bz_typename P_expr1::T_numtype> > > -sqrt(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_sqrt<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sqrt<P_numtype1> > > -sqrt(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_sqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_sqrt<int> > > -sqrt(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_sqrt<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sqrt<P_numtype1> > > -sqrt(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_sqrt<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * tan - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_tan<P_numtype1> > > -tan(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_tan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_tan<_bz_typename P_expr1::T_numtype> > > -tan(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_tan<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_tan<P_numtype1> > > -tan(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_tan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_tan<int> > > -tan(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_tan<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_tan<P_numtype1> > > -tan(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_tan<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * tanh - ****************************************************************************/ - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_tanh<P_numtype1> > > -tanh(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_tanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_tanh<_bz_typename P_expr1::T_numtype> > > -tanh(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_tanh<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_tanh<P_numtype1> > > -tanh(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_tanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_tanh<int> > > -tanh(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_tanh<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_tanh<P_numtype1> > > -tanh(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_tanh<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -/**************************************************************************** - * uitrunc - ****************************************************************************/ - -#ifdef BZ_HAVE_SYSV_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_uitrunc<P_numtype1> > > -uitrunc(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_uitrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_uitrunc<_bz_typename P_expr1::T_numtype> > > -uitrunc(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_uitrunc<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_uitrunc<P_numtype1> > > -uitrunc(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_uitrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_uitrunc<int> > > -uitrunc(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_uitrunc<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_uitrunc<P_numtype1> > > -uitrunc(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_uitrunc<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * y0 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_y0<P_numtype1> > > -y0(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_y0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_y0<_bz_typename P_expr1::T_numtype> > > -y0(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_y0<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_y0<P_numtype1> > > -y0(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_y0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_y0<int> > > -y0(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_y0<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_y0<P_numtype1> > > -y0(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_y0<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -/**************************************************************************** - * y1 - ****************************************************************************/ - -#ifdef BZ_HAVE_IEEE_MATH -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_y1<P_numtype1> > > -y1(const Vector<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>, - _bz_y1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_y1<_bz_typename P_expr1::T_numtype> > > -y1(_bz_VecExpr<P_expr1> d1) -{ - typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>, - _bz_y1<_bz_typename P_expr1::T_numtype> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_y1<P_numtype1> > > -y1(const VectorPick<P_numtype1>& d1) -{ - typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>, - _bz_y1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - - -inline -_bz_VecExpr<_bz_VecExprUnaryOp<Range, - _bz_y1<int> > > -y1(Range d1) -{ - typedef _bz_VecExprUnaryOp<Range, - _bz_y1<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1)); -} - -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_y1<P_numtype1> > > -y1(const TinyVector<P_numtype1, N_length1>& d1) -{ - typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_y1<P_numtype1> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin())); -} - -#endif - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/vecwhere.cc b/weave/blitz-20001213/blitz/vecwhere.cc deleted file mode 100644 index 966c6e5f3..000000000 --- a/weave/blitz-20001213/blitz/vecwhere.cc +++ /dev/null @@ -1,7753 +0,0 @@ -/*************************************************************************** - * blitz/vecwhere.cc where(X,Y,Z) function for vectors - * - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * Licensing inquiries: blitz-licenses@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:11 tveldhui - * Imported sources - * - * Revision 1.1 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - */ - -// Generated source file. Do not edit. -// genvecwhere.cpp Feb 5 1997 09:52:29 - -#ifndef BZ_VECWHERE_CC -#define BZ_VECWHERE_CC - -BZ_NAMESPACE(blitz) - -// where(Vector<P_numtype1>, Vector<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, Range) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - Range > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, int) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, float) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, long double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, Vector<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, Vector<P_numtype3>) -template<class P_numtype1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, Range) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - Range > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_expr2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, int) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, float) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, double) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, long double) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, _bz_VecExpr<P_expr2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_expr2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, Range) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - Range > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, int) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, float) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, long double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, VectorPick<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, Range, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - Range d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, Range, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - Range d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(Vector<P_numtype1>, Range, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - Range d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, Range, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - Range > > -where(const Vector<P_numtype1>& d1, - Range d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(Vector<P_numtype1>, Range, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - Range d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(Vector<P_numtype1>, Range, int) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - Range d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, Range, float) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - Range d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, Range, double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - Range d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, Range, long double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - Range d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, Range, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - Range d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, Range) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, int) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, float) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, double) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, long double) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, TinyVector<P_numtype2, N_length2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, int N_length2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, int, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - int d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, int, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - int d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(Vector<P_numtype1>, int, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - int d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, int, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - Range > > -where(const Vector<P_numtype1>& d1, - int d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(Vector<P_numtype1>, int, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - int d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, int, int) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > > -where(const Vector<P_numtype1>& d1, - int d2, - int d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - _bz_VecExprConstant<int>(d3))); -} - -// where(Vector<P_numtype1>, float, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - float d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, float, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - float d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(Vector<P_numtype1>, float, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - float d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, float, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - Range > > -where(const Vector<P_numtype1>& d1, - float d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(Vector<P_numtype1>, float, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - float d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, float, float) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > > -where(const Vector<P_numtype1>& d1, - float d2, - float d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - _bz_VecExprConstant<float>(d3))); -} - -// where(Vector<P_numtype1>, double, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(Vector<P_numtype1>, double, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, double, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - Range > > -where(const Vector<P_numtype1>& d1, - double d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(Vector<P_numtype1>, double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, double, double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > > -where(const Vector<P_numtype1>& d1, - double d2, - double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - _bz_VecExprConstant<double>(d3))); -} - -// where(Vector<P_numtype1>, long double, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - long double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, long double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - long double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(Vector<P_numtype1>, long double, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - long double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, long double, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - Range > > -where(const Vector<P_numtype1>& d1, - long double d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(Vector<P_numtype1>, long double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - long double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Vector<P_numtype1>, long double, long double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > > -where(const Vector<P_numtype1>& d1, - long double d2, - long double d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Vector<P_numtype1>, complex<T2>, Vector<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, complex<T2>, _bz_VecExpr<P_expr3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, complex<T2>, VectorPick<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, complex<T2>, Range) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - Range > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - Range d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, complex<T2>, TinyVector<P_numtype3, N_length3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Vector<P_numtype1>, complex<T2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > > -where(const Vector<P_numtype1>& d1, - complex<T2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, Vector<P_numtype3>) -template<class P_expr1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, Range) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, int) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, float) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, double) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, long double) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Vector<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - const Vector<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, Vector<P_numtype3>) -template<class P_expr1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, VectorPick<P_numtype3>) -template<class P_expr1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, Range) -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_expr2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, int) -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, float) -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, double) -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, long double) -template<class P_expr1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, _bz_VecExpr<P_expr2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class P_expr2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - _bz_VecExpr<P_expr2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, Vector<P_numtype3>) -template<class P_expr1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, Range) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, int) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, float) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, double) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, long double) -template<class P_expr1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, VectorPick<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - const VectorPick<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, Range, Vector<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Range, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(_bz_VecExpr<P_expr1>, Range, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Range, Range) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - Range > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(_bz_VecExpr<P_expr1>, Range, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, Range, int) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Range, float) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Range, double) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Range, long double) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, Range, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - Range d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - Range, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, Vector<P_numtype3>) -template<class P_expr1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_numtype2, int N_length2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, Range) -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype2, int N_length2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, int) -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, float) -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, double) -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, long double) -template<class P_expr1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, TinyVector<P_numtype2, N_length2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class P_numtype2, int N_length2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - const TinyVector<P_numtype2, N_length2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, int, Vector<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, int, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, int, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, int, Range) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, int, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, int, int) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > > -where(_bz_VecExpr<P_expr1> d1, - int d2, - int d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - _bz_VecExprConstant<int>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, float, Vector<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, float, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, float, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, float, Range) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, float, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, float, float) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > > -where(_bz_VecExpr<P_expr1> d1, - float d2, - float d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - _bz_VecExprConstant<float>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, double, Vector<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, double, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, double, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, double, Range) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, double, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, double, double) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > > -where(_bz_VecExpr<P_expr1> d1, - double d2, - double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - _bz_VecExprConstant<double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, long double, Vector<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, long double, _bz_VecExpr<P_expr3>) -template<class P_expr1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, long double, VectorPick<P_numtype3>) -template<class P_expr1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, long double, Range) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - Range > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(_bz_VecExpr<P_expr1>, long double, TinyVector<P_numtype3, N_length3>) -template<class P_expr1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(_bz_VecExpr<P_expr1>, long double, long double) -template<class P_expr1> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > > -where(_bz_VecExpr<P_expr1> d1, - long double d2, - long double d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - _bz_VecExprConstant<long double>(d3))); -} - -// where(_bz_VecExpr<P_expr1>, complex<T2>, Vector<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, complex<T2>, _bz_VecExpr<P_expr3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, complex<T2>, VectorPick<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, complex<T2>, Range) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - Range > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - Range d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, complex<T2>, TinyVector<P_numtype3, N_length3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(_bz_VecExpr<P_expr1>, complex<T2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr1, class T2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > > -where(_bz_VecExpr<P_expr1> d1, - complex<T2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<_bz_VecExpr<P_expr1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, Range) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - Range > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, int) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, float) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, long double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, Vector<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - const Vector<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, Vector<P_numtype3>) -template<class P_numtype1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, Range) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - Range > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_expr2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, int) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, float) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, double) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, long double) -template<class P_numtype1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, _bz_VecExpr<P_expr2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_expr2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - _bz_VecExpr<P_expr2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, Range) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - Range > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, int) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, float) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, long double) -template<class P_numtype1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, VectorPick<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - const VectorPick<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, Range, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Range, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(VectorPick<P_numtype1>, Range, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Range, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - Range > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(VectorPick<P_numtype1>, Range, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(VectorPick<P_numtype1>, Range, int) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, Range, float) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, Range, double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, Range, long double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, Range, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - Range d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - Range, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, Range) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype2, int N_length2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, int) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, float) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, double) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, long double) -template<class P_numtype1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, TinyVector<P_numtype2, N_length2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class P_numtype2, int N_length2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, int, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - int d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, int, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - int d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, int, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - int d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, int, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - Range > > -where(const VectorPick<P_numtype1>& d1, - int d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, int, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - int d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, int, int) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > > -where(const VectorPick<P_numtype1>& d1, - int d2, - int d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - _bz_VecExprConstant<int>(d3))); -} - -// where(VectorPick<P_numtype1>, float, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - float d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, float, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - float d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, float, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - float d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, float, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - Range > > -where(const VectorPick<P_numtype1>& d1, - float d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, float, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - float d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, float, float) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > > -where(const VectorPick<P_numtype1>& d1, - float d2, - float d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - _bz_VecExprConstant<float>(d3))); -} - -// where(VectorPick<P_numtype1>, double, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, double, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, double, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - Range > > -where(const VectorPick<P_numtype1>& d1, - double d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, double, double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > > -where(const VectorPick<P_numtype1>& d1, - double d2, - double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - _bz_VecExprConstant<double>(d3))); -} - -// where(VectorPick<P_numtype1>, long double, Vector<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, long double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, long double, VectorPick<P_numtype3>) -template<class P_numtype1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, long double, Range) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - Range > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(VectorPick<P_numtype1>, long double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(VectorPick<P_numtype1>, long double, long double) -template<class P_numtype1> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > > -where(const VectorPick<P_numtype1>& d1, - long double d2, - long double d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - _bz_VecExprConstant<long double>(d3))); -} - -// where(VectorPick<P_numtype1>, complex<T2>, Vector<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, complex<T2>, _bz_VecExpr<P_expr3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, complex<T2>, VectorPick<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, complex<T2>, Range) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - Range > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - Range d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, complex<T2>, TinyVector<P_numtype3, N_length3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(VectorPick<P_numtype1>, complex<T2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, class T2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > > -where(const VectorPick<P_numtype1>& d1, - complex<T2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<VectorPickIterConst<P_numtype1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, Vector<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(Range d1, - const Vector<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, Vector<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - const Vector<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, Vector<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - const Vector<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, Vector<P_numtype2>, Range) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - Range > > -where(Range d1, - const Vector<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, Vector<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - const Vector<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, Vector<P_numtype2>, int) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(Range d1, - const Vector<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, Vector<P_numtype2>, float) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(Range d1, - const Vector<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, Vector<P_numtype2>, double) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(Range d1, - const Vector<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, Vector<P_numtype2>, long double) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(Range d1, - const Vector<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, Vector<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - const Vector<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, _bz_VecExpr<P_expr2>, Vector<P_numtype3>) -template<class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, _bz_VecExpr<P_expr2>, _bz_VecExpr<P_expr3>) -template<class P_expr2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(Range, _bz_VecExpr<P_expr2>, VectorPick<P_numtype3>) -template<class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, _bz_VecExpr<P_expr2>, Range) -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - Range > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(Range, _bz_VecExpr<P_expr2>, TinyVector<P_numtype3, N_length3>) -template<class P_expr2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, _bz_VecExpr<P_expr2>, int) -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - int d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, _bz_VecExpr<P_expr2>, float) -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - float d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, _bz_VecExpr<P_expr2>, double) -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - double d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, _bz_VecExpr<P_expr2>, long double) -template<class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, _bz_VecExpr<P_expr2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_expr2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - _bz_VecExpr<P_expr2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, VectorPick<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, VectorPick<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, VectorPick<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, VectorPick<P_numtype2>, Range) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - Range > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, VectorPick<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, VectorPick<P_numtype2>, int) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, VectorPick<P_numtype2>, float) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, VectorPick<P_numtype2>, double) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, VectorPick<P_numtype2>, long double) -template<class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, VectorPick<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - const VectorPick<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, Range, Vector<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - VectorIterConst<P_numtype3> > > -where(Range d1, - Range d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - Range, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, Range, _bz_VecExpr<P_expr3>) -template<class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExpr<P_expr3> > > -where(Range d1, - Range d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(Range, Range, VectorPick<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - Range d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - Range, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, Range, Range) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - Range > > -where(Range d1, - Range d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - Range, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3)); -} - -// where(Range, Range, TinyVector<P_numtype3, N_length3>) -template<class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - Range d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - d3.begin())); -} - -// where(Range, Range, int) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExprConstant<int> > > -where(Range d1, - Range d2, - int d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, Range, float) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExprConstant<float> > > -where(Range d1, - Range d2, - float d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, Range, double) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExprConstant<double> > > -where(Range d1, - Range d2, - double d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, Range, long double) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExprConstant<long double> > > -where(Range d1, - Range d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, Range, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - Range, - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - Range d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - Range, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, TinyVector<P_numtype2, N_length2>, Vector<P_numtype3>) -template<class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, _bz_VecExpr<P_expr3>) -template<class P_numtype2, int N_length2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, VectorPick<P_numtype3>) -template<class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, Range) -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3)); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype2, int N_length2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - d3.begin())); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, int) -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - int d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, float) -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - float d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, double) -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - double d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, long double) -template<class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, TinyVector<P_numtype2, N_length2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype2, int N_length2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - const TinyVector<P_numtype2, N_length2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, int, Vector<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > > -where(Range d1, - int d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Range, int, _bz_VecExpr<P_expr3>) -template<class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - int d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(Range, int, VectorPick<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - int d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Range, int, Range) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - Range > > -where(Range d1, - int d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(Range, int, TinyVector<P_numtype3, N_length3>) -template<class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - int d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(Range, int, int) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > > -where(Range d1, - int d2, - int d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<int>(d2), - _bz_VecExprConstant<int>(d3))); -} - -// where(Range, float, Vector<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > > -where(Range d1, - float d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Range, float, _bz_VecExpr<P_expr3>) -template<class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - float d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(Range, float, VectorPick<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - float d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Range, float, Range) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - Range > > -where(Range d1, - float d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(Range, float, TinyVector<P_numtype3, N_length3>) -template<class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - float d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(Range, float, float) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > > -where(Range d1, - float d2, - float d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<float>(d2), - _bz_VecExprConstant<float>(d3))); -} - -// where(Range, double, Vector<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > > -where(Range d1, - double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Range, double, _bz_VecExpr<P_expr3>) -template<class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(Range, double, VectorPick<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Range, double, Range) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - Range > > -where(Range d1, - double d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(Range, double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(Range, double, double) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > > -where(Range d1, - double d2, - double d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<double>(d2), - _bz_VecExprConstant<double>(d3))); -} - -// where(Range, long double, Vector<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > > -where(Range d1, - long double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Range, long double, _bz_VecExpr<P_expr3>) -template<class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > > -where(Range d1, - long double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(Range, long double, VectorPick<P_numtype3>) -template<class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > > -where(Range d1, - long double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Range, long double, Range) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - Range > > -where(Range d1, - long double d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(Range, long double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - long double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(Range, long double, long double) - -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > > -where(Range d1, - long double d2, - long double d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<long double>(d2), - _bz_VecExprConstant<long double>(d3))); -} - -// where(Range, complex<T2>, Vector<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > > -where(Range d1, - complex<T2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, complex<T2>, _bz_VecExpr<P_expr3>) -#ifdef BZ_HAVE_COMPLEX -template<class T2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > > -where(Range d1, - complex<T2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, complex<T2>, VectorPick<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > > -where(Range d1, - complex<T2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, complex<T2>, Range) -#ifdef BZ_HAVE_COMPLEX -template<class T2> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - Range > > -where(Range d1, - complex<T2> d2, - Range d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, complex<T2>, TinyVector<P_numtype3, N_length3>) -#ifdef BZ_HAVE_COMPLEX -template<class T2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > > -where(Range d1, - complex<T2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(Range, complex<T2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class T2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > > -where(Range d1, - complex<T2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<Range, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1, - _bz_VecExprConstant<complex<T2> > (d2), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, Range) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, int) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, float) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, double) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, long double) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Vector<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const Vector<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_expr2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, Range) -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_expr2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, int) -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, float) -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, double) -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, long double) -template<class P_numtype1, int N_length1, class P_expr2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, _bz_VecExpr<P_expr2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class P_expr2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - _bz_VecExpr<P_expr2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExpr<P_expr2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, Range) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, int) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, float) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, double) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, long double) -template<class P_numtype1, int N_length1, class P_numtype2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, VectorPick<P_numtype2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class P_numtype2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const VectorPick<P_numtype2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - VectorPickIterConst<P_numtype2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, Range, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, Range) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, int) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, float) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, double) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, long double) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, Range, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - Range d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - Range, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2, - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, Range) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, int) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, float) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, double) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, long double) -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, TinyVector<P_numtype2, N_length2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class P_numtype2, int N_length2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - const TinyVector<P_numtype2, N_length2>& d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - TinyVectorIterConst<P_numtype2, N_length2>, - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - d2.begin(), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, int, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, int, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, int, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, int, Range) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, int, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, int, int) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - int d2, - int d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<int>, - _bz_VecExprConstant<int> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<int>(d2), - _bz_VecExprConstant<int>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, float, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, float, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, float, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, float, Range) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, float, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, float, float) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - float d2, - float d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<float>, - _bz_VecExprConstant<float> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<float>(d2), - _bz_VecExprConstant<float>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, double, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, double, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, double, Range) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, double, double) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - double d2, - double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<double>, - _bz_VecExprConstant<double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<double>(d2), - _bz_VecExprConstant<double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, Vector<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, _bz_VecExpr<P_expr3>) -template<class P_numtype1, int N_length1, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, VectorPick<P_numtype3>) -template<class P_numtype1, int N_length1, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, Range) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3)); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, TinyVector<P_numtype3, N_length3>) -template<class P_numtype1, int N_length1, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - d3.begin())); -} - -// where(TinyVector<P_numtype1, N_length1>, long double, long double) -template<class P_numtype1, int N_length1> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - long double d2, - long double d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<long double>, - _bz_VecExprConstant<long double> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<long double>(d2), - _bz_VecExprConstant<long double>(d3))); -} - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, Vector<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - const Vector<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - VectorIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, _bz_VecExpr<P_expr3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2, class P_expr3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - _bz_VecExpr<P_expr3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExpr<P_expr3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, VectorPick<P_numtype3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2, class P_numtype3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - const VectorPick<P_numtype3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - VectorPickIterConst<P_numtype3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, Range) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - Range > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - Range d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - Range > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3)); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, TinyVector<P_numtype3, N_length3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2, class P_numtype3, int N_length3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - const TinyVector<P_numtype3, N_length3>& d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - TinyVectorIterConst<P_numtype3, N_length3> > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - d3.begin())); -} -#endif // BZ_HAVE_COMPLEX - -// where(TinyVector<P_numtype1, N_length1>, complex<T2>, complex<T3>) -#ifdef BZ_HAVE_COMPLEX -template<class P_numtype1, int N_length1, class T2, class T3> -inline -_bz_VecExpr<_bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > > -where(const TinyVector<P_numtype1, N_length1>& d1, - complex<T2> d2, - complex<T3> d3) -{ - typedef _bz_VecWhere<TinyVectorIterConst<P_numtype1, N_length1>, - _bz_VecExprConstant<complex<T2> > , - _bz_VecExprConstant<complex<T3> > > T_expr; - - return _bz_VecExpr<T_expr>(T_expr(d1.begin(), - _bz_VecExprConstant<complex<T2> > (d2), - _bz_VecExprConstant<complex<T3> > (d3))); -} -#endif // BZ_HAVE_COMPLEX - -BZ_NAMESPACE_END - -#endif diff --git a/weave/blitz-20001213/blitz/vecwhere.h b/weave/blitz-20001213/blitz/vecwhere.h deleted file mode 100644 index 590f25899..000000000 --- a/weave/blitz-20001213/blitz/vecwhere.h +++ /dev/null @@ -1,145 +0,0 @@ -/*************************************************************************** - * blitz/vecwhere.h where(X,Y,Z) function for vectors - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/23 03:28:28 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_VECWHERE_H -#define BZ_VECWHERE_H - -#ifndef BZ_VECEXPR_H - #error <blitz/vecwhere.h> must be included via <blitz/vector.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_expr1, class P_expr2, class P_expr3> -class _bz_VecWhere { - -public: - typedef P_expr1 T_expr1; - typedef P_expr2 T_expr2; - typedef P_expr3 T_expr3; - typedef _bz_typename T_expr2::T_numtype T_numtype2; - typedef _bz_typename T_expr3::T_numtype T_numtype3; - typedef BZ_PROMOTE(T_numtype2, T_numtype3) T_numtype; - -#ifdef BZ_PASS_EXPR_BY_VALUE - _bz_VecWhere(T_expr1 a, T_expr2 b, T_expr3 c) - : iter1_(a), iter2_(b), iter3_(c) - { } -#else - _bz_VecWhere(const T_expr1& a, const T_expr2& b, const T_expr3& c) - : iter1_(a), iter2_(b), iter3_(c) - { } -#endif - -#ifdef BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR - _bz_VecWhere(const _bz_VecWhere<T_expr1, T_expr2, T_expr3>& x) - : iter1_(x.iter1_), iter2_(x.iter2_), iter3_(x.iter3_) - { } -#endif - - T_numtype operator[](int i) const - { - return iter1_[i] ? iter2_[i] : iter3_[i]; - } - - enum { - _bz_staticLengthCount = - P_expr1::_bz_staticLengthCount + P_expr2::_bz_staticLengthCount - + P_expr3::_bz_staticLengthCount, - - _bz_dynamicLengthCount = - P_expr1::_bz_dynamicLengthCount + P_expr2::_bz_dynamicLengthCount - + P_expr3::_bz_dynamicLengthCount, - - _bz_staticLength = - _bz_meta_max<_bz_meta_max<P_expr1::_bz_staticLength, - P_expr2::_bz_staticLength>::max, P_expr3::_bz_staticLength>::max - }; - - T_numtype _bz_fastAccess(int i) const - { - return iter1_._bz_fastAccess(i) - ? iter2_._bz_fastAccess(i) - : iter3_._bz_fastAccess(i); - } - - _bz_bool _bz_hasFastAccess() const - { - return iter1_._bz_hasFastAccess() && - iter2_._bz_hasFastAccess() && - iter3_._bz_hasFastAccess(); - } - - int length(int recommendedLength) const - { - return iter1_.length(recommendedLength); - } - - int _bz_suggestLength() const - { - BZPRECONDITION( - (iter1_._bz_suggestLength() == iter2_._bz_suggestLength()) - && (iter2_._bz_suggestLength() == iter3_._bz_suggestLength())); - - return iter1_._bz_suggestLength(); - } - -private: - _bz_VecWhere() { } - - T_expr1 iter1_; - T_expr2 iter2_; - T_expr3 iter3_; -}; - -BZ_NAMESPACE_END - -#include <blitz/vecwhere.cc> // Expression templates - -#endif // BZ_VECWHERE_H - diff --git a/weave/blitz-20001213/blitz/wrap-climits.h b/weave/blitz-20001213/blitz/wrap-climits.h deleted file mode 100644 index e6fc89f4a..000000000 --- a/weave/blitz-20001213/blitz/wrap-climits.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef BZ_WRAP_CLIMITS_H -#define BZ_WRAP_CLIMITS_H - -#ifdef BZ_HAVE_CLIMITS - #include <climits> -#else - #include <limits.h> -#endif - -#endif diff --git a/weave/blitz-20001213/blitz/zero.cc b/weave/blitz-20001213/blitz/zero.cc deleted file mode 100644 index d58566696..000000000 --- a/weave/blitz-20001213/blitz/zero.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> - * All rights reserved. Please see <blitz/blitz.h> for terms and - * conditions of use. - * - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:25:28 ej - * Looks like I need all the .cc files for blitz also - * - * Revision 1.1.1.1 2000/06/19 12:26:09 tveldhui - * Imported sources - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - */ - -#ifndef BZ_ZERO_H - #include <blitz/zero.h> -#endif - -#ifndef BZ_ZERO_CC -#define BZ_ZERO_CC - -BZ_NAMESPACE(blitz) - -template<class P_numtype> -P_numtype ZeroElement<P_numtype>::zero_ = 0; - -#ifdef BZ_HAVE_COMPLEX - -complex<float> ZeroElement<complex<float> >::zero_ = - complex<float>(0.0f, 0.0f); - -complex<double> ZeroElement<complex<double> >::zero_ = - complex<double>(0.,0.); - -complex<long double> ZeroElement<complex<long double> >::zero_ = - complex<long double>(0.0L, 0.0L); - -#endif // BZ_HAVE_COMPLEX - -BZ_NAMESPACE_END - -#endif // BZ_ZERO_CC - diff --git a/weave/blitz-20001213/blitz/zero.h b/weave/blitz-20001213/blitz/zero.h deleted file mode 100644 index 7dc3a0c50..000000000 --- a/weave/blitz-20001213/blitz/zero.h +++ /dev/null @@ -1,124 +0,0 @@ -/*************************************************************************** - * blitz/zero.h Zero elements - * - * $Id$ - * - * Copyright (C) 1997-1999 Todd Veldhuizen <tveldhui@oonumerics.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Suggestions: blitz-dev@oonumerics.org - * Bugs: blitz-bugs@oonumerics.org - * - * For more information, please see the Blitz++ Home Page: - * http://oonumerics.org/blitz/ - * - *************************************************************************** - * $Log$ - * Revision 1.1 2002/01/03 19:50:34 eric - * renaming compiler to weave - * - * Revision 1.1 2001/04/27 17:22:04 ej - * first attempt to include needed pieces of blitz - * - * Revision 1.1.1.1 2000/06/19 12:26:10 tveldhui - * Imported sources - * - * Revision 1.4 1998/03/14 00:04:47 tveldhui - * 0.2-alpha-05 - * - * Revision 1.3 1997/07/16 14:51:20 tveldhui - * Update: Alpha release 0.2 (Arrays) - * - * Revision 1.2 1997/01/24 14:42:00 tveldhui - * Periodic RCS update - * - * Revision 1.1 1997/01/13 22:19:58 tveldhui - * Periodic RCS update - * - * - *************************************************************************** - * - * The purpose of the ZeroElement class is to provide an lvalue for - * non-const element access of matrices with zero elements. For - * example, a tridiagonal matrix has many elements which are - * always zero: - * - * [ x x 0 0 ] - * [ x x x 0 ] - * [ 0 x x x ] - * [ 0 0 x x ] - * - * To implement an operator()(int i, int j) for a tridiagonal - * matrix which may be used as an lvalue - * - * e.g. Matrix<double, Tridiagonal> M(4,4); - * M(1,2) = 3.0L; - * - * some way of returning an lvalue for the zero elements is needed. - * (Either that, or an intermediate class must be returned -- but - * this is less efficient). The solution used for the Blitz++ - * library is to have a unique zero element for each numeric - * type (float, double, etc.). This zero element is then - * returned as an lvalue when needed. - * - * The disadvantage is the possibility of setting the global - * zero-element to something non-zero. - */ - -#ifndef BZ_ZERO_H -#define BZ_ZERO_H - -#ifndef BZ_BLITZ_H - #include <blitz/blitz.h> -#endif - -BZ_NAMESPACE(blitz) - -template<class P_numtype> -class ZeroElement { -public: - typedef P_numtype T_numtype; - - static T_numtype& zero() - { - return zero_; - } - -private: - static T_numtype zero_; -}; - -// Specialization of ZeroElement for complex<float>, complex<double>, -// and complex<long double> - -#define BZZERO_DECLARE(T) \ - template<> \ - class ZeroElement<T > { \ - public: \ - static T& getZero() \ - { return zero_; } \ - private: \ - static T zero_; \ - } - -#ifdef BZ_HAVE_COMPLEX - BZZERO_DECLARE(complex<float>); - BZZERO_DECLARE(complex<double>); - BZZERO_DECLARE(complex<long double>); -#endif // BZ_HAVE_COMPLEX - -BZ_NAMESPACE_END - -#include <blitz/zero.cc> - -#endif // BZ_ZERO_H - |
