]> git.uio.no Git - u/mrichter/AliRoot.git/blob - Vc/include/Vc/limits
update to Vc 0.7.3-dev
[u/mrichter/AliRoot.git] / Vc / include / Vc / limits
1 /*  This file is part of the Vc library.
2
3     Copyright (C) 2009 Matthias Kretz <kretz@kde.org>
4
5     Vc is free software: you can redistribute it and/or modify
6     it under the terms of the GNU Lesser General Public License as
7     published by the Free Software Foundation, either version 3 of
8     the License, or (at your option) any later version.
9
10     Vc is distributed in the hope that it will be useful, but
11     WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with Vc.  If not, see <http://www.gnu.org/licenses/>.
17
18 */
19
20 #ifndef INCLUDE_VC_LIMITS
21 #define INCLUDE_VC_LIMITS
22
23 #include "vector.h"
24 #include "common/macros.h"
25 #include <limits>
26
27 namespace std
28 {
29 template<typename T> struct numeric_limits<Vc::Vector<T> > : public numeric_limits<typename Vc::Vector<T>::EntryType>
30 {
31 private:
32     typedef numeric_limits<typename Vc::Vector<T>::EntryType> _Base;
33 public:
34     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> max()           { return Vc::Vector<T>(_Base::max()); }
35     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> min()           { return Vc::Vector<T>(_Base::min()); }
36     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> lowest()        { return Vc::Vector<T>(_Base::lowest()); }
37     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> epsilon()       { return Vc::Vector<T>(_Base::epsilon()); }
38     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> round_error()   { return Vc::Vector<T>(_Base::round_error()); }
39     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> infinity()      { return Vc::Vector<T>(_Base::infinity()); }
40     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> quiet_NaN()     { return Vc::Vector<T>(_Base::quiet_NaN()); }
41     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> signaling_NaN() { return Vc::Vector<T>(_Base::signaling_NaN()); }
42     static Vc_INTRINSIC Vc_CONST Vc::Vector<T> denorm_min()    { return Vc::Vector<T>(_Base::denorm_min()); }
43 };
44 } // namespace std
45
46 #include "common/undomacros.h"
47 #ifdef VC_IMPL_Scalar
48 # include "scalar/limits.h"
49 #elif defined(VC_IMPL_AVX)
50 # include "avx/limits.h"
51 #elif defined(VC_IMPL_SSE)
52 # include "sse/limits.h"
53 #endif
54
55 #endif // INCLUDE_VC_LIMITS
56
57 // vim: ft=cpp