]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Vc/include/Vc/limits
Vc package added (version 0.6.79-dev)
[u/mrichter/AliRoot.git] / Vc / include / Vc / limits
diff --git a/Vc/include/Vc/limits b/Vc/include/Vc/limits
new file mode 100644 (file)
index 0000000..078e725
--- /dev/null
@@ -0,0 +1,58 @@
+/*  This file is part of the Vc library.
+
+    Copyright (C) 2009 Matthias Kretz <kretz@kde.org>
+
+    Vc is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation, either version 3 of
+    the License, or (at your option) any later version.
+
+    Vc 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 Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with Vc.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef INCLUDE_VC_LIMITS
+#define INCLUDE_VC_LIMITS
+
+#include <limits>
+#include "vector.h"
+#include "common/macros.h"
+#include <limits>
+
+namespace std
+{
+template<typename T> struct numeric_limits<Vc::Vector<T> > : public numeric_limits<typename Vc::Vector<T>::EntryType>
+{
+private:
+    typedef numeric_limits<typename Vc::Vector<T>::EntryType> _Base;
+public:
+    static inline INTRINSIC CONST Vc::Vector<T> max()           { return Vc::Vector<T>(_Base::max()); }
+    static inline INTRINSIC CONST Vc::Vector<T> min()           { return Vc::Vector<T>(_Base::min()); }
+    static inline INTRINSIC CONST Vc::Vector<T> lowest()        { return Vc::Vector<T>(_Base::lowest()); }
+    static inline INTRINSIC CONST Vc::Vector<T> epsilon()       { return Vc::Vector<T>(_Base::epsilon()); }
+    static inline INTRINSIC CONST Vc::Vector<T> round_error()   { return Vc::Vector<T>(_Base::round_error()); }
+    static inline INTRINSIC CONST Vc::Vector<T> infinity()      { return Vc::Vector<T>(_Base::infinity()); }
+    static inline INTRINSIC CONST Vc::Vector<T> quiet_NaN()     { return Vc::Vector<T>(_Base::quiet_NaN()); }
+    static inline INTRINSIC CONST Vc::Vector<T> signaling_NaN() { return Vc::Vector<T>(_Base::signaling_NaN()); }
+    static inline INTRINSIC CONST Vc::Vector<T> denorm_min()    { return Vc::Vector<T>(_Base::denorm_min()); }
+};
+} // namespace std
+
+#include "common/undomacros.h"
+#if VC_IMPL_Scalar
+# include "scalar/limits.h"
+#elif VC_IMPL_AVX
+# include "avx/limits.h"
+#elif VC_IMPL_SSE
+# include "sse/limits.h"
+#endif
+
+#endif // INCLUDE_VC_LIMITS
+
+// vim: ft=cpp