CMS 3D CMS Logo

Classes | Typedefs | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DataFormats/Math/interface/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  Rot2< T >
struct  Rot3< T >

Typedefs

typedef float __attribute__ ((vector_size(8))) float32x2_t
typedef Rot2< double > Rot2D
typedef Rot2< float > Rot2F
typedef Rot3< double > Rot3D
typedef Rot3< float > Rot3F
typedef Vec2< double > Vec2D
typedef Vec2< float > Vec2F
typedef Vec4< double > Vec3D
typedef Vec4< float > Vec3F
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
template<typename Vec >
Vec cross3 (Vec x, Vec y)
template<typename V >
auto dot (V x, V y)->typename std
template<typename V1 , typename V2 >
auto dot2 (V1 x, V2 y)->typename std
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, Rot2F const &v)
std::ostream & operator<< (std::ostream &out, As3D< Vec4F > const &v)
std::ostream & operator<< (std::ostream &out, Vec4F const &v)
std::ostream & operator<< (std::ostream &out, Rot3F const &v)
std::ostream & operator<< (std::ostream &out, Vec2D const &v)
template<typename V >
auto xy (V v)-> Vec2< typename std
template<typename V >
auto zw (V v)-> Vec2< typename std

Typedef Documentation

typedef double __attribute__((vector_size(64))) float64x8_t [inline]

Definition at line 6 of file ExtVec.h.

typedef Rot2<double> Rot2D

Definition at line 265 of file ExtVec.h.

typedef Rot2<float> Rot2F

Definition at line 263 of file ExtVec.h.

typedef Rot3<double> Rot3D

Definition at line 205 of file ExtVec.h.

typedef Rot3<float> Rot3F

Definition at line 203 of file ExtVec.h.

typedef Vec2<double> Vec2D

Definition at line 124 of file ExtVec.h.

typedef Vec2<float> Vec2F

Definition at line 121 of file ExtVec.h.

typedef Vec4<double> Vec3D

Definition at line 125 of file ExtVec.h.

typedef Vec4<float> Vec3F

Definition at line 123 of file ExtVec.h.

typedef Vec4<double> Vec4D

Definition at line 126 of file ExtVec.h.

typedef Vec4<float> Vec4F

Definition at line 122 of file ExtVec.h.


Function Documentation

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

Definition at line 44 of file ExtVec.h.

References constexpr, f, i, N, and run_regression::ret.

Referenced by reco::BinOp< A, Operation, B >::operator()().

                      {
  typedef typename std::remove_reference<decltype(v[0])>::type T;
  constexpr int N = sizeof(Vec)/sizeof(T);
  Vec ret;
  for (int i=0;i!=N;++i) ret[i] = f(v[i]);
  return ret;
}
template<typename V >
As3D<V> as3D ( V const &  v) [inline]

Definition at line 144 of file ExtVec.h.

References findQualityFiles::v.

{ return v;}
template<typename V1 , typename V2 >
auto cross2 ( V1  x,
V2  y 
) [inline]

Definition at line 67 of file ExtVec.h.

References x, and detailsBasic3DVector::y.

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

                                                                           {
  return x[0]*y[1]-x[1]*y[0];
}
template<typename Vec >
Vec cross3 ( Vec  x,
Vec  y 
) [inline]

Definition at line 55 of file ExtVec.h.

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

                         {
  //  typedef Vec4<T> Vec;
  // yz - zy, zx - xz, xy - yx, 0
  Vec x1200{ x[1], x[2], x[0], x[0] };
  Vec y2010{ y[2], y[0], y[1], y[0] };
  Vec x2010{ x[2], x[0], x[1], x[0] };
  Vec y1200{ y[1], y[2], y[0], y[0] };
  return x1200 * y2010 - x2010 * y1200;
}
template<typename V >
auto dot ( x,
y 
) [inline]

Definition at line 101 of file ExtVec.h.

References constexpr, i, N, run_regression::ret, x, and detailsBasic3DVector::y.

                                                                        {
  typedef typename std::remove_reference<decltype(x[0])>::type T;
  constexpr int N = sizeof(V)/sizeof(T);
  T ret=0;
  for (int i=0;i!=N;++i) ret+=x[i]*y[i];
  return ret;
}
template<typename V1 , typename V2 >
auto dot2 ( V1  x,
V2  y 
) [inline]

Definition at line 111 of file ExtVec.h.

References i, run_regression::ret, x, and detailsBasic3DVector::y.

                                                                           {
  typedef typename std::remove_reference<decltype(x[0])>::type T;
  T ret=0;
  for (int i=0;i!=2;++i) ret+=x[i]*y[i];
  return ret;
}
template<typename T >
constexpr Rot3<T> operator* ( Rot3< T > const &  rh,
Rot3< T > const &  lh 
) [inline]

Definition at line 208 of file ExtVec.h.

                                                                             {
  return lh.rotateBack(rh);
}
template<typename T >
constexpr Rot2<T> operator* ( Rot2< T > const &  rh,
Rot2< T > const &  lh 
) [inline]

Definition at line 270 of file ExtVec.h.

                                                                              {
  return lh.rotateBack(rh);
}
std::ostream & operator<< ( std::ostream &  out,
Rot2F const &  v 
)

Definition at line 40 of file SSEVec.cc.

References Rot2< T >::axis.

                                                          {
  return out << r.axis[0] << '\n' << r.axis[1];
}
std::ostream & operator<< ( std::ostream &  out,
As3D< Vec4F > const &  v 
)
std::ostream & operator<< ( std::ostream &  out,
Vec4F const &  v 
)

Definition at line 10 of file SSEVec.cc.

                                                            {
  return out << '(' << v[0] <<", " << v[1] <<", "<< v[2] <<", "<< v[3] <<')';
}
std::ostream& operator<< ( std::ostream &  out,
Rot3F const &  v 
)

Definition at line 28 of file SSEVec.cc.

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

                                                          {
  return out << as3D(r.axis[0]) << '\n' <<  as3D(r.axis[1]) << '\n' <<  as3D(r.axis[2]);
}
std::ostream & operator<< ( std::ostream &  out,
Vec2D const &  v 
)

Definition at line 16 of file SSEVec.cc.

                                                            {
  return out << '(' << v[0] <<", " << v[1] <<')';
}
template<typename V >
auto xy ( v) [inline]

Definition at line 28 of file ExtVec.h.

References findQualityFiles::v.

{ 
  typedef typename std::remove_reference<decltype(v[0])>::type T;
  return Vec2<T>{v[0],v[1]};
}
template<typename V >
auto zw ( v) [inline]

Definition at line 36 of file ExtVec.h.

References findQualityFiles::v.

Referenced by PositionCalc::Calculate_Location().

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