Index: trunk/SophyaExt/Blitz/Blitz.o.list
===================================================================
--- trunk/SophyaExt/Blitz/Blitz.o.list	(revision 221)
+++ trunk/SophyaExt/Blitz/Blitz.o.list	(revision 221)
@@ -0,0 +1,1 @@
+globals.o
Index: trunk/SophyaExt/Blitz/GNUmakefile
===================================================================
--- trunk/SophyaExt/Blitz/GNUmakefile	(revision 221)
+++ trunk/SophyaExt/Blitz/GNUmakefile	(revision 221)
@@ -0,0 +1,13 @@
+include ../Mgr/Makefile.h
+ 
+all: $(LIB)libBlitz.a
+clean:
+	rm -f $(OBJ)globals.o
+	rm $(LIB)libBlitz.a
+$(LIB)libBlitz.a : $(OBJ)globals.o
+	$(AR) $(ARFLAGS) $@ $?
+ifeq ($(CXX),cxx)
+	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -L$(LIB) -lBlitz -lSysTools -o $(OBJ)xx.x -Hf
+endif 
+ 
+$(OBJ)globals.o: globals.cc
Index: trunk/SophyaExt/Blitz/blitz/applics.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/applics.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/applics.h	(revision 221)
@@ -0,0 +1,394 @@
+/***************************************************************************
+ * blitz/applics.h      Applicative template classes
+ *
+ * $Id: applics.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com    
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/array.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array.h	(revision 221)
@@ -0,0 +1,2531 @@
+/***************************************************************************
+ * blitz/array.h      Declaration of the Array<P_numtype, N_rank> class
+ *
+ * $Id: array.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+BZ_NAMESPACE(blitz)
+
+/*
+ * Forward declarations
+ */
+
+template<class T_numtype, int N_rank>
+class ArrayIterator;
+
+template<class P_expr>
+class _bz_ArrayExpr;
+
+#ifdef BZ_NEW_EXPRESSION_TEMPLATES
+template<class T>
+class ETBase { };
+#endif
+
+template<class T_array, class T_index>
+class IndirectArray;
+
+/*
+ * 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()
+    { 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;
+    }
+};
+
+/*
+ * 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;
+    }
+};
+
+/*
+ * 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 an iterator for the array.
+     */
+
+    typedef P_numtype                T_numtype;
+    typedef TinyVector<int, N_rank>  T_index;
+    typedef Array<T_numtype, N_rank> T_array;
+    typedef ArrayIterator<T_numtype, N_rank> T_iterator;
+
+    enum { _bz_rank = N_rank };
+
+    //////////////////////////////////////////////
+    // Constructors                             //
+    //////////////////////////////////////////////
+
+    
+    /*
+     * Construct an array from an array expression.
+     */
+
+    template<class T_expr>
+    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;
+        storageContiguous_ = false;
+    }
+
+    _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 (i.e. the memory block will not be freed by Blitz++).
+     */
+    Array(T_numtype* _bz_restrict dataFirst, TinyVector<int, N_rank> shape,
+        GeneralArrayStorage<N_rank> storage = GeneralArrayStorage<N_rank>())
+      : MemoryBlockReference<T_numtype>(product(shape), dataFirst),
+        storage_(storage)
+    {
+        BZPRECONDITION(dataFirst != 0);
+
+        length_ = shape;
+        computeStrides();
+        data_ += zeroOffset_;
+        storageContiguous_ = _bz_true;
+    }
+
+    /*
+     * 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),
+        storage_(storage)
+    {
+        BZPRECONDITION(dataFirst != 0);
+
+        length_ = shape;
+        stride_ = stride;
+        calculateZeroOffset();
+        data_ += zeroOffset_;
+
+        // NEEDS_WORK: the setting of storageContiguous should be determined
+        // by inspecting the strides.
+        storageContiguous_ = _bz_false;   
+    }
+
+    /*
+     * 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);
+
+    /*
+     * 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); }
+
+    T_iterator                        begin() 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)
+    { 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;
+
+    // NEEDS_WORK -- end()
+
+    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);
+
+    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
+    { return storageContiguous_; }
+
+    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(T_array&);
+
+    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 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 operator()(const RectDomain<N_rank>& subdomain)
+    {
+        return T_array(*this, subdomain);
+    }
+
+    T_array operator()(Range r0)
+    {
+        return T_array(*this, r0);
+    }
+
+    T_array operator()(Range r0, Range r1)
+    {
+        return T_array(*this, r0, r1);
+    }
+
+    T_array operator()(Range r0, Range r1, Range r2)
+    {
+        return T_array(*this, r0, r1, r2);
+    }
+
+    T_array operator()(Range r0, Range r1, Range r2, Range r3)
+    {
+        return T_array(*this, r0, r1, r2, r3);
+    }
+
+    T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4)
+    {
+        return T_array(*this, r0, r1, r2, r3, r4);
+    }
+
+    T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4,
+        Range r5)
+    {
+        return T_array(*this, r0, r1, r2, r3, r4, r5);
+    }
+
+    T_array operator()(Range r0, Range r1, Range r2, Range r3, Range r4,
+        Range r5, Range r6)
+    {
+        return T_array(*this, 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)
+    {
+        return T_array(*this, 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)
+    {
+        return T_array(*this, 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)
+    {
+        return T_array(*this, 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)
+    {
+        return T_array(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8>::T_slice(*this, 
+            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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9>::T_slice(*this, 
+            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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9,
+            T10>::T_slice(*this, 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)
+    {
+        return SliceInfo<T_numtype,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,
+            T11>::T_slice(*this, 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>)
+    { 
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0> >(*this);
+    }
+
+    template<int N0, int N1>
+    _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1> >
+    operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1> >(*this);
+    } 
+
+    template<int N0, int N1, int N2>
+    _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0, N1, N2> >
+    operator()(IndexPlaceholder<N0>, IndexPlaceholder<N1>,
+        IndexPlaceholder<N2>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5, N6> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5, N6, N7> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5, N6, N7, N8> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5, N6, N7, N8, N9> >(*this);
+    }
+
+    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>)
+    {
+        return _bz_ArrayExpr<ArrayIndexMapping<T_numtype, N_rank, N0,
+            N1, N2, N3, N4, N5, N6, N7, N8, N9, N10> >(*this);
+    }
+
+    //////////////////////////////////////////////
+    // Support for multicomponent arrays
+    //////////////////////////////////////////////
+
+    /*
+     * See <blitz/array/multi.h> for an explanation of the traits class
+     * multicomponent_traits.
+     */
+    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);
+
+    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_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator+=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator-=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator*=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator/=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator%=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator^=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator&=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator|=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator>>=(_bz_ArrayExpr<T_expr> expr);
+    template<class T_expr>
+    inline T_array& operator<<=(_bz_ArrayExpr<T_expr> expr);
+
+    // NEEDS_WORK -- Index placeholder operand
+
+    // NEEDS_WORK -- Random operand
+
+
+public:
+    // Undocumented implementation routines
+
+    template<class T_expr, class T_update>
+    inline T_array& evaluate(_bz_ArrayExpr<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, _bz_ArrayExpr<T_expr> expr,
+        T_update);
+#endif
+
+#ifdef BZ_ARRAY_2D_STENCIL_TILING
+    template<class T_expr, class T_update>
+    inline T_array& evaluateWithTiled2DTraversal(_bz_ArrayExpr<T_expr> expr,
+        T_update);
+#endif
+
+    template<class T_expr, class T_update>
+    inline T_array& evaluateWithIndexTraversal1(_bz_ArrayExpr<T_expr> expr,
+        T_update);
+
+    template<class T_expr, class T_update>
+    inline T_array& evaluateWithIndexTraversalN(_bz_ArrayExpr<T_expr> expr,
+        T_update);
+
+    template<class T_expr, class T_update>
+    inline T_array& evaluateWithStackTraversal1(_bz_ArrayExpr<T_expr> expr,
+        T_update);
+
+    template<class T_expr, class T_update>
+    inline T_array& evaluateWithStackTraversalN(_bz_ArrayExpr<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).
+     * storageContiguous_ is true if all the elements in the array are
+     *           stored contiguously in memory.  If this is true, then
+     *           the array can be converted to a one-dimensional array.
+     *           If the array is sliced, then this becomes false.
+     */
+    GeneralArrayStorage<N_rank> storage_;
+    TinyVector<int, N_rank> length_;
+    TinyVector<int, N_rank> stride_;
+    int zeroOffset_;
+    _bz_bool storageContiguous_;
+};
+
+/*
+ * 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>&);
+
+// NEEDS_WORK -- output formatting for N > 2?
+
+BZ_NAMESPACE_END
+
+/*
+ * Include implementations of the member functions and some additional
+ * global functions.
+ */
+
+#include <blitz/array/iter.h>       // Array iterators
+#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
+#include <blitz/array/bops.cc>      // Expression templates, two operands
+#include <blitz/array/uops.cc>      // Expression templates, math functions
+#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
+
Index: trunk/SophyaExt/Blitz/blitz/array/asexpr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/asexpr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/asexpr.h	(revision 221)
@@ -0,0 +1,39 @@
+#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 ArrayIterator<T,N> T_expr;
+};
+
+// Index placeholder
+template<int N>
+struct asExpr<IndexPlaceholder<N> > {
+    typedef IndexPlaceholder<N> T_expr;
+};
+
+BZ_NAMESPACE_END
+
+#endif
Index: trunk/SophyaExt/Blitz/blitz/array/bops.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/bops.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/bops.cc	(revision 221)
@@ -0,0 +1,8371 @@
+/***************************************************************************
+ * blitz/arraybops.cc	Array expression templates (2 operands)
+ *
+ * $Id: bops.cc,v 1.1.1.1 1999-04-09 17:59:04 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.   Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * Suggestions:          blitz-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * Revision 1.2  1998/03/14 00:04:47  tveldhui
+ * 0.2-alpha-05
+ *
+ */ 
+
+// Generated source file.  Do not edit. 
+// genarrbops.cpp Aug  7 1997 15:04:14
+
+#ifndef BZ_ARRAYBOPS_CC
+#define BZ_ARRAYBOPS_CC
+
+#ifndef BZ_ARRAYEXPR_H
+ #error <blitz/arraybops.cc> must be included after <blitz/arrayexpr.h>
+#endif
+
+BZ_NAMESPACE(blitz)
+
+/****************************************************************************
+ * Addition Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> + Array<T_numtype2, N_rank2>
+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>,
+      Add<T_numtype1, T_numtype2 > > >
+operator+(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>, 
+      Add<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> + _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> + IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Add<T_numtype1, int > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Add<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> + int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Add<T_numtype1, int > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Add<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> + float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Add<T_numtype1, float > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Add<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> + double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Add<T_numtype1, double > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Add<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> + long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Add<T_numtype1, long double > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Add<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> + complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Add<T_numtype1, complex<T2>  > > >
+operator+(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Add<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> + Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> + _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> + IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Add<_bz_typename P_expr1::T_numtype, int > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Add<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> + int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Add<_bz_typename P_expr1::T_numtype, int > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Add<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> + float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Add<_bz_typename P_expr1::T_numtype, float > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Add<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> + double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Add<_bz_typename P_expr1::T_numtype, double > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Add<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> + long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Add<_bz_typename P_expr1::T_numtype, long double > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Add<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> + complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Add<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator+(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Add<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> + Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<int, T_numtype2 > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> + _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<int, _bz_typename P_expr2::T_numtype > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> + IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Add<int, int > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Add<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> + int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Add<int, int > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Add<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> + float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Add<int, float > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Add<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> + double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Add<int, double > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Add<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> + long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Add<int, long double > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Add<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> + complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Add<int, complex<T2>  > > >
+operator+(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Add<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int + Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<int, T_numtype2 > > >
+operator+(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int + _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<int, _bz_typename P_expr2::T_numtype > > >
+operator+(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int + IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Add<int, int > > >
+operator+(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Add<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float + Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<float, T_numtype2 > > >
+operator+(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float + _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<float, _bz_typename P_expr2::T_numtype > > >
+operator+(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float + IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Add<float, int > > >
+operator+(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Add<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double + Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<double, T_numtype2 > > >
+operator+(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double + _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<double, _bz_typename P_expr2::T_numtype > > >
+operator+(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double + IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Add<double, int > > >
+operator+(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Add<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double + Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<long double, T_numtype2 > > >
+operator+(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double + _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Add<long double, _bz_typename P_expr2::T_numtype > > >
+operator+(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double + IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Add<long double, int > > >
+operator+(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Add<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> + Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Add<complex<T1> , T_numtype2 > > >
+operator+(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Add<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> + _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Add<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator+(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Add<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> + IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Add<complex<T1> , int > > >
+operator+(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Add<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Subtraction Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> - Array<T_numtype2, N_rank2>
+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>,
+      Subtract<T_numtype1, T_numtype2 > > >
+operator-(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>, 
+      Subtract<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> - _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> - IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<T_numtype1, int > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> - int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Subtract<T_numtype1, int > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Subtract<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> - float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Subtract<T_numtype1, float > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Subtract<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> - double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Subtract<T_numtype1, double > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Subtract<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> - long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Subtract<T_numtype1, long double > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Subtract<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> - complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Subtract<T_numtype1, complex<T2>  > > >
+operator-(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Subtract<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> - Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> - _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> - IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<_bz_typename P_expr1::T_numtype, int > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> - int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Subtract<_bz_typename P_expr1::T_numtype, int > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Subtract<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> - float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Subtract<_bz_typename P_expr1::T_numtype, float > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Subtract<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> - double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Subtract<_bz_typename P_expr1::T_numtype, double > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Subtract<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> - long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Subtract<_bz_typename P_expr1::T_numtype, long double > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Subtract<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> - complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Subtract<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator-(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Subtract<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> - Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<int, T_numtype2 > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> - _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<int, _bz_typename P_expr2::T_numtype > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> - IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<int, int > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> - int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Subtract<int, int > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Subtract<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> - float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Subtract<int, float > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Subtract<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> - double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Subtract<int, double > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Subtract<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> - long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Subtract<int, long double > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Subtract<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> - complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Subtract<int, complex<T2>  > > >
+operator-(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Subtract<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int - Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<int, T_numtype2 > > >
+operator-(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int - _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<int, _bz_typename P_expr2::T_numtype > > >
+operator-(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int - IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<int, int > > >
+operator-(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float - Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<float, T_numtype2 > > >
+operator-(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float - _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<float, _bz_typename P_expr2::T_numtype > > >
+operator-(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float - IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<float, int > > >
+operator-(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double - Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<double, T_numtype2 > > >
+operator-(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double - _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<double, _bz_typename P_expr2::T_numtype > > >
+operator-(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double - IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<double, int > > >
+operator-(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double - Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<long double, T_numtype2 > > >
+operator-(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double - _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<long double, _bz_typename P_expr2::T_numtype > > >
+operator-(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double - IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Subtract<long double, int > > >
+operator-(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Subtract<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> - Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Subtract<complex<T1> , T_numtype2 > > >
+operator-(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Subtract<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> - _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Subtract<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator-(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Subtract<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> - IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Subtract<complex<T1> , int > > >
+operator-(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Subtract<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Multiplication Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> * Array<T_numtype2, N_rank2>
+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>,
+      Multiply<T_numtype1, T_numtype2 > > >
+operator*(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>, 
+      Multiply<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> * _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> * IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<T_numtype1, int > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> * int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Multiply<T_numtype1, int > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Multiply<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> * float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Multiply<T_numtype1, float > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Multiply<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> * double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Multiply<T_numtype1, double > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Multiply<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> * long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Multiply<T_numtype1, long double > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Multiply<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> * complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Multiply<T_numtype1, complex<T2>  > > >
+operator*(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Multiply<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> * Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> * _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> * IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<_bz_typename P_expr1::T_numtype, int > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> * int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Multiply<_bz_typename P_expr1::T_numtype, int > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Multiply<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> * float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Multiply<_bz_typename P_expr1::T_numtype, float > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Multiply<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> * double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Multiply<_bz_typename P_expr1::T_numtype, double > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Multiply<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> * long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Multiply<_bz_typename P_expr1::T_numtype, long double > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Multiply<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> * complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Multiply<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator*(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Multiply<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> * Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<int, T_numtype2 > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> * _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<int, _bz_typename P_expr2::T_numtype > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> * IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<int, int > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> * int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Multiply<int, int > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Multiply<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> * float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Multiply<int, float > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Multiply<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> * double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Multiply<int, double > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Multiply<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> * long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Multiply<int, long double > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Multiply<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> * complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Multiply<int, complex<T2>  > > >
+operator*(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Multiply<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int * Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<int, T_numtype2 > > >
+operator*(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int * _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<int, _bz_typename P_expr2::T_numtype > > >
+operator*(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int * IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<int, int > > >
+operator*(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float * Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<float, T_numtype2 > > >
+operator*(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float * _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<float, _bz_typename P_expr2::T_numtype > > >
+operator*(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float * IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<float, int > > >
+operator*(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double * Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<double, T_numtype2 > > >
+operator*(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double * _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<double, _bz_typename P_expr2::T_numtype > > >
+operator*(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double * IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<double, int > > >
+operator*(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double * Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<long double, T_numtype2 > > >
+operator*(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double * _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<long double, _bz_typename P_expr2::T_numtype > > >
+operator*(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double * IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Multiply<long double, int > > >
+operator*(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Multiply<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> * Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Multiply<complex<T1> , T_numtype2 > > >
+operator*(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Multiply<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> * _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Multiply<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator*(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Multiply<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> * IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Multiply<complex<T1> , int > > >
+operator*(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Multiply<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Division Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> / Array<T_numtype2, N_rank2>
+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>,
+      Divide<T_numtype1, T_numtype2 > > >
+operator/(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>, 
+      Divide<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> / _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> / IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Divide<T_numtype1, int > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> / int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Divide<T_numtype1, int > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Divide<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> / float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Divide<T_numtype1, float > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Divide<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> / double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Divide<T_numtype1, double > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Divide<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> / long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Divide<T_numtype1, long double > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Divide<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> / complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Divide<T_numtype1, complex<T2>  > > >
+operator/(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Divide<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> / Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> / _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> / IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Divide<_bz_typename P_expr1::T_numtype, int > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> / int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Divide<_bz_typename P_expr1::T_numtype, int > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Divide<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> / float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Divide<_bz_typename P_expr1::T_numtype, float > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Divide<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> / double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Divide<_bz_typename P_expr1::T_numtype, double > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Divide<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> / long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Divide<_bz_typename P_expr1::T_numtype, long double > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Divide<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> / complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Divide<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator/(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Divide<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> / Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<int, T_numtype2 > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> / _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<int, _bz_typename P_expr2::T_numtype > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> / IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Divide<int, int > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> / int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Divide<int, int > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Divide<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> / float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Divide<int, float > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Divide<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> / double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Divide<int, double > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Divide<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> / long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Divide<int, long double > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Divide<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> / complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Divide<int, complex<T2>  > > >
+operator/(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Divide<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int / Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<int, T_numtype2 > > >
+operator/(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int / _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<int, _bz_typename P_expr2::T_numtype > > >
+operator/(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int / IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Divide<int, int > > >
+operator/(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float / Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<float, T_numtype2 > > >
+operator/(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float / _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<float, _bz_typename P_expr2::T_numtype > > >
+operator/(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float / IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Divide<float, int > > >
+operator/(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double / Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<double, T_numtype2 > > >
+operator/(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double / _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<double, _bz_typename P_expr2::T_numtype > > >
+operator/(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double / IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Divide<double, int > > >
+operator/(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double / Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<long double, T_numtype2 > > >
+operator/(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double / _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<long double, _bz_typename P_expr2::T_numtype > > >
+operator/(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double / IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Divide<long double, int > > >
+operator/(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Divide<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> / Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Divide<complex<T1> , T_numtype2 > > >
+operator/(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Divide<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> / _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Divide<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator/(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Divide<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> / IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Divide<complex<T1> , int > > >
+operator/(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Divide<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Modulus Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> % Array<T_numtype2, N_rank2>
+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>,
+      Modulo<T_numtype1, T_numtype2 > > >
+operator%(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>, 
+      Modulo<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> % _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Modulo<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator%(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Modulo<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> % IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Modulo<T_numtype1, int > > >
+operator%(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Modulo<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> % int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Modulo<T_numtype1, int > > >
+operator%(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Modulo<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> % Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Modulo<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator%(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Modulo<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> % _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Modulo<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator%(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Modulo<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> % IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Modulo<_bz_typename P_expr1::T_numtype, int > > >
+operator%(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Modulo<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> % int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Modulo<_bz_typename P_expr1::T_numtype, int > > >
+operator%(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Modulo<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> % Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Modulo<int, T_numtype2 > > >
+operator%(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Modulo<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> % _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Modulo<int, _bz_typename P_expr2::T_numtype > > >
+operator%(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Modulo<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> % IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Modulo<int, int > > >
+operator%(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Modulo<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> % int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Modulo<int, int > > >
+operator%(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Modulo<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int % Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Modulo<int, T_numtype2 > > >
+operator%(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Modulo<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int % _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Modulo<int, _bz_typename P_expr2::T_numtype > > >
+operator%(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Modulo<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int % IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Modulo<int, int > > >
+operator%(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Modulo<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Greater-than Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> > Array<T_numtype2, N_rank2>
+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>,
+      Greater<T_numtype1, T_numtype2 > > >
+operator>(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>, 
+      Greater<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> > _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> > IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Greater<T_numtype1, int > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> > int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Greater<T_numtype1, int > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Greater<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> > float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Greater<T_numtype1, float > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Greater<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> > double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Greater<T_numtype1, double > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Greater<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> > long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Greater<T_numtype1, long double > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Greater<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> > complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Greater<T_numtype1, complex<T2>  > > >
+operator>(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Greater<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> > Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> > _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> > IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Greater<_bz_typename P_expr1::T_numtype, int > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> > int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Greater<_bz_typename P_expr1::T_numtype, int > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Greater<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> > float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Greater<_bz_typename P_expr1::T_numtype, float > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Greater<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> > double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Greater<_bz_typename P_expr1::T_numtype, double > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Greater<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> > long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Greater<_bz_typename P_expr1::T_numtype, long double > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Greater<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> > complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Greater<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator>(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Greater<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> > Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<int, T_numtype2 > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> > _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<int, _bz_typename P_expr2::T_numtype > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> > IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Greater<int, int > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> > int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Greater<int, int > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Greater<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> > float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Greater<int, float > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Greater<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> > double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Greater<int, double > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Greater<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> > long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Greater<int, long double > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Greater<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> > complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Greater<int, complex<T2>  > > >
+operator>(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Greater<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int > Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<int, T_numtype2 > > >
+operator>(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int > _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<int, _bz_typename P_expr2::T_numtype > > >
+operator>(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int > IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Greater<int, int > > >
+operator>(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float > Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<float, T_numtype2 > > >
+operator>(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float > _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<float, _bz_typename P_expr2::T_numtype > > >
+operator>(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float > IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Greater<float, int > > >
+operator>(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double > Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<double, T_numtype2 > > >
+operator>(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double > _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<double, _bz_typename P_expr2::T_numtype > > >
+operator>(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double > IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Greater<double, int > > >
+operator>(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double > Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<long double, T_numtype2 > > >
+operator>(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double > _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<long double, _bz_typename P_expr2::T_numtype > > >
+operator>(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double > IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Greater<long double, int > > >
+operator>(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Greater<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> > Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Greater<complex<T1> , T_numtype2 > > >
+operator>(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Greater<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> > _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Greater<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator>(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Greater<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> > IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Greater<complex<T1> , int > > >
+operator>(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Greater<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Less-than Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> < Array<T_numtype2, N_rank2>
+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>,
+      Less<T_numtype1, T_numtype2 > > >
+operator<(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>, 
+      Less<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> < _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> < IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Less<T_numtype1, int > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Less<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> < int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Less<T_numtype1, int > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Less<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> < float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Less<T_numtype1, float > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Less<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> < double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Less<T_numtype1, double > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Less<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> < long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Less<T_numtype1, long double > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Less<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> < complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Less<T_numtype1, complex<T2>  > > >
+operator<(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Less<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> < Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> < _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> < IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Less<_bz_typename P_expr1::T_numtype, int > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Less<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> < int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Less<_bz_typename P_expr1::T_numtype, int > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Less<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> < float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Less<_bz_typename P_expr1::T_numtype, float > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Less<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> < double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Less<_bz_typename P_expr1::T_numtype, double > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Less<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> < long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Less<_bz_typename P_expr1::T_numtype, long double > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Less<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> < complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Less<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator<(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Less<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> < Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<int, T_numtype2 > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> < _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<int, _bz_typename P_expr2::T_numtype > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> < IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Less<int, int > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Less<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> < int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Less<int, int > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Less<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> < float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Less<int, float > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Less<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> < double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Less<int, double > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Less<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> < long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Less<int, long double > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Less<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> < complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Less<int, complex<T2>  > > >
+operator<(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Less<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int < Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<int, T_numtype2 > > >
+operator<(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int < _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<int, _bz_typename P_expr2::T_numtype > > >
+operator<(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int < IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Less<int, int > > >
+operator<(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Less<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float < Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<float, T_numtype2 > > >
+operator<(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float < _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<float, _bz_typename P_expr2::T_numtype > > >
+operator<(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float < IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Less<float, int > > >
+operator<(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Less<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double < Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<double, T_numtype2 > > >
+operator<(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double < _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<double, _bz_typename P_expr2::T_numtype > > >
+operator<(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double < IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Less<double, int > > >
+operator<(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Less<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double < Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<long double, T_numtype2 > > >
+operator<(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double < _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Less<long double, _bz_typename P_expr2::T_numtype > > >
+operator<(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double < IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Less<long double, int > > >
+operator<(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Less<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> < Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Less<complex<T1> , T_numtype2 > > >
+operator<(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Less<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> < _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Less<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator<(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Less<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> < IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Less<complex<T1> , int > > >
+operator<(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Less<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Greater or equal (>=) operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> >= Array<T_numtype2, N_rank2>
+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>,
+      GreaterOrEqual<T_numtype1, T_numtype2 > > >
+operator>=(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>, 
+      GreaterOrEqual<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> >= _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> >= IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<T_numtype1, int > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> >= int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      GreaterOrEqual<T_numtype1, int > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      GreaterOrEqual<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> >= float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      GreaterOrEqual<T_numtype1, float > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      GreaterOrEqual<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> >= double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      GreaterOrEqual<T_numtype1, double > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      GreaterOrEqual<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> >= long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      GreaterOrEqual<T_numtype1, long double > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      GreaterOrEqual<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> >= complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      GreaterOrEqual<T_numtype1, complex<T2>  > > >
+operator>=(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      GreaterOrEqual<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> >= Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> >= _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> >= IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> >= int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> >= float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, float > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> >= double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, double > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> >= long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> >= complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator>=(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      GreaterOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> >= Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<int, T_numtype2 > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> >= _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> >= IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<int, int > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> >= int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      GreaterOrEqual<int, int > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      GreaterOrEqual<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> >= float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      GreaterOrEqual<int, float > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      GreaterOrEqual<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> >= double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      GreaterOrEqual<int, double > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      GreaterOrEqual<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> >= long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      GreaterOrEqual<int, long double > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      GreaterOrEqual<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> >= complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      GreaterOrEqual<int, complex<T2>  > > >
+operator>=(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      GreaterOrEqual<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int >= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<int, T_numtype2 > > >
+operator>=(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int >= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator>=(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int >= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<int, int > > >
+operator>=(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float >= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<float, T_numtype2 > > >
+operator>=(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float >= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<float, _bz_typename P_expr2::T_numtype > > >
+operator>=(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float >= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<float, int > > >
+operator>=(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double >= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<double, T_numtype2 > > >
+operator>=(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double >= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<double, _bz_typename P_expr2::T_numtype > > >
+operator>=(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double >= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<double, int > > >
+operator>=(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double >= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<long double, T_numtype2 > > >
+operator>=(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double >= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype > > >
+operator>=(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double >= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<long double, int > > >
+operator>=(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> >= Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      GreaterOrEqual<complex<T1> , T_numtype2 > > >
+operator>=(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      GreaterOrEqual<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> >= _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      GreaterOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator>=(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      GreaterOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> >= IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      GreaterOrEqual<complex<T1> , int > > >
+operator>=(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      GreaterOrEqual<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Less or equal (<=) operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> <= Array<T_numtype2, N_rank2>
+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>,
+      LessOrEqual<T_numtype1, T_numtype2 > > >
+operator<=(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>, 
+      LessOrEqual<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> <= _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> <= IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<T_numtype1, int > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> <= int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      LessOrEqual<T_numtype1, int > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      LessOrEqual<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> <= float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      LessOrEqual<T_numtype1, float > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      LessOrEqual<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> <= double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      LessOrEqual<T_numtype1, double > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      LessOrEqual<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> <= long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      LessOrEqual<T_numtype1, long double > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      LessOrEqual<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> <= complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      LessOrEqual<T_numtype1, complex<T2>  > > >
+operator<=(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      LessOrEqual<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> <= Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> <= _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> <= IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> <= int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> <= float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, float > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> <= double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, double > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> <= long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, long double > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> <= complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      LessOrEqual<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator<=(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      LessOrEqual<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> <= Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<int, T_numtype2 > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> <= _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> <= IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<int, int > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> <= int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      LessOrEqual<int, int > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      LessOrEqual<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> <= float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      LessOrEqual<int, float > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      LessOrEqual<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> <= double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      LessOrEqual<int, double > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      LessOrEqual<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> <= long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      LessOrEqual<int, long double > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      LessOrEqual<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> <= complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      LessOrEqual<int, complex<T2>  > > >
+operator<=(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      LessOrEqual<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int <= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<int, T_numtype2 > > >
+operator<=(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int <= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator<=(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int <= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<int, int > > >
+operator<=(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float <= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<float, T_numtype2 > > >
+operator<=(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float <= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<float, _bz_typename P_expr2::T_numtype > > >
+operator<=(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float <= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<float, int > > >
+operator<=(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double <= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<double, T_numtype2 > > >
+operator<=(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double <= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<double, _bz_typename P_expr2::T_numtype > > >
+operator<=(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double <= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<double, int > > >
+operator<=(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double <= Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<long double, T_numtype2 > > >
+operator<=(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double <= _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<long double, _bz_typename P_expr2::T_numtype > > >
+operator<=(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double <= IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<long double, int > > >
+operator<=(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> <= Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LessOrEqual<complex<T1> , T_numtype2 > > >
+operator<=(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LessOrEqual<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> <= _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      LessOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator<=(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      LessOrEqual<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> <= IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      LessOrEqual<complex<T1> , int > > >
+operator<=(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      LessOrEqual<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Equality operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> == Array<T_numtype2, N_rank2>
+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>,
+      Equal<T_numtype1, T_numtype2 > > >
+operator==(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>, 
+      Equal<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> == _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> == IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      Equal<T_numtype1, int > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> == int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      Equal<T_numtype1, int > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      Equal<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> == float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      Equal<T_numtype1, float > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      Equal<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> == double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      Equal<T_numtype1, double > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      Equal<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> == long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      Equal<T_numtype1, long double > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Equal<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> == complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Equal<T_numtype1, complex<T2>  > > >
+operator==(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Equal<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> == Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> == _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> == IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      Equal<_bz_typename P_expr1::T_numtype, int > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> == int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      Equal<_bz_typename P_expr1::T_numtype, int > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      Equal<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> == float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      Equal<_bz_typename P_expr1::T_numtype, float > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      Equal<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> == double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      Equal<_bz_typename P_expr1::T_numtype, double > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      Equal<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> == long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      Equal<_bz_typename P_expr1::T_numtype, long double > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Equal<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> == complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Equal<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator==(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Equal<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> == Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<int, T_numtype2 > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> == _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<int, _bz_typename P_expr2::T_numtype > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> == IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      Equal<int, int > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> == int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      Equal<int, int > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      Equal<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> == float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      Equal<int, float > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      Equal<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> == double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      Equal<int, double > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      Equal<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> == long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      Equal<int, long double > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      Equal<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> == complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      Equal<int, complex<T2>  > > >
+operator==(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      Equal<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int == Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<int, T_numtype2 > > >
+operator==(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int == _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<int, _bz_typename P_expr2::T_numtype > > >
+operator==(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int == IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      Equal<int, int > > >
+operator==(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float == Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<float, T_numtype2 > > >
+operator==(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float == _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<float, _bz_typename P_expr2::T_numtype > > >
+operator==(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float == IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      Equal<float, int > > >
+operator==(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double == Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<double, T_numtype2 > > >
+operator==(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double == _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<double, _bz_typename P_expr2::T_numtype > > >
+operator==(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double == IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      Equal<double, int > > >
+operator==(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double == Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<long double, T_numtype2 > > >
+operator==(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double == _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<long double, _bz_typename P_expr2::T_numtype > > >
+operator==(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double == IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      Equal<long double, int > > >
+operator==(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      Equal<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> == Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      Equal<complex<T1> , T_numtype2 > > >
+operator==(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      Equal<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> == _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      Equal<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator==(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      Equal<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> == IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      Equal<complex<T1> , int > > >
+operator==(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      Equal<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Not-equal operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> != Array<T_numtype2, N_rank2>
+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>,
+      NotEqual<T_numtype1, T_numtype2 > > >
+operator!=(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>, 
+      NotEqual<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> != _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> != IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<T_numtype1, int > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> != int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      NotEqual<T_numtype1, int > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      NotEqual<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// Array<T_numtype1, N_rank1> != float
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>,
+      NotEqual<T_numtype1, float > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<float>, 
+      NotEqual<T_numtype1, float> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// Array<T_numtype1, N_rank1> != double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>,
+      NotEqual<T_numtype1, double > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<double>, 
+      NotEqual<T_numtype1, double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// Array<T_numtype1, N_rank1> != long double
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>,
+      NotEqual<T_numtype1, long double > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<long double>, 
+      NotEqual<T_numtype1, long double> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// Array<T_numtype1, N_rank1> != complex<T2>
+template<class T_numtype1, int N_rank1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      NotEqual<T_numtype1, complex<T2>  > > >
+operator!=(const Array<T_numtype1, N_rank1>& d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      NotEqual<T_numtype1, complex<T2> > >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// _bz_ArrayExpr<P_expr1> != Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> != _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> != IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> != int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      NotEqual<_bz_typename P_expr1::T_numtype, int > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> != float
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>,
+      NotEqual<_bz_typename P_expr1::T_numtype, float > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<float>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> != double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>,
+      NotEqual<_bz_typename P_expr1::T_numtype, double > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<double>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> != long double
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>,
+      NotEqual<_bz_typename P_expr1::T_numtype, long double > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<long double>, 
+      NotEqual<_bz_typename P_expr1::T_numtype, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// _bz_ArrayExpr<P_expr1> != complex<T2>
+template<class P_expr1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      NotEqual<_bz_typename P_expr1::T_numtype, complex<T2>  > > >
+operator!=(_bz_ArrayExpr<P_expr1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      NotEqual<_bz_typename P_expr1::T_numtype, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// IndexPlaceholder<N_index1> != Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<int, T_numtype2 > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> != _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> != IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<int, int > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> != int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      NotEqual<int, int > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      NotEqual<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> != float
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>,
+      NotEqual<int, float > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      float d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<float>, 
+      NotEqual<int, float> >
+      (d1, 
+      _bz_ArrayExprConstant<float>(d2));
+}
+
+// IndexPlaceholder<N_index1> != double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>,
+      NotEqual<int, double > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<double>, 
+      NotEqual<int, double> >
+      (d1, 
+      _bz_ArrayExprConstant<double>(d2));
+}
+
+// IndexPlaceholder<N_index1> != long double
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>,
+      NotEqual<int, long double > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      long double d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<long double>, 
+      NotEqual<int, long double> >
+      (d1, 
+      _bz_ArrayExprConstant<long double>(d2));
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// IndexPlaceholder<N_index1> != complex<T2>
+template<int N_index1, class T2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > ,
+      NotEqual<int, complex<T2>  > > >
+operator!=(IndexPlaceholder<N_index1> d1, 
+      complex<T2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<complex<T2> > , 
+      NotEqual<int, complex<T2> > >
+      (d1, 
+      _bz_ArrayExprConstant<complex<T2> > (d2));
+}
+#endif // BZ_HAVE_COMPLEX
+
+// int != Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<int, T_numtype2 > > >
+operator!=(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int != _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<int, _bz_typename P_expr2::T_numtype > > >
+operator!=(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int != IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<int, int > > >
+operator!=(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// float != Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<float, T_numtype2 > > >
+operator!=(float d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<float, T_numtype2> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2.begin());
+}
+
+// float != _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<float, _bz_typename P_expr2::T_numtype > > >
+operator!=(float d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<float, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// float != IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<float, int > > >
+operator!=(float d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<float>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<float, int> >
+      (_bz_ArrayExprConstant<float>(d1), 
+      d2);
+}
+
+// double != Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<double, T_numtype2 > > >
+operator!=(double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<double, T_numtype2> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2.begin());
+}
+
+// double != _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<double, _bz_typename P_expr2::T_numtype > > >
+operator!=(double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// double != IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<double, int > > >
+operator!=(double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<double>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<double, int> >
+      (_bz_ArrayExprConstant<double>(d1), 
+      d2);
+}
+
+// long double != Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<long double, T_numtype2 > > >
+operator!=(long double d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<long double, T_numtype2> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2.begin());
+}
+
+// long double != _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<long double, _bz_typename P_expr2::T_numtype > > >
+operator!=(long double d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<long double, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+// long double != IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>,
+      NotEqual<long double, int > > >
+operator!=(long double d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<long double>, 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<long double, int> >
+      (_bz_ArrayExprConstant<long double>(d1), 
+      d2);
+}
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> != Array<T_numtype2, N_rank2>
+template<class T1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>,
+      NotEqual<complex<T1> , T_numtype2 > > >
+operator!=(complex<T1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      NotEqual<complex<T1> , T_numtype2> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2.begin());
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> != _bz_ArrayExpr<P_expr2>
+template<class T1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>,
+      NotEqual<complex<T1> , _bz_typename P_expr2::T_numtype > > >
+operator!=(complex<T1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      _bz_ArrayExpr<P_expr2>, 
+      NotEqual<complex<T1> , _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+
+#ifdef BZ_HAVE_COMPLEX
+// complex<T1> != IndexPlaceholder<N_index2>
+template<class T1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>,
+      NotEqual<complex<T1> , int > > >
+operator!=(complex<T1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<complex<T1> > , 
+      IndexPlaceholder<N_index2>, 
+      NotEqual<complex<T1> , int> >
+      (_bz_ArrayExprConstant<complex<T1> > (d1), 
+      d2);
+}
+#endif // BZ_HAVE_COMPLEX
+/****************************************************************************
+ * Logical AND operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> && Array<T_numtype2, N_rank2>
+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>,
+      LogicalAnd<T_numtype1, T_numtype2 > > >
+operator&&(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>, 
+      LogicalAnd<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> && _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalAnd<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator&&(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalAnd<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> && IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalAnd<T_numtype1, int > > >
+operator&&(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalAnd<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> && int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalAnd<T_numtype1, int > > >
+operator&&(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalAnd<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> && Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalAnd<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator&&(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalAnd<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> && _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator&&(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> && IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalAnd<_bz_typename P_expr1::T_numtype, int > > >
+operator&&(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalAnd<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> && int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalAnd<_bz_typename P_expr1::T_numtype, int > > >
+operator&&(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalAnd<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> && Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalAnd<int, T_numtype2 > > >
+operator&&(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalAnd<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> && _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalAnd<int, _bz_typename P_expr2::T_numtype > > >
+operator&&(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalAnd<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> && IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalAnd<int, int > > >
+operator&&(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalAnd<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> && int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalAnd<int, int > > >
+operator&&(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalAnd<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int && Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalAnd<int, T_numtype2 > > >
+operator&&(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalAnd<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int && _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalAnd<int, _bz_typename P_expr2::T_numtype > > >
+operator&&(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalAnd<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int && IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      LogicalAnd<int, int > > >
+operator&&(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalAnd<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Logical OR operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> || Array<T_numtype2, N_rank2>
+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>,
+      LogicalOr<T_numtype1, T_numtype2 > > >
+operator||(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>, 
+      LogicalOr<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> || _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalOr<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator||(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalOr<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> || IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalOr<T_numtype1, int > > >
+operator||(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalOr<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> || int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalOr<T_numtype1, int > > >
+operator||(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalOr<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> || Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalOr<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator||(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalOr<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> || _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator||(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> || IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalOr<_bz_typename P_expr1::T_numtype, int > > >
+operator||(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalOr<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> || int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalOr<_bz_typename P_expr1::T_numtype, int > > >
+operator||(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalOr<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> || Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalOr<int, T_numtype2 > > >
+operator||(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalOr<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> || _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalOr<int, _bz_typename P_expr2::T_numtype > > >
+operator||(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalOr<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> || IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      LogicalOr<int, int > > >
+operator||(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalOr<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> || int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      LogicalOr<int, int > > >
+operator||(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      LogicalOr<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int || Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      LogicalOr<int, T_numtype2 > > >
+operator||(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      LogicalOr<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int || _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      LogicalOr<int, _bz_typename P_expr2::T_numtype > > >
+operator||(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      LogicalOr<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int || IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      LogicalOr<int, int > > >
+operator||(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      LogicalOr<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Bitwise XOR Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> ^ Array<T_numtype2, N_rank2>
+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>,
+      BitwiseXor<T_numtype1, T_numtype2 > > >
+operator^(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>, 
+      BitwiseXor<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> ^ _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseXor<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator^(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseXor<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> ^ IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseXor<T_numtype1, int > > >
+operator^(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseXor<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> ^ int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseXor<T_numtype1, int > > >
+operator^(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseXor<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> ^ Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseXor<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator^(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseXor<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> ^ _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseXor<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator^(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseXor<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> ^ IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseXor<_bz_typename P_expr1::T_numtype, int > > >
+operator^(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseXor<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> ^ int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseXor<_bz_typename P_expr1::T_numtype, int > > >
+operator^(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseXor<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> ^ Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseXor<int, T_numtype2 > > >
+operator^(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseXor<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> ^ _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseXor<int, _bz_typename P_expr2::T_numtype > > >
+operator^(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseXor<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> ^ IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseXor<int, int > > >
+operator^(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseXor<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> ^ int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseXor<int, int > > >
+operator^(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseXor<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int ^ Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseXor<int, T_numtype2 > > >
+operator^(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseXor<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int ^ _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseXor<int, _bz_typename P_expr2::T_numtype > > >
+operator^(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseXor<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int ^ IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseXor<int, int > > >
+operator^(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseXor<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Bitwise And Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> & Array<T_numtype2, N_rank2>
+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>,
+      BitwiseAnd<T_numtype1, T_numtype2 > > >
+operator&(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>, 
+      BitwiseAnd<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> & _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseAnd<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator&(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseAnd<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> & IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseAnd<T_numtype1, int > > >
+operator&(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseAnd<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> & int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseAnd<T_numtype1, int > > >
+operator&(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseAnd<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> & Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator&(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> & _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator&(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> & IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, int > > >
+operator&(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> & int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, int > > >
+operator&(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseAnd<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> & Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseAnd<int, T_numtype2 > > >
+operator&(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseAnd<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> & _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseAnd<int, _bz_typename P_expr2::T_numtype > > >
+operator&(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseAnd<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> & IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseAnd<int, int > > >
+operator&(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseAnd<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> & int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseAnd<int, int > > >
+operator&(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseAnd<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int & Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseAnd<int, T_numtype2 > > >
+operator&(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseAnd<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int & _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseAnd<int, _bz_typename P_expr2::T_numtype > > >
+operator&(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseAnd<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int & IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseAnd<int, int > > >
+operator&(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseAnd<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Bitwise Or Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> | Array<T_numtype2, N_rank2>
+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>,
+      BitwiseOr<T_numtype1, T_numtype2 > > >
+operator|(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>, 
+      BitwiseOr<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> | _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseOr<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator|(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseOr<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> | IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseOr<T_numtype1, int > > >
+operator|(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseOr<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> | int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseOr<T_numtype1, int > > >
+operator|(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseOr<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> | Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseOr<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator|(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseOr<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> | _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator|(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseOr<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> | IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseOr<_bz_typename P_expr1::T_numtype, int > > >
+operator|(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseOr<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> | int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseOr<_bz_typename P_expr1::T_numtype, int > > >
+operator|(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseOr<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> | Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseOr<int, T_numtype2 > > >
+operator|(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseOr<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> | _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseOr<int, _bz_typename P_expr2::T_numtype > > >
+operator|(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseOr<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> | IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseOr<int, int > > >
+operator|(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseOr<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> | int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      BitwiseOr<int, int > > >
+operator|(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      BitwiseOr<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int | Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      BitwiseOr<int, T_numtype2 > > >
+operator|(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      BitwiseOr<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int | _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      BitwiseOr<int, _bz_typename P_expr2::T_numtype > > >
+operator|(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      BitwiseOr<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int | IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      BitwiseOr<int, int > > >
+operator|(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      BitwiseOr<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Shift right Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> >> Array<T_numtype2, N_rank2>
+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>,
+      ShiftRight<T_numtype1, T_numtype2 > > >
+operator>>(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>, 
+      ShiftRight<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> >> _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftRight<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator>>(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftRight<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> >> IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftRight<T_numtype1, int > > >
+operator>>(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftRight<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> >> int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftRight<T_numtype1, int > > >
+operator>>(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftRight<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> >> Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftRight<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator>>(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftRight<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> >> _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator>>(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftRight<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> >> IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftRight<_bz_typename P_expr1::T_numtype, int > > >
+operator>>(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftRight<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> >> int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftRight<_bz_typename P_expr1::T_numtype, int > > >
+operator>>(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftRight<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> >> Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftRight<int, T_numtype2 > > >
+operator>>(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftRight<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> >> _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftRight<int, _bz_typename P_expr2::T_numtype > > >
+operator>>(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftRight<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> >> IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftRight<int, int > > >
+operator>>(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftRight<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> >> int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftRight<int, int > > >
+operator>>(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftRight<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int >> Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftRight<int, T_numtype2 > > >
+operator>>(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftRight<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int >> _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftRight<int, _bz_typename P_expr2::T_numtype > > >
+operator>>(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftRight<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int >> IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      ShiftRight<int, int > > >
+operator>>(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftRight<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+/****************************************************************************
+ * Shift left Operators
+ ****************************************************************************/
+
+// Array<T_numtype1, N_rank1> << Array<T_numtype2, N_rank2>
+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>,
+      ShiftLeft<T_numtype1, T_numtype2 > > >
+operator<<(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>, 
+      ShiftLeft<T_numtype1, T_numtype2> >
+      (d1.begin(), 
+      d2.begin());
+}
+
+// Array<T_numtype1, N_rank1> << _bz_ArrayExpr<P_expr2>
+template<class T_numtype1, int N_rank1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftLeft<T_numtype1, _bz_typename P_expr2::T_numtype > > >
+operator<<(const Array<T_numtype1, N_rank1>& d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftLeft<T_numtype1, _bz_typename P_expr2::T_numtype> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> << IndexPlaceholder<N_index2>
+template<class T_numtype1, int N_rank1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftLeft<T_numtype1, int > > >
+operator<<(const Array<T_numtype1, N_rank1>& d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftLeft<T_numtype1, int> >
+      (d1.begin(), 
+      d2);
+}
+
+// Array<T_numtype1, N_rank1> << int
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftLeft<T_numtype1, int > > >
+operator<<(const Array<T_numtype1, N_rank1>& d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<ArrayIterator<T_numtype1, N_rank1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftLeft<T_numtype1, int> >
+      (d1.begin(), 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// _bz_ArrayExpr<P_expr1> << Array<T_numtype2, N_rank2>
+template<class P_expr1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftLeft<_bz_typename P_expr1::T_numtype, T_numtype2 > > >
+operator<<(_bz_ArrayExpr<P_expr1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftLeft<_bz_typename P_expr1::T_numtype, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// _bz_ArrayExpr<P_expr1> << _bz_ArrayExpr<P_expr2>
+template<class P_expr1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype > > >
+operator<<(_bz_ArrayExpr<P_expr1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftLeft<_bz_typename P_expr1::T_numtype, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> << IndexPlaceholder<N_index2>
+template<class P_expr1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftLeft<_bz_typename P_expr1::T_numtype, int > > >
+operator<<(_bz_ArrayExpr<P_expr1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftLeft<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      d2);
+}
+
+// _bz_ArrayExpr<P_expr1> << int
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftLeft<_bz_typename P_expr1::T_numtype, int > > >
+operator<<(_bz_ArrayExpr<P_expr1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExpr<P_expr1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftLeft<_bz_typename P_expr1::T_numtype, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// IndexPlaceholder<N_index1> << Array<T_numtype2, N_rank2>
+template<int N_index1, class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftLeft<int, T_numtype2 > > >
+operator<<(IndexPlaceholder<N_index1> d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftLeft<int, T_numtype2> >
+      (d1, 
+      d2.begin());
+}
+
+// IndexPlaceholder<N_index1> << _bz_ArrayExpr<P_expr2>
+template<int N_index1, class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftLeft<int, _bz_typename P_expr2::T_numtype > > >
+operator<<(IndexPlaceholder<N_index1> d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftLeft<int, _bz_typename P_expr2::T_numtype> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> << IndexPlaceholder<N_index2>
+template<int N_index1, int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>,
+      ShiftLeft<int, int > > >
+operator<<(IndexPlaceholder<N_index1> d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftLeft<int, int> >
+      (d1, 
+      d2);
+}
+
+// IndexPlaceholder<N_index1> << int
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>,
+      ShiftLeft<int, int > > >
+operator<<(IndexPlaceholder<N_index1> d1, 
+      int d2)
+{
+    return _bz_ArrayExprOp<IndexPlaceholder<N_index1>, 
+      _bz_ArrayExprConstant<int>, 
+      ShiftLeft<int, int> >
+      (d1, 
+      _bz_ArrayExprConstant<int>(d2));
+}
+
+// int << Array<T_numtype2, N_rank2>
+template<class T_numtype2, int N_rank2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>,
+      ShiftLeft<int, T_numtype2 > > >
+operator<<(int d1, 
+      const Array<T_numtype2, N_rank2>& d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      ArrayIterator<T_numtype2, N_rank2>, 
+      ShiftLeft<int, T_numtype2> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2.begin());
+}
+
+// int << _bz_ArrayExpr<P_expr2>
+template<class P_expr2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>,
+      ShiftLeft<int, _bz_typename P_expr2::T_numtype > > >
+operator<<(int d1, 
+      _bz_ArrayExpr<P_expr2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      _bz_ArrayExpr<P_expr2>, 
+      ShiftLeft<int, _bz_typename P_expr2::T_numtype> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+
+// int << IndexPlaceholder<N_index2>
+template<int N_index2>
+inline
+_bz_ArrayExpr<_bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>,
+      ShiftLeft<int, int > > >
+operator<<(int d1, 
+      IndexPlaceholder<N_index2> d2)
+{
+    return _bz_ArrayExprOp<_bz_ArrayExprConstant<int>, 
+      IndexPlaceholder<N_index2>, 
+      ShiftLeft<int, int> >
+      (_bz_ArrayExprConstant<int>(d1), 
+      d2);
+}
+BZ_NAMESPACE_END
+
+#endif
Index: trunk/SophyaExt/Blitz/blitz/array/cartesian.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/cartesian.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/cartesian.h	(revision 221)
@@ -0,0 +1,155 @@
+#ifndef BZ_ARRAY_CARTESIAN_H
+#define BZ_ARRAY_CARTESIAN_H
+
+/*
+ * 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];
+    }
+}
+
+#endif // BZ_ARRAY_CARTESIAN_H
+
Index: trunk/SophyaExt/Blitz/blitz/array/cgsolve.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/cgsolve.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/cgsolve.h	(revision 221)
@@ -0,0 +1,126 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/array/complex.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/complex.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/complex.cc	(revision 221)
@@ -0,0 +1,31 @@
+// 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(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(Array<complex<T_numtype>,N_rank>& A)
+{
+    return A.extractComponent(T_numtype(), 1, 2);
+}
+
+#endif
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYCOMPLEX_CC
+
Index: trunk/SophyaExt/Blitz/blitz/array/cycle.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/cycle.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/cycle.cc	(revision 221)
@@ -0,0 +1,54 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/array/domain.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/domain.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/domain.h	(revision 221)
@@ -0,0 +1,89 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/array/eval.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/eval.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/eval.cc	(revision 221)
@@ -0,0 +1,1206 @@
+/*
+ * $Id: eval.cc,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * $Log: not supported by cvs2svn $
+ * 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_ArrayExpr<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_ArrayExpr<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(_bz_ArrayExpr<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.");
+
+#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(_bz_ArrayExpr<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
+    ArrayIterator<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(_bz_ArrayExpr<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
+    ArrayIterator<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* _bz_restrict 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))
+        {
+            lastLength *= length(outerLoopRank);
+            firstNoncollapsedLoop = i+1;
+        }
+    }
+#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))
+        {
+            T_numtype * _bz_restrict end = const_cast<T_numtype*>(iter.data()) 
+                + lastLength;
+
+#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 ArrayIterator, 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 
+
+            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(_bz_ArrayExpr<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])
+        {
+            iter[index[0]] = expr(index);
+        }
+    }
+    else {
+        ArrayIterator<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(_bz_ArrayExpr<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);
+    const int secondLastRank = ordering(1);
+
+#ifdef BZ_DEBUG_TRAVERSE
+cout << "Index traversal: N_rank = " << N_rank << endl;
+cout << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank
+     << endl;
+cout.flush();
+#endif
+
+    ArrayIterator<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, _bz_ArrayExpr<T_expr> expr,
+    T_update)
+{
+    const int maxRank = ordering(0);
+    const int secondLastRank = ordering(1);
+
+#ifdef BZ_DEBUG_TRAVERSE
+cerr << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank
+     << endl;
+#endif
+
+    ArrayIterator<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(_bz_ArrayExpr<T_expr> 
+    expr, T_update)
+{
+    const int minorRank = ordering(0);
+    const int majorRank = ordering(1);
+
+    ArrayIterator<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(_bz_ArrayExpr<T_expr> 
+    expr, T_update)
+{
+    const int minorRank = ordering(0);
+    const int majorRank = ordering(1);
+
+    const int blockSize = 16;
+    
+    ArrayIterator<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
+
Index: trunk/SophyaExt/Blitz/blitz/array/expr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/expr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/expr.h	(revision 221)
@@ -0,0 +1,646 @@
+/***************************************************************************
+ * blitz/arrayexpr.h     Array<T,N> expression templates
+ *
+ * $Id: expr.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+#ifndef BZ_NUMINQUIRE_H
+ #include <blitz/numinquire.h>
+#endif
+#endif
+
+/*
+ * The array expression templates iterator interface is followed by
+ * these classes:
+ *
+ * ArrayIterator              <blitz/arrayiter.h>
+ * _bz_ArrayExpr              <blitz/arrayexpr.h>
+ * _bz_ArrayExprOp                    "
+ * _bz_ArrayExprUnaryOp               "
+ * _bz_ArrayExprConstant              "
+ * _bz_ArrayMap               <blitz/arraymap.h>
+ * _bz_ArrayExprReduce        <blitz/arrayreduce.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_)
+    { }
+
+    _bz_ArrayExpr(T_expr a)
+        : iter_(a)
+    { }
+
+    _bz_ArrayExpr(_bz_typename T_expr::T_ctorArg1 a)
+        : iter_(a)
+    { }
+
+    // This template is not possible because it masks the copy constructor,
+    // wreaking havoc.
+
+#if BZ_TEMPLATE_CTOR_DOESNT_CAUSE_HAVOC
+    template<class T1>
+    _bz_explicit _bz_ArrayExpr(T1 a)
+       : iter_(a)
+    { }
+#endif
+
+    template<class T1, class T2>
+    _bz_ArrayExpr(T1 a, T2 b)
+        : iter_(a, b)
+    { }
+
+    template<class T1, class T2, class T3>
+    _bz_ArrayExpr(T1 a, T2 b, T3 c)
+        : iter_(a, b, c)
+    { }
+
+    template<class T1, class T2>
+    _bz_ArrayExpr(_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 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_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(T1 a, 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 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(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(T1 a)
+        : iter_(a)
+    { }
+#endif
+
+    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 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
+
Index: trunk/SophyaExt/Blitz/blitz/array/geometry.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/geometry.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/geometry.h	(revision 221)
@@ -0,0 +1,81 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/array/indirect.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/indirect.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/indirect.h	(revision 221)
@@ -0,0 +1,270 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/array/interlace.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/interlace.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/interlace.cc	(revision 221)
@@ -0,0 +1,549 @@
+/***************************************************************************
+ * blitz/array/interlace.cc
+ *
+ * $Id: interlace.cc,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ *
+ */
+
+#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
+
Index: trunk/SophyaExt/Blitz/blitz/array/io.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/io.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/io.cc	(revision 221)
@@ -0,0 +1,44 @@
+#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 << "[ ";
+    for (int i=x.lbound(firstRank); i <= x.ubound(firstRank); ++i)
+    {
+        os << setw(10) << x(i);
+        if (!((i+1)%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;
+    for (int i=x.lbound(firstRank); i <= x.ubound(firstRank); ++i)
+    {
+        for (int j=x.lbound(secondRank); j <= x.ubound(secondRank); ++j)
+        {
+            os << setw(10) << x(i,j);
+            if (!((j+1)%7))
+                os << endl << "  ";
+        }
+        os << endl;
+    }
+
+    return os;
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYIO_CC
Index: trunk/SophyaExt/Blitz/blitz/array/iter.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/iter.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/iter.h	(revision 221)
@@ -0,0 +1,262 @@
+/***************************************************************************
+ * blitz/array/iter.h     Declaration of ArrayIterator<P_numtype,N_rank>
+ *
+ * $Id: iter.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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_ARRAYITER_H
+#define BZ_ARRAYITER_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 ArrayIterator {
+public:
+    typedef P_numtype                T_numtype;
+    typedef Array<T_numtype, N_rank> T_array;
+    typedef ArrayIterator<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.
+    ArrayIterator(const ArrayIterator<P_numtype, N_rank>& x)
+        : array_(x.array_), data_(x.data_)
+    { }
+
+    void operator=(const ArrayIterator<P_numtype, N_rank>& x)
+    {
+        array_ = x.array_;
+        data_ = x.data_;
+        stack_ = x.stack_;
+        stride_ = x.stride_;
+    }
+
+    ArrayIterator(const T_array& array)
+        : array_(array)
+    {
+        data_   = array.data();
+    }
+
+    ~ArrayIterator()
+    { }
+
+#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 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_; }
+
+    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, 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_array&                          array_;
+    const T_numtype * _bz_restrict          data_;
+    const T_numtype * _bz_restrict          stack_[N_rank];
+    int                                     stride_;
+};
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYITER_H
Index: trunk/SophyaExt/Blitz/blitz/array/map.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/map.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/map.h	(revision 221)
@@ -0,0 +1,430 @@
+/***************************************************************************
+ * blitz/array/map.h      Declaration of the ArrayIndexMapping class
+ *
+ * $Id: map.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 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
+
Index: trunk/SophyaExt/Blitz/blitz/array/methods.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/methods.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/methods.cc	(revision 221)
@@ -0,0 +1,321 @@
+/*
+ * $Id: methods.cc,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
+#include <blitz/minmax.h>  // Needed for resizeAndPreserve()
+
+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)
+{
+    BZ_NOT_IMPLEMENTED();
+
+    // Obtain storage order from an operand in the expression
+    // (if possible).  Probably best to assume C-style storage,
+    // then pass the storage object to the expression for possible
+    // modification.
+
+    // Obtain ubounds/lbounds from array operands.  Precondition
+    // failure if any bounds missing.
+
+    // Size array.
+
+    // assignment of expression.
+}
+
+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 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
+       << "storageContiguous = " << storageContiguous_ << 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(Array<P_numtype, N_rank>& array)
+{
+    storage_ = array.storage_;
+    length_ = array.length_;
+    stride_ = array.stride_;
+    zeroOffset_ = array.zeroOffset_;
+    storageContiguous_ = array.storageContiguous_;
+
+    MemoryBlockReference<P_numtype>::changeBlock(array, array.zeroOffset_);
+
+    data_ = 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_;
+
+    // A new array will always have contiguous storage
+    storageContiguous_ = _bz_true;
+}
+
+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] * (length_[rank] - 1);
+    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)
+{
+    BZPRECONDITION((componentNumber >= 0) && (componentNumber < numComponents));
+
+    TinyVector<int,N_rank> stride2;
+    stride2 = stride_ * numComponents;
+    T_numtype2* dataFirst2 = ((T_numtype2*)dataFirst()) + componentNumber;
+    return Array<T_numtype2,N_rank>(dataFirst2, length_, stride2, storage_);
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAY_CC
+
Index: trunk/SophyaExt/Blitz/blitz/array/misc.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/misc.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/misc.cc	(revision 221)
@@ -0,0 +1,82 @@
+#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<ArrayIterator<T_numtype,N_rank>,    \
+    fnobj<T_numtype> > >                                               \
+fn(const Array<T_numtype,N_rank>& array)                               \
+{                                                                      \
+    return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype,N_rank>,       \
+        fnobj<T_numtype> >(array.begin());                             \
+}                                                                      \
+                                                                       \
+template<class T_expr>                                                 \
+inline                                                                 \
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>,              \
+    fnobj<_bz_typename T_expr::T_numtype> > >                          \
+fn(_bz_ArrayExpr<T_expr> expr)                                         \
+{                                                                      \
+    return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>,                 \
+        fnobj<_bz_typename T_expr::T_numtype> >(expr);                 \
+}                                                                      \
+                                                                       \
+template<int N_index>                                                  \
+inline                                                                 \
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index>,          \
+    fnobj<int> > >                                                     \
+fn(IndexPlaceholder<N_index> index)                                    \
+{                                                                      \
+    return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index>,             \
+        fnobj<int> >(index);                                           \
+}
+
+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<ArrayIterator<T_numtype,N_rank>,   
+    Cast<T_numtype, T_cast> > >
+cast(const Array<T_numtype,N_rank>& array, T_cast)
+{                                                                      
+    return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype,N_rank>,      
+        Cast<T_numtype,T_cast> >(array.begin());                            
+}                                                                      
+                                                                       
+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_ArrayExpr<T_expr> expr, T_cast)
+{                                                                      
+    return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<T_expr>,                 
+        Cast<_bz_typename T_expr::T_numtype,T_cast> >(expr);                 
+}                                                                      
+                                                                       
+template<int N_index, class T_cast>
+inline                                                                 
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index>,          
+    Cast<int,T_cast> > >                                                     
+cast(IndexPlaceholder<N_index> index, T_cast)
+{                                                                      
+    return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index>,             
+        Cast<int,T_cast> >(index);                                           
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYMISC_CC
+
Index: trunk/SophyaExt/Blitz/blitz/array/multi.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/multi.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/multi.h	(revision 221)
@@ -0,0 +1,56 @@
+// 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 };
+};
+
+// complex<T>
+template<class T>
+struct multicomponent_traits<complex<T> > {
+    typedef T T_element;
+    enum { numComponents = 2 };
+};
+
+// This macro is provided so that users can register their own
+// multicomponent types.
+
+#define BZ_DECLARE_MULTICOMPONENT_TYPE(T_tuple,T,N)          \
+  template<>                                                 \
+  struct multicomponent_traits<T_tuple > {                   \
+    typedef T T_element;                                     \
+    enum { numComponents = N };                              \
+  };
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYMULTI_H
Index: trunk/SophyaExt/Blitz/blitz/array/ops.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/ops.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/ops.cc	(revision 221)
@@ -0,0 +1,309 @@
+#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;
+}
+
+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<ArrayIterator<T_numtype, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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<ArrayIterator<T_numtype2, N_rank> >(x.begin());
+    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_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_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_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_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_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_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_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_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_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_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_ArrayExpr<T_expr> expr)
+{
+    evaluate(expr, _bz_shiftl_update<T_numtype,
+        _bz_typename T_expr::T_numtype>());
+    return *this;
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYOPS_CC
Index: trunk/SophyaExt/Blitz/blitz/array/reduce.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/reduce.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/reduce.cc	(revision 221)
@@ -0,0 +1,122 @@
+#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 NOT_IMPLEMENTED
+    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;
+            }
+        }
+
+#if 0
+        int j = 1;
+        for (; j < rank; ++j)
+        {
+            index(j-1) = first(j-1);
+            ++index(j);
+            if (index(j) != last(j))
+                break;
+        }
+
+        if (j == rank)
+            break;
+#endif
+
+        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
+
Index: trunk/SophyaExt/Blitz/blitz/array/reduce.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/reduce.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/reduce.h	(revision 221)
@@ -0,0 +1,303 @@
+/***************************************************************************
+ * 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: reduce.h,v 1.1.1.1 1999-04-09 17:59:04 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 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(std::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<ArrayIterator<T_numtype,N_rank>,      \
+    N_index, reduction<T_numtype> > >                                   \
+fn(const Array<T_numtype, N_rank>& array,                               \
+    const IndexPlaceholder<N_index>&)                                   \
+{                                                                       \
+    return _bz_ArrayExprReduce<ArrayIterator<T_numtype,N_rank>,         \
+        N_index, reduction<T_numtype> > (array.begin());                \
+}                        
+
+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)
+
+/*
+ * 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.begin(),                       \
+        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(minIndex, ReduceMinIndex)
+BZ_DECL_ARRAY_FULL_REDUCE(max,      ReduceMax)
+BZ_DECL_ARRAY_FULL_REDUCE(maxIndex, ReduceMaxIndex)
+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_NAMESPACE_END
+
+#include <blitz/array/reduce.cc>
+
+#endif // BZ_ARRAYREDUCE_H
Index: trunk/SophyaExt/Blitz/blitz/array/resize.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/resize.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/resize.cc	(revision 221)
@@ -0,0 +1,425 @@
+#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
+
+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(1);
+    }
+}
+
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+
+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(1);
+    }
+}
+
+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(1);
+    }
+}
+
+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
+        Range overlap0 = Range(fromStart, 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_);
+        Range overlap0 = Range(fromStart, min(B.ubound(0), ubound(0)));
+        Range overlap1 = Range(fromStart, 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_);
+        Range overlap0 = Range(fromStart, min(B.ubound(0), ubound(0)));
+        Range overlap1 = Range(fromStart, min(B.ubound(1), ubound(1)));
+        Range overlap2 = Range(fromStart, 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_);
+        Range overlap0 = Range(fromStart, min(B.ubound(0), ubound(0)));
+        Range overlap1 = Range(fromStart, min(B.ubound(1), ubound(1)));
+        Range overlap2 = Range(fromStart, min(B.ubound(2), ubound(2)));
+        Range overlap3 = Range(fromStart, 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_);
+        Range overlap0 = Range(fromStart, min(B.ubound(0), ubound(0)));
+        Range overlap1 = Range(fromStart, min(B.ubound(1), ubound(1)));
+        Range overlap2 = Range(fromStart, min(B.ubound(2), ubound(2)));
+        Range overlap3 = Range(fromStart, min(B.ubound(3), ubound(3)));
+        Range overlap4 = Range(fromStart, 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_);
+        Range overlap0 = Range(fromStart, min(B.ubound(0), ubound(0)));
+        Range overlap1 = Range(fromStart, min(B.ubound(1), ubound(1)));
+        Range overlap2 = Range(fromStart, min(B.ubound(2), ubound(2)));
+        Range overlap3 = Range(fromStart, min(B.ubound(3), ubound(3)));
+        Range overlap4 = Range(fromStart, min(B.ubound(4), ubound(4)));
+        Range overlap5 = Range(fromStart, 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(1);
+//    }
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYRESIZE_CC
Index: trunk/SophyaExt/Blitz/blitz/array/shape.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/shape.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/shape.h	(revision 221)
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * blitz/array/shape.h        
+ *
+ * $Id: shape.h,v 1.1.1.1 1999-04-09 17:59:04 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/array/slice.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/slice.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/slice.h	(revision 221)
@@ -0,0 +1,127 @@
+/***************************************************************************
+ * blitz/array/slice.h    Helper classes for slicing arrays
+ *
+ * $Id: slice.h,v 1.1.1.1 1999-04-09 17:59:04 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/array/slicing.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/slicing.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/slicing.cc	(revision 221)
@@ -0,0 +1,330 @@
+#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
+    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()
+
+    // Note: this code ignores a few weird cases that would hopefully come
+    // up rarely, e.g. slicing the array 0..99,0..99 with
+    // Range::all() and Range(1,99,2).  This preserves contiguous
+    // storage, but the contiguousStorage_ flag will still be set
+    // false.  This isn't a serious problem -- array operations will
+    // just be a tad slower in this situation.
+    if (isMinorRank(rank) &&
+      ((first != base(rank)) || (last != base(rank) + length_[rank] - 1)))
+        storageContiguous_ = _bz_false;
+
+    if ((ordering(rank) != N_rank-1) && (stride != 1))
+        storageContiguous_ = _bz_false;
+
+    length_[rank] = (last - first) / stride + 1;
+
+    int offset = (first - base(rank)) * stride_[rank];
+    data_ += offset;
+    zeroOffset_ -= offset;
+
+    stride_[rank] *= stride;
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_ARRAYSLICING_CC
Index: trunk/SophyaExt/Blitz/blitz/array/stencil.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/stencil.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/stencil.cc	(revision 221)
@@ -0,0 +1,523 @@
+#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>
+inline 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>
+inline 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
+    stencilExtent_traits<T_array2>::T_stencilExtent Bt;
+    stencilExtent_traits<T_array3>::T_stencilExtent Ct;
+    stencilExtent_traits<T_array4>::T_stencilExtent Dt;
+    stencilExtent_traits<T_array5>::T_stencilExtent Et;
+    stencilExtent_traits<T_array6>::T_stencilExtent Ft;
+    stencilExtent_traits<T_array7>::T_stencilExtent Gt;
+    stencilExtent_traits<T_array8>::T_stencilExtent Ht;
+    stencilExtent_traits<T_array9>::T_stencilExtent It;
+    stencilExtent_traits<T_array10>::T_stencilExtent Jt;
+    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>
+inline 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);
+}
+
+/*
+ * 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);
+  
+    // Interrogate the stencil to find out its extent
+    stencilExtent<3, T_numtype1> At;
+    calcStencilExtent(At, 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 = At.min(0);
+    int stencil_lbound1 = At.min(1);
+    int stencil_lbound2 = At.min(2);
+
+    int stencil_ubound0 = At.max(0);
+    int stencil_ubound1 = At.max(1);
+    int stencil_ubound2 = At.max(2);
+
+    int lbound0 = max(A.lbound(0), A.lbound(0) - stencil_lbound0);
+    int lbound1 = max(A.lbound(1), A.lbound(1) - stencil_lbound1);
+    int lbound2 = max(A.lbound(2), A.lbound(2) - stencil_lbound2);
+
+    int ubound0 = min(A.ubound(0), A.ubound(0) - stencil_ubound0);
+    int ubound1 = min(A.ubound(1), A.ubound(1) - stencil_ubound1);
+    int ubound2 = 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
+    ArrayIterator<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, const Array<T_numtype1,2>& 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)
+{
+    checkShapes(A,B,C,D,E,F,G,H,I,J,K);
+
+    // Interrogate the stencil to find out its extent
+    stencilExtent<2, T_numtype1> At;
+    calcStencilExtent(At, 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 = At.min(0);
+    int stencil_lbound1 = At.min(1);
+
+    int stencil_ubound0 = At.max(0);
+    int stencil_ubound1 = At.max(1);
+
+    int lbound0 = max(A.lbound(0), A.lbound(0) - stencil_lbound0);
+    int lbound1 = max(A.lbound(1), A.lbound(1) - stencil_lbound1);
+
+    int ubound0 = min(A.ubound(0), A.ubound(0) - stencil_ubound0);
+    int ubound1 = 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
+    ArrayIterator<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, const Array<T_numtype1,1>& 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)
+{
+    checkShapes(A,B,C,D,E,F,G,H,I,J,K);
+
+    // Interrogate the stencil to find out its extent
+    stencilExtent<1, T_numtype1> At;
+    calcStencilExtent(At, 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 = At.min(0);
+
+    int stencil_ubound0 = At.max(0);
+
+    int lbound0 = max(A.lbound(0), A.lbound(0) - stencil_lbound0);
+    int ubound0 = 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
+    ArrayIterator<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);
+
+    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
Index: trunk/SophyaExt/Blitz/blitz/array/stencil.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/stencil.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/stencil.h	(revision 221)
@@ -0,0 +1,301 @@
+#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 } };
+#define BZ_STENCIL_END } };
+
+#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<_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] = ::min(min_[i], x.min(i));
+            max_[i] = ::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
+
Index: trunk/SophyaExt/Blitz/blitz/array/stencilops.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/stencilops.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/stencilops.h	(revision 221)
@@ -0,0 +1,963 @@
+#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_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*A(0,0) + A(-1,0) + A(1,0) + A(0,-1) + A(0,1);
+BZ_END_STENCIL_OPERATOR
+
+BZ_DECLARE_STENCIL_OPERATOR1(Laplacian3D, A)
+    return -6*A(0,0,0) + A(-1,0,0) + A(1,0,0) + A(0,-1,0) + A(0,1,0)
+        + A(0,0,-1) + A(0,0,1);
+BZ_END_STENCIL_OPERATOR
+
+BZ_DECLARE_STENCIL_OPERATOR1(Laplacian2D4, A)
+    return -1*A(-2,0) + 16*A(-1,0) -A(0,-2) + 16*A(0,-1) -60*A(0,0)
+      +16*A(0,1) -A(0,2) + 16*A(1,0) - A(2,0);
+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 -1*A(-2,0,0) + 16*A(-1,0,0) -A(0,-2,0) + 16*A(0,-1,0) -90*A
+      +16*A(0,1,0) -A(0,2,0) + 16*A(1,0,0) - A(2,0,0)
+      - A(0,0,-2) + 16*A(0,0,-1) + 16*A(0,0,1) - A(0,0,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) -2*A.shift(+1,dim) + A.shift(+2,dim);
+}
+
+BZ_DECLARE_DIFF(central42) {
+  return A.shift(-2,dim) -4*A.shift(-1,dim) +6*A.shift(0,dim) -4*A.shift(1,dim)
+    +A.shift(2,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) -1*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]
+     -1*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 -1*A+A.shift(1,dim);
+}
+
+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 -1*(*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) + 11*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));
+}
+
+/****************************************************************************
+ * 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 _bz_typename 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 _bz_typename 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 _bz_typename 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 _bz_typename 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);
+}
+
+/****************************************************************************
+ * Divergence
+ ****************************************************************************/
+
+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
+
+/****************************************************************************
+ * 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 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
+
Index: trunk/SophyaExt/Blitz/blitz/array/uops.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/uops.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/uops.cc	(revision 221)
@@ -0,0 +1,5419 @@
+/***************************************************************************
+ * blitz/arrayuops.cc	Expression templates for arrays, unary functions
+ *
+ * $Id: uops.cc,v 1.1.1.1 1999-04-09 17:59:04 ansari Exp $
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ */ 
+
+// Generated source file.  Do not edit. 
+// genarruops.cpp Jun 10 1998 16:02:18
+
+#ifndef BZ_ARRAYUOPS_CC
+#define BZ_ARRAYUOPS_CC
+
+#ifndef BZ_ARRAYEXPR_H
+ #error <blitz/array/uops.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);
+}
+
+
+/****************************************************************************
+ * finite
+ ****************************************************************************/
+
+#ifdef BZ_HAVE_IEEE_MATH
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>,
+    _bz_finite<T_numtype1> > >
+finite(const Array<T_numtype1, N_rank1>& d1)
+{
+    return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>,
+    _bz_finite<T_numtype1> >(d1.begin());
+}
+
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>,
+    _bz_finite<_bz_typename P_expr1::T_numtype> > >
+finite(_bz_ArrayExpr<P_expr1> d1)
+{
+    return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>,
+    _bz_finite<_bz_typename P_expr1::T_numtype> >(d1);
+}
+
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>,
+    _bz_finite<int> > >
+finite(IndexPlaceholder<N_index1> d1)
+{
+    return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>,
+    _bz_finite<int> >(d1);
+}
+
+#endif
+
+/****************************************************************************
+ * 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);
+}
+
+
+/****************************************************************************
+ * trunc
+ ****************************************************************************/
+
+#ifdef BZ_HAVE_IEEE_MATH
+template<class T_numtype1, int N_rank1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>,
+    _bz_trunc<T_numtype1> > >
+trunc(const Array<T_numtype1, N_rank1>& d1)
+{
+    return _bz_ArrayExprUnaryOp<ArrayIterator<T_numtype1, N_rank1>,
+    _bz_trunc<T_numtype1> >(d1.begin());
+}
+
+template<class P_expr1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>,
+    _bz_trunc<_bz_typename P_expr1::T_numtype> > >
+trunc(_bz_ArrayExpr<P_expr1> d1)
+{
+    return _bz_ArrayExprUnaryOp<_bz_ArrayExpr<P_expr1>,
+    _bz_trunc<_bz_typename P_expr1::T_numtype> >(d1);
+}
+
+template<int N_index1>
+inline
+_bz_ArrayExpr<_bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>,
+    _bz_trunc<int> > >
+trunc(IndexPlaceholder<N_index1> d1)
+{
+    return _bz_ArrayExprUnaryOp<IndexPlaceholder<N_index1>,
+    _bz_trunc<int> >(d1);
+}
+
+#endif
+
+/****************************************************************************
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/array/where.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/where.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/where.h	(revision 221)
@@ -0,0 +1,186 @@
+#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(T1 a, T2 b, 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 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 max(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]";
+        // NEEDS_WORK
+    }
+
+    template<class T_shape>
+    _bz_bool shapeCheck(const T_shape& shape)
+    { 
+        return iter1_.shapeCheck(shape) 
+            && iter2_.shapeCheck(shape)
+            && iter3_.shapeCheck(shape); 
+    }
+
+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
+
Index: trunk/SophyaExt/Blitz/blitz/array/zip.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/array/zip.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/array/zip.h	(revision 221)
@@ -0,0 +1,46 @@
+#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
+
Index: trunk/SophyaExt/Blitz/blitz/bench.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/bench.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/bench.cc	(revision 221)
@@ -0,0 +1,189 @@
+/*
+ * $Id: bench.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/bench.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/bench.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/bench.h	(revision 221)
@@ -0,0 +1,147 @@
+/***************************************************************************
+ * blitz/bench.h      Benchmark classes
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/benchext.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/benchext.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/benchext.cc	(revision 221)
@@ -0,0 +1,307 @@
+/*
+ * $Id: benchext.cc,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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>::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
Index: trunk/SophyaExt/Blitz/blitz/benchext.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/benchext.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/benchext.h	(revision 221)
@@ -0,0 +1,129 @@
+/***************************************************************************
+ * blitz/benchext.h      BenchmarkExt classes (Benchmarks with external
+ *                       control)
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 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
Index: trunk/SophyaExt/Blitz/blitz/blitz.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/blitz.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/blitz.h	(revision 221)
@@ -0,0 +1,111 @@
+/***************************************************************************
+ * blitz/blitz.h      Includes all the important header files
+ *
+ * $Id: blitz.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com    
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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.
+ */
+
+#ifndef BZ_DISABLE_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>
+  #include <cmath>
+#else
+  #include <iostream.h>
+  #include <iomanip.h>
+#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
Index: trunk/SophyaExt/Blitz/blitz/bzdebug.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/bzdebug.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/bzdebug.h	(revision 221)
@@ -0,0 +1,238 @@
+/***************************************************************************
+ * blitz/bzdebug.h      Debugging macros
+ *
+ * $Id: bzdebug.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/compiler.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/compiler.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/compiler.h	(revision 221)
@@ -0,0 +1,166 @@
+/***************************************************************************
+ * blitz/compiler.h      Compiler specific directives and kludges
+ *
+ * $Id: compiler.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+#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_BLITZ_SCOPE(x) blitz::x
+#else
+  #define BZ_BLITZ_SCOPE(x) ::x
+#endif
+
+#endif // BZ_COMPILER_H
+
Index: trunk/SophyaExt/Blitz/blitz/config-ICL.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/config-ICL.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/config-ICL.h	(revision 221)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.
+ *
+ */
+
+// This configuration file is for the Intel C/C++ compiler which
+// comes with the VTune 2.4 cdrom.
+ 
+#ifndef BZ_CONFIG_H
+#define BZ_CONFIG_H
+ 
+#define BZ_COMPILER_NAME   "icl"
+#define BZ_COMPILER_OPTIONS ""
+#define BZ_OS_NAME         "Windows 95"
+#define BZ_BZCONFIG_DATE   "Thu Aug 21 09:00:00 EST 1997"
+ 
+#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_BOOL
+#define BZ_CONST_CAST
+#define BZ_STATIC_CAST
+#define BZ_REINTERPRET_CAST
+#define BZ_DYNAMIC_CAST
+#define BZ_TEMPLATES
+#undef  BZ_PARTIAL_SPECIALIZATION
+#undef  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
+#undef  BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#undef  BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#undef  BZ_TEMPLATE_KEYWORD_QUALIFIER
+#undef  BZ_TEMPLATE_SCOPED_ARGUMENT_MATCHING
+#define BZ_TYPE_PROMOTION
+#define BZ_USE_NUMTRAIT
+#undef  BZ_HAVE_COMPLEX
+#define BZ_HAVE_NUMERIC_LIMITS
+#define BZ_HAVE_VALARRAY
+#undef  BZ_HAVE_COMPLEX_MATH
+#undef  BZ_HAVE_IEEE_MATH
+#undef  BZ_HAVE_SYSTEM_V_MATH
+#undef  BZ_HAVE_STD
+#undef  BZ_HAVE_RUSAGE
+ 
+#endif // BZ_CONFIG_H
Index: trunk/SophyaExt/Blitz/blitz/config-KCC.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/config-KCC.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/config-KCC.h	(revision 221)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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   "KCC"
+#define BZ_COMPILER_OPTIONS "-x --restrict"
+#define BZ_OS_NAME         "AIX 2"
+#define BZ_BZCONFIG_DATE   "Wed Jul 29 12:57:56 EDT 1998"
+#define BZ_PLATFORM        "powerpc-ibm-aix4.2.0.0"
+ 
+#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
+#define BZ_NCEG_RESTRICT
+#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
+#undef  BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#undef  BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#undef  BZ_TEMPLATE_KEYWORD_QUALIFIER
+#undef  BZ_TEMPLATE_SCOPED_ARGUMENT_MATCHING
+#define BZ_TYPE_PROMOTION
+#define BZ_USE_NUMTRAIT
+#define BZ_HAVE_COMPLEX
+#define BZ_HAVE_NUMERIC_LIMITS
+#define BZ_HAVE_VALARRAY
+#define BZ_HAVE_COMPLEX_MATH1
+#undef  BZ_HAVE_COMPLEX_MATH2
+#define BZ_HAVE_IEEE_MATH
+#define 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
+#define BZ_ENUM_COMPUTATIONS
+#define BZ_ENUM_COMPUTATIONS_WITH_CAST
+ 
+#endif // BZ_CONFIG_H
Index: trunk/SophyaExt/Blitz/blitz/config-SC4.0.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/config-SC4.0.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/config-SC4.0.h	(revision 221)
@@ -0,0 +1,54 @@
+// From: Doug Moore <dougm@rice.edu>
+// Organization: Rice University Computer Science
+// SC4.0 18 Oct 1995 C++ 4.1
+
+/******************************************************************************
+ * 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   "CC"
+#define BZ_OS_NAME         "SunOS 5.5"
+#define BZ_BZCONFIG_DATE   "Fri Nov  8 16:56:17 CST 1996"
+ 
+#undef  BZ_NAMESPACES
+#undef  BZ_EXCEPTIONS
+#undef  BZ_RTTI
+#undef  BZ_MEMBER_CONSTANTS
+#define BZ_OLD_FOR_SCOPING
+#undef  BZ_EXPLICIT
+#undef  BZ_MUTABLE
+#undef  BZ_TYPENAME
+#undef  BZ_NCEG_RESTRICT
+#undef  BZ_BOOL
+#undef  BZ_CONST_CAST
+#undef  BZ_STATIC_CAST
+#undef  BZ_REINTERPRET_CAST
+#undef  BZ_DYNAMIC_CAST
+#define BZ_TEMPLATES
+#undef  BZ_PARTIAL_SPECIALIZATION
+#undef  BZ_DEFAULT_TEMPLATE_PARAMETERS
+#undef  BZ_MEMBER_TEMPLATES
+#undef  BZ_MEMBER_TEMPLATES_OUTSIDE_CLASS
+#undef  BZ_FULL_SPECIALIZATION_SYNTAX
+#undef  BZ_FUNCTION_NONTYPE_PARAMETERS
+#undef  BZ_TEMPLATE_QUALIFIED_BASE_CLASS
+#undef  BZ_TEMPLATE_QUALIFIED_RETURN_TYPE
+#undef  BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#undef  BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#undef  BZ_TEMPLATE_KEYWORD_QUALIFIER
+#define BZ_TYPE_PROMOTION
+#undef  BZ_HAVE_COMPLEX
+#undef  BZ_HAVE_NUMERIC_LIMITS
+#undef  BZ_HAVE_VALARRAY
+ 
+#endif // BZ_CONFIG_H
+
Index: trunk/SophyaExt/Blitz/blitz/config-egcs.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/config-egcs.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/config-egcs.h	(revision 221)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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   "xgcc"
+#define BZ_COMPILER_OPTIONS "-I /home/tveldhui/software/egcs/include -B /home/tveldhui/software/egcs/include"
+#define BZ_OS_NAME         "AIX 2"
+#define BZ_BZCONFIG_DATE   "Mon Sep  8 13:14:14 EDT 1997"
+ 
+#undef  BZ_NAMESPACES
+#undef  BZ_EXCEPTIONS
+#define BZ_RTTI
+#define BZ_MEMBER_CONSTANTS
+#define BZ_OLD_FOR_SCOPING
+#define BZ_EXPLICIT
+#define BZ_MUTABLE
+#define BZ_TYPENAME
+#undef  BZ_NCEG_RESTRICT
+#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
+#undef  BZ_PARTIAL_ORDERING
+#define BZ_DEFAULT_TEMPLATE_PARAMETERS
+#undef  BZ_MEMBER_TEMPLATES
+#undef  BZ_MEMBER_TEMPLATES_OUTSIDE_CLASS
+#define BZ_FULL_SPECIALIZATION_SYNTAX
+#undef  BZ_FUNCTION_NONTYPE_PARAMETERS
+#define BZ_TEMPLATE_QUALIFIED_BASE_CLASS
+#define BZ_TEMPLATE_QUALIFIED_RETURN_TYPE
+#undef  BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#undef  BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#undef  BZ_TEMPLATE_KEYWORD_QUALIFIER
+#undef  BZ_TEMPLATE_SCOPED_ARGUMENT_MATCHING
+#define BZ_TYPE_PROMOTION
+#define BZ_USE_NUMTRAIT
+#undef  BZ_HAVE_COMPLEX
+#undef  BZ_HAVE_NUMERIC_LIMITS
+#undef  BZ_HAVE_VALARRAY
+#undef  BZ_HAVE_COMPLEX_MATH
+#define BZ_HAVE_IEEE_MATH
+#define BZ_HAVE_SYSTEM_V_MATH
+#undef  BZ_HAVE_STD
+#define BZ_HAVE_RUSAGE
+#define BZ_ENUM_COMPUTATIONS
+ 
+#endif // BZ_CONFIG_H
Index: trunk/SophyaExt/Blitz/blitz/config.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/config.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/config.h	(revision 221)
@@ -0,0 +1,23 @@
+/******************************************************************************
+  Selection de fichier config suivant compilateur supporte ds PEIDA
+                                      Reza 04/99
+*/
+
+
+ 
+#ifndef BZ_CONFIG_S_H
+#define BZ_CONFIG_S_H
+
+#if defined(Linux)  || defined(linux)
+#endif
+
+#ifdef __DECCXX
+#include "peida_config_cxx.h"
+#else
+/* EGCS uniquement */
+#include "peida_config_egcs.h"
+#endif
+
+ 
+ 
+#endif // BZ_CONFIG_S_H
Index: trunk/SophyaExt/Blitz/blitz/extremum.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/extremum.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/extremum.h	(revision 221)
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * blitz/extremum.h      Declaration of the Extremum<T_numtype, T_index> class
+ *
+ * $Id: extremum.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/indexexpr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/indexexpr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/indexexpr.h	(revision 221)
@@ -0,0 +1,213 @@
+/***************************************************************************
+ * blitz/indexexpr.h     Declaration of the IndexPlaceholder<N> class
+ *
+ * $Id: indexexpr.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    p://seurat.uhttwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+BZ_NAMESPACE(blitz)
+
+template<int N>
+class IndexPlaceholder {
+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 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 IndexPlaceholder<0> i;
+    _bz_global IndexPlaceholder<1> j;
+    _bz_global IndexPlaceholder<2> k;
+    _bz_global IndexPlaceholder<3> l;
+    _bz_global IndexPlaceholder<4> m;
+    _bz_global IndexPlaceholder<5> n;
+    _bz_global IndexPlaceholder<6> o;
+    _bz_global IndexPlaceholder<7> p;
+    _bz_global IndexPlaceholder<8> q;
+    _bz_global IndexPlaceholder<9> r;
+    _bz_global IndexPlaceholder<10> s;
+    _bz_global IndexPlaceholder<11> t;
+BZ_NAMESPACE_END // tensor
+
+#endif
+
+BZ_NAMESPACE_END
+
+#endif // BZ_INDEXEXPR_H
+
Index: trunk/SophyaExt/Blitz/blitz/listinit.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/listinit.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/listinit.h	(revision 221)
@@ -0,0 +1,121 @@
+/***************************************************************************
+ * blitz/listinit.h      Classes for initialization lists
+ *
+ * $Id: listinit.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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(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;
+
+    ListInitializationSwitch(const ListInitializationSwitch<T_array>& 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
+
Index: trunk/SophyaExt/Blitz/blitz/matbops.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matbops.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matbops.h	(revision 221)
@@ -0,0 +1,6070 @@
+// 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
Index: trunk/SophyaExt/Blitz/blitz/matdiag.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matdiag.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matdiag.h	(revision 221)
@@ -0,0 +1,176 @@
+/***************************************************************************
+ * blitz/matdiag.h      Declarations for Diagonal matrices 
+ *
+ * $Id: matdiag.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/matexpr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matexpr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matexpr.h	(revision 221)
@@ -0,0 +1,185 @@
+/***************************************************************************
+ * blitz/matexpr.h      Matrix<P_numtype, P_structure> expression templates
+ *
+ * $Id: matexpr.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/matgen.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matgen.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matgen.h	(revision 221)
@@ -0,0 +1,213 @@
+/***************************************************************************
+ * blitz/matgen.h       Declarations for RowMajor and ColumnMajor matrices
+ *
+ * $Id: matgen.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/mathf2.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/mathf2.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/mathf2.h	(revision 221)
@@ -0,0 +1,252 @@
+#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
Index: trunk/SophyaExt/Blitz/blitz/mathfunc.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/mathfunc.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/mathfunc.h	(revision 221)
@@ -0,0 +1,2680 @@
+// Generated: genmathfunc.cpp Jul 28 1998 17:29:02
+
+#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 += ")";
+    }
+};
+
+// 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 += ")";
+    }
+};
+
+// acos(complex<float> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_acos<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(acos)((complex<float> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "acos(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// acos(complex<double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_acos<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(acos)((complex<double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "acos(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// acos(complex<long double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_acos<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(acos)((complex<long double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "acos(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// 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_MATHFN_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 += ")";
+    }
+};
+
+// asin(complex<float> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_asin<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(asin)((complex<float> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "asin(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// asin(complex<double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_asin<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(asin)((complex<double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "asin(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// asin(complex<long double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_asin<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(asin)((complex<long double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "asin(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// 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_MATHFN_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
+
+// 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 += ")";
+    }
+};
+
+// atan(complex<float> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_atan<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(atan)((complex<float> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "atan(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// atan(complex<double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_atan<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(atan)((complex<double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "atan(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// atan(complex<long double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_atan<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(atan)((complex<long double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "atan(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// 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_MATHFN_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); }
+};
+
+// 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); }
+};
+
+// 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); }
+};
+
+// _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_MATHFN_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_MATHFN_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 += ")";
+    }
+};
+
+// 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_MATH1
+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_MATH1
+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_MATH1
+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_MATHFN_SCOPE(copysign)((double)x,(double)y); }
+};
+#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_MATH1
+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_MATH1
+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_MATH1
+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_MATHFN_SCOPE(drem)((double)x,(double)y); }
+};
+#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_MATH1
+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_MATH1
+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_MATH1
+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_MATHFN_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_MATHFN_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_MATHFN_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
+
+// finite(P_numtype1)    Nonzero if finite
+#ifdef BZ_HAVE_IEEE_MATH
+template<class P_numtype1>
+class _bz_finite : public OneOperandApplicativeTemplatesBase {
+public:
+    typedef P_numtype1 T_numtype1;
+    typedef int T_numtype;
+
+    static inline T_numtype apply(T_numtype1 x)
+    { return BZ_MATHFN_SCOPE(finite)(x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "finite(";
+        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_MATHFN_SCOPE(fmod)((double)x,(double)y); }
+};
+#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_MATHFN_SCOPE(hypot)((double)x,(double)y); }
+};
+#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_MATHFN_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_MATHFN_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_MATHFN_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_MATHFN_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_MATHFN_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_MATHFN_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_MATH1
+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_MATH1
+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_MATH1
+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_MATHFN_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_MATHFN_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 += ")";
+    }
+};
+
+// log10(complex<float> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_log10<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(log10)((complex<float> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "log10(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// log10(complex<double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_log10<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(log10)((complex<double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "log10(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// log10(complex<long double> )
+#ifdef BZ_HAVE_COMPLEX_MATH2
+template<>
+class _bz_log10<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(log10)((complex<long double> )x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "log10(";
+        a.prettyPrint(str,format);
+        str += ")";
+    }
+};
+#endif
+
+// 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_MATHFN_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_MATHFN_SCOPE(nextafter)((double)x,(double)y); }
+};
+#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; }
+};
+
+// 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); }
+};
+
+// 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); }
+};
+
+// 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); }
+};
+
+// pow(complex<float>, complex<float>)
+#ifdef BZ_HAVE_COMPLEX_MATH1
+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); }
+};
+#endif
+
+// pow(complex<double>, complex<double>)
+#ifdef BZ_HAVE_COMPLEX_MATH1
+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); }
+};
+#endif
+
+// pow(complex<long double>, complex<long double>)
+#ifdef BZ_HAVE_COMPLEX_MATH1
+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); }
+};
+#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_MATHFN_SCOPE(remainder)((double)x,(double)y); }
+};
+#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_MATHFN_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_MATHFN_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_MATHFN_SCOPE(scalb)((double)x,(double)y); }
+};
+#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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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 += ")";
+    }
+};
+
+// 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 += ")";
+    }
+};
+
+// 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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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_MATH1
+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
+
+// trunc(P_numtype1)    Nearest floating integer in the direction of zero
+#ifdef BZ_HAVE_IEEE_MATH
+template<class P_numtype1>
+class _bz_trunc : public OneOperandApplicativeTemplatesBase {
+public:
+    typedef P_numtype1 T_numtype1;
+    typedef double T_numtype;
+
+    static inline T_numtype apply(T_numtype1 x)
+    { return BZ_MATHFN_SCOPE(trunc)((double)x); }
+
+    template<class T1>
+    static void prettyPrint(string& str, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "trunc(";
+        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_MATHFN_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_MATHFN_SCOPE(unordered)(x,y); }
+};
+#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_MATHFN_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_MATHFN_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
Index: trunk/SophyaExt/Blitz/blitz/matltri.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matltri.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matltri.h	(revision 221)
@@ -0,0 +1,190 @@
+/***************************************************************************
+ * blitz/matltri.h      Declarations for LowerTriangular matrices
+ *
+ * $Id: matltri.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/matref.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matref.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matref.h	(revision 221)
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * blitz/matref.h      Declaration of the _bz_MatrixRef<P_numtype, P_structure>
+ *                     class.
+ *
+ * $Id: matref.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/matrix.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matrix.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matrix.cc	(revision 221)
@@ -0,0 +1,71 @@
+/*
+ * $Id: matrix.cc,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/matrix.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matrix.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matrix.h	(revision 221)
@@ -0,0 +1,234 @@
+/***************************************************************************
+ * blitz/matrix.h      Declaration of the Matrix<T_type, T_structure> class
+ *
+ * $Id: matrix.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/matsymm.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matsymm.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matsymm.h	(revision 221)
@@ -0,0 +1,185 @@
+/***************************************************************************
+ * blitz/matsymm.h      Declarations for Symmetric matrices
+ *
+ * $Id: matsymm.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/mattoep.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/mattoep.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/mattoep.h	(revision 221)
@@ -0,0 +1,170 @@
+/***************************************************************************
+ * blitz/mattoep.h      Declarations for Toeplitz matrices
+ *
+ * $Id: mattoep.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/matuops.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matuops.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matuops.h	(revision 221)
@@ -0,0 +1,1 @@
+
Index: trunk/SophyaExt/Blitz/blitz/matutri.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/matutri.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/matutri.h	(revision 221)
@@ -0,0 +1,187 @@
+/***************************************************************************
+ * blitz/matutri.h      Declarations for UpperTriangular matrices
+ *
+ * $Id: matutri.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/memblock.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/memblock.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/memblock.cc	(revision 221)
@@ -0,0 +1,77 @@
+/*
+ * $Id: memblock.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
+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>
+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.
+        // NB: This code assumes that T_type has a trivial
+        // constructor.
+        const int cacheBlockSize = 128;    // Will work for 32, 16 also
+
+        dataBlockAddress_ = new T_type[length
+            + (cacheBlockSize + sizeof(T_type) - 1) / sizeof(T_type)];
+
+        // 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);
+    }
+#endif
+}
+
+
+BZ_NAMESPACE_END
+
+#endif // BZ_MEMBLOCK_CC
Index: trunk/SophyaExt/Blitz/blitz/memblock.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/memblock.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/memblock.h	(revision 221)
@@ -0,0 +1,318 @@
+/***************************************************************************
+ * blitz/memblock.h      MemoryBlock<T> and MemoryBlockReference<T>
+ *
+ * $Id: memblock.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+#include <stddef.h>     // ptrdiff_t
+
+BZ_NAMESPACE(blitz)
+
+// 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;
+        ownData_ = 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;
+        ownData_ = 1;
+    }
+
+    MemoryBlock(size_t length, T_type* _bz_restrict data)
+    {
+        length_ = length;
+        data_ = data;
+        dataBlockAddress_ = 0;
+        references_ = 0;
+        ownData_ = 0;
+    }
+
+    virtual ~MemoryBlock()
+    {
+        if ((dataBlockAddress_) && (ownData_))
+        {
+
+#ifdef BZ_DEBUG_LOG_ALLOCATIONS
+    cout << "MemoryBlock:     freed " << setw(8) << length_
+         << " at " << ((void *)dataBlockAddress_) << endl;
+#endif
+
+            delete [] dataBlockAddress_;
+        }
+    }
+
+    void          addReference()
+    { 
+        ++references_; 
+
+#ifdef BZ_DEBUG_LOG_REFERENCES
+    cout << "MemoryBlock:    reffed " << setw(8) << length_ 
+         << " at " << ((void *)dataBlockAddress_) << " (r=" 
+         << 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=" << references_ 
+         << ")" << endl;
+#endif
+
+        if (!references_)
+            delete this;
+    }
+
+    int references() const
+    {
+        return references_;
+    }
+
+protected:
+    inline void allocate(int length);
+
+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_;
+    int     references_;
+    size_t  length_;
+    int     ownData_;
+};
+
+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;
+
+    MemoryBlockReference()
+    {
+        block_ = &nullBlock_;
+        block_->addReference();
+
+#ifndef BZ_TEMPLATE_STATIC_INIT
+        // This compiler doesn't handle static initialization
+        // and templates properly.  Give the NullMemoryBlock
+        // another reference to make sure it doesn't delete
+        // itself and cause a seg fault when we dereference it.
+        block_->addReference();
+#endif
+
+        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)
+    {
+        // Create a memory block using already allocated memory.  Note
+        // that the memory will not be freed when no longer being
+        // referenced.
+        block_ = new MemoryBlock<T_type>(length, data);
+        block_->addReference();
+
+        // This extra reference indicates that another object somewhere
+        // has a pointer to the data.  This is necessary so that makeUnique()
+        // will create a copy of the data.   -- TV 19980615
+        block_->addReference();
+        data_ = data;
+    }
+
+    _bz_explicit MemoryBlockReference(size_t items)
+    {
+        block_ = new MemoryBlock<T_type>(items);
+        block_->addReference();
+        data_ = block_->data();
+    }
+
+   ~MemoryBlockReference()
+    {
+        block_->removeReference();
+    }
+
+    int numReferences() const
+    {
+        return block_->references();
+    }
+
+protected:
+
+    void changeToNullBlock()
+    {
+        block_->removeReference();
+        block_ = &nullBlock_;
+        block_->addReference();
+        data_ = 0;
+    }
+
+    void changeBlock(MemoryBlockReference<T_type>& ref, size_t offset)
+    {
+        block_->removeReference();
+        block_ = ref.block_;
+        block_->addReference();
+        data_ = block_->data() + offset;
+    }
+
+    void newBlock(size_t items)
+    {
+        block_->removeReference();
+        block_ = new MemoryBlock<T_type>(items);
+        block_->addReference();
+        data_ = block_->data();
+    }
+
+private:
+    void operator=(const MemoryBlockReference<T_type>&)
+    { }
+
+private:
+    MemoryBlock<T_type>* block_;
+    static NullMemoryBlock<T_type> nullBlock_;
+    
+protected:
+    T_type * _bz_restrict data_;
+};
+
+
+BZ_NAMESPACE_END
+
+#include <blitz/memblock.cc>
+
+#endif // __BZ_MEMBLOCK_H__
Index: trunk/SophyaExt/Blitz/blitz/meta/dot.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/dot.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/dot.h	(revision 221)
@@ -0,0 +1,112 @@
+/***************************************************************************
+ * blitz/meta/dot.h      Tiny vector dot product metaprogram
+ *
+ * $Id: dot.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/meta/matassign.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/matassign.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/matassign.h	(revision 221)
@@ -0,0 +1,87 @@
+/***************************************************************************
+ * blitz/meta/matassign.h   TinyMatrix assignment metaprogram
+ *
+ * $Id: matassign.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/meta/matmat.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/matmat.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/matmat.h	(revision 221)
@@ -0,0 +1,133 @@
+/***************************************************************************
+ * blitz/meta/matmat.h   TinyMatrix matrix-matrix product metaprogram
+ *
+ * $Id: matmat.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/meta/matvec.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/matvec.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/matvec.h	(revision 221)
@@ -0,0 +1,200 @@
+/***************************************************************************
+ * blitz/tiny/matvec.h   TinyMatrix/TinyVector product metaprogram
+ *
+ * $Id: matvec.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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()));
+}
+
+// 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
+
Index: trunk/SophyaExt/Blitz/blitz/meta/metaprog.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/metaprog.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/metaprog.h	(revision 221)
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * blitz/meta/metaprog.h   Useful metaprogram declarations
+ *
+ * $Id: metaprog.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/meta/product.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/product.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/product.h	(revision 221)
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * blitz/meta/product.h  TinyVector product metaprogram
+ *
+ * $Id: product.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/meta/sum.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/sum.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/sum.h	(revision 221)
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * blitz/meta/sum.h      TinyVector sum metaprogram
+ *
+ * $Id: sum.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/meta/vecassign.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/meta/vecassign.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/meta/vecassign.h	(revision 221)
@@ -0,0 +1,95 @@
+/***************************************************************************
+ * blitz/meta/vecassign.h   TinyVector assignment metaprogram
+ *
+ * $Id: vecassign.h,v 1.1.1.1 1999-04-09 17:59:03 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/minmax.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/minmax.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/minmax.h	(revision 221)
@@ -0,0 +1,32 @@
+#ifndef BZ_MINMAX_H
+#define BZ_MINMAX_H
+
+#include <blitz/promote.h>
+
+BZ_NAMESPACE(blitz)
+
+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
+
+#endif
Index: trunk/SophyaExt/Blitz/blitz/mstruct.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/mstruct.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/mstruct.h	(revision 221)
@@ -0,0 +1,149 @@
+/***************************************************************************
+ * blitz/mstruct.h      Matrix structure classes
+ *
+ * $Id: mstruct.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/numinquire.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/numinquire.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/numinquire.h	(revision 221)
@@ -0,0 +1,315 @@
+/***************************************************************************
+ * blitz/numinquire.h    Numeric inquiry functions
+ *
+ * $Id: numinquire.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+ #error <blitz/numinquire.h> requires <limits> from the ISO/ANSI C++ standard (you may need to rerun the compiler/bzconfig script)
+#endif
+
+#include <limits>
+
+#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();
+}
+
+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 std::float_round_style round_style(T)
+{
+    return numeric_limits<T>::round_style;
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_NUMINQUIRE_H
+
Index: trunk/SophyaExt/Blitz/blitz/numtrait.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/numtrait.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/numtrait.h	(revision 221)
@@ -0,0 +1,109 @@
+/***************************************************************************
+ * blitz/numtrait.h      Declaration of the NumericTypeTraits class
+ *
+ * $Id: numtrait.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+};
+
+#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;                                     \
+    }                                                               
+
+#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
Index: trunk/SophyaExt/Blitz/blitz/ops.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/ops.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/ops.h	(revision 221)
@@ -0,0 +1,211 @@
+/***************************************************************************
+ * blitz/ops.h           Function objects for operators
+ *
+ * $Id: ops.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ *************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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& os, prettyPrintFormat& format,
+        const T1& a)
+    {
+        str += "~";
+        a.prettyPrint(os,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
+
+
Index: trunk/SophyaExt/Blitz/blitz/peida_config_cxx.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/peida_config_cxx.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/peida_config_cxx.h	(revision 221)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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   "cxx"
+#define BZ_COMPILER_OPTIONS ""
+#define BZ_OS_NAME         "OSF1 V4.0"
+#define BZ_BZCONFIG_DATE   "Wed Apr  7 13:12:07 MET DST 1999"
+#define BZ_PLATFORM        "alphaev6-dec-osf4.0e"
+ 
+#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_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
+#undef  BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#undef  BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#undef  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_TEMPLATE_STATIC_INIT
+#define BZ_HAVE_COMPLEX
+#define BZ_HAVE_NUMERIC_LIMITS
+#define BZ_HAVE_VALARRAY
+#define BZ_HAVE_COMPLEX_MATH1
+#undef  BZ_HAVE_COMPLEX_MATH2
+#undef  BZ_HAVE_IEEE_MATH
+#undef  BZ_HAVE_SYSTEM_V_MATH
+#undef  BZ_MATH_FN_IN_NAMESPACE_STD
+#define BZ_COMPLEX_MATH_IN_NAMESPACE_STD
+#undef  BZ_HAVE_STD
+#define BZ_HAVE_STL
+#define BZ_HAVE_RUSAGE
+ 
+#endif // BZ_CONFIG_H
Index: trunk/SophyaExt/Blitz/blitz/peida_config_egcs.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/peida_config_egcs.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/peida_config_egcs.h	(revision 221)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.2"
+#define BZ_BZCONFIG_DATE   "Thu Apr  8 13:48:37 CEST 1999"
+#define BZ_PLATFORM        "i686-pc-linux-gnu"
+ 
+#define BZ_NAMESPACES
+#define BZ_EXCEPTIONS
+#define BZ_RTTI
+#define BZ_MEMBER_CONSTANTS
+#define BZ_OLD_FOR_SCOPING
+#define BZ_EXPLICIT
+#define BZ_MUTABLE
+#define BZ_TYPENAME
+#undef  BZ_NCEG_RESTRICT
+#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
+#undef  BZ_TEMPLATE_STATIC_INIT
+#define BZ_HAVE_COMPLEX
+#undef  BZ_HAVE_NUMERIC_LIMITS
+#undef  BZ_HAVE_VALARRAY
+#undef  BZ_HAVE_COMPLEX_MATH1
+#undef  BZ_HAVE_COMPLEX_MATH2
+#undef  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
Index: trunk/SophyaExt/Blitz/blitz/prettyprint.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/prettyprint.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/prettyprint.h	(revision 221)
@@ -0,0 +1,82 @@
+/***************************************************************************
+ * blitz/prettyprint.h      Format object for pretty-printing of
+ *                          array expressions
+ *
+ * $Id: prettyprint.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/promote-old.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/promote-old.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/promote-old.h	(revision 221)
@@ -0,0 +1,1360 @@
+/***********************************************************************
+ * promote.h   Arithmetic type promotion trait class
+ * Author: Todd Veldhuizen         (tveldhui@seurat.uwaterloo.ca)
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/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
+
Index: trunk/SophyaExt/Blitz/blitz/promote.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/promote.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/promote.h	(revision 221)
@@ -0,0 +1,160 @@
+/***********************************************************************
+ * promote.h   Arithmetic type promotion trait class
+ * Author: Todd Veldhuizen         (tveldhui@seurat.uwaterloo.ca)
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/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
Index: trunk/SophyaExt/Blitz/blitz/rand-dunif.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/rand-dunif.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/rand-dunif.h	(revision 221)
@@ -0,0 +1,79 @@
+/***************************************************************************
+ * blitz/rand-dunif.h    Discrete uniform generator
+ *
+ * $Id: rand-dunif.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/rand-normal.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/rand-normal.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/rand-normal.h	(revision 221)
@@ -0,0 +1,101 @@
+/***************************************************************************
+ * blitz/rand-normal.h    Random Gaussian (Normal) generator
+ *
+ * $Id: rand-normal.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/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: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/rand-tt800.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/rand-tt800.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/rand-tt800.h	(revision 221)
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * blitz/rand-tt800.h      Matsumoto and Kurita's TT800 uniform random 
+ *                         number generator.
+ *
+ * $Id: rand-tt800.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ ***************************************************************************
+ *
+ * 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: not supported by cvs2svn $
+ * 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;
+    }
+
+    void randomize() 
+    { 
+        BZ_NOT_IMPLEMENTED();            // NEEDS_WORK
+    }
+  
+    double random()
+    { 
+        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++;
+
+        // NEEDS_WORK: this only generates a random number with
+        // 15 bits of precision.  Need 48 bits for double.
+        return low_ + length_ * ( (double) y / (unsigned long) 0xffffffff);
+    } 
+
+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_;
+    int k;
+    unsigned long x[N];
+    unsigned long mag01[2];
+};
+
+BZ_NAMESPACE_END
+
+#endif // BZ_RAND_TT800_H
+
Index: trunk/SophyaExt/Blitz/blitz/rand-uniform.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/rand-uniform.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/rand-uniform.h	(revision 221)
@@ -0,0 +1,128 @@
+/***************************************************************************
+ * blitz/rand-uniform.h    Uniform class, which provides uniformly
+ *                         distributed random numbers.
+ *
+ * $Id: rand-uniform.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/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: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/random.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/random.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/random.h	(revision 221)
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * blitz/random.h       Random number generator wrapper class
+ *
+ * $Id: random.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/randref.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/randref.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/randref.h	(revision 221)
@@ -0,0 +1,87 @@
+/***************************************************************************
+ * blitz/randref.h      Random number generators, expression templates
+ *                      wrapper
+ *
+ * $Id: randref.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/range.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/range.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/range.h	(revision 221)
@@ -0,0 +1,229 @@
+/***************************************************************************
+ * blitz/range.h      Declaration of the Range class
+ *
+ * $Id: range.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 <limits.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
Index: trunk/SophyaExt/Blitz/blitz/reduce.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/reduce.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/reduce.h	(revision 221)
@@ -0,0 +1,687 @@
+/***************************************************************************
+ * blitz/reduce.h        Reduction operators: sum, mean, min, max,
+ *                       minIndex, maxIndex, product, count, any, all
+ *
+ * $Id: reduce.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+#ifndef BZ_NUMINQUIRE_H
+ #include <blitz/numinquire.h>
+#endif
+#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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { sum_ = zero(T_resulttype()); }
+#else
+    void reset()
+    { sum_ = 0; }
+#endif
+
+    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; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { sum_ = zero(T_resulttype()); }
+#else
+    void reset()
+    { sum_ = 0; }
+#endif
+
+    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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { min_ = huge(P_sourcetype()); }
+#else
+    void reset()
+    {
+        BZPRECHECK(0, "ReduceMin requires <limits> from the ISO/ANSI C++ standard");
+    }
+#endif
+
+    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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { max_ = tiny(P_sourcetype()); }
+#else
+    void reset()
+    { 
+        BZPRECHECK(0, "ReduceMax requires <limits> from the ISO/ANSI C++ standard");
+    }
+#endif
+
+    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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { 
+        min_ = huge(T_sourcetype());
+        index_ = tiny(int());        
+    }
+#else
+    void reset()
+    {
+        BZPRECHECK(0, "ReduceMinIndex requires <limits> from the ISO/ANSI C++ standard");
+    }
+#endif
+
+    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>
+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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    {
+        max_ = tiny(T_sourcetype());
+        index_ = tiny(int());
+    }
+#else
+    void reset()
+    {
+        BZPRECHECK(0, "ReduceMaxIndex requires <limits> from the ISO/ANSI C++ standard");
+    }
+#endif
+
+    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>
+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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    {
+        index_ = tiny(int());
+    }
+#else
+    void reset()
+    {
+        index_ = INT_MIN;
+    }
+#endif
+
+    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 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 };
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    ReduceProduct()
+    { product_ = one(T_resulttype()); }
+#else
+    ReduceProduct()
+    { product_ = 1; }
+#endif
+
+    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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { product_ = one(T_resulttype()); }
+#else
+    void reset()
+    { product_ = T_resulttype(1.0); }
+#endif
+
+    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_; }
+
+#ifdef BZ_HAVE_NUMERIC_LIMITS
+    void reset()
+    { count_ = zero(T_resulttype()); }
+#else
+    void reset()
+    { count_ = 0; }
+#endif
+
+    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
Index: trunk/SophyaExt/Blitz/blitz/shapecheck.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/shapecheck.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/shapecheck.h	(revision 221)
@@ -0,0 +1,79 @@
+/***************************************************************************
+ * blitz/shapecheck.h    Functions for checking conformability of arrays
+ *
+ * $Id: shapecheck.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 (int 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
Index: trunk/SophyaExt/Blitz/blitz/tau.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tau.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tau.h	(revision 221)
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * blitz/tau.h       Integration with the Tau profiling package.
+ *                   See http://www.acl.lanl.gov/tau/
+ *
+ * $Id: tau.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/timer.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/timer.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/timer.h	(revision 221)
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * blitz/Timer.h        Timer class, for use in benchmarking
+ *
+ * $Id: timer.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/tiny.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tiny.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tiny.h	(revision 221)
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * blitz/tiny.h          Tiny base class; now defunct; delete?
+ *
+ * $Id: tiny.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/tinymat.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinymat.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinymat.h	(revision 221)
@@ -0,0 +1,149 @@
+/***************************************************************************
+ * blitz/tinymat.h       Declaration of TinyMatrix<T, N, M>
+ *
+ * $Id: tinymat.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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;
+    }
+
+    // NEEDS_WORK -- not implemented
+    void initialize(T_numtype x)
+    { BZ_NOT_IMPLEMENTED(); }
+
+    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
+
Index: trunk/SophyaExt/Blitz/blitz/tinymatexpr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinymatexpr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinymatexpr.h	(revision 221)
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * blitz/tinymatexpr.h   Tiny Matrix Expressions
+ *
+ * $Id: tinymatexpr.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/tinyvec.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinyvec.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinyvec.cc	(revision 221)
@@ -0,0 +1,654 @@
+#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);
+    }
+}
+
+/*****************************************************************************
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/tinyvec.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinyvec.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinyvec.h	(revision 221)
@@ -0,0 +1,433 @@
+/***************************************************************************
+ * blitz/tinyvec.h      Declaration of the TinyVector<T, N> class
+ *
+ * $Id: tinyvec.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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;
+    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;
+    }
+
+    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];
+};
+
+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
+
Index: trunk/SophyaExt/Blitz/blitz/tinyvecio.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinyvecio.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinyvecio.cc	(revision 221)
@@ -0,0 +1,44 @@
+/*
+ * $Id: tinyvecio.cc,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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 << "[ ";
+    for (int i=0; i < N_length; ++i)
+    {
+        os << setw(10) << x[i];
+        if (!((i+1)%7))
+            os << endl << "  ";
+    }
+    os << " ]";
+    return os;
+}
+
+BZ_NAMESPACE_END
+
+#endif // BZ_TINYVECIO_CC
Index: trunk/SophyaExt/Blitz/blitz/tinyveciter.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tinyveciter.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tinyveciter.h	(revision 221)
@@ -0,0 +1,170 @@
+/***************************************************************************
+ * blitz/tinyveciter.h   Declaration of TinyVectorIter<T,N,stride>
+ *
+ * $Id: tinyveciter.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/traversal.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/traversal.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/traversal.cc	(revision 221)
@@ -0,0 +1,100 @@
+#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)
+
+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
Index: trunk/SophyaExt/Blitz/blitz/traversal.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/traversal.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/traversal.h	(revision 221)
@@ -0,0 +1,167 @@
+/***************************************************************************
+ * blitz/traversal.h      Declaration of the TraversalOrder classes
+ *
+ * $Id: traversal.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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> {
+};
+
+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
+
Index: trunk/SophyaExt/Blitz/blitz/tuning.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tuning.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tuning.h	(revision 221)
@@ -0,0 +1,140 @@
+/***************************************************************************
+ * blitz/tuning.h      Platform-specific code tuning
+ *
+ * $Id: tuning.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+
+/*
+ * 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 __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
Index: trunk/SophyaExt/Blitz/blitz/tvcross.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tvcross.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tvcross.h	(revision 221)
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * blitz/tvcross.h      Cross product of TinyVector<N,3>'s
+ *
+ * $Id: tvcross.h,v 1.1.1.1 1999-04-09 17:59:02 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/tvecglobs.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/tvecglobs.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/tvecglobs.h	(revision 221)
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * blitz/tvecglobs.h     TinyVector global functions
+ *
+ * $Id: tvecglobs.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/update.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/update.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/update.h	(revision 221)
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * blitz/update.h      Declaration of the _bz_XXXX updater classes
+ *
+ * $Id: update.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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; }                                \
+  }
+
+BZ_DECL_UPDATER(_bz_update, =, "=");
+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
+
Index: trunk/SophyaExt/Blitz/blitz/vecaccum.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecaccum.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecaccum.cc	(revision 221)
@@ -0,0 +1,78 @@
+/*
+ * $Id: vecaccum.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecall.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecall.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecall.cc	(revision 221)
@@ -0,0 +1,76 @@
+/*
+ * $Id: vecall.cc,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecany.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecany.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecany.cc	(revision 221)
@@ -0,0 +1,76 @@
+/*
+ * $Id: vecany.cc,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecbfn.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecbfn.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecbfn.cc	(revision 221)
@@ -0,0 +1,15 @@
+#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
+
Index: trunk/SophyaExt/Blitz/blitz/vecbops.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecbops.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecbops.cc	(revision 221)
@@ -0,0 +1,17290 @@
+/***************************************************************************
+ * blitz/vecbops.cc	Vector expression templates (2 operands)
+ *
+ * $Id: vecbops.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.   Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * Suggestions:          blitz-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ * Licensing inquiries:  blitz-licenses@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/veccount.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/veccount.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/veccount.cc	(revision 221)
@@ -0,0 +1,74 @@
+/*
+ * $Id: veccount.cc,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecdelta.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecdelta.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecdelta.cc	(revision 221)
@@ -0,0 +1,85 @@
+/*
+ * $Id: vecdelta.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecdot.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecdot.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecdot.cc	(revision 221)
@@ -0,0 +1,142 @@
+/*
+ * $Id: vecdot.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecexpr.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecexpr.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecexpr.h	(revision 221)
@@ -0,0 +1,289 @@
+/***************************************************************************
+ * blitz/vecexpr.h      Vector<P_numtype> expression templates
+ *
+ * $Id: vecexpr.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecexprwrap.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecexprwrap.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecexprwrap.h	(revision 221)
@@ -0,0 +1,96 @@
+/***************************************************************************
+ * blitz/vecexprwrap.h   Vector expression templates wrapper class
+ *
+ * $Id: vecexprwrap.h,v 1.1.1.1 1999-04-09 17:59:01 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecglobs.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecglobs.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecglobs.cc	(revision 221)
@@ -0,0 +1,36 @@
+/*
+ * $Id: vecglobs.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecglobs.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecglobs.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecglobs.h	(revision 221)
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * blitz/vecglobs.h      Global vector functions
+ *
+ * $Id: vecglobs.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecio.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecio.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecio.cc	(revision 221)
@@ -0,0 +1,57 @@
+/*
+ * $Id: vecio.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/veciter.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/veciter.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/veciter.h	(revision 221)
@@ -0,0 +1,220 @@
+/***************************************************************************
+ * blitz/veciter.h      Iterator classes for Vector<P_numtype>
+ *
+ * $Id: veciter.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecmax.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecmax.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecmax.cc	(revision 221)
@@ -0,0 +1,163 @@
+/*
+ * $Id: vecmax.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecmin.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecmin.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecmin.cc	(revision 221)
@@ -0,0 +1,161 @@
+/*
+ * $Id: vecmin.cc,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecnorm.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecnorm.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecnorm.cc	(revision 221)
@@ -0,0 +1,102 @@
+/*
+ * $Id: vecnorm.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecnorm1.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecnorm1.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecnorm1.cc	(revision 221)
@@ -0,0 +1,87 @@
+/*
+ * $Id: vecnorm1.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecpick.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecpick.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecpick.cc	(revision 221)
@@ -0,0 +1,658 @@
+/*
+ * $Id: vecpick.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecpick.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecpick.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecpick.h	(revision 221)
@@ -0,0 +1,317 @@
+/***************************************************************************
+ * blitz/vecpick.h      Declaration of the VectorPick<T_numtype> class
+ *
+ * $Id: vecpick.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
+#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
Index: trunk/SophyaExt/Blitz/blitz/vecpickio.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecpickio.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecpickio.cc	(revision 221)
@@ -0,0 +1,34 @@
+/*
+ * $Id: vecpickio.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecpickiter.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecpickiter.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecpickiter.h	(revision 221)
@@ -0,0 +1,188 @@
+/***************************************************************************
+ * blitz/vecpickiter.h      Declaration of VectorPickIter<T_numtype> and
+ *                          VectorPickIterConst<T_numtype> classes
+ *
+ * $Id: vecpickiter.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vecsum.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecsum.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecsum.cc	(revision 221)
@@ -0,0 +1,117 @@
+/*
+ * $Id: vecsum.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/vector.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vector.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vector.cc	(revision 221)
@@ -0,0 +1,862 @@
+/*
+ * $Id: vector.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vector.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vector.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vector.h	(revision 221)
@@ -0,0 +1,495 @@
+/***************************************************************************
+ * blitz/vector.h      Declaration of the Vector<P_numtype> class
+ *
+ * $Id: vector.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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 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)
+    {
+        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);
+    
+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
Index: trunk/SophyaExt/Blitz/blitz/vecuops.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecuops.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecuops.cc	(revision 221)
@@ -0,0 +1,2818 @@
+/***************************************************************************
+ * blitz/vecuops.cc	Expression templates for vectors, unary functions
+ *
+ * $Id: vecuops.cc,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ */ 
+
+// Generated source file.  Do not edit. 
+// genvecuops.cpp Jun 10 1998 16:03:50
+
+#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()));
+}
+
+
+/****************************************************************************
+ * finite
+ ****************************************************************************/
+
+#ifdef BZ_HAVE_IEEE_MATH
+template<class P_numtype1>
+inline
+_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>,
+    _bz_finite<P_numtype1> > >
+finite(const Vector<P_numtype1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>,
+        _bz_finite<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_finite<_bz_typename P_expr1::T_numtype> > >
+finite(_bz_VecExpr<P_expr1> d1)
+{
+    typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>,
+        _bz_finite<_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_finite<P_numtype1> > >
+finite(const VectorPick<P_numtype1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>,
+        _bz_finite<P_numtype1> > T_expr;
+
+    return _bz_VecExpr<T_expr>(T_expr(d1.begin()));
+}
+
+
+inline
+_bz_VecExpr<_bz_VecExprUnaryOp<Range,
+    _bz_finite<int> > >
+finite(Range d1)
+{
+    typedef _bz_VecExprUnaryOp<Range,
+        _bz_finite<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_finite<P_numtype1> > >
+finite(const TinyVector<P_numtype1, N_length1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>,
+        _bz_finite<P_numtype1> > T_expr;
+
+    return _bz_VecExpr<T_expr>(T_expr(d1.begin()));
+}
+
+#endif
+
+/****************************************************************************
+ * 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()));
+}
+
+
+/****************************************************************************
+ * trunc
+ ****************************************************************************/
+
+#ifdef BZ_HAVE_IEEE_MATH
+template<class P_numtype1>
+inline
+_bz_VecExpr<_bz_VecExprUnaryOp<VectorIterConst<P_numtype1>,
+    _bz_trunc<P_numtype1> > >
+trunc(const Vector<P_numtype1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<VectorIterConst<P_numtype1>,
+        _bz_trunc<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_trunc<_bz_typename P_expr1::T_numtype> > >
+trunc(_bz_VecExpr<P_expr1> d1)
+{
+    typedef _bz_VecExprUnaryOp<_bz_VecExpr<P_expr1>,
+        _bz_trunc<_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_trunc<P_numtype1> > >
+trunc(const VectorPick<P_numtype1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<VectorPickIterConst<P_numtype1>,
+        _bz_trunc<P_numtype1> > T_expr;
+
+    return _bz_VecExpr<T_expr>(T_expr(d1.begin()));
+}
+
+
+inline
+_bz_VecExpr<_bz_VecExprUnaryOp<Range,
+    _bz_trunc<int> > >
+trunc(Range d1)
+{
+    typedef _bz_VecExprUnaryOp<Range,
+        _bz_trunc<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_trunc<P_numtype1> > >
+trunc(const TinyVector<P_numtype1, N_length1>& d1)
+{
+    typedef _bz_VecExprUnaryOp<TinyVectorIterConst<P_numtype1, N_length1>,
+        _bz_trunc<P_numtype1> > T_expr;
+
+    return _bz_VecExpr<T_expr>(T_expr(d1.begin()));
+}
+
+#endif
+
+/****************************************************************************
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecwhere.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecwhere.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecwhere.cc	(revision 221)
@@ -0,0 +1,7744 @@
+/***************************************************************************
+ * blitz/vecwhere.cc	where(X,Y,Z) function for vectors
+ *
+ * $Id: vecwhere.cc,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.   Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * Suggestions:          blitz-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ * Licensing inquiries:  blitz-licenses@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
Index: trunk/SophyaExt/Blitz/blitz/vecwhere.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/vecwhere.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/vecwhere.h	(revision 221)
@@ -0,0 +1,136 @@
+/***************************************************************************
+ * blitz/vecwhere.h      where(X,Y,Z) function for vectors
+ *
+ * $Id: vecwhere.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/zero.cc
===================================================================
--- trunk/SophyaExt/Blitz/blitz/zero.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/zero.cc	(revision 221)
@@ -0,0 +1,45 @@
+/*
+ * $Id: zero.cc,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
+ *
+ * Copyright (C) 1997 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ * All rights reserved.  Please see <blitz/blitz.h> for terms and
+ * conditions of use.
+ *
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/blitz/zero.h
===================================================================
--- trunk/SophyaExt/Blitz/blitz/zero.h	(revision 221)
+++ trunk/SophyaExt/Blitz/blitz/zero.h	(revision 221)
@@ -0,0 +1,115 @@
+/***************************************************************************
+ * blitz/zero.h          Zero elements
+ *
+ * $Id: zero.h,v 1.1.1.1 1999-04-09 17:59:00 ansari Exp $
+ *
+ * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
+ *
+ * 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-suggest@cybervision.com
+ * Bugs:                 blitz-bugs@cybervision.com
+ *
+ * For more information, please see the Blitz++ Home Page:
+ *    http://seurat.uwaterloo.ca/blitz/
+ *
+ ***************************************************************************
+ * $Log: not supported by cvs2svn $
+ * 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
+
Index: trunk/SophyaExt/Blitz/globals.cc
===================================================================
--- trunk/SophyaExt/Blitz/globals.cc	(revision 221)
+++ trunk/SophyaExt/Blitz/globals.cc	(revision 221)
@@ -0,0 +1,44 @@
+#define BZ_GENERATE_GLOBAL_INSTANCES
+
+/*
+ * This module contains instances of global variables and objects.
+ * The preprocessor symbol _bz_global normally expands to "extern",
+ * but the declaration of BZ_GENERATE_GLOBAL_INSTANCES causes it
+ * to expand to "" for this source file.  This ensures that globals
+ * will have one unique instance, in libblitz.a.
+ */
+
+#include <blitz/indexexpr.h>      // Tensor index objects
+#include <blitz/bzdebug.h>        // Test suite globals
+#include <blitz/array.h>          // Dummy array object (_dummyArray)
+
+// NEEDS_WORK: after switch from RCS to CVS, get a version identifier.
+char* _blitz_id = "@(#) Blitz++ class library";
+
+// Instatiation explicite de vecteurs et matrices
+
+using namespace blitz ;
+
+void tst_instance_arrays_forlibs()
+{
+Array<int,1> iv(3), iv2(3);
+Array<long,1> lv(3), lv2(3);
+Array<float,1> fv(3), fv2(3);
+Array<double,1> dv(3), dv2(3);
+Array<int,2> im(3,3);
+Array<long,2> lm(3,3);
+Array<float,2> fm(3,3);
+Array<double,2> dm(3,3);
+dv = 1.5, 22.66, 333.777;
+dm = 9.1, 88.22, 777.333,
+     8.2, 77.33, 666.444,
+     7.3, 66.44, 555.333;
+firstIndex i;
+secondIndex j;
+dv2 = sum(dm(i,j)*dv(j),j);
+iv = lv = fv = dv;
+im = lm = fm = dm;
+fv2 = sum(fm(i,j)*fv(j),j);
+iv2 = sum(im(i,j)*iv(j),j);
+lv2 = sum(lm(i,j)*lv(j),j);
+}
