CMS 3D CMS Logo

Classes | Macros | Typedefs | Functions
ExtVec.h File Reference
#include <type_traits>
#include <iosfwd>

Go to the source code of this file.

Classes

struct  As3D< V >
 
struct  ExtVecTraits< T, N >
 
struct  ExtVecTraits< double, 2 >
 
struct  ExtVecTraits< double, 4 >
 
struct  ExtVecTraits< float, 2 >
 
struct  ExtVecTraits< float, 4 >
 
struct  ExtVecTraits< long double, 2 >
 
struct  ExtVecTraits< long double, 4 >
 
struct  Rot2< T >
 
struct  Rot3< T >
 

Macros

#define VECTOR_EXT(N)   __attribute__( ( vector_size( N ) ) )
 

Typedefs

typedef float __attribute__((vector_size(8))) cms_float32x2_t
 
template<typename T , int N>
using ExtVec = typename ExtVecTraits< T, N >::type
 
typedef Rot2< double > Rot2D
 
typedef Rot2< float > Rot2F
 
typedef Rot3< double > Rot3D
 
typedef Rot3< float > Rot3F
 
template<typename T >
using Vec2 = ExtVec< T, 2 >
 
typedef Vec2< double > Vec2D
 
typedef Vec2< float > Vec2F
 
typedef Vec4< double > Vec3D
 
typedef Vec4< float > Vec3F
 
template<typename T >
using Vec4 = ExtVec< T, 4 >
 
typedef Vec4< double > Vec4D
 
typedef Vec4< float > Vec4F
 

Functions

template<typename Vec , typename F >
Vec apply (Vec v, F f)
 
template<typename V >
As3D< V > as3D (V const &v)
 
template<typename V1 , typename V2 >
auto cross2 (V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
 
template<typename Vec >
Vec cross3 (Vec x, Vec y)
 
template<typename V >
auto dot (V x, V y) -> typename std::remove_reference< decltype(x[0])>::type
 
template<typename V1 , typename V2 >
auto dot2 (V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
 
template<typename T >
constexpr Rot3< Toperator* (Rot3< T > const &rh, Rot3< T > const &lh)
 
template<typename T >
constexpr Rot2< Toperator* (Rot2< T > const &rh, Rot2< T > const &lh)
 
std::ostream & operator<< (std::ostream &out, Vec2D const &v)
 
std::ostream & operator<< (std::ostream &out, Vec2F const &v)
 
std::ostream & operator<< (std::ostream &out, Vec4F const &v)
 
std::ostream & operator<< (std::ostream &out, Vec4D const &v)
 
std::ostream & operator<< (std::ostream &out, As3D< Vec4F > const &v)
 
std::ostream & operator<< (std::ostream &out, As3D< Vec4D > const &v)
 
std::ostream & operator<< (std::ostream &out, Rot3F const &v)
 
std::ostream & operator<< (std::ostream &out, Rot3D const &v)
 
std::ostream & operator<< (std::ostream &out, Rot2F const &v)
 
std::ostream & operator<< (std::ostream &out, Rot2D const &v)
 
template<typename V >
auto xy (V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
 
template<typename V >
auto zw (V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
 

Macro Definition Documentation

#define VECTOR_EXT (   N)    __attribute__( ( vector_size( N ) ) )

Definition at line 9 of file ExtVec.h.

Typedef Documentation

float __attribute__
inline

Definition at line 12 of file ExtVec.h.

template<typename T , int N>
using ExtVec = typename ExtVecTraits<T,N>::type

Definition at line 60 of file ExtVec.h.

typedef Rot2<double> Rot2D

Definition at line 304 of file ExtVec.h.

typedef Rot2<float> Rot2F

Definition at line 302 of file ExtVec.h.

typedef Rot3<double> Rot3D

Definition at line 244 of file ExtVec.h.

typedef Rot3<float> Rot3F

Definition at line 242 of file ExtVec.h.

template<typename T >
using Vec2 = ExtVec<T,2>

Definition at line 63 of file ExtVec.h.

typedef Vec2<double> Vec2D

Definition at line 163 of file ExtVec.h.

typedef Vec2<float> Vec2F

Definition at line 160 of file ExtVec.h.

typedef Vec4<double> Vec3D

Definition at line 164 of file ExtVec.h.

typedef Vec4<float> Vec3F

Definition at line 162 of file ExtVec.h.

template<typename T >
using Vec4 = ExtVec<T,4>

Definition at line 62 of file ExtVec.h.

typedef Vec4<double> Vec4D

Definition at line 165 of file ExtVec.h.

typedef Vec4<float> Vec4F

Definition at line 161 of file ExtVec.h.

Function Documentation

template<typename Vec , typename F >
Vec apply ( Vec  v,
F  f 
)
inline

Definition at line 83 of file ExtVec.h.

References constexpr, f, mps_fire::i, and N.

Referenced by BeautifulSoup.Tag::__call__(), FWGUIEventFilter::isOpen(), reco::BinOp< A, Operation, B >::operator()(), gen::PhotosppInterface::specialSettings(), and gen::PhotosInterface::specialSettings().

83  {
85  constexpr int N = sizeof(Vec)/sizeof(T);
86  Vec ret;
87  for (int i=0;i!=N;++i) ret[i] = f(v[i]);
88  return ret;
89 }
type
Definition: HCALResponse.h:21
#define constexpr
double f[11][100]
#define N
Definition: blowfish.cc:9
long double T
template<typename V >
As3D<V> as3D ( V const &  v)
inline

Definition at line 183 of file ExtVec.h.

References findQualityFiles::v.

Referenced by operator*().

183 { return v;}
template<typename V1 , typename V2 >
auto cross2 ( V1  x,
V2  y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 106 of file ExtVec.h.

References x, and y.

Referenced by Conv::convolution(), and Basic2DVector< float >::cross().

106  {
107  return x[0]*y[1]-x[1]*y[0];
108 }
T x() const
Cartesian x coordinate.
template<typename Vec >
Vec cross3 ( Vec  x,
Vec  y 
)
inline

Definition at line 94 of file ExtVec.h.

94  {
95  // typedef Vec4<T> Vec;
96  // yz - zy, zx - xz, xy - yx, 0
97  Vec x1200{ x[1], x[2], x[0], x[0] };
98  Vec y2010{ y[2], y[0], y[1], y[0] };
99  Vec x2010{ x[2], x[0], x[1], x[0] };
100  Vec y1200{ y[1], y[2], y[0], y[0] };
101  return x1200 * y2010 - x2010 * y1200;
102 }
T x() const
Cartesian x coordinate.
template<typename V >
auto dot ( x,
y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 140 of file ExtVec.h.

References constexpr, mps_fire::i, N, x, and y.

140  {
142  constexpr int N = sizeof(V)/sizeof(T);
143  T ret=0;
144  for (int i=0;i!=N;++i) ret+=x[i]*y[i];
145  return ret;
146 }
type
Definition: HCALResponse.h:21
#define constexpr
T x() const
Cartesian x coordinate.
#define N
Definition: blowfish.cc:9
long double T
template<typename V1 , typename V2 >
auto dot2 ( V1  x,
V2  y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 150 of file ExtVec.h.

References mps_fire::i, x, and y.

Referenced by Basic3DVector< float >::perp2().

150  {
152  T ret=0;
153  for (int i=0;i!=2;++i) ret+=x[i]*y[i];
154  return ret;
155 }
type
Definition: HCALResponse.h:21
T x() const
Cartesian x coordinate.
long double T
template<typename T >
constexpr Rot3<T> operator* ( Rot3< T > const &  rh,
Rot3< T > const &  lh 
)
inline

Definition at line 247 of file ExtVec.h.

References Rot3< T >::rotateBack().

247  {
248  return lh.rotateBack(rh);
249 }
constexpr Vec4< T > rotateBack(Vec4< T > v) const
Definition: ExtVec.h:226
template<typename T >
constexpr Rot2<T> operator* ( Rot2< T > const &  rh,
Rot2< T > const &  lh 
)
inline

Definition at line 309 of file ExtVec.h.

References as3D(), Rot3< T >::axis, Rot2< T >::axis, operator<<(), MillePedeFileConverter_cfg::out, alignCSCRings::r, Rot2< T >::rotateBack(), and findQualityFiles::v.

309  {
310  return lh.rotateBack(rh);
311 }
constexpr Vec2< T > rotateBack(Vec2< T > v) const
Definition: ExtVec.h:286
std::ostream& operator<< ( std::ostream &  out,
Vec2D const &  v 
)

Definition at line 16 of file SSEVec.cc.

Referenced by operator*().

16  {
17  return out << '(' << v[0] <<", " << v[1] <<')';
18 }
std::ostream& operator<< ( std::ostream &  out,
Vec2F const &  v 
)

Definition at line 13 of file SSEVec.cc.

13  {
14  return out << '(' << v[0] <<", " << v[1] <<')';
15 }
std::ostream& operator<< ( std::ostream &  out,
Vec4F const &  v 
)

Definition at line 7 of file SSEVec.cc.

7  {
8  return out << '(' << v[0] <<", " << v[1] <<", "<< v[2] <<", "<< v[3] <<')';
9 }
std::ostream& operator<< ( std::ostream &  out,
Vec4D const &  v 
)
std::ostream& operator<< ( std::ostream &  out,
As3D< Vec4F > const &  v 
)
std::ostream& operator<< ( std::ostream &  out,
As3D< Vec4D > const &  v 
)
std::ostream& operator<< ( std::ostream &  out,
Rot3F const &  v 
)

Definition at line 28 of file SSEVec.cc.

References mathSSE::as3D(), and Rot3< T >::axis.

28  {
29  return out << as3D(r.axis[0]) << '\n' << as3D(r.axis[1]) << '\n' << as3D(r.axis[2]);
30 }
As3D< V > as3D(V const &v)
Definition: ExtVec.h:183
std::ostream& operator<< ( std::ostream &  out,
Rot3D const &  v 
)
std::ostream& operator<< ( std::ostream &  out,
Rot2F const &  v 
)

Definition at line 36 of file SSEVec.cc.

References Rot2< T >::axis.

36  {
37  return out << r.axis[0] << '\n' << r.axis[1];
38 }
std::ostream& operator<< ( std::ostream &  out,
Rot2D const &  v 
)
template<typename V >
auto xy ( v) -> Vec2<typename std::remove_reference<decltype(v[0])>::type>
inline

Definition at line 67 of file ExtVec.h.

References findQualityFiles::v.

Referenced by Rot3< align::Scalar >::Rot3().

68 {
70  return Vec2<T>{v[0],v[1]};
71 }
type
Definition: HCALResponse.h:21
ExtVec< T, 2 > Vec2
Definition: ExtVec.h:63
long double T
template<typename V >
auto zw ( v) -> Vec2<typename std::remove_reference<decltype(v[0])>::type>
inline

Definition at line 75 of file ExtVec.h.

References findQualityFiles::v.

Referenced by PositionCalc::Calculate_Location(), MonitorElement::Fill(), and mathSSE::Vec2< T >::Vec2().

76 {
78  return Vec2<T>{v[2],v[3]};
79 }
type
Definition: HCALResponse.h:21
ExtVec< T, 2 > Vec2
Definition: ExtVec.h:63
long double T