1 //===------------------------ valarray.cpp --------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 _LIBCPP_BEGIN_NAMESPACE_STD
13 // These two symbols are part of the v1 ABI but not part of the >=v2 ABI.
14 #if _LIBCPP_ABI_VERSION == 1
15 template valarray<size_t>::valarray(size_t);
16 template valarray<size_t>::~valarray();
19 template void valarray<size_t>::resize(size_t, size_t);
22 gslice::__init(size_t __start)
24 valarray<size_t> __indices(__size_.size());
25 size_t __k = __size_.size() != 0;
26 for (size_t __i = 0; __i < __size_.size(); ++__i)
35 size_t __i = __indices.size() - 1;
38 if (++__indices[__i] < __size_[__i])
41 __1d_[__k] = __1d_[__k-1] + __stride_[__i];
42 for (size_t __j = __i + 1; __j != __indices.size(); ++__j)
43 __1d_[__k] -= __stride_[__j] * (__size_[__j] - 1);
57 _LIBCPP_END_NAMESPACE_STD