CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Typedefs | Functions
newBasic2DVector.h File Reference
#include "DataFormats/GeometryVector/interface/Phi.h"
#include "DataFormats/GeometryVector/interface/PreciseFloatType.h"
#include "DataFormats/GeometryVector/interface/CoordinateSets.h"
#include "DataFormats/Math/interface/SSEVec.h"
#include <cmath>
#include <iosfwd>

Go to the source code of this file.

Classes

class  Basic2DVector< T >
 

Namespaces

 geometryDetails
 

Typedefs

typedef Basic2DVector< double > Basic2DVectorD
 
typedef Basic2DVector< float > Basic2DVectorF
 

Functions

template<class T >
T operator* (const Basic2DVector< T > &v1, const Basic2DVector< T > &v2)
 
template<class T , class U >
PreciseFloatType< T, U >::Type operator* (const Basic2DVector< T > &v1, const Basic2DVector< U > &v2)
 scalar product of vectors of different precision More...
 
template<class T >
Basic2DVector< Toperator* (const Basic2DVector< T > &v, T t)
 
template<class T >
Basic2DVector< Toperator* (T t, const Basic2DVector< T > &v)
 Same as operator*( Vector, Scalar) More...
 
template<class T , class Scalar >
Basic2DVector< Toperator* (const Basic2DVector< T > &v, const Scalar &s)
 
template<class T , class Scalar >
Basic2DVector< Toperator* (const Scalar &s, const Basic2DVector< T > &v)
 Same as operator*( Vector, Scalar) More...
 
template<class T >
Basic2DVector< Toperator+ (const Basic2DVector< T > &a, const Basic2DVector< T > &b)
 vector sum and subtraction of vectors of possibly different precision More...
 
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type > 
operator+ (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
 
template<class T >
Basic2DVector< Toperator- (const Basic2DVector< T > &a, const Basic2DVector< T > &b)
 
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type > 
operator- (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
 
template<class T >
Basic2DVector< Toperator/ (const Basic2DVector< T > &v, T t)
 
template<class T , class Scalar >
Basic2DVector< Toperator/ (const Basic2DVector< T > &v, const Scalar &s)
 
template<class T >
std::ostream & operator<< (std::ostream &s, const Basic2DVector< T > &v)
 simple text output to standard streams More...
 
std::ostream & geometryDetails::print2D (std::ostream &s, double x, double y)
 

Typedef Documentation

typedef Basic2DVector<double> Basic2DVectorD

Definition at line 257 of file newBasic2DVector.h.

typedef Basic2DVector<float> Basic2DVectorF

Definition at line 256 of file newBasic2DVector.h.

Function Documentation

template<class T >
T operator* ( const Basic2DVector< T > &  v1,
const Basic2DVector< T > &  v2 
)
inline

Definition at line 200 of file newBasic2DVector.h.

References Basic2DVector< T >::dot().

200  {
201  return v1.dot(v2);
202 }
T dot(const Basic2DVector &lh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
template<class T , class U >
PreciseFloatType<T,U>::Type operator* ( const Basic2DVector< T > &  v1,
const Basic2DVector< U > &  v2 
)
inline

scalar product of vectors of different precision

Definition at line 206 of file newBasic2DVector.h.

References Basic2DVector< T >::dot().

207  {
208  return v1.dot(v2);
209 }
T dot(const Basic2DVector &lh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
template<class T >
Basic2DVector<T> operator* ( const Basic2DVector< T > &  v,
T  t 
)
inline

Multiplication by scalar, does not change the precision of the vector. The return type is the same as the type of the vector argument.

Definition at line 216 of file newBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

216  {
217  return v.v*t;
218 }
mathSSE::Vec2< T > v
template<class T >
Basic2DVector<T> operator* ( T  t,
const Basic2DVector< T > &  v 
)
inline

Same as operator*( Vector, Scalar)

Definition at line 222 of file newBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

222  {
223  return v.v*t;
224 }
mathSSE::Vec2< T > v
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Basic2DVector< T > &  v,
const Scalar &  s 
)
inline

Definition at line 229 of file newBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

229  {
230  T t = static_cast<T>(s);
231  return v*t;
232 }
long double T
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Scalar &  s,
const Basic2DVector< T > &  v 
)
inline

Same as operator*( Vector, Scalar)

Definition at line 236 of file newBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

236  {
237  T t = static_cast<T>(s);
238  return v*t;
239 }
long double T
template<class T >
Basic2DVector<T> operator+ ( const Basic2DVector< T > &  a,
const Basic2DVector< T > &  b 
)
inline

vector sum and subtraction of vectors of possibly different precision

Definition at line 172 of file newBasic2DVector.h.

References Basic2DVector< T >::v.

172  {
173  return a.v+b.v;
174 }
mathSSE::Vec2< T > v
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator+ ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
)
inline

Definition at line 183 of file newBasic2DVector.h.

183  {
185  return RT(a) + RT(b);
186 }
template<class T >
Basic2DVector<T> operator- ( const Basic2DVector< T > &  a,
const Basic2DVector< T > &  b 
)
inline

Definition at line 177 of file newBasic2DVector.h.

References Basic2DVector< T >::v.

177  {
178  return a.v-b.v;
179 }
mathSSE::Vec2< T > v
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator- ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
)
inline

Definition at line 190 of file newBasic2DVector.h.

190  {
192  return RT(a)-RT(b);
193 }
template<class T >
Basic2DVector<T> operator/ ( const Basic2DVector< T > &  v,
T  t 
)
inline

Division by scalar, does not change the precision of the vector. The return type is the same as the type of the vector argument.

Definition at line 245 of file newBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

245  {
246  return v.v/t;
247 }
mathSSE::Vec2< T > v
template<class T , class Scalar >
Basic2DVector<T> operator/ ( const Basic2DVector< T > &  v,
const Scalar &  s 
)
inline

Definition at line 250 of file newBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

250  {
251  // T t = static_cast<T>(Scalar(1)/s); return v*t;
252  T t = static_cast<T>(s);
253  return v/t;
254 }
long double T
template<class T >
std::ostream& operator<< ( std::ostream &  s,
const Basic2DVector< T > &  v 
)
inline

simple text output to standard streams

Definition at line 164 of file newBasic2DVector.h.

References geometryDetails::print2D(), alignCSCRings::s, and v.

164  {
165  return geometryDetails::print2D(s, v.x(),v.y());
166 }
std::ostream & print2D(std::ostream &s, double x, double y)
Definition: print.cc:8
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.