CMS 3D CMS Logo

Classes | Namespaces | Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/GeometryVector/interface/Basic2DVector.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

namespace  geometryDetails

Functions

template<class T >
operator* (const Basic2DVector< T > &v1, const Basic2DVector< T > &v2)
template<class T , class Scalar >
Basic2DVector< T > operator* (const Scalar &s, const Basic2DVector< T > &v)
 Same as operator*( Vector, Scalar)
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
template<class T , class Scalar >
Basic2DVector< T > operator* (const Basic2DVector< T > &v, const Scalar &s)
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type > 
operator+ (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
 vector sum and subtraction of vectors of possibly different precision
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type > 
operator- (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
template<class T , class Scalar >
Basic2DVector< T > operator/ (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
std::ostream & geometryDetails::print2D (std::ostream &s, double x, double y)

Function Documentation

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

Definition at line 177 of file Basic2DVector.h.

References Basic2DVector< T >::dot().

                                                                            {
  return v1.dot(v2);
}
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Scalar &  s,
const Basic2DVector< T > &  v 
) [inline]

Same as operator*( Vector, Scalar)

Definition at line 199 of file Basic2DVector.h.

References asciidump::s, matplotRender::t, Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                               {
  T t = static_cast<T>(s);
  return Basic2DVector<T>(v.x()*t, v.y()*t);
}
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 183 of file Basic2DVector.h.

References Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                                   {
  return v1.x()*v2.x() + v1.y()*v2.y();
}
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Basic2DVector< T > &  v,
const Scalar &  s 
) [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 192 of file Basic2DVector.h.

References asciidump::s, matplotRender::t, Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                               {
  T t = static_cast<T>(s);
  return Basic2DVector<T>(v.x()*t, v.y()*t);
}
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator+ ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
) [inline]

vector sum and subtraction of vectors of possibly different precision

Definition at line 160 of file Basic2DVector.h.

References Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                 {
  typedef Basic2DVector<typename PreciseFloatType<T,U>::Type> RT;
  return RT(a.x()+b.x(), a.y()+b.y());
}
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator- ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
) [inline]

Definition at line 167 of file Basic2DVector.h.

References Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                 {
  typedef Basic2DVector<typename PreciseFloatType<T,U>::Type> RT;
  return RT(a.x()-b.x(), a.y()-b.y());
}
template<class T , class Scalar >
Basic2DVector<T> operator/ ( const Basic2DVector< T > &  v,
const Scalar &  s 
) [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 208 of file Basic2DVector.h.

References asciidump::s, matplotRender::t, Basic2DVector< T >::x(), and Basic2DVector< T >::y().

                                                                               {
  T t = static_cast<T>(s);
  return Basic2DVector<T>(v.x()/t, v.y()/t);
}
template<class T >
std::ostream& operator<< ( std::ostream &  s,
const Basic2DVector< T > &  v 
) [inline]

simple text output to standard streams

Definition at line 152 of file Basic2DVector.h.

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

                                                                          {
  return geometryDetails::print2D(s, v.x(),v.y());
}