ROOT  6.06/09
Reference Guide
vector.h
Go to the documentation of this file.
1 /* This file is part of the Vc library.
2 
3  Copyright (C) 2009-2012 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 VECTOR_H
21 #define VECTOR_H
22 
23 #include "global.h"
24 #include "internal/namespace.h"
25 
26 #ifdef VC_IMPL_Scalar
27 # include "scalar/vector.h"
28 # include "scalar/helperimpl.h"
29 #elif defined(VC_IMPL_AVX)
30 # include "avx/vector.h"
31 # include "avx/helperimpl.h"
32 #elif defined(VC_IMPL_SSE)
33 # include "sse/vector.h"
34 # include "sse/helperimpl.h"
35 #endif
36 
37 #ifdef isfinite
38 #undef isfinite
39 #endif
40 #ifdef isnan
41 #undef isnan
42 #endif
43 
44 namespace ROOT {
45 namespace Vc
46 {
48  using VECTOR_NAMESPACE::VectorAlignedBaseT;
49  typedef VectorAlignedBaseT<> VectorAlignedBase;
50  using namespace VectorSpecialInitializerZero;
51  using namespace VectorSpecialInitializerOne;
52  using namespace VectorSpecialInitializerIndexesFromZero;
78  using VECTOR_NAMESPACE::Vector;
79 
81  typedef double_v::Mask double_m;
83  typedef sfloat_v::Mask sfloat_m;
85  typedef float_v::Mask float_m;
87  typedef int_v::Mask int_m;
89  typedef uint_v::Mask uint_m;
91  typedef short_v::Mask short_m;
93  typedef ushort_v::Mask ushort_m;
94 
95  namespace {
96 #if defined(VC_IMPL_SSE) || defined(VC_IMPL_AVX)
97  using VECTOR_NAMESPACE::Const;
98 #endif
99  VC_STATIC_ASSERT_NC(double_v::Size == VC_DOUBLE_V_SIZE, VC_DOUBLE_V_SIZE_MACRO_WRONG);
100  VC_STATIC_ASSERT_NC(float_v::Size == VC_FLOAT_V_SIZE , VC_FLOAT_V_SIZE_MACRO_WRONG );
101  VC_STATIC_ASSERT_NC(sfloat_v::Size == VC_SFLOAT_V_SIZE, VC_SFLOAT_V_SIZE_MACRO_WRONG);
102  VC_STATIC_ASSERT_NC(int_v::Size == VC_INT_V_SIZE , VC_INT_V_SIZE_MACRO_WRONG );
103  VC_STATIC_ASSERT_NC(uint_v::Size == VC_UINT_V_SIZE , VC_UINT_V_SIZE_MACRO_WRONG );
104  VC_STATIC_ASSERT_NC(short_v::Size == VC_SHORT_V_SIZE , VC_SHORT_V_SIZE_MACRO_WRONG );
105  VC_STATIC_ASSERT_NC(ushort_v::Size == VC_USHORT_V_SIZE, VC_USHORT_V_SIZE_MACRO_WRONG);
106  }
107 } // namespace Vc
108 } // namespace ROOT
109 
110 #include "common/vectortuple.h"
111 #include "common/iif.h"
112 
113 #ifndef VC_NO_NAMESPACE_ALIAS
114 namespace Vc = ROOT::Vc;
115 #endif
116 
117 #ifndef VC_NO_STD_FUNCTIONS
118 namespace std
119 {
120  using Vc::min;
121  using Vc::max;
122 
123  using Vc::abs;
124  using Vc::asin;
125  using Vc::atan;
126  using Vc::atan2;
127  using Vc::ceil;
128  using Vc::cos;
129  using Vc::exp;
130  using Vc::floor;
131  using Vc::frexp;
132  using Vc::ldexp;
133  using Vc::log;
134  using Vc::log10;
135  using Vc::log2;
136  using Vc::round;
137  using Vc::sin;
138  using Vc::sqrt;
139 
140  using Vc::isfinite;
141  using Vc::isnan;
142 } // namespace std
143 #endif
144 
145 #ifndef VC_CLEAN_NAMESPACE
146 #define foreach_bit(_it_, _mask_) Vc_foreach_bit(_it_, _mask_)
147 #endif
148 
149 #undef VECTOR_NAMESPACE
150 
151 #endif // VECTOR_H
#define VC_STATIC_ASSERT_NC(cond, msg)
Definition: macros.h:241
VectorAlignedBaseT VectorAlignedBase
Definition: vector.h:49
VECTOR_NAMESPACE::uint_v uint_v
Definition: vector.h:88
VECTOR_NAMESPACE::sfloat_v sfloat_v
Definition: vector.h:82
float_v::Mask float_m
Definition: vector.h:85
#define VC_SHORT_V_SIZE
Definition: types.h:32
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
static Vc_ALWAYS_INLINE float_v trunc(float_v::AsArg v)
Definition: math.h:95
const char * Size
Definition: TXMLSetup.cxx:56
ushort_v::Mask ushort_m
Definition: vector.h:93
#define VC_USHORT_V_SIZE
Definition: types.h:33
STL namespace.
double cos(double)
VECTOR_NAMESPACE::short_v short_v
Definition: vector.h:90
static Vc_ALWAYS_INLINE void forceToRegisters(const Vector< T1 > &, const Vector< T2 > &, const Vector< T3 > &, const Vector< T4 > &, const Vector< T5 > &, const Vector< T6 > &, const Vector< T7 > &, const Vector< T8 > &, const Vector< T9 > &, const Vector< T10 > &, const Vector< T11 > &, const Vector< T12 > &, const Vector< T13 > &, const Vector< T14 > &, const Vector< T15 > &, const Vector< T16 > &)
Definition: vector.h:462
double sqrt(double)
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > abs(const Vector< T > &x)
Definition: vector.h:524
double_v frexp(double_v::AsArg v, int_v *e)
splits v into exponent and mantissa, the sign is kept with the mantissa
Definition: math.h:38
sfloat_v::Mask sfloat_m
Definition: vector.h:83
#define VC_FLOAT_V_SIZE
Definition: types.h:28
double log10(double)
VECTOR_NAMESPACE::ushort_v ushort_v
Definition: vector.h:92
double_v::Mask double_m
Definition: vector.h:81
double sin(double)
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > round(const Vector< T > &x)
Definition: vector.h:526
uint_v::Mask uint_m
Definition: vector.h:89
int isnan(double)
VECTOR_NAMESPACE::int_v int_v
Definition: vector.h:86
VECTOR_NAMESPACE::double_v double_v
Definition: vector.h:80
int_v::Mask int_m
Definition: vector.h:87
double floor(double)
#define VC_SFLOAT_V_SIZE
Definition: types.h:29
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > rsqrt(const Vector< T > &x)
Definition: vector.h:523
#define VC_UINT_V_SIZE
Definition: types.h:31
double asin(double)
static Vc_ALWAYS_INLINE Vc_PURE Vector< T > reciprocal(const Vector< T > &x)
Definition: vector.h:525
static Vc_ALWAYS_INLINE Vc_PURE sfloat_v max(const sfloat_v &x, const sfloat_v &y)
Definition: vector.h:518
double atan2(double, double)
double atan(double)
VECTOR_NAMESPACE::float_v float_v
Definition: vector.h:84
static Vc_ALWAYS_INLINE Vc_PURE sfloat_v min(const sfloat_v &x, const sfloat_v &y)
Definition: vector.h:515
#define VC_INT_V_SIZE
Definition: types.h:30
double ceil(double)
static Vc_ALWAYS_INLINE Vc_PURE Vector< T >::Mask isfinite(const Vector< T > &x)
Definition: vector.h:528
Definition: casts.h:28
double exp(double)
#define VC_DOUBLE_V_SIZE
Definition: types.h:27
short_v::Mask short_m
Definition: vector.h:91
double log(double)
double ldexp(double, int)