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 Rot2< Toperator* (Rot2< T > const &rh, Rot2< T > const &lh)
 
template<typename T >
constexpr Rot3< Toperator* (Rot3< T > const &rh, Rot3< T > const &lh)
 
std::ostream & operator<< (std::ostream &out, As3D< Vec4D > const &v)
 
std::ostream & operator<< (std::ostream &out, As3D< Vec4F > const &v)
 
std::ostream & operator<< (std::ostream &out, Rot2D const &v)
 
std::ostream & operator<< (std::ostream &out, Rot2F const &v)
 
std::ostream & operator<< (std::ostream &out, Rot3D const &v)
 
std::ostream & operator<< (std::ostream &out, Rot3F const &v)
 
std::ostream & operator<< (std::ostream &out, Vec2D const &v)
 
std::ostream & operator<< (std::ostream &out, Vec2F const &v)
 
std::ostream & operator<< (std::ostream &out, Vec4D const &v)
 
std::ostream & operator<< (std::ostream &out, Vec4F 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

◆ VECTOR_EXT

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

Definition at line 9 of file ExtVec.h.

Typedef Documentation

◆ __attribute__

float __attribute__
inline

Definition at line 12 of file ExtVec.h.

◆ ExtVec

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

Definition at line 61 of file ExtVec.h.

◆ Rot2D

typedef Rot2<double> Rot2D

Definition at line 258 of file ExtVec.h.

◆ Rot2F

typedef Rot2<float> Rot2F

Definition at line 256 of file ExtVec.h.

◆ Rot3D

typedef Rot3<double> Rot3D

Definition at line 219 of file ExtVec.h.

◆ Rot3F

typedef Rot3<float> Rot3F

Definition at line 217 of file ExtVec.h.

◆ Vec2

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

Definition at line 66 of file ExtVec.h.

◆ Vec2D

typedef Vec2<double> Vec2D

Definition at line 154 of file ExtVec.h.

◆ Vec2F

typedef Vec2<float> Vec2F

Definition at line 151 of file ExtVec.h.

◆ Vec3D

typedef Vec4<double> Vec3D

Definition at line 155 of file ExtVec.h.

◆ Vec3F

typedef Vec4<float> Vec3F

Definition at line 153 of file ExtVec.h.

◆ Vec4

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

Definition at line 64 of file ExtVec.h.

◆ Vec4D

typedef Vec4<double> Vec4D

Definition at line 156 of file ExtVec.h.

◆ Vec4F

typedef Vec4<float> Vec4F

Definition at line 152 of file ExtVec.h.

Function Documentation

◆ apply()

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

Definition at line 81 of file ExtVec.h.

81  {
82  typedef typename std::remove_reference<decltype(v[0])>::type T;
83  constexpr int N = sizeof(Vec) / sizeof(T);
84  Vec ret;
85  for (int i = 0; i != N; ++i)
86  ret[i] = f(v[i]);
87  return ret;
88 }

References f, mps_fire::i, N, runTheMatrix::ret, and findQualityFiles::v.

Referenced by BeautifulSoup.Tag::__call__(), HcalDbProducer::HcalDbProducer(), HcalDbProducer::produce(), HcalDbProducer::TokensForServiceHolder< RecordType, TokenHolders >::setConsumes(), and HcalDbProducer::TokensForServiceHolder< RecordType, TokenHolders >::setupHcalDbService().

◆ as3D()

template<typename V >
As3D<V> as3D ( V const &  v)
inline

Definition at line 174 of file ExtVec.h.

174  {
175  return v;
176 }

References findQualityFiles::v.

◆ cross2()

template<typename V1 , typename V2 >
auto cross2 ( V1  x,
V2  y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 102 of file ExtVec.h.

102  {
103  return x[0] * y[1] - x[1] * y[0];
104 }

References vertices_cff::x, and detailsBasic3DVector::y.

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

◆ cross3()

template<typename Vec >
Vec cross3 ( Vec  x,
Vec  y 
)
inline

Definition at line 91 of file ExtVec.h.

91  {
92  // typedef Vec4<T> Vec;
93  // yz - zy, zx - xz, xy - yx, 0
94  Vec x1200{x[1], x[2], x[0], x[0]};
95  Vec y2010{y[2], y[0], y[1], y[0]};
96  Vec x2010{x[2], x[0], x[1], x[0]};
97  Vec y1200{y[1], y[2], y[0], y[0]};
98  return x1200 * y2010 - x2010 * y1200;
99 }

References vertices_cff::x, and detailsBasic3DVector::y.

Referenced by Basic3DVector< align::Scalar >::cross().

◆ dot()

template<typename V >
auto dot ( x,
y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 133 of file ExtVec.h.

133  {
134  typedef typename std::remove_reference<decltype(x[0])>::type T;
135  constexpr int N = sizeof(V) / sizeof(T);
136  T ret = 0;
137  for (int i = 0; i != N; ++i)
138  ret += x[i] * y[i];
139  return ret;
140 }

References mps_fire::i, N, runTheMatrix::ret, cms::cuda::V, vertices_cff::x, and detailsBasic3DVector::y.

◆ dot2()

template<typename V1 , typename V2 >
auto dot2 ( V1  x,
V2  y 
) -> typename std::remove_reference<decltype(x[0])>::type
inline

Definition at line 143 of file ExtVec.h.

143  {
144  typedef typename std::remove_reference<decltype(x[0])>::type T;
145  T ret = 0;
146  for (int i = 0; i != 2; ++i)
147  ret += x[i] * y[i];
148  return ret;
149 }

References mps_fire::i, runTheMatrix::ret, vertices_cff::x, and detailsBasic3DVector::y.

Referenced by Basic3DVector< align::Scalar >::perp2().

◆ operator*() [1/2]

template<typename T >
constexpr Rot2<T> operator* ( Rot2< T > const &  rh,
Rot2< T > const &  lh 
)
inlineconstexpr

Definition at line 261 of file ExtVec.h.

261  {
262  return lh.rotateBack(rh);
263 }

References mathSSE::lh.

◆ operator*() [2/2]

template<typename T >
constexpr Rot3<T> operator* ( Rot3< T > const &  rh,
Rot3< T > const &  lh 
)
inlineconstexpr

Definition at line 222 of file ExtVec.h.

222  {
223  return lh.rotateBack(rh);
224 }

References mathSSE::lh.

◆ operator<<() [1/10]

std::ostream& operator<< ( std::ostream &  out,
As3D< Vec4D > const &  v 
)

◆ operator<<() [2/10]

std::ostream& operator<< ( std::ostream &  out,
As3D< Vec4F > const &  v 
)

◆ operator<<() [3/10]

std::ostream& operator<< ( std::ostream &  out,
Rot2D const &  v 
)

Definition at line 35 of file SSEVec.cc.

35 { return out << r.axis[0] << '\n' << r.axis[1]; }

References MillePedeFileConverter_cfg::out, and alignCSCRings::r.

◆ operator<<() [4/10]

std::ostream& operator<< ( std::ostream &  out,
Rot2F const &  v 
)

Definition at line 33 of file SSEVec.cc.

33 { return out << r.axis[0] << '\n' << r.axis[1]; }

References MillePedeFileConverter_cfg::out, and alignCSCRings::r.

◆ operator<<() [5/10]

std::ostream& operator<< ( std::ostream &  out,
Rot3D const &  v 
)

◆ operator<<() [6/10]

std::ostream& operator<< ( std::ostream &  out,
Rot3F const &  v 
)

Definition at line 25 of file SSEVec.cc.

25  {
26  return out << as3D(r.axis[0]) << '\n' << as3D(r.axis[1]) << '\n' << as3D(r.axis[2]);
27 }

References mathSSE::as3D(), MillePedeFileConverter_cfg::out, and alignCSCRings::r.

◆ operator<<() [7/10]

std::ostream& operator<< ( std::ostream &  out,
Vec2D const &  v 
)

Definition at line 15 of file SSEVec.cc.

15 { return out << '(' << v[0] << ", " << v[1] << ')'; }

◆ operator<<() [8/10]

std::ostream& operator<< ( std::ostream &  out,
Vec2F const &  v 
)

Definition at line 14 of file SSEVec.cc.

14 { return out << '(' << v[0] << ", " << v[1] << ')'; }

◆ operator<<() [9/10]

std::ostream& operator<< ( std::ostream &  out,
Vec4D const &  v 
)

◆ operator<<() [10/10]

std::ostream& operator<< ( std::ostream &  out,
Vec4F const &  v 
)

Definition at line 8 of file SSEVec.cc.

8  {
9  return out << '(' << v[0] << ", " << v[1] << ", " << v[2] << ", " << v[3] << ')';
10 }

◆ xy()

template<typename V >
auto xy ( v) -> Vec2<typename std::remove_reference<decltype(v[0])>::type>
inline

Definition at line 69 of file ExtVec.h.

69  {
70  typedef typename std::remove_reference<decltype(v[0])>::type T;
71  return Vec2<T>{v[0], v[1]};
72 }

References findQualityFiles::v.

Referenced by Rot2< Scalar >::Rot2(), and Rot3< align::Scalar >::Rot3().

◆ zw()

template<typename V >
auto zw ( v) -> Vec2<typename std::remove_reference<decltype(v[0])>::type>
inline

Definition at line 75 of file ExtVec.h.

75  {
76  typedef typename std::remove_reference<decltype(v[0])>::type T;
77  return Vec2<T>{v[2], v[3]};
78 }

References findQualityFiles::v.

Referenced by algorithm(), PositionCalc::Calculate_Location(), DDHGCalCell::execute(), DDHGCalWafer8::execute(), CSCMonitorObject::Fill(), dqm::impl::MonitorElement::Fill(), and EcalSelectiveReadoutValidation::fill().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
cms::cuda::V
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
Definition: HistoContainer.h:99
mps_fire.i
i
Definition: mps_fire.py:355
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
Vec2
ExtVec< T, 2 > Vec2
Definition: ExtVec.h:66
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
findQualityFiles.v
v
Definition: findQualityFiles.py:179
vertices_cff.x
x
Definition: vertices_cff.py:29
N
#define N
Definition: blowfish.cc:9
alignCSCRings.r
r
Definition: alignCSCRings.py:93
as3D
As3D< V > as3D(V const &v)
Definition: ExtVec.h:174
type
type
Definition: HCALResponse.h:21
T
long double T
Definition: Basic3DVectorLD.h:48
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31