tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / libc++ / dist / libcxx / src / valarray.cpp
blobe4c9ed024620c47e25be67a96518947c51126146
1 //===------------------------ valarray.cpp --------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
12 #include "valarray"
14 _LIBCPP_BEGIN_NAMESPACE_STD
16 template valarray<size_t>::valarray(size_t);
17 template valarray<size_t>::~valarray();
18 template void valarray<size_t>::resize(size_t, size_t);
20 void
21 gslice::__init(size_t __start)
23 valarray<size_t> __indices(__size_.size());
24 size_t __k = __size_.size() != 0;
25 for (size_t __i = 0; __i < __size_.size(); ++__i)
26 __k *= __size_[__i];
27 __1d_.resize(__k);
28 if (__1d_.size())
30 __k = 0;
31 __1d_[__k] = __start;
32 while (true)
34 size_t __i = __indices.size() - 1;
35 while (true)
37 if (++__indices[__i] < __size_[__i])
39 ++__k;
40 __1d_[__k] = __1d_[__k-1] + __stride_[__i];
41 for (size_t __j = __i + 1; __j != __indices.size(); ++__j)
42 __1d_[__k] -= __stride_[__j] * (__size_[__j] - 1);
43 break;
45 else
47 if (__i == 0)
48 return;
49 __indices[__i--] = 0;
56 _LIBCPP_END_NAMESPACE_STD