ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_valarray.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Copyright (c) 1999
00006  * Boris Fomitchev
00007  *
00008  * This material is provided "as is", with absolutely no warranty expressed
00009  * or implied. Any use is at your own risk.
00010  *
00011  * Permission to use or copy this software for any purpose is hereby granted
00012  * without fee, provided the above notices are retained on all copies.
00013  * Permission to modify the code and to distribute modified code is granted,
00014  * provided the above notices are retained, and a notice that the code was
00015  * modified is included with the above copyright notice.
00016  *
00017  */
00018 
00019 #ifndef _STLP_VALARRAY_H
00020 #define _STLP_VALARRAY_H
00021 
00022 #ifndef _STLP_INTERNAL_CMATH
00023 #  include <stl/_cmath.h>
00024 #endif
00025 
00026 #ifndef _STLP_INTERNAL_NEW
00027 #  include <stl/_new.h>
00028 #endif
00029 
00030 #ifndef _STLP_INTERNAL_ALGO_H
00031 #  include <stl/_algo.h>
00032 #endif
00033 
00034 #ifndef _STLP_INTERNAL_NUMERIC_H
00035 #  include <stl/_numeric.h>
00036 #endif
00037 
00038 #ifndef _STLP_INTERNAL_LIMITS
00039 #  include <stl/_limits.h>
00040 #endif
00041 
00042 _STLP_BEGIN_NAMESPACE
00043 
00044 class slice;
00045 class gslice;
00046 
00047 template <class _Tp> class valarray;
00048 typedef valarray<bool>    _Valarray_bool;
00049 typedef valarray<size_t>  _Valarray_size_t;
00050 
00051 template <class _Tp> class slice_array;
00052 template <class _Tp> class gslice_array;
00053 template <class _Tp> class mask_array;
00054 template <class _Tp> class indirect_array;
00055 
00056 //----------------------------------------------------------------------
00057 // class valarray
00058 
00059 // Base class to handle memory allocation and deallocation.  We can't just
00060 // use vector<>, because vector<bool> would be unsuitable as an internal
00061 // representation for valarray<bool>.
00062 
00063 template <class _Tp>
00064 struct _Valarray_base {
00065   _Tp*   _M_first;
00066   size_t _M_size;
00067 
00068   _Valarray_base() : _M_first(0), _M_size(0) {}
00069   _Valarray_base(size_t __n) : _M_first(0), _M_size(0) { _M_allocate(__n); }
00070   ~_Valarray_base() { _M_deallocate(); }
00071 
00072   void _M_allocate(size_t __n) {
00073     if (__n != 0) {
00074       _M_first = __STATIC_CAST(_Tp*, __stl_new(__n * sizeof(_Tp)));
00075       _M_size  = __n;
00076     }
00077     else {
00078       _M_first = 0;
00079       _M_size = 0;
00080     }
00081   }
00082 
00083   void _M_deallocate() {
00084     __stl_delete(_M_first);
00085     _M_first = 0;
00086     _M_size = 0;
00087   }
00088 };
00089 
00090 template <class _Tp>
00091 class valarray : private _Valarray_base<_Tp>
00092 {
00093   friend class gslice;
00094 
00095 public:
00096   typedef _Tp value_type;
00097 
00098   // Basic constructors
00099   valarray() : _Valarray_base<_Tp>() {}
00100   explicit valarray(size_t __n) : _Valarray_base<_Tp>(__n)
00101     { uninitialized_fill_n(this->_M_first, this->_M_size, _STLP_DEFAULT_CONSTRUCTED(value_type)); }
00102   valarray(const value_type& __x, size_t __n) : _Valarray_base<_Tp>(__n)
00103     { uninitialized_fill_n(this->_M_first, this->_M_size, __x); }
00104   valarray(const value_type* __p, size_t __n) : _Valarray_base<_Tp>(__n)
00105     { uninitialized_copy(__p, __p + __n, this->_M_first); }
00106   valarray(const valarray<_Tp>& __x) : _Valarray_base<_Tp>(__x._M_size) {
00107     uninitialized_copy(__x._M_first, __x._M_first + __x._M_size,
00108                        this->_M_first);
00109   }
00110 
00111   // Constructors from auxiliary array types
00112   valarray(const slice_array<_Tp>&);
00113   valarray(const gslice_array<_Tp>&);
00114   valarray(const mask_array<_Tp>&);
00115   valarray(const indirect_array<_Tp>&);
00116 
00117   // Destructor
00118   ~valarray() { _STLP_STD::_Destroy_Range(this->_M_first, this->_M_first + this->_M_size); }
00119 
00120   // Extension: constructor that doesn't initialize valarray elements to a
00121   // specific value.  This is faster for types such as int and double.
00122 private:
00123   void _M_initialize(const __true_type&) {}
00124   void _M_initialize(const __false_type&)
00125     { uninitialized_fill_n(this->_M_first, this->_M_size, _STLP_DEFAULT_CONSTRUCTED(_Tp)); }
00126 
00127 public:
00128   struct _NoInit {};
00129   valarray(size_t __n, _NoInit) : _Valarray_base<_Tp>(__n) {
00130     typedef typename __type_traits<_Tp>::has_trivial_default_constructor _Is_Trivial;
00131     _M_initialize(_Is_Trivial());
00132   }
00133 
00134 public:                         // Assignment
00135   // Basic assignment.  Note that 'x = y' is undefined if x.size() != y.size()
00136   valarray<_Tp>& operator=(const valarray<_Tp>& __x) {
00137     _STLP_ASSERT(__x.size() == this->size())
00138     if (this != &__x)
00139       copy(__x._M_first, __x._M_first + __x._M_size, this->_M_first);
00140     return *this;
00141   }
00142 
00143   // Scalar assignment
00144   valarray<_Tp>& operator=(const value_type& __x) {
00145     fill_n(this->_M_first, this->_M_size, __x);
00146     return *this;
00147   }
00148 
00149   // Assignment of auxiliary array types
00150   valarray<_Tp>& operator=(const slice_array<_Tp>&);
00151   valarray<_Tp>& operator=(const gslice_array<_Tp>&);
00152   valarray<_Tp>& operator=(const mask_array<_Tp>&);
00153   valarray<_Tp>& operator=(const indirect_array<_Tp>&);
00154 
00155 public:                         // Element access
00156   value_type  operator[](size_t __n) const {
00157     _STLP_ASSERT(__n < this->size())
00158     return this->_M_first[__n];
00159   }
00160   value_type& operator[](size_t __n) {
00161     _STLP_ASSERT(__n < this->size())
00162     return this->_M_first[__n];
00163   }
00164   size_t size() const { return this->_M_size; }
00165 
00166 public:                         // Subsetting operations with auxiliary type
00167   valarray<_Tp>       operator[](slice) const;
00168   slice_array<_Tp>    operator[](slice);
00169   valarray<_Tp>       operator[](const gslice&) const;
00170   gslice_array<_Tp>   operator[](const gslice&);
00171   valarray<_Tp>       operator[](const _Valarray_bool&) const;
00172   mask_array<_Tp>     operator[](const _Valarray_bool&);
00173   valarray<_Tp>       operator[](const _Valarray_size_t&) const;
00174   indirect_array<_Tp> operator[](const _Valarray_size_t&);
00175 
00176 public:                         // Unary operators.
00177   valarray<_Tp> operator+() const { return *this; }
00178 
00179   valarray<_Tp> operator-() const {
00180     valarray<_Tp> __tmp(this->size(), _NoInit());
00181     for (size_t __i = 0; __i < this->size(); ++__i)
00182       __tmp[__i] = -(*this)[__i];
00183     return __tmp;
00184   }
00185 
00186   valarray<_Tp> operator~() const {
00187     valarray<_Tp> __tmp(this->size(), _NoInit());
00188     for (size_t __i = 0; __i < this->size(); ++__i)
00189       __tmp[__i] = ~(*this)[__i];
00190     return __tmp;
00191   }
00192 
00193   _Valarray_bool operator!() const;
00194 
00195 public:                         // Scalar computed assignment.
00196   valarray<_Tp>& operator*= (const value_type& __x) {
00197     for (size_t __i = 0; __i < this->size(); ++__i)
00198       (*this)[__i] *= __x;
00199     return *this;
00200   }
00201 
00202   valarray<_Tp>& operator/= (const value_type& __x) {
00203     for (size_t __i = 0; __i < this->size(); ++__i)
00204       (*this)[__i] /= __x;
00205     return *this;
00206   }
00207 
00208   valarray<_Tp>& operator%= (const value_type& __x) {
00209     for (size_t __i = 0; __i < this->size(); ++__i)
00210       (*this)[__i] %= __x;
00211     return *this;
00212   }
00213 
00214   valarray<_Tp>& operator+= (const value_type& __x) {
00215     for (size_t __i = 0; __i < this->size(); ++__i)
00216       (*this)[__i] += __x;
00217     return *this;
00218   }
00219 
00220   valarray<_Tp>& operator-= (const value_type& __x) {
00221     for (size_t __i = 0; __i < this->size(); ++__i)
00222       (*this)[__i] -= __x;
00223     return *this;
00224   }
00225 
00226   valarray<_Tp>& operator^= (const value_type& __x) {
00227     for (size_t __i = 0; __i < this->size(); ++__i)
00228       (*this)[__i] ^= __x;
00229     return *this;
00230   }
00231 
00232   valarray<_Tp>& operator&= (const value_type& __x) {
00233     for (size_t __i = 0; __i < this->size(); ++__i)
00234       (*this)[__i] &= __x;
00235     return *this;
00236   }
00237 
00238   valarray<_Tp>& operator|= (const value_type& __x) {
00239     for (size_t __i = 0; __i < this->size(); ++__i)
00240       (*this)[__i] |= __x;
00241     return *this;
00242   }
00243 
00244   valarray<_Tp>& operator<<= (const value_type& __x) {
00245     for (size_t __i = 0; __i < this->size(); ++__i)
00246       (*this)[__i] <<= __x;
00247     return *this;
00248   }
00249 
00250   valarray<_Tp>& operator>>= (const value_type& __x) {
00251     for (size_t __i = 0; __i < this->size(); ++__i)
00252       (*this)[__i] >>= __x;
00253     return *this;
00254   }
00255 
00256 public:                         // Array computed assignment.
00257   valarray<_Tp>& operator*= (const valarray<_Tp>& __x) {
00258     _STLP_ASSERT(__x.size() == this->size())
00259     for (size_t __i = 0; __i < this->size(); ++__i)
00260       (*this)[__i] *= __x[__i];
00261     return *this;
00262   }
00263 
00264   valarray<_Tp>& operator/= (const valarray<_Tp>& __x) {
00265     _STLP_ASSERT(__x.size() == this->size())
00266     for (size_t __i = 0; __i < this->size(); ++__i)
00267       (*this)[__i] /= __x[__i];
00268     return *this;
00269   }
00270 
00271   valarray<_Tp>& operator%= (const valarray<_Tp>& __x) {
00272     _STLP_ASSERT(__x.size() == this->size())
00273     for (size_t __i = 0; __i < this->size(); ++__i)
00274       (*this)[__i] %= __x[__i];
00275     return *this;
00276   }
00277 
00278   valarray<_Tp>& operator+= (const valarray<_Tp>& __x) {
00279     _STLP_ASSERT(__x.size() == this->size())
00280     for (size_t __i = 0; __i < this->size(); ++__i)
00281       (*this)[__i] += __x[__i];
00282     return *this;
00283   }
00284 
00285   valarray<_Tp>& operator-= (const valarray<_Tp>& __x) {
00286     _STLP_ASSERT(__x.size() == this->size())
00287     for (size_t __i = 0; __i < this->size(); ++__i)
00288       (*this)[__i] -= __x[__i];
00289     return *this;
00290   }
00291 
00292   valarray<_Tp>& operator^= (const valarray<_Tp>& __x) {
00293     _STLP_ASSERT(__x.size() == this->size())
00294     for (size_t __i = 0; __i < this->size(); ++__i)
00295       (*this)[__i] ^= __x[__i];
00296     return *this;
00297   }
00298 
00299   valarray<_Tp>& operator&= (const valarray<_Tp>& __x) {
00300     _STLP_ASSERT(__x.size() == this->size())
00301     for (size_t __i = 0; __i < this->size(); ++__i)
00302       (*this)[__i] &= __x[__i];
00303     return *this;
00304   }
00305 
00306   valarray<_Tp>& operator|= (const valarray<_Tp>& __x) {
00307     _STLP_ASSERT(__x.size() == this->size())
00308     for (size_t __i = 0; __i < this->size(); ++__i)
00309       (*this)[__i] |= __x[__i];
00310     return *this;
00311   }
00312 
00313   valarray<_Tp>& operator<<= (const valarray<_Tp>& __x) {
00314     _STLP_ASSERT(__x.size() == this->size())
00315     for (size_t __i = 0; __i < this->size(); ++__i)
00316       (*this)[__i] <<= __x[__i];
00317     return *this;
00318   }
00319 
00320   valarray<_Tp>& operator>>= (const valarray<_Tp>& __x) {
00321     _STLP_ASSERT(__x.size() == this->size())
00322     for (size_t __i = 0; __i < this->size(); ++__i)
00323       (*this)[__i] >>= __x[__i];
00324     return *this;
00325   }
00326 
00327 public:                         // Other member functions.
00328 
00329   // The result is undefined for zero-length arrays
00330   value_type sum() const {
00331     _STLP_ASSERT(this->size() != 0)
00332     return accumulate(this->_M_first + 1, this->_M_first + this->_M_size,
00333                       (*this)[0]);
00334   }
00335 
00336   // The result is undefined for zero-length arrays
00337   value_type (min) () const {
00338     _STLP_ASSERT(this->size() != 0)
00339     return *min_element(this->_M_first + 0, this->_M_first + this->_M_size);
00340   }
00341 
00342   value_type (max) () const {
00343     _STLP_ASSERT(this->size() != 0)
00344     return *max_element(this->_M_first + 0, this->_M_first + this->_M_size);
00345   }
00346 
00347   valarray<_Tp> shift(int __n) const;
00348   valarray<_Tp> cshift(int __n) const;
00349 
00350   valarray<_Tp> apply(value_type __f(value_type)) const {
00351     valarray<_Tp> __tmp(this->size());
00352     transform(this->_M_first + 0, this->_M_first + this->_M_size, __tmp._M_first,
00353               __f);
00354     return __tmp;
00355   }
00356   valarray<_Tp> apply(value_type __f(const value_type&)) const {
00357     valarray<_Tp> __tmp(this->size());
00358     transform(this->_M_first + 0, this->_M_first + this->_M_size, __tmp._M_first,
00359               __f);
00360     return __tmp;
00361   }
00362 
00363   void resize(size_t __n, value_type __x = value_type()) {
00364     _STLP_STD::_Destroy_Range(this->_M_first, this->_M_first + this->_M_size);
00365     _Valarray_base<_Tp>::_M_deallocate();
00366     _Valarray_base<_Tp>::_M_allocate(__n);
00367     uninitialized_fill_n(this->_M_first, this->_M_size, __x);
00368   }
00369 };
00370 
00371 //----------------------------------------------------------------------
00372 // valarray non-member functions.
00373 
00374 // Binary arithmetic operations between two arrays.  Behavior is
00375 // undefined if the two arrays do not have the same length.
00376 
00377 template <class _Tp>
00378 inline valarray<_Tp>  _STLP_CALL operator*(const valarray<_Tp>& __x,
00379                                            const valarray<_Tp>& __y) {
00380   _STLP_ASSERT(__x.size() == __y.size())
00381   typedef typename valarray<_Tp>::_NoInit _NoInit;
00382   valarray<_Tp> __tmp(__x.size(), _NoInit());
00383   for (size_t __i = 0; __i < __x.size(); ++__i)
00384     __tmp[__i] = __x[__i] * __y[__i];
00385   return __tmp;
00386 }
00387 
00388 template <class _Tp>
00389 inline valarray<_Tp>  _STLP_CALL operator/(const valarray<_Tp>& __x,
00390                                            const valarray<_Tp>& __y) {
00391   _STLP_ASSERT(__x.size() == __y.size())
00392   typedef typename valarray<_Tp>::_NoInit _NoInit;
00393   valarray<_Tp> __tmp(__x.size(), _NoInit());
00394   for (size_t __i = 0; __i < __x.size(); ++__i)
00395     __tmp[__i] = __x[__i] / __y[__i];
00396   return __tmp;
00397 }
00398 
00399 template <class _Tp>
00400 inline valarray<_Tp>  _STLP_CALL operator%(const valarray<_Tp>& __x,
00401                                            const valarray<_Tp>& __y) {
00402   _STLP_ASSERT(__x.size() == __y.size())
00403   typedef typename valarray<_Tp>::_NoInit _NoInit;
00404   valarray<_Tp> __tmp(__x.size(), _NoInit());
00405   for (size_t __i = 0; __i < __x.size(); ++__i)
00406     __tmp[__i] = __x[__i] % __y[__i];
00407   return __tmp;
00408 }
00409 
00410 template <class _Tp>
00411 inline valarray<_Tp>  _STLP_CALL operator+(const valarray<_Tp>& __x,
00412                                            const valarray<_Tp>& __y) {
00413   _STLP_ASSERT(__x.size() == __y.size())
00414   typedef typename valarray<_Tp>::_NoInit _NoInit;
00415   valarray<_Tp> __tmp(__x.size(), _NoInit());
00416   for (size_t __i = 0; __i < __x.size(); ++__i)
00417     __tmp[__i] = __x[__i] + __y[__i];
00418   return __tmp;
00419 }
00420 
00421 template <class _Tp>
00422 inline valarray<_Tp>  _STLP_CALL operator-(const valarray<_Tp>& __x,
00423                                            const valarray<_Tp>& __y) {
00424   _STLP_ASSERT(__x.size() == __y.size())
00425   typedef typename valarray<_Tp>::_NoInit _NoInit;
00426   valarray<_Tp> __tmp(__x.size(), _NoInit());
00427   for (size_t __i = 0; __i < __x.size(); ++__i)
00428     __tmp[__i] = __x[__i] - __y[__i];
00429   return __tmp;
00430 }
00431 
00432 template <class _Tp>
00433 inline valarray<_Tp> _STLP_CALL operator^(const valarray<_Tp>& __x,
00434                                           const valarray<_Tp>& __y) {
00435   _STLP_ASSERT(__x.size() == __y.size())
00436   typedef typename valarray<_Tp>::_NoInit _NoInit;
00437   valarray<_Tp> __tmp(__x.size(), _NoInit());
00438   for (size_t __i = 0; __i < __x.size(); ++__i)
00439     __tmp[__i] = __x[__i] ^ __y[__i];
00440   return __tmp;
00441 }
00442 
00443 template <class _Tp>
00444 inline valarray<_Tp> _STLP_CALL operator&(const valarray<_Tp>& __x,
00445                                           const valarray<_Tp>& __y) {
00446   _STLP_ASSERT(__x.size() == __y.size())
00447   typedef typename valarray<_Tp>::_NoInit _NoInit;
00448   valarray<_Tp> __tmp(__x.size(), _NoInit());
00449   for (size_t __i = 0; __i < __x.size(); ++__i)
00450     __tmp[__i] = __x[__i] & __y[__i];
00451   return __tmp;
00452 }
00453 
00454 template <class _Tp>
00455 inline valarray<_Tp> _STLP_CALL operator|(const valarray<_Tp>& __x,
00456                                           const valarray<_Tp>& __y) {
00457   _STLP_ASSERT(__x.size() == __y.size())
00458   typedef typename valarray<_Tp>::_NoInit _NoInit;
00459   valarray<_Tp> __tmp(__x.size(), _NoInit());
00460   for (size_t __i = 0; __i < __x.size(); ++__i)
00461     __tmp[__i] = __x[__i] | __y[__i];
00462   return __tmp;
00463 }
00464 
00465 template <class _Tp>
00466 inline valarray<_Tp> _STLP_CALL operator<<(const valarray<_Tp>& __x,
00467                                            const valarray<_Tp>& __y) {
00468   _STLP_ASSERT(__x.size() == __y.size())
00469   typedef typename valarray<_Tp>::_NoInit _NoInit;
00470   valarray<_Tp> __tmp(__x.size(), _NoInit());
00471   for (size_t __i = 0; __i < __x.size(); ++__i)
00472     __tmp[__i] = __x[__i] << __y[__i];
00473   return __tmp;
00474 }
00475 
00476 template <class _Tp>
00477 inline valarray<_Tp> _STLP_CALL operator>>(const valarray<_Tp>& __x,
00478                                            const valarray<_Tp>& __y) {
00479   _STLP_ASSERT(__x.size() == __y.size())
00480   typedef typename valarray<_Tp>::_NoInit _NoInit;
00481   valarray<_Tp> __tmp(__x.size(), _NoInit());
00482   for (size_t __i = 0; __i < __x.size(); ++__i)
00483     __tmp[__i] = __x[__i] >> __y[__i];
00484   return __tmp;
00485 }
00486 
00487 // Binary arithmetic operations between an array and a scalar.
00488 
00489 template <class _Tp>
00490 inline valarray<_Tp> _STLP_CALL operator*(const valarray<_Tp>& __x, const _Tp& __c) {
00491   typedef typename valarray<_Tp>::_NoInit _NoInit;
00492   valarray<_Tp> __tmp(__x.size(), _NoInit());
00493   for (size_t __i = 0; __i < __x.size(); ++__i)
00494     __tmp[__i] = __x[__i]  * __c;
00495   return __tmp;
00496 }
00497 
00498 template <class _Tp>
00499 inline valarray<_Tp> _STLP_CALL operator*(const _Tp& __c, const valarray<_Tp>& __x) {
00500   typedef typename valarray<_Tp>::_NoInit _NoInit;
00501   valarray<_Tp> __tmp(__x.size(), _NoInit());
00502   for (size_t __i = 0; __i < __x.size(); ++__i)
00503     __tmp[__i] = __c * __x[__i];
00504   return __tmp;
00505 }
00506 
00507 template <class _Tp>
00508 inline valarray<_Tp> _STLP_CALL operator/(const valarray<_Tp>& __x, const _Tp& __c) {
00509   typedef typename valarray<_Tp>::_NoInit _NoInit;
00510   valarray<_Tp> __tmp(__x.size(), _NoInit());
00511   for (size_t __i = 0; __i < __x.size(); ++__i)
00512     __tmp[__i] = __x[__i]  / __c;
00513   return __tmp;
00514 }
00515 
00516 template <class _Tp>
00517 inline valarray<_Tp> _STLP_CALL operator/(const _Tp& __c, const valarray<_Tp>& __x) {
00518   typedef typename valarray<_Tp>::_NoInit _NoInit;
00519   valarray<_Tp> __tmp(__x.size(), _NoInit());
00520   for (size_t __i = 0; __i < __x.size(); ++__i)
00521     __tmp[__i] = __c / __x[__i];
00522   return __tmp;
00523 }
00524 
00525 template <class _Tp>
00526 inline valarray<_Tp> _STLP_CALL operator%(const valarray<_Tp>& __x, const _Tp& __c) {
00527   typedef typename valarray<_Tp>::_NoInit _NoInit;
00528   valarray<_Tp> __tmp(__x.size(), _NoInit());
00529   for (size_t __i = 0; __i < __x.size(); ++__i)
00530     __tmp[__i] = __x[__i]  % __c;
00531   return __tmp;
00532 }
00533 
00534 template <class _Tp>
00535 inline valarray<_Tp> _STLP_CALL operator%(const _Tp& __c, const valarray<_Tp>& __x) {
00536   typedef typename valarray<_Tp>::_NoInit _NoInit;
00537   valarray<_Tp> __tmp(__x.size(), _NoInit());
00538   for (size_t __i = 0; __i < __x.size(); ++__i)
00539     __tmp[__i] = __c % __x[__i];
00540   return __tmp;
00541 }
00542 
00543 template <class _Tp>
00544 inline valarray<_Tp> _STLP_CALL operator+(const valarray<_Tp>& __x, const _Tp& __c) {
00545   typedef typename valarray<_Tp>::_NoInit _NoInit;
00546   valarray<_Tp> __tmp(__x.size(), _NoInit());
00547   for (size_t __i = 0; __i < __x.size(); ++__i)
00548     __tmp[__i] = __x[__i]  + __c;
00549   return __tmp;
00550 }
00551 
00552 template <class _Tp>
00553 inline valarray<_Tp> _STLP_CALL operator+(const _Tp& __c, const valarray<_Tp>& __x) {
00554   typedef typename valarray<_Tp>::_NoInit _NoInit;
00555   valarray<_Tp> __tmp(__x.size(), _NoInit());
00556   for (size_t __i = 0; __i < __x.size(); ++__i)
00557     __tmp[__i] = __c + __x[__i];
00558   return __tmp;
00559 }
00560 
00561 template <class _Tp>
00562 inline valarray<_Tp> _STLP_CALL operator-(const valarray<_Tp>& __x, const _Tp& __c) {
00563   typedef typename valarray<_Tp>::_NoInit _NoInit;
00564   valarray<_Tp> __tmp(__x.size(), _NoInit());
00565   for (size_t __i = 0; __i < __x.size(); ++__i)
00566     __tmp[__i] = __x[__i]  - __c;
00567   return __tmp;
00568 }
00569 
00570 template <class _Tp>
00571 inline valarray<_Tp> _STLP_CALL operator-(const _Tp& __c, const valarray<_Tp>& __x) {
00572   typedef typename valarray<_Tp>::_NoInit _NoInit;
00573   valarray<_Tp> __tmp(__x.size(), _NoInit());
00574   for (size_t __i = 0; __i < __x.size(); ++__i)
00575     __tmp[__i] = __c - __x[__i];
00576   return __tmp;
00577 }
00578 
00579 template <class _Tp>
00580 inline valarray<_Tp> _STLP_CALL operator^(const valarray<_Tp>& __x, const _Tp& __c) {
00581   typedef typename valarray<_Tp>::_NoInit _NoInit;
00582   valarray<_Tp> __tmp(__x.size(), _NoInit());
00583   for (size_t __i = 0; __i < __x.size(); ++__i)
00584     __tmp[__i] = __x[__i]  ^ __c;
00585   return __tmp;
00586 }
00587 
00588 template <class _Tp>
00589 inline valarray<_Tp> _STLP_CALL operator^(const _Tp& __c, const valarray<_Tp>& __x) {
00590   typedef typename valarray<_Tp>::_NoInit _NoInit;
00591   valarray<_Tp> __tmp(__x.size(), _NoInit());
00592   for (size_t __i = 0; __i < __x.size(); ++__i)
00593     __tmp[__i] = __c ^ __x[__i];
00594   return __tmp;
00595 }
00596 
00597 template <class _Tp>
00598 inline valarray<_Tp> _STLP_CALL operator&(const valarray<_Tp>& __x, const _Tp& __c) {
00599   typedef typename valarray<_Tp>::_NoInit _NoInit;
00600   valarray<_Tp> __tmp(__x.size(), _NoInit());
00601   for (size_t __i = 0; __i < __x.size(); ++__i)
00602     __tmp[__i] = __x[__i]  & __c;
00603   return __tmp;
00604 }
00605 
00606 template <class _Tp>
00607 inline valarray<_Tp> _STLP_CALL operator&(const _Tp& __c, const valarray<_Tp>& __x) {
00608   typedef typename valarray<_Tp>::_NoInit _NoInit;
00609   valarray<_Tp> __tmp(__x.size(), _NoInit());
00610   for (size_t __i = 0; __i < __x.size(); ++__i)
00611     __tmp[__i] = __c & __x[__i];
00612   return __tmp;
00613 }
00614 
00615 template <class _Tp>
00616 inline valarray<_Tp> _STLP_CALL operator|(const valarray<_Tp>& __x, const _Tp& __c) {
00617   typedef typename valarray<_Tp>::_NoInit _NoInit;
00618   valarray<_Tp> __tmp(__x.size(), _NoInit());
00619   for (size_t __i = 0; __i < __x.size(); ++__i)
00620     __tmp[__i] = __x[__i]  | __c;
00621   return __tmp;
00622 }
00623 
00624 template <class _Tp>
00625 inline valarray<_Tp> _STLP_CALL operator|(const _Tp& __c, const valarray<_Tp>& __x) {
00626   typedef typename valarray<_Tp>::_NoInit _NoInit;
00627   valarray<_Tp> __tmp(__x.size(), _NoInit());
00628   for (size_t __i = 0; __i < __x.size(); ++__i)
00629     __tmp[__i] = __c | __x[__i];
00630   return __tmp;
00631 }
00632 
00633 template <class _Tp>
00634 inline valarray<_Tp> _STLP_CALL operator<<(const valarray<_Tp>& __x, const _Tp& __c) {
00635   typedef typename valarray<_Tp>::_NoInit _NoInit;
00636   valarray<_Tp> __tmp(__x.size(), _NoInit());
00637   for (size_t __i = 0; __i < __x.size(); ++__i)
00638     __tmp[__i] = __x[__i]  << __c;
00639   return __tmp;
00640 }
00641 
00642 template <class _Tp>
00643 inline valarray<_Tp> _STLP_CALL operator<<(const _Tp& __c, const valarray<_Tp>& __x) {
00644   typedef typename valarray<_Tp>::_NoInit _NoInit;
00645   valarray<_Tp> __tmp(__x.size(), _NoInit());
00646   for (size_t __i = 0; __i < __x.size(); ++__i)
00647     __tmp[__i] = __c << __x[__i];
00648   return __tmp;
00649 }
00650 
00651 template <class _Tp>
00652 inline valarray<_Tp> _STLP_CALL operator>>(const valarray<_Tp>& __x, const _Tp& __c) {
00653   typedef typename valarray<_Tp>::_NoInit _NoInit;
00654   valarray<_Tp> __tmp(__x.size(), _NoInit());
00655   for (size_t __i = 0; __i < __x.size(); ++__i)
00656     __tmp[__i] = __x[__i]  >> __c;
00657   return __tmp;
00658 }
00659 
00660 template <class _Tp>
00661 inline valarray<_Tp> _STLP_CALL operator>>(const _Tp& __c, const valarray<_Tp>& __x) {
00662   typedef typename valarray<_Tp>::_NoInit _NoInit;
00663   valarray<_Tp> __tmp(__x.size(), _NoInit());
00664   for (size_t __i = 0; __i < __x.size(); ++__i)
00665     __tmp[__i] = __c >> __x[__i];
00666   return __tmp;
00667 }
00668 
00669 // Binary logical operations between two arrays.  Behavior is undefined
00670 // if the two arrays have different lengths.  Note that operator== does
00671 // not do what you might at first expect.
00672 
00673 template <class _Tp>
00674 inline _Valarray_bool _STLP_CALL operator==(const valarray<_Tp>& __x,
00675                                             const valarray<_Tp>& __y) {
00676   _STLP_ASSERT(__x.size() == __y.size())
00677   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00678   for (size_t __i = 0; __i < __x.size(); ++__i)
00679     __tmp[__i] = __x[__i] == __y[__i];
00680   return __tmp;
00681 }
00682 
00683 template <class _Tp>
00684 inline _Valarray_bool _STLP_CALL operator<(const valarray<_Tp>& __x,
00685                                            const valarray<_Tp>& __y) {
00686   _STLP_ASSERT(__x.size() == __y.size())
00687   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00688   for (size_t __i = 0; __i < __x.size(); ++__i)
00689     __tmp[__i] = __x[__i] < __y[__i];
00690   return __tmp;
00691 }
00692 
00693 #ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
00694 
00695 template <class _Tp>
00696 inline _Valarray_bool _STLP_CALL operator!=(const valarray<_Tp>& __x,
00697                                             const valarray<_Tp>& __y) {
00698   _STLP_ASSERT(__x.size() == __y.size())
00699   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00700   for (size_t __i = 0; __i < __x.size(); ++__i)
00701     __tmp[__i] = __x[__i] != __y[__i];
00702   return __tmp;
00703 }
00704 
00705 template <class _Tp>
00706 inline _Valarray_bool _STLP_CALL operator>(const valarray<_Tp>& __x,
00707                                            const valarray<_Tp>& __y) {
00708   _STLP_ASSERT(__x.size() == __y.size())
00709   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00710   for (size_t __i = 0; __i < __x.size(); ++__i)
00711     __tmp[__i] = __x[__i] > __y[__i];
00712   return __tmp;
00713 }
00714 
00715 template <class _Tp>
00716 inline _Valarray_bool _STLP_CALL operator<=(const valarray<_Tp>& __x,
00717                                             const valarray<_Tp>& __y) {
00718   _STLP_ASSERT(__x.size() == __y.size())
00719   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00720   for (size_t __i = 0; __i < __x.size(); ++__i)
00721     __tmp[__i] = __x[__i] <= __y[__i];
00722   return __tmp;
00723 }
00724 
00725 template <class _Tp>
00726 inline _Valarray_bool _STLP_CALL operator>=(const valarray<_Tp>& __x,
00727                                             const valarray<_Tp>& __y) {
00728   _STLP_ASSERT(__x.size() == __y.size())
00729   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00730   for (size_t __i = 0; __i < __x.size(); ++__i)
00731     __tmp[__i] = __x[__i] >= __y[__i];
00732   return __tmp;
00733 }
00734 
00735 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
00736 // fbp : swap ?
00737 
00738 template <class _Tp>
00739 inline _Valarray_bool _STLP_CALL operator&&(const valarray<_Tp>& __x,
00740                                             const valarray<_Tp>& __y) {
00741   _STLP_ASSERT(__x.size() == __y.size())
00742   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00743   for (size_t __i = 0; __i < __x.size(); ++__i)
00744     __tmp[__i] = __x[__i] && __y[__i];
00745   return __tmp;
00746 }
00747 
00748 template <class _Tp>
00749 inline _Valarray_bool _STLP_CALL operator||(const valarray<_Tp>& __x,
00750                                             const valarray<_Tp>& __y) {
00751   _STLP_ASSERT(__x.size() == __y.size())
00752   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00753   for (size_t __i = 0; __i < __x.size(); ++__i)
00754     __tmp[__i] = __x[__i] || __y[__i];
00755   return __tmp;
00756 }
00757 
00758 // Logical operations between an array and a scalar.
00759 
00760 template <class _Tp>
00761 inline _Valarray_bool _STLP_CALL operator==(const valarray<_Tp>& __x, const _Tp& __c) {
00762   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00763   for (size_t __i = 0; __i < __x.size(); ++__i)
00764     __tmp[__i] = __x[__i] == __c;
00765   return __tmp;
00766 }
00767 
00768 template <class _Tp>
00769 inline _Valarray_bool _STLP_CALL operator==(const _Tp& __c, const valarray<_Tp>& __x) {
00770   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00771   for (size_t __i = 0; __i < __x.size(); ++__i)
00772     __tmp[__i] = __c == __x[__i];
00773   return __tmp;
00774 }
00775 
00776 template <class _Tp>
00777 inline _Valarray_bool _STLP_CALL operator!=(const valarray<_Tp>& __x, const _Tp& __c) {
00778   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00779   for (size_t __i = 0; __i < __x.size(); ++__i)
00780     __tmp[__i] = __x[__i] != __c;
00781   return __tmp;
00782 }
00783 
00784 template <class _Tp>
00785 inline _Valarray_bool _STLP_CALL operator!=(const _Tp& __c, const valarray<_Tp>& __x) {
00786   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00787   for (size_t __i = 0; __i < __x.size(); ++__i)
00788     __tmp[__i] = __c != __x[__i];
00789   return __tmp;
00790 }
00791 
00792 template <class _Tp>
00793 inline _Valarray_bool _STLP_CALL operator<(const valarray<_Tp>& __x, const _Tp& __c) {
00794   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00795   for (size_t __i = 0; __i < __x.size(); ++__i)
00796     __tmp[__i] = __x[__i] < __c;
00797   return __tmp;
00798 }
00799 
00800 template <class _Tp>
00801 inline _Valarray_bool _STLP_CALL operator<(const _Tp& __c, const valarray<_Tp>& __x) {
00802   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00803   for (size_t __i = 0; __i < __x.size(); ++__i)
00804     __tmp[__i] = __c < __x[__i];
00805   return __tmp;
00806 }
00807 
00808 template <class _Tp>
00809 inline _Valarray_bool _STLP_CALL operator>(const valarray<_Tp>& __x, const _Tp& __c) {
00810   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00811   for (size_t __i = 0; __i < __x.size(); ++__i)
00812     __tmp[__i] = __x[__i] > __c;
00813   return __tmp;
00814 }
00815 
00816 template <class _Tp>
00817 inline _Valarray_bool _STLP_CALL operator>(const _Tp& __c, const valarray<_Tp>& __x) {
00818   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00819   for (size_t __i = 0; __i < __x.size(); ++__i)
00820     __tmp[__i] = __c > __x[__i];
00821   return __tmp;
00822 }
00823 
00824 template <class _Tp>
00825 inline _Valarray_bool _STLP_CALL operator<=(const valarray<_Tp>& __x, const _Tp& __c) {
00826   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00827   for (size_t __i = 0; __i < __x.size(); ++__i)
00828     __tmp[__i] = __x[__i]  <= __c;
00829   return __tmp;
00830 }
00831 
00832 template <class _Tp>
00833 inline _Valarray_bool _STLP_CALL operator<=(const _Tp& __c, const valarray<_Tp>& __x) {
00834   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00835   for (size_t __i = 0; __i < __x.size(); ++__i)
00836     __tmp[__i] = __c <= __x[__i];
00837   return __tmp;
00838 }
00839 
00840 template <class _Tp>
00841 inline _Valarray_bool _STLP_CALL operator>=(const valarray<_Tp>& __x, const _Tp& __c) {
00842   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00843   for (size_t __i = 0; __i < __x.size(); ++__i)
00844     __tmp[__i] = __x[__i] >= __c;
00845   return __tmp;
00846 }
00847 
00848 template <class _Tp>
00849 inline _Valarray_bool _STLP_CALL operator>=(const _Tp& __c, const valarray<_Tp>& __x) {
00850   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00851   for (size_t __i = 0; __i < __x.size(); ++__i)
00852     __tmp[__i] = __c >= __x[__i];
00853   return __tmp;
00854 }
00855 
00856 template <class _Tp>
00857 inline _Valarray_bool _STLP_CALL operator&&(const valarray<_Tp>& __x, const _Tp& __c) {
00858   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00859   for (size_t __i = 0; __i < __x.size(); ++__i)
00860     __tmp[__i] = __x[__i] && __c;
00861   return __tmp;
00862 }
00863 
00864 template <class _Tp>
00865 inline _Valarray_bool _STLP_CALL operator&&(const _Tp& __c, const valarray<_Tp>& __x) {
00866   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00867   for (size_t __i = 0; __i < __x.size(); ++__i)
00868     __tmp[__i] = __c && __x[__i];
00869   return __tmp;
00870 }
00871 
00872 template <class _Tp>
00873 inline _Valarray_bool _STLP_CALL operator||(const valarray<_Tp>& __x, const _Tp& __c) {
00874   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00875   for (size_t __i = 0; __i < __x.size(); ++__i)
00876     __tmp[__i] = __x[__i] || __c;
00877   return __tmp;
00878 }
00879 
00880 template <class _Tp>
00881 inline _Valarray_bool _STLP_CALL operator||(const _Tp& __c, const valarray<_Tp>& __x) {
00882   _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
00883   for (size_t __i = 0; __i < __x.size(); ++__i)
00884     __tmp[__i] = __c || __x[__i];
00885   return __tmp;
00886 }
00887 
00888 // valarray "transcendentals" (the list includes abs and sqrt, which,
00889 // of course, are not transcendental).
00890 
00891 template <class _Tp>
00892 inline valarray<_Tp> abs(const valarray<_Tp>& __x) {
00893   typedef typename valarray<_Tp>::_NoInit _NoInit;
00894   valarray<_Tp> __tmp(__x.size(), _NoInit());
00895   for (size_t __i = 0; __i < __x.size(); ++__i)
00896     __tmp[__i] = ::abs(__x[__i]);
00897   return __tmp;
00898 }
00899 
00900 template <class _Tp>
00901 inline valarray<_Tp> acos(const valarray<_Tp>& __x) {
00902   typedef typename valarray<_Tp>::_NoInit _NoInit;
00903   valarray<_Tp> __tmp(__x.size(), _NoInit());
00904   for (size_t __i = 0; __i < __x.size(); ++__i)
00905     __tmp[__i] = ::acos(__x[__i]);
00906   return __tmp;
00907 }
00908 
00909 template <class _Tp>
00910 inline valarray<_Tp> asin(const valarray<_Tp>& __x) {
00911   typedef typename valarray<_Tp>::_NoInit _NoInit;
00912   valarray<_Tp> __tmp(__x.size(), _NoInit());
00913   for (size_t __i = 0; __i < __x.size(); ++__i)
00914     __tmp[__i] = ::asin(__x[__i]);
00915   return __tmp;
00916 }
00917 
00918 template <class _Tp>
00919 inline valarray<_Tp> atan(const valarray<_Tp>& __x) {
00920   typedef typename valarray<_Tp>::_NoInit _NoInit;
00921   valarray<_Tp> __tmp(__x.size(), _NoInit());
00922   for (size_t __i = 0; __i < __x.size(); ++__i)
00923     __tmp[__i] = ::atan(__x[__i]);
00924   return __tmp;
00925 }
00926 
00927 template <class _Tp>
00928 inline valarray<_Tp> atan2(const valarray<_Tp>& __x,
00929                            const valarray<_Tp>& __y) {
00930   typedef typename valarray<_Tp>::_NoInit _NoInit;
00931   valarray<_Tp> __tmp(__x.size(), _NoInit());
00932   for (size_t __i = 0; __i < __x.size(); ++__i)
00933     __tmp[__i] = ::atan2(__x[__i], __y[__i]);
00934   return __tmp;
00935 }
00936 
00937 template <class _Tp>
00938 inline valarray<_Tp> atan2(const valarray<_Tp>& __x, const _Tp& __c) {
00939   typedef typename valarray<_Tp>::_NoInit _NoInit;
00940   valarray<_Tp> __tmp(__x.size(), _NoInit());
00941   for (size_t __i = 0; __i < __x.size(); ++__i)
00942     __tmp[__i] = ::atan2(__x[__i], __c);
00943   return __tmp;
00944 }
00945 
00946 template <class _Tp>
00947 inline valarray<_Tp> atan2(const _Tp& __c, const valarray<_Tp>& __x) {
00948   typedef typename valarray<_Tp>::_NoInit _NoInit;
00949   valarray<_Tp> __tmp(__x.size(), _NoInit());
00950   for (size_t __i = 0; __i < __x.size(); ++__i)
00951     __tmp[__i] = ::atan2(__c, __x[__i]);
00952   return __tmp;
00953 }
00954 
00955 template <class _Tp>
00956 inline valarray<_Tp> cos(const valarray<_Tp>& __x) {
00957   typedef typename valarray<_Tp>::_NoInit _NoInit;
00958   valarray<_Tp> __tmp(__x.size(), _NoInit());
00959   for (size_t __i = 0; __i < __x.size(); ++__i)
00960     __tmp[__i] = ::cos(__x[__i]);
00961   return __tmp;
00962 }
00963 
00964 template <class _Tp>
00965 inline valarray<_Tp> cosh(const valarray<_Tp>& __x) {
00966   typedef typename valarray<_Tp>::_NoInit _NoInit;
00967   valarray<_Tp> __tmp(__x.size(), _NoInit());
00968   for (size_t __i = 0; __i < __x.size(); ++__i)
00969     __tmp[__i] = ::cosh(__x[__i]);
00970   return __tmp;
00971 }
00972 
00973 template <class _Tp>
00974 inline valarray<_Tp> exp(const valarray<_Tp>& __x) {
00975   typedef typename valarray<_Tp>::_NoInit _NoInit;
00976   valarray<_Tp> __tmp(__x.size(), _NoInit());
00977   for (size_t __i = 0; __i < __x.size(); ++__i)
00978     __tmp[__i] = ::exp(__x[__i]);
00979   return __tmp;
00980 }
00981 
00982 template <class _Tp>
00983 inline valarray<_Tp> log(const valarray<_Tp>& __x) {
00984   typedef typename valarray<_Tp>::_NoInit _NoInit;
00985   valarray<_Tp> __tmp(__x.size(), _NoInit());
00986   for (size_t __i = 0; __i < __x.size(); ++__i)
00987     __tmp[__i] = ::log(__x[__i]);
00988   return __tmp;
00989 }
00990 
00991 template <class _Tp>
00992 inline valarray<_Tp> log10(const valarray<_Tp>& __x) {
00993   typedef typename valarray<_Tp>::_NoInit _NoInit;
00994   valarray<_Tp> __tmp(__x.size(), _NoInit());
00995   for (size_t __i = 0; __i < __x.size(); ++__i)
00996     __tmp[__i] = ::log10(__x[__i]);
00997   return __tmp;
00998 }
00999 
01000 template <class _Tp>
01001 inline valarray<_Tp> pow(const valarray<_Tp>& __x,
01002                          const valarray<_Tp>& __y) {
01003   typedef typename valarray<_Tp>::_NoInit _NoInit;
01004   valarray<_Tp> __tmp(__x.size(), _NoInit());
01005   for (size_t __i = 0; __i < __x.size(); ++__i)
01006     __tmp[__i] = ::pow(__x[__i], __y[__i]);
01007   return __tmp;
01008 }
01009 
01010 template <class _Tp>
01011 inline valarray<_Tp> pow(const valarray<_Tp>& __x, const _Tp& __c) {
01012   typedef typename valarray<_Tp>::_NoInit _NoInit;
01013   valarray<_Tp> __tmp(__x.size(), _NoInit());
01014   for (size_t __i = 0; __i < __x.size(); ++__i)
01015     __tmp[__i] = ::pow(__x[__i], __c);
01016   return __tmp;
01017 }
01018 
01019 template <class _Tp>
01020 inline valarray<_Tp> pow(const _Tp& __c, const valarray<_Tp>& __x) {
01021   typedef typename valarray<_Tp>::_NoInit _NoInit;
01022   valarray<_Tp> __tmp(__x.size(), _NoInit());
01023   for (size_t __i = 0; __i < __x.size(); ++__i)
01024     __tmp[__i] = ::pow(__c, __x[__i]);
01025   return __tmp;
01026 }
01027 
01028 template <class _Tp>
01029 inline valarray<_Tp> sin(const valarray<_Tp>& __x) {
01030   typedef typename valarray<_Tp>::_NoInit _NoInit;
01031   valarray<_Tp> __tmp(__x.size(), _NoInit());
01032   for (size_t __i = 0; __i < __x.size(); ++__i)
01033     __tmp[__i] = ::sin(__x[__i]);
01034   return __tmp;
01035 }
01036 
01037 template <class _Tp>
01038 inline valarray<_Tp> sinh(const valarray<_Tp>& __x) {
01039   typedef typename valarray<_Tp>::_NoInit _NoInit;
01040   valarray<_Tp> __tmp(__x.size(), _NoInit());
01041   for (size_t __i = 0; __i < __x.size(); ++__i)
01042     __tmp[__i] = ::sinh(__x[__i]);
01043   return __tmp;
01044 }
01045 
01046 template <class _Tp>
01047 inline valarray<_Tp> sqrt(const valarray<_Tp>& __x) {
01048   typedef typename valarray<_Tp>::_NoInit _NoInit;
01049   valarray<_Tp> __tmp(__x.size(), _NoInit());
01050   for (size_t __i = 0; __i < __x.size(); ++__i)
01051     __tmp[__i] = ::sqrt(__x[__i]);
01052   return __tmp;
01053 }
01054 
01055 template <class _Tp>
01056 inline valarray<_Tp> tan(const valarray<_Tp>& __x) {
01057   typedef typename valarray<_Tp>::_NoInit _NoInit;
01058   valarray<_Tp> __tmp(__x.size(), _NoInit());
01059   for (size_t __i = 0; __i < __x.size(); ++__i)
01060     __tmp[__i] = ::tan(__x[__i]);
01061   return __tmp;
01062 }
01063 
01064 template <class _Tp>
01065 inline valarray<_Tp> tanh(const valarray<_Tp>& __x) {
01066   typedef typename valarray<_Tp>::_NoInit _NoInit;
01067   valarray<_Tp> __tmp(__x.size(), _NoInit());
01068   for (size_t __i = 0; __i < __x.size(); ++__i)
01069     __tmp[__i] = ::tanh(__x[__i]);
01070   return __tmp;
01071 }
01072 
01073 //----------------------------------------------------------------------
01074 // slice and slice_array
01075 
01076 class slice {
01077 public:
01078   slice() : _M_start(0), _M_length(0), _M_stride(0) {}
01079   slice(size_t __start, size_t __length, size_t __stride)
01080     : _M_start(__start), _M_length(__length), _M_stride(__stride)
01081     {}
01082   __TRIVIAL_DESTRUCTOR(slice)
01083 
01084   size_t start()  const { return _M_start; }
01085   size_t size()   const { return _M_length; }
01086   size_t stride() const { return _M_stride; }
01087 
01088 private:
01089   size_t _M_start;
01090   size_t _M_length;
01091   size_t _M_stride;
01092 };
01093 
01094 template <class _Tp>
01095 class slice_array {
01096   friend class valarray<_Tp>;
01097 public:
01098   typedef _Tp value_type;
01099 
01100   void operator=(const valarray<value_type>& __x) const {
01101     size_t __index = _M_slice.start();
01102     for (size_t __i = 0;
01103          __i < _M_slice.size();
01104          ++__i, __index += _M_slice.stride())
01105       _M_array[__index] = __x[__i];
01106   }
01107 
01108   void operator*=(const valarray<value_type>& __x) const {
01109     size_t __index = _M_slice.start();
01110     for (size_t __i = 0;
01111          __i < _M_slice.size();
01112          ++__i, __index += _M_slice.stride())
01113       _M_array[__index] *= __x[__i];
01114   }
01115 
01116   void operator/=(const valarray<value_type>& __x) const {
01117     size_t __index = _M_slice.start();
01118     for (size_t __i = 0;
01119          __i < _M_slice.size();
01120          ++__i, __index += _M_slice.stride())
01121       _M_array[__index] /= __x[__i];
01122   }
01123 
01124   void operator%=(const valarray<value_type>& __x) const {
01125     size_t __index = _M_slice.start();
01126     for (size_t __i = 0;
01127          __i < _M_slice.size();
01128          ++__i, __index += _M_slice.stride())
01129       _M_array[__index] %= __x[__i];
01130   }
01131 
01132   void operator+=(const valarray<value_type>& __x) const {
01133     size_t __index = _M_slice.start();
01134     for (size_t __i = 0;
01135          __i < _M_slice.size();
01136          ++__i, __index += _M_slice.stride())
01137       _M_array[__index] += __x[__i];
01138   }
01139 
01140   void operator-=(const valarray<value_type>& __x) const {
01141     size_t __index = _M_slice.start();
01142     for (size_t __i = 0;
01143          __i < _M_slice.size();
01144          ++__i, __index += _M_slice.stride())
01145       _M_array[__index] -= __x[__i];
01146   }
01147 
01148   void operator^=(const valarray<value_type>& __x) const {
01149     size_t __index = _M_slice.start();
01150     for (size_t __i = 0;
01151          __i < _M_slice.size();
01152          ++__i, __index += _M_slice.stride())
01153       _M_array[__index] ^= __x[__i];
01154   }
01155 
01156   void operator&=(const valarray<value_type>& __x) const {
01157     size_t __index = _M_slice.start();
01158     for (size_t __i = 0;
01159          __i < _M_slice.size();
01160          ++__i, __index += _M_slice.stride())
01161       _M_array[__index] &= __x[__i];
01162   }
01163 
01164   void operator|=(const valarray<value_type>& __x) const {
01165     size_t __index = _M_slice.start();
01166     for (size_t __i = 0;
01167          __i < _M_slice.size();
01168          ++__i, __index += _M_slice.stride())
01169       _M_array[__index] |= __x[__i];
01170   }
01171 
01172   void operator<<=(const valarray<value_type>& __x) const {
01173     size_t __index = _M_slice.start();
01174     for (size_t __i = 0;
01175          __i < _M_slice.size();
01176          ++__i, __index += _M_slice.stride())
01177       _M_array[__index] <<= __x[__i];
01178   }
01179 
01180   void operator>>=(const valarray<value_type>& __x) const {
01181     size_t __index = _M_slice.start();
01182     for (size_t __i = 0;
01183          __i < _M_slice.size();
01184          ++__i, __index += _M_slice.stride())
01185       _M_array[__index] >>= __x[__i];
01186   }
01187 
01188   void operator=(const value_type& __c) /*const could be const but standard says NO (26.3.5.4-1)*/ {
01189     size_t __index = _M_slice.start();
01190     for (size_t __i = 0;
01191          __i < _M_slice.size();
01192          ++__i, __index += _M_slice.stride())
01193       _M_array[__index] = __c;
01194   }
01195 
01196   // C++ Standard defect 253, copy constructor must be public.
01197   slice_array(const slice_array &__x)
01198     : _M_slice(__x._M_slice), _M_array(__x._M_array)
01199     {}
01200 
01201   ~slice_array() {}
01202 
01203 private:
01204   slice_array(const slice& __slice, valarray<_Tp> &__array)
01205     : _M_slice(__slice), _M_array(__array)
01206     {}
01207 
01208   slice          _M_slice;
01209   valarray<_Tp>& _M_array;
01210 
01211 private:
01212   // Disable default constructor and assignment
01213   slice_array();
01214   slice_array& operator=(const slice_array&);
01215 };
01216 
01217 // valarray member functions dealing with slice and slice_array
01218 
01219 template <class _Tp>
01220 inline valarray<_Tp>::valarray(const slice_array<_Tp>& __x)
01221   : _Valarray_base<_Tp>(__x._M_slice.size()) {
01222   typedef typename __type_traits<_Tp>::has_trivial_default_constructor
01223           _Is_Trivial;
01224   _M_initialize(_Is_Trivial());
01225   *this = __x;
01226 }
01227 
01228 
01229 template <class _Tp>
01230 inline slice_array<_Tp> valarray<_Tp>::operator[](slice __slice)
01231 { return slice_array<_Tp>(__slice, *this); }
01232 
01233 //----------------------------------------------------------------------
01234 // gslice and gslice_array
01235 
01236 template <class _Size>
01237 struct _Gslice_Iter_tmpl;
01238 
01239 class gslice {
01240   friend struct _Gslice_Iter_tmpl<size_t>;
01241 public:
01242   gslice() : _M_start(0), _M_lengths(), _M_strides() {}
01243   gslice(size_t __start,
01244          const _Valarray_size_t& __lengths, const _Valarray_size_t& __strides)
01245     : _M_start(__start), _M_lengths(__lengths), _M_strides(__strides)
01246     {}
01247   __TRIVIAL_DESTRUCTOR(gslice)
01248 
01249   size_t start()            const { return _M_start; }
01250   _Valarray_size_t size()   const { return _M_lengths; }
01251   _Valarray_size_t stride() const { return _M_strides; }
01252 
01253   // Extension: check for an empty gslice.
01254   bool _M_empty() const { return _M_lengths.size() == 0; }
01255 
01256   // Extension: number of indices this gslice represents.  (For a degenerate
01257   // gslice, they're not necessarily all distinct.)
01258   size_t _M_size() const {
01259     return !this->_M_empty()
01260       ? accumulate(_M_lengths._M_first + 1,
01261                    _M_lengths._M_first + _M_lengths._M_size,
01262                    _M_lengths[0],
01263                    multiplies<size_t>())
01264       : 0;
01265   }
01266 
01267 # ifndef __HP_aCC
01268 private:
01269 # endif
01270 
01271   size_t _M_start;
01272   _Valarray_size_t _M_lengths;
01273   _Valarray_size_t _M_strides;
01274 };
01275 
01276 // This is not an STL iterator.  It is constructed from a gslice, and it
01277 // steps through the gslice indices in sequence.  See 23.3.6 of the C++
01278 // standard, paragraphs 2-3, for an explanation of the sequence.  At
01279 // each step we get two things: the ordinal (i.e. number of steps taken),
01280 // and the one-dimensional index.
01281 
01282 template <class _Size>
01283 struct _Gslice_Iter_tmpl {
01284   _Gslice_Iter_tmpl(const gslice& __gslice)
01285     : _M_step(0), _M_1d_idx(__gslice.start()),
01286       _M_indices(size_t(0), __gslice._M_lengths.size()),
01287       _M_gslice(__gslice)
01288     {}
01289 
01290   bool _M_done() const { return _M_indices[0] == _M_gslice._M_lengths[0]; }
01291 
01292   bool _M_incr();
01293 
01294   _Size _M_step;
01295   _Size _M_1d_idx;
01296 
01297   valarray<_Size> _M_indices;
01298   const gslice& _M_gslice;
01299 };
01300 
01301 typedef _Gslice_Iter_tmpl<size_t> _Gslice_Iter;
01302 
01303 template <class _Tp>
01304 class gslice_array {
01305   friend class valarray<_Tp>;
01306 public:
01307   typedef _Tp value_type;
01308 
01309   void operator= (const valarray<value_type>& __x) const {
01310     if (!_M_gslice._M_empty()) {
01311       _Gslice_Iter __i(_M_gslice);
01312       do _M_array[__i._M_1d_idx] = __x[__i._M_step]; while(__i._M_incr());
01313     }
01314   }
01315 
01316   void operator*= (const valarray<value_type>& __x) const {
01317     if (!_M_gslice._M_empty()) {
01318       _Gslice_Iter __i(_M_gslice);
01319       do _M_array[__i._M_1d_idx] *= __x[__i._M_step]; while(__i._M_incr());
01320     }
01321   }
01322 
01323   void operator/= (const valarray<value_type>& __x) const {
01324     if (!_M_gslice._M_empty()) {
01325       _Gslice_Iter __i(_M_gslice);
01326       do _M_array[__i._M_1d_idx] /= __x[__i._M_step]; while(__i._M_incr());
01327     }
01328   }
01329 
01330   void operator%= (const valarray<value_type>& __x) const {
01331     if (!_M_gslice._M_empty()) {
01332       _Gslice_Iter __i(_M_gslice);
01333       do _M_array[__i._M_1d_idx] %= __x[__i._M_step]; while(__i._M_incr());
01334     }
01335   }
01336 
01337   void operator+= (const valarray<value_type>& __x) const {
01338     if (!_M_gslice._M_empty()) {
01339       _Gslice_Iter __i(_M_gslice);
01340       do _M_array[__i._M_1d_idx] += __x[__i._M_step]; while(__i._M_incr());
01341     }
01342   }
01343 
01344   void operator-= (const valarray<value_type>& __x) const {
01345     if (!_M_gslice._M_empty()) {
01346       _Gslice_Iter __i(_M_gslice);
01347       do _M_array[__i._M_1d_idx] -= __x[__i._M_step]; while(__i._M_incr());
01348     }
01349   }
01350 
01351   void operator^= (const valarray<value_type>& __x) const {
01352     if (!_M_gslice._M_empty()) {
01353       _Gslice_Iter __i(_M_gslice);
01354       do _M_array[__i._M_1d_idx] ^= __x[__i._M_step]; while(__i._M_incr());
01355     }
01356   }
01357 
01358   void operator&= (const valarray<value_type>& __x) const {
01359     if (!_M_gslice._M_empty()) {
01360       _Gslice_Iter __i(_M_gslice);
01361       do _M_array[__i._M_1d_idx] &= __x[__i._M_step]; while(__i._M_incr());
01362     }
01363   }
01364 
01365   void operator|= (const valarray<value_type>& __x) const {
01366     if (!_M_gslice._M_empty()) {
01367       _Gslice_Iter __i(_M_gslice);
01368       do _M_array[__i._M_1d_idx] |= __x[__i._M_step]; while(__i._M_incr());
01369     }
01370   }
01371 
01372   void operator<<= (const valarray<value_type>& __x) const {
01373     if (!_M_gslice._M_empty()) {
01374       _Gslice_Iter __i(_M_gslice);
01375       do _M_array[__i._M_1d_idx] <<= __x[__i._M_step]; while(__i._M_incr());
01376     }
01377   }
01378 
01379   void operator>>= (const valarray<value_type>& __x) const {
01380     if (!_M_gslice._M_empty()) {
01381       _Gslice_Iter __i(_M_gslice);
01382       do _M_array[__i._M_1d_idx] >>= __x[__i._M_step]; while(__i._M_incr());
01383     }
01384   }
01385 
01386   void operator= (const value_type& __c) /*const could be const but standard says NO (26.3.7.4-1)*/ {
01387     if (!_M_gslice._M_empty()) {
01388       _Gslice_Iter __i(_M_gslice);
01389       do _M_array[__i._M_1d_idx] = __c; while(__i._M_incr());
01390     }
01391   }
01392 
01393   // C++ Standard defect 253, copy constructor must be public.
01394   gslice_array(const gslice_array& __x)
01395     : _M_gslice(__x._M_gslice), _M_array(__x._M_array)
01396     {}
01397 
01398   ~gslice_array() {}
01399 
01400 private:
01401   gslice_array(const gslice &__gslice, valarray<_Tp> &__array)
01402     : _M_gslice(__gslice), _M_array(__array)
01403     {}
01404 
01405   gslice                _M_gslice;
01406   valarray<value_type>& _M_array;
01407 
01408 private:
01409   // Disable default constructor and assignment
01410   gslice_array();
01411   void operator=(const gslice_array<_Tp>&);
01412 };
01413 
01414 // valarray member functions dealing with gslice and gslice_array.  Note
01415 // that it is illegal (behavior is undefined) to construct a gslice_array
01416 // from a degenerate gslice.
01417 
01418 template <class _Tp>
01419 inline valarray<_Tp>::valarray(const gslice_array<_Tp>& __x)
01420   : _Valarray_base<_Tp>(__x._M_gslice._M_size()) {
01421   typedef typename __type_traits<_Tp>::has_trivial_default_constructor
01422           _Is_Trivial;
01423   _M_initialize(_Is_Trivial());
01424   *this = __x;
01425 }
01426 
01427 template <class _Tp>
01428 inline gslice_array<_Tp> valarray<_Tp>::operator[](const gslice& __slice)
01429 { return gslice_array<_Tp>(__slice, *this); }
01430 
01431 
01432 //----------------------------------------------------------------------
01433 // mask_array
01434 
01435 template <class _Tp>
01436 class mask_array {
01437   friend class valarray<_Tp>;
01438 public:
01439   typedef _Tp value_type;
01440 
01441   void operator=(const valarray<value_type>& __x) const {
01442     size_t __idx = 0;
01443     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01444       if (_M_mask[__i]) _M_array[__i] = __x[__idx++];
01445   }
01446 
01447   void operator*=(const valarray<value_type>& __x) const {
01448     size_t __idx = 0;
01449     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01450       if (_M_mask[__i]) _M_array[__i] *= __x[__idx++];
01451   }
01452 
01453   void operator/=(const valarray<value_type>& __x) const {
01454     size_t __idx = 0;
01455     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01456       if (_M_mask[__i]) _M_array[__i] /= __x[__idx++];
01457   }
01458 
01459   void operator%=(const valarray<value_type>& __x) const {
01460     size_t __idx = 0;
01461     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01462       if (_M_mask[__i]) _M_array[__i] %= __x[__idx++];
01463   }
01464 
01465   void operator+=(const valarray<value_type>& __x) const {
01466     size_t __idx = 0;
01467     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01468       if (_M_mask[__i]) _M_array[__i] += __x[__idx++];
01469   }
01470 
01471   void operator-=(const valarray<value_type>& __x) const {
01472     size_t __idx = 0;
01473     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01474       if (_M_mask[__i]) _M_array[__i] -= __x[__idx++];
01475   }
01476 
01477   void operator^=(const valarray<value_type>& __x) const {
01478     size_t __idx = 0;
01479     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01480       if (_M_mask[__i]) _M_array[__i] ^= __x[__idx++];
01481   }
01482 
01483   void operator&=(const valarray<value_type>& __x) const {
01484     size_t __idx = 0;
01485     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01486       if (_M_mask[__i]) _M_array[__i] &= __x[__idx++];
01487   }
01488 
01489   void operator|=(const valarray<value_type>& __x) const {
01490     size_t __idx = 0;
01491     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01492       if (_M_mask[__i]) _M_array[__i] |= __x[__idx++];
01493   }
01494 
01495   void operator<<=(const valarray<value_type>& __x) const {
01496     size_t __idx = 0;
01497     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01498       if (_M_mask[__i]) _M_array[__i] <<= __x[__idx++];
01499   }
01500 
01501   void operator>>=(const valarray<value_type>& __x) const {
01502     size_t __idx = 0;
01503     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01504       if (_M_mask[__i]) _M_array[__i] >>= __x[__idx++];
01505   }
01506 
01507   void operator=(const value_type& __c) const {
01508     for (size_t __i = 0; __i < _M_array.size(); ++__i)
01509       if (_M_mask[__i]) _M_array[__i] = __c;
01510   }
01511 
01512   // Extension: number of true values in the mask
01513   size_t _M_num_true() const {
01514     size_t __result = 0;
01515     for (size_t __i = 0; __i < _M_mask.size(); ++__i)
01516       if (_M_mask[__i]) ++__result;
01517     return __result;
01518   }
01519 
01520   // C++ Standard defect 253, copy constructor must be public.
01521   mask_array(const mask_array& __x)
01522     : _M_mask(__x._M_mask), _M_array(__x._M_array)
01523     {}
01524 
01525   ~mask_array() {}
01526 
01527 private:
01528   mask_array(const _Valarray_bool& __mask, valarray<_Tp>& __array)
01529     : _M_mask(__mask), _M_array(__array)
01530     {}
01531   _Valarray_bool _M_mask;
01532   valarray<_Tp>& _M_array;
01533 
01534 private:
01535   // Disable default constructor and assignment
01536   mask_array();
01537   void operator=(const mask_array<_Tp>&);
01538 };
01539 
01540 // valarray member functions dealing with mask_array
01541 
01542 template <class _Tp>
01543 inline valarray<_Tp>::valarray(const mask_array<_Tp>& __x)
01544   : _Valarray_base<_Tp>(__x._M_num_true()) {
01545   typedef typename __type_traits<_Tp>::has_trivial_default_constructor
01546           _Is_Trivial;
01547   _M_initialize(_Is_Trivial());
01548   *this = __x;
01549 }
01550 
01551 // Behavior is undefined if __x._M_num_true() != this->size()
01552 template <class _Tp>
01553 inline valarray<_Tp>& valarray<_Tp>::operator=(const mask_array<_Tp>& __x) {
01554   size_t __idx = 0;
01555   for (size_t __i = 0; __i < __x._M_array.size(); ++__i)
01556     if (__x._M_mask[__i]) (*this)[__idx++] = __x._M_array[__i];
01557   return *this;
01558 }
01559 
01560 template <class _Tp>
01561 inline mask_array<_Tp> valarray<_Tp>::operator[](const _Valarray_bool& __mask) {
01562   _STLP_ASSERT(__mask.size() == this->size())
01563   return mask_array<_Tp>(__mask, *this);
01564 }
01565 
01566 //----------------------------------------------------------------------
01567 // indirect_array
01568 
01569 template <class _Tp>
01570 class indirect_array {
01571   friend class valarray<_Tp>;
01572 public:
01573   typedef _Tp value_type;
01574 
01575   void operator=(const valarray<value_type>& __x) const {
01576     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01577       _M_array[_M_addr[__i]] = __x[__i];
01578   }
01579 
01580   void operator*=(const valarray<value_type>& __x) const {
01581     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01582       _M_array[_M_addr[__i]] *= __x[__i];
01583   }
01584 
01585   void operator/=(const valarray<value_type>& __x) const {
01586     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01587       _M_array[_M_addr[__i]] /= __x[__i];
01588   }
01589 
01590   void operator%=(const valarray<value_type>& __x) const {
01591     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01592       _M_array[_M_addr[__i]] %= __x[__i];
01593   }
01594 
01595   void operator+=(const valarray<value_type>& __x) const {
01596     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01597       _M_array[_M_addr[__i]] += __x[__i];
01598   }
01599 
01600   void operator-=(const valarray<value_type>& __x) const {
01601     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01602       _M_array[_M_addr[__i]] -= __x[__i];
01603   }
01604 
01605   void operator^=(const valarray<value_type>& __x) const {
01606     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01607       _M_array[_M_addr[__i]] ^= __x[__i];
01608   }
01609 
01610   void operator&=(const valarray<value_type>& __x) const {
01611     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01612       _M_array[_M_addr[__i]] &= __x[__i];
01613   }
01614 
01615   void operator|=(const valarray<value_type>& __x) const {
01616     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01617       _M_array[_M_addr[__i]] |= __x[__i];
01618   }
01619 
01620   void operator<<=(const valarray<value_type>& __x) const {
01621     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01622       _M_array[_M_addr[__i]] <<= __x[__i];
01623   }
01624 
01625   void operator>>=(const valarray<value_type>& __x) const {
01626     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01627       _M_array[_M_addr[__i]] >>= __x[__i];
01628   }
01629 
01630   void operator=(const value_type& __c) const {
01631     for (size_t __i = 0; __i < _M_addr.size(); ++__i)
01632       _M_array[_M_addr[__i]] = __c;
01633   }
01634 
01635   // C++ Standard defect 253, copy constructor must be public.
01636   indirect_array(const indirect_array& __x)
01637     : _M_addr(__x._M_addr), _M_array(__x._M_array)
01638     {}
01639 
01640   ~indirect_array() {}
01641 
01642 private:
01643   indirect_array(const _Valarray_size_t& __addr, valarray<_Tp>& __array)
01644     : _M_addr(__addr), _M_array(__array)
01645   {}
01646 
01647   _Valarray_size_t _M_addr;
01648   valarray<_Tp>&   _M_array;
01649 
01650 private:
01651   // Disable default constructor and assignment
01652   indirect_array();
01653   void operator=(const indirect_array<_Tp>&);
01654 };
01655 
01656 // valarray member functions dealing with indirect_array
01657 
01658 template <class _Tp>
01659 inline valarray<_Tp>::valarray(const indirect_array<_Tp>& __x)
01660   : _Valarray_base<_Tp>(__x._M_addr.size()) {
01661   typedef typename __type_traits<_Tp>::has_trivial_default_constructor
01662           _Is_Trivial;
01663   _M_initialize(_Is_Trivial());
01664   *this = __x;
01665 }
01666 
01667 
01668 template <class _Tp>
01669 inline indirect_array<_Tp>
01670 valarray<_Tp>::operator[](const _Valarray_size_t& __addr)
01671 { return indirect_array<_Tp>(__addr, *this); }
01672 
01673 _STLP_END_NAMESPACE
01674 
01675 # if !defined (_STLP_LINK_TIME_INSTANTIATION)
01676 #  include <stl/_valarray.c>
01677 # endif
01678 
01679 #endif /* _STLP_VALARRAY */
01680 
01681 
01682 // Local Variables:
01683 // mode:C++
01684 // End:

Generated on Sat May 26 2012 04:28:21 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.